OpenBK7231T_App icon indicating copy to clipboard operation
OpenBK7231T_App copied to clipboard

ln882H HA discovery mem error

Open nosmaster89 opened this issue 1 year ago • 5 comments

Describe the bug calling discovery for home assistant causes a memory error and it fails to send the discovery message

Firmware:

  • Version LN882H_Test
  • Device? ali smart mini switch
  • Chip/model: LN822H?
  • Device config?

To Reproduce Steps to reproduce the behavior:

  1. flash ln882_Test
  2. setup mqtt
  3. try to run ha discovery
Error:MQTT:Publish err: ERR_MEM aka -1
Info:MQTT:Publishing val (307 bytes) to homeassistant/binary_sensor/Front_room_ceiling_binary_sensor_2/config retain=1
Error:MQTT:Publish err: ERR_MEM aka -1
Info:MQTT:MQTT will reconnect soon to fix ERR_MEM errors
Info:MQTT:MQTT has pending reconnect in 4
Info:MQTT:Publishing val (322 bytes) to homeassistant/sensor/Front_room_ceiling_rssi/config retain=1
Error:MQTT:Publish err: ERR_MEM aka -1```
**Additional context**
Add any other context about the problem here.

nosmaster89 avatar Feb 03 '24 18:02 nosmaster89

I think I know what may be wrong. We need to expand buffers: https://github.com/openshwprojects/OpenLN882H/commit/29073151d1bc6dada9bb28f818928bba8e06617e I will push this to releases, can you recheck?

openshwprojects avatar Feb 09 '24 13:02 openshwprojects

yes not a problem i just saw it was released but no file for it at the moment

nosmaster89 avatar Feb 09 '24 14:02 nosmaster89

one moment please, check next commit

openshwprojects avatar Feb 09 '24 16:02 openshwprojects

yes that worked ha now discovers it , although the config isnt using the device name in the HA yaml unique_id: "Front_room_ceiling_relay_1" name: 1 so it doesnt get a distinct name in HA

nosmaster89 avatar Feb 09 '24 18:02 nosmaster89

I didnt experience the initial problem, but a discovery with 1.17.457 seems to OK for me. device is showing in HASS. OBK console log:

Info:MQTT:Publishing val 258.2 to euplug/voltage/get retain=0
Info:MAIN:Time 36535, idle 0/s, free 96048, MQTT 1(2208), bWifi 1, secondsWithNoPing 36470, socks 0/0 
Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic euplug/voltage/get
Info:CMD:[WebApp Cmd 'logfeature 2 0' Result] OK
Info:MQTT:Publishing val 0.047 to euplug/energycounter/get retain=0
Info:MQTT:Publishing val 0.000 to euplug/energycounter_last_hour/get retain=0
Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic euplug/energycounter/get
Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic euplug/energycounter_last_hour/get
Info:MQTT:Publishing val 260.3 to euplug/voltage/get retain=0
Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic euplug/voltage/get
Info:MQTT:Queued topic=homeassistant/switch/OpenBK_LN882H_WL2S_EUPlug_PM_relay_0/config, 1 items in queue
Info:MQTT:Queued topic=homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_sensor_0/config, 2 items in queue
Info:MQTT:Queued topic=homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_sensor_1/config, 3 items in queue
Info:MQTT:Queued topic=homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_sensor_2/config, 4 items in queue
Info:MQTT:Queued topic=homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_sensor_3/config, 5 items in queue
Info:MQTT:Queued topic=homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_sensor_4/config, 6 items in queue
Info:MQTT:Queued topic=homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_sensor_5/config, 7 items in queue
Info:MQTT:Queued topic=homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_rssi/config, 8 items in queue
Info:MQTT:Publishing val (325 bytes) to homeassistant/switch/OpenBK_LN882H_WL2S_EUPlug_PM_relay_0/config retain=1
Info:MQTT:Publishing val (359 bytes) to homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_sensor_0/config retain=1
Info:MQTT:Publishing val (359 bytes) to homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_sensor_1/config retain=1
Info:MQTT:Publishing val (353 bytes) to homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_sensor_2/config retain=1
Info:MQTT:Publishing val (376 bytes) to homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_sensor_3/config retain=1
Info:MQTT:Publishing val (396 bytes) to homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_sensor_4/config retain=1
Info:MQTT:Publishing val 0.011 to euplug/current/get retain=0
Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic euplug/current/get
Info:MQTT:Publishing val (315 bytes) to homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_sensor_5/config retain=1
Info:MQTT:Publishing val (330 bytes) to homeassistant/sensor/OpenBK_LN882H_WL2S_EUPlug_PM_rssi/config retain=1
Info:MQTT:Channel has changed! Publishing 0 to channel 0 
Info:MQTT:Publishing val 0 to euplug/0/get retain=0
Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic euplug/0/get
Info:MQTT:Publishing val 258.2 to euplug/voltage/get retain=0
Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic euplug/voltage/get
Info:MQTT:Publishing val 0.000 to euplug/current/get retain=0
Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic euplug/current/get
Info:MQTT:Publishing val 260.1 to euplug/voltage/get retain=0

divadiow avatar Feb 10 '24 06:02 divadiow

Closing as solved, increasing buffers helped.

openshwprojects avatar Apr 05 '24 14:04 openshwprojects