kbialek / deye-inverter-mqtt

Reads Deye solar inverter metrics and posts them over mqtt
Apache License 2.0
201 stars 48 forks source link

New firmware not work #123

Closed Joerglp closed 10 months ago

Joerglp commented 10 months ago

Hardware (please complete the following information):

Software (please complete the following information):

Error: 2023-09-07 15:33:49,329 - DeyeDaemon - INFO - Reading start 2023-09-07 15:33:49,329 - DeyeDaemon - INFO - Reading registers [metrics group: micro, range: 003c-0074] 2023-09-07 15:33:49,469 - DeyeModbus - ERROR - Response frame has invalid starting byte 2023-09-07 15:33:49,470 - DeyeMqttClient - INFO - Logger is offline

With Firmware 1.57 ist o.k. Now with the new Firmware are not o.k.

kbialek commented 10 months ago

Thanks for reporting the problem @Joerglp . It seems like something has changed in version 2 of the firmware. Could you enable DEBUG logs, and try again, so we can see what is returned by the logger?

Joerglp commented 10 months ago

2023-09-08 04:56:49,420 - DeyeDaemon - INFO - Reading start2023-09-08 04:56:49,421 - DeyeDaemon - INFO - Reading registers [metrics group: micro, range: 003c-0074]2023-09-08 04:56:51,237 - DeyeConnector - DEBUG - Request frame: a5170010450000e0bf1dfa0200000000000000000000000000000103003c003945d4b6152023-09-08 04:56:51,748 - paho.mqtt.client - DEBUG - Sending PINGREQ2023-09-08 04:56:51,749 - paho.mqtt.client - DEBUG - Received PINGRESP2023-09-08 04:56:52,033 - DeyeConnector - DEBUG - Received response frame in 1. attempt: 41542b595a434d505645523d4d57335f3136555f353430365f322e30360d0a0d0a2023-09-08 04:56:52,033 - DeyeModbus - ERROR - Response frame has invalid starting byte2023-09-08 04:56:52,034 - DeyeMqttClient - DEBUG - Publishing message. topic: 'deye/logger_status', value: 'offline'2023-09-08 04:56:52,034 - paho.mqtt.client - DEBUG - Sending PUBLISH (d0, q1, r0, m19), 'b'deye/logger_status'', ... (7 bytes)2023-09-08 04:56:52,035 - paho.mqtt.client - DEBUG - Received PUBACK (Mid: 19)2023-09-08 04:56:52,036 - DeyeMqttClient - INFO - Logger is offline2023-09-08 04:56:52,037 - DeyeDaemon - INFO - Reading completedVon meinem iPad gesendetAm 07.09.2023 um 21:39 schrieb Krzysztof Białek @.***>: Thanks for reporting the problem @Joerglp . It seems like something has changed in version 2 of the firmware. Could you enable DEBUG logs, and try again, so we can see what is returned by the logger?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

kbialek commented 10 months ago

The response "41542b595a434d505645523d4d57335f3136555f353430365f322e30360d0a0d0a" is a hex encoded ascii string. After conversion it looks like this "AT+YZCMPVER=MW3_16U_5406_2.06", so it's a response from the AT command interface.

Possible options:

  1. Someone figures out how to do Modbus/TCP communication with loggers having fw v2.x
  2. Someone implements AT command support as a replacement of Modbus/TCP. Something similar to https://github.com/jedie/inverter-connect @jedie Do you know if it's feasible and could solve the problem?

EDIT: @Joerglp Could you check in your logger web interface, if there is maybe an option to enable Modbus/TCP?

SMCerina commented 10 months ago

I cannot see any option to enable Modbus/TCP even in the config_hide.html.

kbialek commented 10 months ago

Okay, perhaps Modbus/TCP interface has been moved to another TCP port. Can you scan your inverter IP with nmap?

SMCerina commented 10 months ago

No other open port on the inverter.

80/tcp   open  http       LimitlessLED smart lightbulb bridge httpd
|_http-server-header: HTTPD
| http-methods: 
|_  Supported Methods: GET POST
|_http-title: 401 Unauthorized
| http-auth: 
| HTTP/1.0 401 Unauthorized\x0D
|_  Basic realm=USER LOGIN
8899/tcp open  ospf-lite?
| fingerprint-strings: 
|   GenericLines: 
|     AT+YZCMPVER=MW3_16U_5406_2.27
|     2211101306
|     2211101306
|     2211101306
|   GetRequest, HTTPOptions, NULL: 
|     AT+YZCMPVER=MW3_16U_5406_2.27
|     2211101306
|   RTSPRequest: 
|     AT+YZCMPVER=MW3_16U_5406_2.27
|     2211101306
|_    2211101306
Joerglp commented 10 months ago

I can see the Entry Server and Port 8899 in the config_hide.html. I have the Firmware 2.06

Joerglp commented 10 months ago

Per Telnet: telnet 192.168.0.71 8899 Connected to 192.168.0.71 AT+YZCMPVER=MW3_16U_5406_2.06

��B��X#�&2211236711 � p ����B��Y��&2211236711 � p ����B�&2211236711 � p ����B��X#^C

carstenfroehlich commented 10 months ago

The big problem is, that the new SUN-MI-RELAY-01 is automatically updating the inverter to firmware version 2.27. So most of the users will have this problem in the near future. Like me since 5 days...

carstenfroehlich commented 10 months ago

Maybe these settings are helping to analyse? Screenshot_2023-09-09-09-01-30-80_40deb401b9ffe8e1df2f1cc5ba480b12 Screenshot_2023-09-09-09-01-41-63_40deb401b9ffe8e1df2f1cc5ba480b12

kbialek commented 10 months ago

@Joerglp @SMCerina Could you please check if the AT interface works with the new firmware as before? If yes, then there is a chance to use for Modbus-over-AT communication. For that you can use this project https://github.com/s10l/deye-logger-at-cmd

Here are the results I got from my logger running firmware v1

  1. Connectivity test:
    ❯ ./build/main -t 192.168.2.90:48899
    2023/09/09 08:46:00 * Connecting :0 -> 192.168.2.90:48899...
    2023/09/09 08:46:08 AP settings
    2023/09/09 08:46:08     Mode, SSID and Chanel:  11BGN,AP_XXXXXXXXX,AUTO
    2023/09/09 08:46:08     Encryption:             WPA2PSK,AES,712003b0
    2023/09/09 08:46:08 Station settings
    2023/09/09 08:46:08     SSID:                   XXXXXXXXX
    2023/09/09 08:46:08     Key:                    WPA2PSK,AES,XXXXXXXXXX
    2023/09/09 08:46:08     IP:                     DHCP,192.168.2.90,255.255.255.0,192.168.2.1
    2023/09/09 08:46:08 Web settings
    2023/09/09 08:46:08     Login:                  admin,admin
    2023/09/09 08:46:09 
  2. Modbus read test:
    ❯ ./build/main -t 192.168.2.90:48899 -xmb 00280001
    2023/09/09 09:02:21 * Connecting :0 -> 192.168.2.90:48899...
    2023/09/09 09:02:24 +ok=01030204423AB50000
    2023/09/09 09:02:25 
kbialek commented 10 months ago

@carstenfroehlich What are the options available here? image

carstenfroehlich commented 10 months ago

TCP-Server TCP-Client UDP

kbialek commented 10 months ago

TCP-Server TCP-Client UDP

Exactly the same options as for my logger running on firmware v1

carstenfroehlich commented 10 months ago

maybe the values of the options have changed? `

`

Joerglp commented 10 months ago

./main -t 192.168.0.71:48899 2023/09/09 11:22:20 Connecting :0 -> 192.168.0.71:48899... 2023/09/09 11:22:28 AP settings 2023/09/09 11:22:28 Mode, SSID and Chanel: 11BGN,AP_4196253664,AUTO 2023/09/09 11:22:28 Encryption: WPA2PSK,AES,847a4d1c 2023/09/09 11:22:28 Station settings 2023/09/09 11:22:28 SSID: XXXXX 2023/09/09 11:22:28 Key: WPA2PSK,AES,XXXXXXXXX 2023/09/09 11:22:28 IP: static,192.168.0.71,255.255.255.0,192.168.0.254 2023/09/09 11:22:28 Web settings 2023/09/09 11:22:28 Login: admin,admin 2023/09/09 11:22:29 ./main -t 192.168.0.71:48899 -xmb 00280001 2023/09/09 11:23:01 Connecting :0 -> 192.168.0.71:48899... 2023/09/09 11:23:04 +ok=0103020064B9AF 2023/09/09 11:23:05

kbialek commented 10 months ago

@Joerglp Thanks. This looks very promising.

carstenfroehlich commented 10 months ago

this is from my server:

go run main.go -t 192.168.178.108:48899 2023/09/09 12:43:09 * Connecting :0 -> 192.168.178.108:48899... 2023/09/09 12:43:17 AP settings 2023/09/09 12:43:17 Mode, SSID and Chanel: 11BGN,AP_XXXXXXX,AUTO 2023/09/09 12:43:17 Encryption: WPA2PSK,AES,XXXXXX 2023/09/09 12:43:17 Station settings 2023/09/09 12:43:17 SSID: XXXXXXXXXXX 2023/09/09 12:43:17 Key: WPA2PSK,AES,XXXXXXXX 2023/09/09 12:43:17 IP: DHCP,192.168.178.108,255.255.255.0,192.168.178.1 2023/09/09 12:43:17 Web settings 2023/09/09 12:43:17 Login: XXXXXXX,XXXXXXXX 2023/09/09 12:43:18

go run main.go -t 192.168.178.108:48899 -xmb 00280001 2023/09/09 12:46:08 * Connecting :0 -> 192.168.178.108:48899... 2023/09/09 12:46:11 +ok=0103020064B9AF 2023/09/09 12:46:12

carstenfroehlich commented 10 months ago

does this help? 2023-09-09 12:31:28,362 - DeyeDaemon - INFO - Reading start 2023-09-09 12:31:28,363 - DeyeDaemon - INFO - Reading registers [metrics group: micro, range: 003c-0074] 2023-09-09 12:31:28,371 - DeyeModbus - ERROR - Response frame has invalid starting byte 2023-09-09 12:31:28,375 - DeyeMqttClient - INFO - Logger is offline 2023-09-09 12:31:28,375 - DeyeDaemon - INFO - Reading completed

kbialek commented 10 months ago

Your tests proven, that it's possible to use Modbus-over-AT to read the data. I've started working on that feature. Stay tuned.

maehtricks commented 10 months ago

It actually works with https://github.com/jedie/inverter-connect via Modbus over AT (SUN-600G3 with 2.27)

./cli.py print-values --ip 192.168.71.178 --port 48899 -c

image

kbialek commented 10 months ago

Here is a beta image that uses AT commands for communication with the inverter exclusively. ghcr.io/kbialek/deye-inverter-mqtt:2023.09.1-beta-1 Try it out.

The implementation is very hacky now. Primarily error handling is very poor. However it's ready to start collecting feedback.

No extra config changes are necessary.

Joerglp commented 10 months ago

Now I became that: 2023-09-09 15:43:08,215 - DeyeDaemon - INFO - Please help me build the list of compatible inverters. https://github.com/kbialek/deye-inverter-mqtt/issues/41 2023-09-09 15:43:08,215 - DeyeAtConnector - INFO - Hello 2023-09-09 15:43:08,259 - paho.mqtt.client - DEBUG - Sending CONNECT (u1, p1, wr1, wq1, wf1, c1, k60) client_id=b'deye-inverter-4196253664' 2023-09-09 15:43:08,261 - paho.mqtt.client - DEBUG - Received CONNACK (0, 0) 2023-09-09 15:43:08,262 - paho.mqtt.client - DEBUG - Sending PUBLISH (d0, q1, r1, m1), 'b'deye/status'', ... (6 bytes) 2023-09-09 15:43:08,262 - DeyeMqttClient - INFO - Successfully connected to MQTT Broker located at 192.168.0.101:1883 2023-09-09 15:43:08,263 - DeyeDaemon - INFO - Feature "Report metrics over MQTT": enabled 2023-09-09 15:43:08,263 - DeyeDaemon - INFO - Feature "Set inverter time once online": enabled 2023-09-09 15:43:08,263 - DeyeDaemon - DEBUG - Start to execute the daemon at intervals of 60 seconds 2023-09-09 15:43:08,264 - DeyeDaemon - INFO - Reading start 2023-09-09 15:43:08,264 - DeyeDaemon - INFO - Reading registers [metrics group: micro, range: 003c-0074] 2023-09-09 15:43:08,265 - DeyeAtConnector - DEBUG - Sending AT command: b'WIFIKIT-214028-READ' 2023-09-09 15:43:08,265 - paho.mqtt.client - DEBUG - Received PUBACK (Mid: 1) 2023-09-09 15:43:08,766 - DeyeAtConnector - DEBUG - Received response frame in 1. attempt: b'192.168.0.71,E8FDF88E20F6,4196253664' 2023-09-09 15:43:08,766 - DeyeAtConnector - DEBUG - Sending AT command: b'+ok' 2023-09-09 15:43:09,267 - DeyeAtConnector - DEBUG - Sending AT command: b'AT+INVDATA=8,0103003c003945d4\n' 2023-09-09 15:43:09,768 - DeyeAtConnector - DEBUG - Received response frame in 1. attempt: b'+ok=01\x1003\x1072\x1000\x101D\x1000\x1000\x1000\x1000\x100F\x10F2\x1000\x1000\x1000\x100E\x1000\x100E\x1000\x1000\x1000\x1000\x1007\x10BD\x1000\x1000\x1007\x10D1\x1000\x1000\x1009\x1038\x1000\x1000\x1000\x1000\x1000\x1001\x1000\x1000\x1000\x1000\x1013\x1088\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1001\x1068\x1000\x1000\x1000\x1000\x1000\x1000\x1012\x10E8\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x10EA\x1000\x1007\x1000\x10FA\x1000\x1007\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1058\x10AB\x10\r\n\r\n' 2023-09-09 15:43:09,768 - DeyeAtConnector - DEBUG - Extracted Modbus response 010372001D000000000FF20000000E000E0000000007BD000007D100000938000000000001000000001388000000000000000000000000016800000000000012E800000000000000000000000000000000000000000000000000000000000000000000000000EA000700FA00070000000000000000 2023-09-09 15:43:09,768 - DeyeAtConnector - DEBUG - Sending AT command: b'AT+Q\n' 2023-09-09 15:43:10,269 - DeyeModbus - ERROR - Modbus frame is too short 2023-09-09 15:43:10,270 - DeyeMqttClient - DEBUG - Publishing message. topic: 'deye/logger_status', value: 'offline' 2023-09-09 15:43:10,270 - paho.mqtt.client - DEBUG - Sending PUBLISH (d0, q1, r0, m2), 'b'deye/logger_status'', ... (7 bytes) 2023-09-09 15:43:10,271 - paho.mqtt.client - DEBUG - Received PUBACK (Mid: 2) 2023-09-09 15:43:10,272 - DeyeMqttClient - INFO - Logger is offline 2023-09-09 15:43:10,272 - DeyeDaemon - INFO - Reading completed 2023-09-09 15:44:08,344 - paho.mqtt.client - DEBUG - Sending PINGREQ 2023-09-09 15:44:08,375 - paho.mqtt.client - DEBUG - Received PINGRESP 2023-09-09 15:44:10,274 - DeyeDaemon - INFO - Reading start 2023-09-09 15:44:10,278 - DeyeDaemon - INFO - Reading registers [metrics group: micro, range: 003c-0074] 2023-09-09 15:44:10,279 - DeyeAtConnector - DEBUG - Sending AT command: b'WIFIKIT-214028-READ' 2023-09-09 15:44:10,781 - DeyeAtConnector - DEBUG - Received response frame in 1. attempt: b'192.168.0.71,E8FDF88E20F6,4196253664' 2023-09-09 15:44:10,781 - DeyeAtConnector - DEBUG - Sending AT command: b'+ok' 2023-09-09 15:44:11,285 - DeyeAtConnector - DEBUG - Sending AT command: b'AT+INVDATA=8,0103003c003945d4\n' 2023-09-09 15:44:11,786 - DeyeAtConnector - DEBUG - Received response frame in 1. attempt: b'+ok=01\x1003\x1072\x1000\x101D\x1000\x1000\x1000\x1000\x100F\x10F2\x1000\x1000\x1000\x100E\x1000\x100E\x1000\x1000\x1000\x1000\x1007\x10BD\x1000\x1000\x1007\x10D1\x1000\x1000\x1009\x1038\x1000\x1000\x1000\x1000\x1000\x1001\x1000\x1000\x1000\x1000\x1013\x1088\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1001\x1068\x1000\x1000\x1000\x1000\x1000\x1000\x1012\x10E8\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x10EA\x1000\x1007\x1000\x10FA\x1000\x1007\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1058\x10AB\x10\r\n\r\n' 2023-09-09 15:44:11,787 - DeyeAtConnector - DEBUG - Extracted Modbus response 010372001D000000000FF20000000E000E0000000007BD000007D100000938000000000001000000001388000000000000000000000000016800000000000012E800000000000000000000000000000000000000000000000000000000000000000000000000EA000700FA00070000000000000000 2023-09-09 15:44:11,787 - DeyeAtConnector - DEBUG - Sending AT command: b'AT+Q\n' 2023-09-09 15:44:12,290 - DeyeModbus - ERROR - Modbus frame is too short 2023-09-09 15:44:12,292 - DeyeMqttClient - DEBUG - Publishing message. topic: 'deye/logger_status', value: 'offline' 2023-09-09 15:44:12,295 - paho.mqtt.client - DEBUG - Sending PUBLISH (d0, q1, r0, m3), 'b'deye/logger_status'', ... (7 bytes) 2023-09-09 15:44:12,296 - paho.mqtt.client - DEBUG - Received PUBACK (Mid: 3) 2023-09-09 15:44:12,297 - DeyeMqttClient - INFO - Logger is offline 2023-09-09 15:44:12,298 - DeyeDaemon - INFO - Reading completed 2023-09-09 15:45:08,393 - paho.mqtt.client - DEBUG - Sending PINGREQ 2023-09-09 15:45:08,395 - paho.mqtt.client - DEBUG - Received PINGRESP 2023-09-09 15:45:10,272 - DeyeDaemon - INFO - Reading start 2023-09-09 15:45:10,275 - DeyeDaemon - INFO - Reading registers [metrics group: micro, range: 003c-0074] 2023-09-09 15:45:10,275 - DeyeAtConnector - DEBUG - Sending AT command: b'WIFIKIT-214028-READ' 2023-09-09 15:45:15,780 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-09 15:45:20,784 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-09 15:45:25,788 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-09 15:45:30,793 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-09 15:45:35,798 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-09 15:45:35,798 - DeyeAtConnector - WARNING - Too many connection timeouts 2023-09-09 15:45:35,798 - DeyeAtConnector - DEBUG - Sending AT command: b'+ok' 2023-09-09 15:45:36,299 - DeyeAtConnector - DEBUG - Sending AT command: b'AT+INVDATA=8,0103003c003945d4\n' 2023-09-09 15:45:41,804 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-09 15:45:46,808 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-09 15:45:51,812 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-09 15:45:56,816 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-09 15:46:01,820 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-09 15:46:01,820 - DeyeAtConnector - WARNING - Too many connection timeouts 2023-09-09 15:46:01,820 - DeyeDaemon - ERROR - Unexpected error during daemon execution Traceback (most recent call last): File "/opt/deye_inverter_mqtt/deye_daemon.py", line 167, in __invoke_action self.action() File "/opt/deye_inverter_mqtt/deye_daemon.py", line 89, in do_task regs |= self.modbus.read_registers(reg_range.first_reg_address, reg_range.last_reg_address) File "/opt/deye_inverter_mqtt/deye_modbus.py", line 50, in read_registers modbus_resp_frame = self.connector.send_request(modbus_frame + modbus_crc) File "/opt/deye_inverter_mqtt/deye_at_connector.py", line 95, in send_request if at_response.startswith(b'+ok='): AttributeError: 'NoneType' object has no attribute 'startswith' 2023-09-09 15:46:08,475 - paho.mqtt.client - DEBUG - Sending PINGREQ 2023-09-09 15:46:08,477 - paho.mqtt.client - DEBUG - Received PINGRESP 2023-09-09 15:46:10,272 - DeyeDaemon - INFO - Reading start 2023-09-09 15:46:10,273 - DeyeDaemon - INFO - Reading registers [metrics group: micro, range: 003c-0074] 2023-09-09 15:46:10,273 - DeyeAtConnector - DEBUG - Sending AT command: b'WIFIKIT-214028-READ' 2023-09-09 15:46:10,863 - DeyeAtConnector - DEBUG - Received response frame in 1. attempt: b'192.168.0.71,E8FDF88E20F6,4196253664' 2023-09-09 15:46:10,863 - DeyeAtConnector - DEBUG - Sending AT command: b'+ok' 2023-09-09 15:46:11,364 - DeyeAtConnector - DEBUG - Sending AT command: b'AT+INVDATA=8,0103003c003945d4\n' 2023-09-09 15:46:11,938 - DeyeAtConnector - DEBUG - Received response frame in 1. attempt: b'+ok=01\x1003\x1072\x1000\x101D\x1000\x1000\x1000\x1000\x100F\x10F2\x1000\x1000\x1000\x100E\x1000\x100E\x1000\x1000\x1000\x1000\x1007\x10BD\x1000\x1000\x1007\x10D1\x1000\x1000\x1009\x1024\x1000\x1000\x1000\x1000\x1000\x1001\x1000\x1000\x1000\x1000\x1013\x1088\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1001\x1068\x1000\x1000\x1000\x1000\x1000\x1000\x1012\x1098\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x10F6\x1000\x1007\x1000\x10F8\x1000\x1007\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x1000\x10BB\x10AA\x10\r\n\r\n' 2023-09-09 15:46:11,938 - DeyeAtConnector - DEBUG - Extracted Modbus response 010372001D000000000FF20000000E000E0000000007BD000007D1000009240000000000010000000013880000000000000000000000000168000000000000129800000000000000000000000000000000000000000000000000000000000000000000000000F6000700F800070000000000000000 2023-09-09 15:46:11,939 - DeyeAtConnector - DEBUG - Sending AT command: b'AT+Q\n' 2023-09-09 15:46:12,440 - DeyeModbus - ERROR - Modbus frame is too short 2023-09-09 15:46:12,443 - DeyeMqttClient - DEBUG - Publishing message. topic: 'deye/logger_status', value: 'offline' 2023-09-09 15:46:12,443 - paho.mqtt.client - DEBUG - Sending PUBLISH (d0, q1, r0, m4), 'b'deye/logger_status'', ... (7 bytes) 2023-09-09 15:46:12,445 - paho.mqtt.client - DEBUG - Received PUBACK (Mid: 4) 2023-09-09 15:46:12,445 - DeyeMqttClient - INFO - Logger is offline 2023-09-09 15:46:12,445 - DeyeDaemon - INFO - Reading completed

Joerglp commented 10 months ago

With the tool from @maehtricks works inverter v0.13.0 (Set log level 0: ERROR)

InverterInfo(ip='192.168.0.71', mac='E8FDF88E20F6', serial=4196253664)

Fetch...PV1 Voltage,PV2 Voltage,PV1 Current,PV2 Current,Daily Production,Daily Production 1,Daily Production 2,Total Production,Total Production 1,Total Production 2,Active Power Regulations,PV1 Power,PV2 Power,Total Power, Signing off with "AT+Q"...Goodbye ;)

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Inverter Values
┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━┓ ┃ Counter ┃ Name ┃ Value ┃ Register ┃ Length ┃ Raw data ┃ ┡━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━┩ │ 1 │ PV1 Voltage │ 23.4 V │ 006D │ 1 │ 00ea │ │ 2 │ PV2 Voltage │ 24.6 V │ 006F │ 1 │ 00f6 │ │ 3 │ PV1 Current │ 0.4 A │ 006E │ 1 │ 0004 │ │ 4 │ PV2 Current │ 0.4 A │ 0070 │ 1 │ 0004 │ │ 5 │ Daily Production │ 2.9 kWh │ 003C │ 1 │ 001d │ │ 6 │ Daily Production 1 │ 1.4 kWh │ 0041 │ 1 │ 000e │ │ 7 │ Daily Production 2 │ 1.4 kWh │ 0042 │ 1 │ 000e │ │ 8 │ Total Production │ 408.2 kWh │ 003F │ 2 │ 0ff20000 │ │ 9 │ Total Production 1 │ 198.1 kWh │ 0045 │ 1 │ 07bd │ │ 10 │ Total Production 2 │ 200.1 kWh │ 0047 │ 1 │ 07d1 │ │ 11 │ Active Power Regulations │ 100 % │ 0028 │ 1 │ 0064 │ │ 12 │ PV1 Power │ 9.36 W │ - │ - │ (Computed) │ │ 13 │ PV2 Power │ 9.84 W │ - │ - │ (Computed) │ │ 14 │ Total Power │ 19.2 W │ - │ - │ (Computed) │ └─────────┴──────────────────────────┴──────────────────┴──────────┴────────┴────────────┘ ───────────────────────────────────────────────────── Sa 09 Sep 2023 18:06:33 ─────────────────────────────────────────────────────

carstenfroehlich commented 10 months ago

seems it is not working 2023-09-09 16:27:13,632 - DeyeDaemon - INFO - Please help me build the list of compatible inverters. https://github.com/kbialek/deye-inverter-mqtt/issues/41 2023-09-09 16:27:13,666 - paho.mqtt.client - DEBUG - Sending CONNECT (u0, p0, wr1, wq1, wf1, c1, k60) client_id=b'deye-inverter-3939493096' 2023-09-09 16:27:13,668 - paho.mqtt.client - DEBUG - Received CONNACK (0, 0) 2023-09-09 16:27:14,669 - paho.mqtt.client - DEBUG - Sending PUBLISH (d0, q1, r1, m1), 'b'deye/status'', ... (6 bytes) 2023-09-09 16:27:14,670 - DeyeMqttClient - INFO - Successfully connected to MQTT Broker located at 192.168.178.113:1883 2023-09-09 16:27:14,671 - DeyeDaemon - INFO - Feature "Report metrics over MQTT": enabled 2023-09-09 16:27:14,671 - DeyeDaemon - INFO - Feature "Set inverter time once online": disabled 2023-09-09 16:27:14,672 - DeyeDaemon - DEBUG - Start to execute the daemon at intervals of 30 seconds 2023-09-09 16:27:14,674 - paho.mqtt.client - DEBUG - Received PUBACK (Mid: 1) 2023-09-09 16:27:14,675 - DeyeDaemon - INFO - Reading start 2023-09-09 16:27:14,677 - DeyeDaemon - INFO - Reading registers [metrics group: micro, range: 003c-0074] 2023-09-09 16:27:14,681 - DeyeConnector - DEBUG - Request frame: a5170010450000e8e4cfea0200000000000000000000000000000103003c003945d48515 2023-09-09 16:27:14,686 - DeyeConnector - DEBUG - Received response frame in 1. attempt: 41542b595a434d505645523d4d57335f3136555f353430365f322e32370d0a0d0a 2023-09-09 16:27:14,687 - DeyeModbus - ERROR - Response frame has invalid starting byte 2023-09-09 16:27:14,688 - DeyeMqttClient - DEBUG - Publishing message. topic: 'deye/logger_status', value: 'offline' 2023-09-09 16:27:14,690 - paho.mqtt.client - DEBUG - Sending PUBLISH (d0, q1, r0, m2), 'b'deye/logger_status'', ... (26 bytes) 2023-09-09 16:27:14,692 - paho.mqtt.client - DEBUG - Received PUBACK (Mid: 2) 2023-09-09 16:27:14,694 - DeyeMqttClient - INFO - Logger is offline 2023-09-09 16:27:14,694 - DeyeDaemon - INFO - Reading completed

kbialek commented 10 months ago

Thanks for the logs. They are very helpful. I see where the problem is. My logger appends trailing zeros to the Modbus response. You can see it here https://github.com/kbialek/deye-inverter-mqtt/issues/123#issuecomment-1712438301 I'm talking about this "+ok=01030204423AB50000" In my initial implementation I've decided to blindly drop them. However your loggers work correctly and do not append those trailing zeros, so the "fix" I've added actually broke it. Now it's also clear for me why https://github.com/jedie/inverter-connect does not work for me. Exactly because of these trailing zeros.

Here is a new, fixed docker image ghcr.io/kbialek/deye-inverter-mqtt:2023.09.1-beta-2

carstenfroehlich commented 10 months ago

Thanks a lot. I have deployed it but I can test it tomorrow, because the inverter is currently down without sun. I will report then.

Joerglp commented 10 months ago

I would also like to say a big thank you for your quick work. Update has been installed, but we won't see the result until tomorrow morning. It's hard for me to stand on the carport roof with a headlight and illuminate the solar panel... what should the neighbors think.... so let's hope for the best!

carstenfroehlich commented 10 months ago

Many thanks from me too, but it seems still not working. 2023-09-10 05:58:19,374 - DeyeDaemon - INFO - Please help me build the list of compatible inverters. https://github.com/ kbialek/deye-inverter-mqtt/issues/41 2023-09-10 05:58:19,408 - paho.mqtt.client - DEBUG - Sending CONNECT (u0, p0, wr1, wq1, wf1, c1, k60) client_id=b'deye-i nverter-3939493096' 2023-09-10 05:58:19,410 - paho.mqtt.client - DEBUG - Receive d CONNACK (0, 0) 2023-09-10 05:58:20,412 - paho.mqtt.client - DEBUG - Sending PUBLISH (d0, q1, r1, m1), 'b'deye/status'', ... (6 bytes) 2023-09-10 05:58:20,413 - DeyeMqttClient - INFO - Successful ly connected to MQTT Broker located at 192.168.178.113:1883 2023-09-10 05:58:20,413 - DeyeDaemon - INFO - Feature "Repor t metrics over MQTT": enabled 2023-09-10 05:58:20,414 - DeyeDaemon - INFO - Feature "Set i nverter time once online": disabled 2023-09-10 05:58:20,414 - DeyeDaemon - DEBUG - Start to exec ute the daemon at intervals of 30 seconds 2023-09-10 05:58:20,416 - paho.mqtt.client - DEBUG - Receive d PUBACK (Mid: 1) 2023-09-10 05:58:20,417 - DeyeDaemon - INFO - Reading start 2023-09-10 05:58:20,419 - DeyeDaemon - INFO - Reading regist ers [metrics group: micro, range: 003c-0074] 2023-09-10 05:58:20,424 - DeyeConnector - DEBUG - Request fr ame: a5170010450000e8e4cfea020000000000000000000000000000010 3003c003945d48515 2023-09-10 05:58:20,429 - DeyeConnector - DEBUG - Received r esponse frame in 1. attempt: 41542b595a434d505645523d4d57335 f3136555f353430365f322e32370d0a0d0a 2023-09-10 05:58:20,430 - DeyeModbus - ERROR - Response fram e has invalid starting byte 2023-09-10 05:58:20,431 - DeyeMqttClient - DEBUG - Publishin g message. topic: 'deye/logger_status', value: 'offline' 2023-09-10 05:58:20,431 - paho.mqtt.client - DEBUG - Sending PUBLISH (d0, q1, r0, m2), 'b'deye/logger_status'', ... (26 bytes) 2023-09-10 05:58:20,434 - paho.mqtt.client - DEBUG - Receive d PUBACK (Mid: 2) 2023-09-10 05:58:20,436 - DeyeMqttClient - INFO - Logger is offline 2023-09-10 05:58:20,436 - DeyeDaemon - INFO - Reading comple ted 2023-09-10 05:58:50,437 - DeyeDaemon - INFO - Reading start 2023-09-10 05:58:50,437 - DeyeDaemon - INFO - Reading regist ers [metrics group: micro, range: 003c-0074] 2023-09-10 05:58:50,442 - DeyeConnector - DEBUG - Request fr ame: a5170010450000e8e4cfea020000000000000000000000000000010 3003c003945d48515 2023-09-10 05:58:50,444 - DeyeConnector - DEBUG - Received r esponse frame in 1. attempt: 41542b595a434d505645523d4d57335 f3136555f353430365f322e32370d0a0d0a 2023-09-10 05:58:50,446 - DeyeModbus - ERROR - Response fram e has invalid starting byte 2023-09-10 05:58:50,447 - DeyeMqttClient - DEBUG - Publishin g message. topic: 'deye/logger_status', value: 'offline' 2023-09-10 05:58:50,448 - paho.mqtt.client - DEBUG - Sending PUBLISH (d0, q1, r0, m3), 'b'deye/logger_status'', ... (26 bytes) 2023-09-10 05:58:50,450 - paho.mqtt.client - DEBUG - Receive d PUBACK (Mid: 3) 2023-09-10 05:58:50,452 - DeyeMqttClient - INFO - Logger is offline 2023-09-10 05:58:50,452 - DeyeDaemon - INFO - Reading comple ted

I have tested if I really deployed the patch but it looks good. docker pull g hcr.io/kbialek/deye-inverter-mqtt:2023.09.1-beta-2 2023.09.1-beta-2: Pulling from kbialek/deye-inverter-mqtt Digest: sha256:71b42b946f63212d71684cbf86831ab285155dfbc37b7 b143c57f6a313bddc4b Status: Image is up to date for ghcr.io/kbialek/deye-inverte r-mqtt:2023.09.1-beta-2 ghcr.io/kbialek/deye-inverter-mqtt:2023.09.1-beta-2

kbialek commented 10 months ago

@carstenfroehlich I'm affraid that you are running wrong image. There should be no log messages from DeyeConnector class, because it's not in use by the AT command integration.

2023-09-10 05:58:20,424 - DeyeConnector - DEBUG - Request fr ame: a5170010450000e8e4cfea020000000000000000000000000000010
kbialek commented 10 months ago

@Joerglp @carstenfroehlich Here is a new docker image with another bugfix ghcr.io/kbialek/deye-inverter-mqtt:2023.09.1-beta-3

carstenfroehlich commented 10 months ago

Maybe I am doing something absolutely wrong, but I have pulled the third patch and restarted my docker container. Result is still the same and I have still the debug message from DeyeConnector Class...

I have also tried to rebuild the container with the no-cache option without any other result

kbialek commented 10 months ago

@carstenfroehlich Pulling is not enough. This image is not tagged as latest, thus you also have to explicitly reference the image version in your docker run configuration.

carstenfroehlich commented 10 months ago

@carstenfroehlich Pulling is not enough. This image is not tagged as latest, thus you also have to explicitly reference the image version in your docker run configuration.

OK, thanks, I have to read about this a bit. Until now I always checked out a branch, restart my container and it works. I have currently no idea where to find this docker run configuration. Do you mean the docker compose file?

kbialek commented 10 months ago

@carstenfroehlich If you use docker-compose - then yes, you should reference the image like this

services:
  deye-mqtt:
    image: ghcr.io/kbialek/deye-inverter-mqtt:2023.09.1-beta-3
    env_file:
      - config.env
    restart: unless-stopped
Joerglp commented 10 months ago

Hello, thank. It‘s work now.

carstenfroehlich commented 10 months ago

Hi, the patch is working, but it seems, that the output format for telegraf is not correct. My influxdb is not receiving other data than the total_energy. 2023-09-10T08:46:53Z D! [outputs.influxdb_v2] Wrote batch of 10 metrics in 8.814369ms 2023-09-10T08:46:53Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=267 1694335603678723268 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=268 1694335604685585777 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=267 1694335605686476802 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=266 1694335606709000591 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=267 1694335607642289198 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=267 1694335608697057763 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=266 1694335609649502380 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=267 1694335610654414048 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=267 1694335611656056068 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=266 1694335612657921937 2023-09-10T08:46:53Z D! [outputs.file] Wrote batch of 10 metrics in 1.887356ms 2023-09-10T08:46:53Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics 2023-09-10T08:46:53Z E! [inputs.mqtt_consumer] Error in plugin: invalid character ':' after top-level value 2023-09-10T08:46:54Z E! [inputs.mqtt_consumer] Error in plugin: invalid character ':' after top-level value 2023-09-10T08:46:55Z E! [inputs.mqtt_consumer] Error in plugin: invalid character ':' after top-level value 2023-09-10T08:46:56Z E! [inputs.mqtt_consumer] Error in plugin: invalid character ':' after top-level value 2023-09-10T08:46:57Z E! [inputs.mqtt_consumer] Error in plugin: invalid character ':' after top-level value 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: invalid character 'o' looking for beginning of value 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: must be an object or an array of objects 2023-09-10T08:46:58Z E! [inputs.mqtt_consumer] Error in plugin: invalid character ':' after top-level value ^X2023-09-10T08:46:59Z E! [inputs.mqtt_consumer] Error in plugin: invalid character ':' after top-level value 2023-09-10T08:47:00Z E! [inputs.mqtt_consumer] Error in plugin: invalid character ':' after top-level value 2023-09-10T08:47:01Z E! [inputs.mqtt_consumer] Error in plugin: invalid character ':' after top-level value 2023-09-10T08:47:02Z E! [inputs.mqtt_consumer] Error in plugin: invalid character ':' after top-level value 2023-09-10T08:47:03Z D! [outputs.influxdb_v2] Wrote batch of 10 metrics in 8.820892ms 2023-09-10T08:47:03Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=267 1694335613661503043 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=281 1694335614663369052 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=280 1694335615663010770 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=280 1694335616668391001 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=282 1694335617674698329 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=282 1694335618684564933 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=282 1694335619704615890 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=282 1694335620679162818 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=282 1694335621677448298 mqtt_consumer,host=dfd91121bec7,topic=tele/tasmota_E27D60/SENSOR LK13BE_Power_curr=282 1694335622687034480 2023-09-10T08:47:03Z D! [outputs.file] Wrote batch of 10 metrics in 1.948691ms 2023-09-10T08:47:03Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics 2023-09-10T08:47:03Z E! [inputs.mqtt_consumer] Error in plugin: invalid character ':' after top-level value 2023-09-10T08:47:04Z E! [inputs.mqtt_consumer] Error in plugin: invalid character ':' after top-level value

kbialek commented 10 months ago

@carstenfroehlich

the patch is working, but it seems, that the output format for telegraf is not correct. My influxdb is not receiving other data than the total_energy.

This is strange. My changes have nothing to do with metrics processing. Perhaps there was an unhandled communication error with the logger, which caused that. Please collect more logs.

@Joerglp

Nice. It's working for me too. Let's run it for one more day to see if it's stable enough.

kbialek commented 10 months ago

Here is another docker image ghcr.io/kbialek/deye-inverter-mqtt:2023.09.1-beta-4

Before using it, you have to update your configuration

  1. Remove DEYE_LOGGER_PORT env variable
  2. Add DEYE_LOGGER_PROTOCOL=at env variable

For more info read this https://github.com/kbialek/deye-inverter-mqtt/tree/feature/at-interface#installation

@carstenfroehlich Please check if it also resolves your problem with influx integration.

carstenfroehlich commented 10 months ago

sorry, but there seems to be an error in logging ` docker logs deye-inverter-mqtt_deye-mqtt_1

Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' `

carstenfroehlich commented 10 months ago

The problems in influx integration are not solved. With the beta-4 image i do not get any data anymore... When I reset to the master, logging is working again, but not receiving any data like before

SMCerina commented 10 months ago

The beta 4 image is working for me. Thank you for your quick support.

kbialek commented 10 months ago

@carstenfroehlich Share debug logs and your config.env

carstenfroehlich commented 10 months ago

@kbialek this is my config.env: ` DEYE_LOGGER_IP_ADDRESS=192.168.178.108

DEYE_LOGGER_PORT=8899

DEYE_LOGGER_PROTOCOL=at DEYE_LOGGER_SERIAL_NUMBER=3939493096

MQTT_HOST=192.168.178.113 MQTT_PORT=1883 MQTT_USERNAME= MQTT_PASSWORD= MQTT_TOPIC_PREFIX=deye MQTT_TLS_ENABLED=false

MQTT_TLS_INSECURE=true

MQTT_TLS_CA_CERT_PATH=certs/ca.crt

MQTT_TLS_CLIENT_CERT_PATH=certs/client.crt

MQTT_TLS_CLIENT_KEY_PATH=certs/client.key

LOG_LEVEL=DEBUG

LOG_STREAM=STDOUT

PLUGINS_DIR=plugins

DEYE_DATA_READ_INTERVAL=30 DEYE_METRIC_GROUPS=micro `

this is my whole debug log from this container:

docker logs deye-inverter-mqtt_deye-mqtt_1

Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Error setting up logging: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

The error is the only entry in the log, once per minute

the result then is, that in MQTT Data no topic deye is existing: image

kbialek commented 10 months ago

@carstenfroehlich I'm pretty much confident that you are still running the latest or 2023.08.1 image version, which requires DEYE_LOGGER_PORT env variable. When this variable is not present the error you posted is printed. You see it once per minute, because docker restarts the container.

EDIT: Or one of the former beta version. Please simply ensure that you are running ghcr.io/kbialek/deye-inverter-mqtt:2023.09.1-beta-4

Joerglp commented 10 months ago

@kbialek Beta3 is running flawlessly for me so far. Telegraf fetches the data from Mqtt and delivers it to the influxDB. Thanks again! I'll get back to you in a few days and let you know whether the beta is running smoothly.

kbialek commented 10 months ago

@Joerglp Thanks. Could you please test beta-4 too? Instructions are here https://github.com/kbialek/deye-inverter-mqtt/issues/123#issuecomment-1712760875

carstenfroehlich commented 10 months ago

@carstenfroehlich I'm pretty much confident that you are still running the latest or 2023.08.1 image version, which requires DEYE_LOGGER_PORT env variable. When this variable is not present the error you posted is printed. You see it once per minute, because docker restarts the container.

EDIT: Or one of the former beta version. Please simply ensure that you are running ghcr.io/kbialek/deye-inverter-mqtt:2023.09.1-beta-4

you are totally right, sorry for the confusion. I had additionally to the image entry an build entry in my docker compose file, so it was always overwriting your beta image! Thanks a lot for your support! I will test it tomorrow, but currently this is the log:

2023-09-10 18:46:17,870 - DeyeDaemon - INFO - Please help me build the list of compatible inverters. https://github.com/kbialek/deye-inverter-mqtt/issues/41 2023-09-10 18:46:17,870 - DeyeConnectorFactory - INFO - Creating Modbus/AT Logger connector 2023-09-10 18:46:17,871 - DeyeAtConnector - INFO - Hello 2023-09-10 18:46:17,903 - paho.mqtt.client - DEBUG - Sending CONNECT (u0, p0, wr1, wq1, wf1, c1, k60) client_id=b'deye-inverter-3939493096' 2023-09-10 18:46:17,906 - paho.mqtt.client - DEBUG - Received CONNACK (0, 0) 2023-09-10 18:46:18,908 - paho.mqtt.client - DEBUG - Sending PUBLISH (d0, q1, r1, m1), 'b'deye/status'', ... (6 bytes) 2023-09-10 18:46:18,909 - DeyeMqttClient - INFO - Successfully connected to MQTT Broker located at 192.168.178.113:1883 2023-09-10 18:46:18,909 - DeyeDaemon - INFO - Feature "Report metrics over MQTT": enabled 2023-09-10 18:46:18,910 - DeyeDaemon - INFO - Feature "Set inverter time once online": disabled 2023-09-10 18:46:18,910 - DeyeDaemon - DEBUG - Start to execute the daemon at intervals of 30 seconds 2023-09-10 18:46:18,911 - paho.mqtt.client - DEBUG - Received PUBACK (Mid: 1) 2023-09-10 18:46:18,912 - DeyeDaemon - INFO - Reading start 2023-09-10 18:46:18,913 - DeyeDaemon - INFO - Reading registers [metrics group: micro, range: 003c-0074] 2023-09-10 18:46:18,914 - DeyeAtConnector - DEBUG - Sending AT command: b'WIFIKIT-214028-READ' 2023-09-10 18:46:20,015 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-10 18:46:21,017 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-10 18:46:22,018 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-10 18:46:23,020 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-10 18:46:24,022 - DeyeAtConnector - DEBUG - Connection response timeout 2023-09-10 18:46:24,022 - DeyeAtConnector - WARNING - Too many connection timeouts 2023-09-10 18:46:24,023 - DeyeAtConnector - DEBUG - Sending AT command: b'+ok' 2023-09-10 18:46:24,124 - DeyeAtConnector - DEBUG - Sending AT command: b'AT+INVDATA=8,0103003c003945d4\n'

Looks good!

Joerglp commented 10 months ago

@kbialek beta4 ist deployed. I'll see if it's working during the day.

Edit: It‘s work.

carstenfroehlich commented 10 months ago

Now the inverter seems to be damaged... The external relay has worked for one day. Now the inverter shows a permanent red light. So poorly I'm out for testing...