openshwprojects / OpenBK7231T_App

Open source firmware (Tasmota/Esphome replacement) for BK7231T, BK7231N, BL2028N, T34, XR809, W800/W801, W600/W601, BL602 and LN882H
https://openbekeniot.github.io/webapp/devicesList.html
1.44k stars 262 forks source link

MQTT Disconect each every minute #181

Open bugalaws opened 2 years ago

bugalaws commented 2 years ago

I’m using a aubees 16A gang and the openbk connected into hassio by mqtt bit the problem is each one minute the mqtt gets disconected. I don’t use the flag 2 enabled.. and the wifi is stable..

Info:MQTT:mqtt_userName xxx mqtt_pass xxxx mqtt_clientID LuzCorredorCasa mqtt_host 192.168.0.20:1883

Info:MQTT:Connect error in mqtt_client_connect - code: -10

Info:MAIN:Time 35398, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35399, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35400, free 85160, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 3/38

Info:GEN:dhcp=0 ip=192.168.0.166 gate=192.168.0.1 mask=255.255.255.0 mac=c8:47:8c:6c:bf:c4

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MQTT:mqtt_connection_cb: Disconnected, reason: 256

Info:MAIN:wl_status 11

Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED

Info:MAIN:Time 35401, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35402, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35403, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35404, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35405, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35406, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35407, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35408, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MQTT:mqtt_userName xxx mqtt_pass xxx mqtt_clientID LuzCorredorCasa mqtt_host 192.168.0.20:1883

Info:MAIN:Time 35409, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35410, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Info:GEN:dhcp=0 ip=192.168.0.166 gate=192.168.0.1 mask=255.255.255.0 mac=c8:47:8c:6c:bf:c4

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35411, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35412, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35413, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35414, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35415, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35416, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35417, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35418, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Debug:HTTP:TCP will process packet of len 336

Info:MAIN:Time 35419, free 89840, MQTT 0, bWifi 1, secondsWithNoPing -1, socks 2/38

Debug:HTTP:TCP will process packet of len 336

Info:MQTT:mqtt_userName xxx mqtt_pass xxx mqtt_clientID LuzCorredorCasa mqtt_host 192.168.0.20:1883

openshwprojects commented 2 years ago

Hey, have you ever managed to get to "MQTT 1" stage in the log? I can see it has never connected correctly. Can you double check the password and IP?

Also... mqtt_client_connect -10? https://www.nongnu.org/lwip/2_0_x/group__mqtt.html https://www.nongnu.org/lwip/2_0_x/err_8h.html ERR_ISCONN = -10 That's a strange return value as for that function. I think I will need more information to debug it.

bugalaws commented 2 years ago

Hey, have you ever managed to get to "MQTT 1" stage in the log? I can see it has never connected correctly. Can you double check the password and IP?

Also... mqtt_client_connect -10? https://www.nongnu.org/lwip/2_0_x/group__mqtt.html https://www.nongnu.org/lwip/2_0_x/err_8h.html ERR_ISCONN = -10 That's a strange return value as for that function. I think I will need more information to debug it.

Hello friend, yes o got connected.. because i have control of in the home assistant, the user and pas are correctly… the same what i use on my tasmotas… On the below image do you can see the home assiatant history of this device… each every minute it reconnect… And this cause a problem because in each mqtt reconnect it turn of the lamp… this way i cant stay witch the lamp on…

1164DBCE-B527-4077-AD80-E6A4EACD66DE

bugalaws commented 2 years ago

I’m ready to help with the logs, what logs do you need ?

bugalaws commented 2 years ago

Now the log are like below and repeats every minute..:

Info:MQTT:mqtt_connection_cb: Disconnected, reason: 256

Info:MQTT:mqtt_userName usuario mqtt_pass senha mqtt_clientID LuzCorredorCasa mqtt_host 192.168.0.20:1883

Info:MQTT:mqtt_connection_cb: Successfully connected

Info:MQTT:mqtt_subscribed to LuzCorredorCasa/+/set

Info:MQTT:mqtt_subscribed to cmnd/LuzCorredorCasa/+

Info:MQTT:mqtt_publish requies 35, has 1024 Info:MQTT:MQTT client "LuzCorredorCasa" request cb: err 0

Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic LuzCorredorCasa/1/set

Info:MQTT:MQTT in topic LuzCorredorCasa/1/set Info:MQTT:channelSet topic 4210268 Info:MQTT:channelSet part topic 1/set Info:MQTT:channelSet channel 1 Info:MQTT:MQTT client in mqtt_incoming_data_cb data is 1 for ch 1

Info:MQTT:MQTT client "LuzCorredorCasa" request cb: err 0

Info:MQTT:Publishing sockets = 2

Info:MQTT:mqtt_publish requies 28, has 1024 Info:MQTT:[g_bPublishAllStatesNow] item -5 result 0

Info:MQTT:Publishing rssi = -43

Info:MQTT:mqtt_publish requies 27, has 1024 Info:MQTT:[g_bPublishAllStatesNow] item -4 result 0

Info:MQTT:Publishing uptime = 1337

Info:MQTT:mqtt_publish requies 30, has 1024 Info:MQTT:[g_bPublishAllStatesNow] item -3 result 0

Info:MQTT:Publishing freeheap = 85688

Info:MQTT:mqtt_publish requies 33, has 1024 Info:MQTT:[g_bPublishAllStatesNow] item -2 result 0

Info:MQTT:Publishing ip = 192.168.0.166

Info:MQTT:mqtt_publish requies 35, has 1024 Info:MQTT:[g_bPublishAllStatesNow] item -1 result 0

Info:MQTT:Publishing 1 = 1

Info:MQTT:mqtt_publish requies 26, has 1024 Info:MQTT:mqtt_connection_cb: Disconnected, reason: 256

manivalaguru commented 2 years ago

hello have you resolved this issue i am also having the same?

bugalaws commented 2 years ago

hello have you resolved this issue i am also having the same?

I don’t solved it.. the bug continue….

i reactivate a tasmota device until this bug is solved….