syssi / esphome-pipsolar

ESPHome component to monitor and control a pipsolar inverter via RS232
Apache License 2.0
78 stars 35 forks source link

Daxtromn 6.2kW issue #98

Closed AkinysSurf closed 7 months ago

AkinysSurf commented 7 months ago

Hi,

Inverter https://daxtromn-power.com/products/special-offer-6.2kw-hybrid-solar-inverter-pure-sine-wave-220vac-output-48vdc-input-120a-mppt-solar-charger-controller-6200w-european-union-stock-fast-ship

With esp32 setup example uart debug shows real and changing values, but only zeroes a sent to HA Here some log fragment

[15:30:01][D][uart_debug:158]: >>> "QPIGS\xB7\xA9\r"
[15:30:01][D][pipsolar:839]: Sending polling command : QPIGS with length 5
[15:30:01][D][uart_debug:158]: <<< "QPIGS\xB7\xA9\r"
[15:30:01][D][pipsolar:773]: checking crc on incoming message
[15:30:01][D][pipsolar:776]: CRC OK
[15:30:01][D][pipsolar:449]: Decode QPIGS
[15:30:01][D][text_sensor:064]: 'inverter0_last_qpigs': Sending state 'QPIGS'
[15:30:01][D][sensor:094]: 'inverter0_grid_voltage': Sending state 0.00000 V with 1 decimals of accuracy
[15:30:01][D][sensor:094]: 'inverter0_grid_frequency': Sending state 0.00000 Hz with 1 decimals of accuracy
[15:30:01][D][sensor:094]: 'inverter0_output_load_percent': Sending state 0.00000 % with 1 decimals of accuracy
[15:30:01][D][sensor:094]: 'inverter0_inverter_heat_sink_temperature': Sending state 0.00000 °C with 1 decimals of accuracy
[15:30:02][D][uart_debug:158]: <<< "(223.2 50.0 000.0 00.0 0000 0000 000 001 03.30 000 000 0032 00.0 000.0 00.00 00000 00000000 00 00 00000 000\xFB\xB8\r"
[15:30:02][D][uart_debug:158]: >>> "QMODI\xC1\r"
[15:30:02][D][pipsolar:839]: Sending polling command : QMOD with length 4
[15:30:02][D][uart_debug:158]: <<< "QMODI\xC1\r"
[15:30:02][D][pipsolar:773]: checking crc on incoming message
[15:30:02][D][pipsolar:776]: CRC OK
[15:30:02][D][pipsolar:472]: Decode QMOD
[15:30:02][D][text_sensor:064]: 'inverter0_device_mode': Sending state 'M'
[15:30:02][D][uart_debug:158]: <<< "(S\xE5\xD9\r"
[15:30:03][D][uart_debug:158]: >>> "QPIRI\xF8T\r"
[15:30:03][D][pipsolar:839]: Sending polling command : QPIRI with length 5
[15:30:03][D][uart_debug:158]: <<< "QPIRI\xF8T\r"
[15:30:03][D][pipsolar:773]: checking crc on incoming message
[15:30:03][D][pipsolar:776]: CRC OK
[15:30:03][D][pipsolar:430]: Decode QPIRI
[15:30:03][D][text_sensor:064]: 'inverter0_last_qpiri': Sending state 'QPIRI'
[15:30:03][D][sensor:094]: 'inverter0_output_source_priority': Sending state 0.00000  with 1 decimals of accuracy
[15:30:04][D][uart_debug:158]: <<< "(230.0 26.9 230.0 50.0 26.9 6200 6200 48.0 42.0 42.0 49.2 48.2 2 020 040 1 1 1 1 01 0 0 49.0 0 1\x16\xE8\r"
[15:30:04][D][uart_debug:158]: >>> "QPIGS\xB7\xA9\r"
[15:30:04][D][pipsolar:839]: Sending polling command : QPIGS with length 5
[15:30:04][D][uart_debug:158]: <<< "QPIGS\xB7\xA9\r"
[15:30:04][D][pipsolar:773]: checking crc on incoming message
[15:30:04][D][pipsolar:776]: CRC OK
[15:30:04][D][pipsolar:449]: Decode QPIGS
[15:30:04][D][text_sensor:064]: 'inverter0_last_qpigs': Sending state 'QPIGS'
[15:30:04][D][sensor:094]: 'inverter0_grid_voltage': Sending state 0.00000 V with 1 decimals of accuracy
[15:30:04][D][sensor:094]: 'inverter0_grid_frequency': Sending state 0.00000 Hz with 1 decimals of accuracy
[15:30:04][D][sensor:094]: 'inverter0_output_load_percent': Sending state 0.00000 % with 1 decimals of accuracy
[15:30:04][D][sensor:094]: 'inverter0_inverter_heat_sink_temperature': Sending state 0.00000 °C with 1 decimals of accuracy
[15:30:05][D][uart_debug:158]: <<< "(223.2 50.0 000.0 00.0 0000 0000 000 001 03.40 000 000 0032 00.0 000.0 00.00 00000 00000000 00 00 00000 000\x80L\r"
[15:30:05][D][uart_debug:158]: >>> "QMODI\xC1\r"
[15:30:05][D][pipsolar:839]: Sending polling command : QMOD with length 4
[15:30:05][D][uart_debug:158]: <<< "QMODI\xC1\r"
[15:30:05][D][pipsolar:773]: checking crc on incoming message
[15:30:05][D][pipsolar:776]: CRC OK
[15:30:05][D][pipsolar:472]: Decode QMOD
[15:30:05][D][text_sensor:064]: 'inverter0_device_mode': Sending state 'M'
[15:30:05][D][uart_debug:158]: <<< "(S\xE5\xD9\r"
syssi commented 7 months ago

Welcome here! :-) As first step please check your wiring. One thing is strange:

[15:30:01][D][uart_debug:158]: >>> "QPIGS\xB7\xA9\r"
[15:30:01][D][uart_debug:158]: <<< "QPIGS\xB7\xA9\r"
[15:30:02][D][uart_debug:158]: <<< "(223.2 50.0 000.0 00.0 0000 0000 000 001 03.30 000 000 0032 00.0 000.0 00.00 00000 00000000 00 00 00000 000\xFB\xB8\r"

If your ESP sends ( >>>) the request QPIGS the same word/command is received <<< QPIGS immediately. This isn't normal and looks like a local echo / short circuit between RX & TX.

AkinysSurf commented 7 months ago

If I disconnect any wire (tx or rx) then this uart debug string

[15:30:05][D][uart_debug:158]: <<< "(223.2 50.0 000.0 00.0 0000 0000 000 001 03.40 000 000 0032 00.0 000.0 00.00 00000 00000000 00 00 00000 000\x80L\r"

dissapears, so I assumed that wiring is correct.

syssi commented 7 months ago

Yes, this line is a valid response from your inverter:

[15:30:05][D][uart_debug:158]: <<< "(223.2 50.0 000.0 00.0 0000 0000 000 001 03.40 000 000 0032 00.0 000.0 00.00 00000 00000000 00 00 00000 000\x80L\r"

If you disconnect the inverter this response cannot reach the ESP anymore but this isn't the point.

I'm talking about this traffic:

[15:30:01][D][uart_debug:158]: >>> "QPIGS\xB7\xA9\r"
[15:30:01][D][uart_debug:158]: <<< "QPIGS\xB7\xA9\r"

If you send the command QPIGS to the inverter it should respond immediately with (223.2 50.0 000.0 00.0...).

Therefore my guess is there is a short cut between the RX and TX pin of your ESP. If the ESP sends (TX) QPIGS it can hear (RX) himself. If you remove all wires from the ESP do you still see the incoming <<< QPIGS message?

AkinysSurf commented 7 months ago

Maybe something wrong with rs232 converter - I am using inverter useless wifi module - desoldered wifi part and connected esp pins to max3232 pins.... I will try with different rs232-ttl converter, aliexpress package will arrive soon.

AkinysSurf commented 7 months ago

Finally, after yours tip to disconnect tx/rx from esp, I found that echo occurs in my TTGO Lora without any connection to max3232 :)
It was on tx_pin: GPIO18 rx_pin: GPIO19 Changed to tx_pin: GPIO17 rx_pin: GPIO16 and now it works. Thanks for help

syssi commented 7 months ago

Perfect! Let's close this issue.