nakla / sbfspot

Scripts for building and running the docker container
18 stars 10 forks source link

MQTT: Failed te execute '/usr/bin/mosquitto_pub' #9

Closed busaku closed 2 years ago

busaku commented 3 years ago

Hey together,

i need to reinstall my raspberry pi4. so i copy my old SBFspot.cfg and the dockerfile.

Now, the container start correct (?), but it only found one inverter (hcitool found all 3) and the one inverter, cant published by MQTT, caus it isnt installed.

"MQTT: Failed te execute '/usr/bin/mosquitto_pub' mosquitto clients installed? Error 256 while publishing to MQTT Broker

Iam not sure, bot normally an alpine image should be pulled from docker or? Now i got only one image (sbf_spot) with around 26MB

Thanks in advance patrick

nakla commented 3 years ago

Possibly an issue with your cfg? Can you post log messages from the sbfspot container?

cant published by MQTT, caus it isnt installed. mosquitto_pub is installed in the container, but no message broker like mosquitto.

busaku commented 3 years ago

Yeha,

most of the time, i got:

SBFspot V3.8.2 Yet another tool to read power production of SMA solar inverters (c) 2012-2021, SBF (https://github.com/SBFspot/SBFspot) Compiled for Linux (LE) 32 bitCommandline Args: -v -mqtt -cfg/etc/sbfspot/SBFspot.cfg Reading config '/etc/sbfspot/SBFspot.cfg' Tue Aug 31 13:27:00 2021: INFO: Starting... sunrise: 04:47 sunset : 18:21 Connecting to 00:80:25:XX:XX:XX (1/10) Initializing... SUSyID: 125 - SessionID: 802948170 (0x2FDC044A) SMA netID=03 Waiting for network to be built... In case of single inverter system set MIS_Enabled=0 in config file. Tue Aug 31 13:28:02 2021: CRITICAL: Failed to initialize communication with inverter. Tue Aug 31 13:28:02 2021: INFO: Done. Tue Aug 31 13:28:02 UTC 2021 Sleeping 600 seconds.

(Thought it was bad Bluetooth, but the Raspberry is just.. 50cm next to the inverter) It never founds the other Mac-Addresses. (I put the XX:XX:XX..)

But sometimes, it works with one inverter

SBFspot V3.8.2 ,Yet another tool to read power production of SMA solar inverters ,(c) 2012-2021, SBF (https://github.com/SBFspot/SBFspot) ,Compiled for Linux (LE) 32 bitCommandline Args: -d0 -v2 -mqtt -cfg/etc/sbfspot/SBFspot.cfg ,Reading config '/etc/sbfspot/SBFspot.cfg' ,Tue Aug 31 15:49:06 2021: INFO: Starting... ,sunrise: 06:47 ,sunset : 20:21 ,Connecting to 00:80:25:0B:F5:EF (1/10) ,Initializing... ,SUSyID: 125 - SessionID: 823347164 (0x311347DC) ,SMA netID=03 ,Waiting for network to be built... ,In case of single inverter system set MIS_Enabled=0 in config file. ,Tue Aug 31 15:50:08 2021: CRITICAL: Failed to initialize communication with inverter. ,Tue Aug 31 15:50:08 2021: INFO: Done. ,Tue Aug 31 15:50:08 CEST 2021 ,Sleeping 600 seconds. ,SBFspot V3.8.2 ,Yet another tool to read power production of SMA solar inverters ,(c) 2012-2021, SBF (https://github.com/SBFspot/SBFspot) ,Compiled for Linux (LE) 32 bitCommandline Args: -d0 -v2 -mqtt -cfg/etc/sbfspot/SBFspot.cfg ,Reading config '/etc/sbfspot/SBFspot.cfg' ,Tue Aug 31 15:51:26 2021: INFO: Starting... ,sunrise: 06:47 ,sunset : 20:21 ,Connecting to 00:80:25:0B:F5:EF (1/10) ,Initializing... ,SUSyID: 125 - SessionID: 864408280 (0x3385D2D8) ,SMA netID=03 ,Waiting for network to be built... ,SUSyID: 78 - SN: 2100204985 ,BT Signal=72.5% ,Logon OK ,getInverterData(sbftest) returned an error: -1 ,SUSyID: 78 - SN: 2100204985 ,Device Name: SN: 2100204985 ,Device Class: Solar-Wechselrichter ,Device Type: SB 4000TL-20 ,Software Version: 02.08.01.R ,Serial number: 2100204985 ,SUSyID: 78 - SN: 2100204985 ,Device Status: Ok ,SUSyID: 78 - SN: 2100204985 ,Device Temperature: 47.1°C ,SUSyID: 78 - SN: 2100204985 ,GridRelay Status: Geschlossen ,SUSyID: 78 - SN: 2100204985 ,Pac max phase 1: 4000W ,Pac max phase 2: 0W ,Pac max phase 3: 0W ,SUSyID: 78 - SN: 2100204985 ,Energy Production: , EToday: 11.316kWh , ETotal: 44307.174kWh , Operation Time: 47561.30h , Feed-In Time : 46201.71h ,SUSyID: 78 - SN: 2100204985 ,DC Spot Data: , String 1 Pdc: 0.344kW - Udc: 322.09V - Idc: 1.069A , String 2 Pdc: 0.702kW - Udc: 253.84V - Idc: 2.768A , Calculated Total Pdc: 1.046kW ,SUSyID: 78 - SN: 2100204985 ,AC Spot Data: , Phase 1 Pac : 1.043kW - Uac: 233.96V - Iac: 4.459A , Phase 2 Pac : 0.000kW - Uac: 0.00V - Iac: 0.000A , Phase 3 Pac : 0.000kW - Uac: 0.00V - Iac: 0.000A , Total Pac : 1.043kW - Calculated Pac: 1.043kW , Efficiency : 99.71% ,SUSyID: 78 - SN: 2100204985 ,Grid Freq. : 49.98Hz ,SUSyID: 78 - SN: 2100204985 ,Current Inverter Time: 31/08/2021 15:50:37 ,Inverter Wake-Up Time: 31/08/2021 06:57:16 ,Inverter Sleep Time : 31/08/2021 15:50:40 ,MQTT: Publishing (sbfspot/{serial}) "Timestamp": "31/08/2021 15:52:15","SunRise": "31/08/2021 06:47:00","SunSet": "31/08/2021 20:21:00","InvSerial": 2100204985,"InvName": "SN: 2100204985","InvTime": "31/08/2021 15:50:37","InvStatus": "Ok","InvTemperature": 47.060,"InvGridRelay": "Geschlossen","EToday": 11.316,"ETotal": 44307.174,"PACTot": 1043.000,"UDC1": 322.090,"UDC2": 253.840,"IDC1": 1.069,"IDC2": 2.768,"PDC1": 344.000,"PDC2": 702.000 ,Error: Connection refused ,MQTT: Failed te execute '/usr/bin/mosquitto_pub' mosquitto clients installed? ,Error 256 while publishing to MQTT Broker ,**** , ArchiveDayData() ,**** ,startTime = 612D54E0 -> 31/08/2021 00:00:00 ,** , ArchiveMonthData() ,** ,startTime = 61067EB0 -> 01/08/2021 13:00:00 ,Reading events: 2021-Aug-01 ,Tue Aug 31 15:52:16 2021: INFO: Done. ,Tue Aug 31 15:52:16 CEST 2021 ,Sleeping 600 seconds.

If i exec /bin/sh in the container, mosquitto_pub will find and send

I have no idea. Works like a charm for over 1 year with the old pi4 :(

nakla commented 3 years ago

Your bluetooth strength seems very good, that should not be the problem. It seems sbfspot can't build a network between your inverters. In your config, you have MIS_Enabled=1 option set and only one inverters bluetooth address provided (all 3 BT addresses won't work)?

busaku commented 3 years ago

how i should set all addresses?

busaku commented 3 years ago

Hm. i changed the BT address to another inverter - now it found two of three. but no mqtt :(

busaku commented 3 years ago

.. i got and " " after my mqtt host..

so, just need the last inverter ;)

nakla commented 3 years ago

In earlier versions of sbfspot it was possible to configure more than one BT address - sbfspot polled every address one after the other. Perhaps simply test the last BT address and/or reboot the inverters (after attempting to connect to an inverter, the inverter needs some time in which no connection is possible) I don't think sbfspot is the problem in your case...