rbroker / ecodan-ha-local

Local HomeAssistant support for Air to Water Heat Pump Data/Control for Mitsubishi Ecodan
GNU General Public License v3.0
43 stars 10 forks source link

ESP remains in an undefined state #45

Open Himbeerlinux opened 3 weeks ago

Himbeerlinux commented 3 weeks ago

Hi I have installed the software on an ESP32 and it works without MQTT, as described. I can access the ESP via WEB. As soon as I activate the MQTT broker, the software stops somewhere.

I use the IObroker to collect all the data. There is a separate module for MQTT. After the ESP starts, the connection to the MQTT broker is also briefly established and an object tree is partially created and data is stored. After about 15 seconds, this connection is disconnected and the ESP remains in an undefined state. Access via WEB does not work. I cannot read the log file. As soon as the broker is running, WEB access does not work at all. You can only unplug the ESP and start again. At some point the program freezes and stops. A ping to the IP still works, so the network connection is still active. What can you do to find the error.

Himbeerlinux commented 3 weeks ago

Here is a log from ioBroker. Unfortunately I don't have access to the ESP when I activate MQTT:

2024-06-28 11:32:03.842 - info: mqtt.0 (11395) starting. Version 5.2.0 in /opt/iobroker/node_modules/iobroker.mqtt, node: v18.20.3, js-controller: 5.0.19 2024-06-28 11:32:04.037 - info: mqtt.0 (11395) Starting MQTT authenticated server on 0.0.0.0:5002 2024-06-28 11:32:21.584 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] connected with secret 1719567141575_8582 2024-06-28 11:32:21.764 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] subscribes on "mqtt.0.ecodan_hp.climate_control_90d31376efd0.temp_cmd" 2024-06-28 11:32:21.798 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] subscribes on "mqtt.0.ecodan_hp.force_dhw_90d31376efd0.set" 2024-06-28 11:32:21.810 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] subscribes on "mqtt.0.ecodan_hp.turn_on_off_hp_90d31376efd0.set" 2024-06-28 11:32:21.823 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] subscribes on "mqtt.0.ecodan_hp.dhw_water_heater_90d31376efd0.set" 2024-06-28 11:32:21.835 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] subscribes on "mqtt.0.ecodan_hp.z1_flow_temp_target_90d31376efd0.set" 2024-06-28 11:32:21.847 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] subscribes on "mqtt.0.ecodan_hp.dhw_mode_90d31376efd0.set" 2024-06-28 11:32:21.863 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] subscribes on "mqtt.0.ecodan_hp.sh_mode_90d31376efd0.set" 2024-06-28 11:32:21.966 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] publishOnSubscribe 2024-06-28 11:32:22.000 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] publishOnSubscribe 2024-06-28 11:32:22.010 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] publishOnSubscribe 2024-06-28 11:32:22.024 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] publishOnSubscribe 2024-06-28 11:32:22.035 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] publishOnSubscribe 2024-06-28 11:32:22.048 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] publishOnSubscribe 2024-06-28 11:32:22.063 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] publishOnSubscribe 2024-06-28 11:32:39.216 - info: mqtt.0 (11395) Client [192.168.xxx.xxx] connection closed: timeout

rbroker commented 3 weeks ago

I'm not familiar with ioBroker, so it's difficult for me to say what might be happening in this case. I had a quick look over the ioBroker source code, and it looks like they're dispatching state data in response to the MQTT subscription requests, my best guess is that it's sending something in a format homeassistant wouldn't send (as I guess it doesn't use homeassistant's value template format) and it's not being handled properly.

You could try temporarily commenting out the code inside the mqtt_callback() function in ehal_mqtt.cpp, if you're only looking to collect back the reported data and no control the pump - if that stops the hanging issue then at least you've identified that it's something to do with the data being sent by ioBroker whhich my code can't currently handle.

Himbeerlinux commented 2 weeks ago

Thanks for the quick reply. I don't know the homeassistant, but I will test it. It may replace the iobroker. I will also test the changes in the code to see if it is sufficient for my purposes.

Himbeerlinux commented 2 weeks ago

I changed the code. Now iobroker can handle the data and I can add the info to my Grafana dashboard. Thanks again.