martin-ger / esp_mqtt

MQTT Broker/Bridge on the ESP8266
MIT License
293 stars 68 forks source link

esp mqtt crashes when a client connects #69

Open krishnak opened 1 year ago

krishnak commented 1 year ago

I installed your binary from github using the esptool.py as described in your post. I am running your code on Weimos D1 clone/ ESP8266 with 4MB flash. After the broker was setup, it had two IP's one from my router and another from its network. All well so far

I have another NodeMCU running Tasmato which is connected to my router. I configured it to post to your broker.

As soon as it started sending the message, the application crashed on the MQTT broker see output below.

uMQTT Broker V2.0.10 starting

Config found and loaded
Starting Console TCP Server on port 7777
Max number of TCP clients: 15
mode : sta(ac:0b:fb:db:9f:ed) + softAP(ae:0b:fb:db:9f:ed)
add if0
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
mode: 0 -> 3
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt 

connected with Sundara, channel 5
dhcp client start...
connect to ssid Sundara, channel 5
ip:192.168.1.18,mask:255.255.255.0,gw:192.168.1.1
ip:192.168.1.18,mask:255.255.255.0,gw:192.168.1.1,dns:8.8.8.8
Got NTP server: 162.159.200.123
MQTT: Partial message received
MQTT: Partial message received
MQTT: Partial message received
Fatal exception 28(LoadProhibitedCause):
epc1=0x4000df60, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0�000000
 ets Jan  8 2013,rst cause:2, boot mode:(3,4)

load 0x40100000, len 30196, room 16 
tail 4
chksum 0xaf
load 0x3ffe8000, len 2124, room 4 
tail 8
chksum 0x9b
load 0x3ffe8850, len 10060, room 0 
tail 12
chksum 0x9f
csum 0x9f

The Tasmato keeps trying to resend and this is resulting in a continuous crash. Can you please let me know whether it is a code issue .

krishnak commented 1 year ago

The output from Tasmato console when the MQTT broker crashed is as follows

00:00:02.005 HTP: Web server active on Entrance-0349 with IP address 192.168.1.16
22:55:22.030 MQT: Attempting connection...
22:55:22.070 MQT: Connected
22:55:22.073 MQT: testpost/LWT = Online (retained)
22:55:22.075 MQT: testpost/cmnd/POWER = 
22:55:22.079 MQT: testpost/INFO1 = {"Info1":{"Module":"Entrance","Version":"12.1.1(tasmota)","FallbackTopic":"cmnd/DVES_C8215D_fb/","GroupTopic":"testpost/cmnd/"}}
22:55:22.087 MQT: testpost/INFO2 = {"Info2":{"WebServerMode":"Admin","Hostname":"Entrance-0349","IPAddress":"192.168.1.16"}}
22:55:22.099 MQT: testpost/INFO3 = {"Info3":{"RestartReason":"Software/System restart","BootCount":24}}
22:55:22.108 MQT: testpost/RESULT = {"POWER1":"OFF"}
22:55:22.111 MQT: testpost/POWER1 = OFF
22:55:22.115 MQT: testpost/RESULT = {"POWER2":"OFF"}
22:55:22.119 MQT: testpost/POWER2 = OFF
22:55:25.492 QPC: Reset
22:55:26.405 MQT: testpost/STATE = {"Time":"2022-08-26T22:55:26","Uptime":"0T00:00:09","UptimeSec":9,"Heap":24,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Dimmer":10,"Color":"1A1A1A","HSBColor":"0,0,10","Channel":[10,10,10],"Scheme":0,"Width":1,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"Sundara","BSSId":"14:A7:2B:77:2A:9C","Channel":5,"Mode":"11n","RSSI":76,"Signal":-62,"LinkCount":1,"Downtime":"0T00:00:03"}}
22:55:32.013 MQT: Attempting connection...
22:55:32.027 MQT: Connected
22:55:32.031 MQT: testpost/LWT = Online (retained)
22:55:32.033 MQT: testpost/cmnd/POWER = 
22:55:43.018 MQT: Attempting connection...
22:55:43.032 MQT: Connected
22:55:43.035 MQT: testpost/LWT = Online (retained)
22:55:43.038 MQT: testpost/cmnd/POWER = 
22:55:55.004 MQT: Attempting connection...
22:55:55.024 MQT: Connected
22:55:55.027 MQT: testpost/LWT = Online (retained)
22:55:55.029 MQT: testpost/cmnd/POWER = 
22:56:02.035 MQT: Attempting connection...
22:56:02.055 MQT: Connected
22:56:02.058 MQT: testpost/LWT = Online (retained)
22:56:02.061 MQT: testpost/cmnd/POWER = 
22:57:03.028 MQT: Attempting connection...`
`