Open reaper7 opened 6 years ago
Just to understand a few questions:
Thanks, Martin
I'm using lib only as client and this happens on client. Original lib -> the same problem
mqtt_pub.ino from origial mqtt-client lib, only wifi user/pass and mqtt server IP changed. if I add in setup (before myMqtt.connect();): myMqtt.setUserPwd("mymqttuser", "mymqttpass"); everything works correctly
but without setUserPwd I got:
Exception 9: LoadStoreAlignmentCause: Load or store to an unaligned address
Decoding 18 results
0x40104a44: ets_timer_setfn at ?? line ?
0x4010020c: _umm_free at C:\PROGRAMY\Arduino\hardware\esp8266com\esp8266\cores\esp8266\umm_malloc/umm_malloc.c line 1291
0x40104c70: ets_timer_arm_new at ?? line ?
0x401004f4: calloc at C:\PROGRAMY\Arduino\hardware\esp8266com\esp8266\cores\esp8266\umm_malloc/umm_malloc.c line 1688
0x402198da: MQTT_Connect at C:\PROGRAMY\arduino_projekty\libraries\esp-mqtt-arduino\src\mqtt/mqtt.c line 915
0x40219891: MQTT_Connect at C:\PROGRAMY\arduino_projekty\libraries\esp-mqtt-arduino\src\mqtt/mqtt.c line 901
0x40201340: delay at C:\PROGRAMY\Arduino\hardware\esp8266com\esp8266\cores\esp8266/core_esp8266_wiring.c line 46
0x4020269c: MQTT::connect() at C:\PROGRAMY\arduino_projekty\libraries\esp-mqtt-arduino\src/MQTT.cpp line 198
0x40201f77: myDisconnectedCb() at C:\tmp\arduino_modified_sketch_608881/mqtt_pub.ino line 90
0x4010420a: lmacTxFrame at ?? line ?
0x40203125: mqttDisconnectedCb at C:\PROGRAMY\arduino_projekty\libraries\esp-mqtt-arduino\src/MQTT.cpp line 198
0x40100a91: ppEnqueueRxq at ?? line ?
0x40218f65: mqtt_tcpclient_discon_cb at C:\PROGRAMY\arduino_projekty\libraries\esp-mqtt-arduino\src\mqtt/mqtt.c line 509
0x4022294b: espconn_tcp_disconnect_successful at app/espconn_tcp.c line 384
: (inlined by) espconn_Task at app/espconn_tcp.c line 439
0x40222958: espconn_tcp_disconnect_successful at app/espconn_tcp.c line 389
: (inlined by) espconn_Task at app/espconn_tcp.c line 439
0x4010085e: ppProcessTxQ at ?? line ?
0x4021b8a6: ppPeocessRxPktHdr at ?? line ?
Hi Martin
Thanks for the hard work done with the Andriod library.
When running the code on ESP8266 I intermittently get a broker error message when I disconnect a client from the broker: (connect and then a few seconds later disconnect the client).
Fatal exception 9(LoadStoreAlignmentCause): epc1=0x40227fd2, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000107, depc=0x00000000
Exception (9): epc1=0x40227fd2 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000107 depc=0x00000000
With debug activated and a client disconnect requested, I noticed that during the client diconnect sequence a espconn_delete(mqttClientCon->pCon) and when the MQTT_ServerTask is executed a espconn_disconnect(clientcon->pCon) is called. The Fatal exception happens when espconn_disconnect(clientcon->pCon) is executed.
Would it not be better to prevent a espconn_delete to be followed by espconn_disconnect by changing ClientCon->connState in MQTT_server_deleteClientCon.
bool ICACHE_FLASH_ATTR MQTT_server_deleteClientCon(MQTT_ClientCon * mqttClientCon) { MQTT_INFO("MQTT: DeleteClientCon\r\n");
if (mqttClientCon == NULL) return;
os_timer_disarm(&mqttClientCon->mqttTimer);
if (mqttClientCon->pCon != NULL) {
mqttClientCon->connState = TCP_DISCONNECTING;
espconn_delete(mqttClientCon->pCon);
}
Your feedback plse.
Regards Marius
My mqtt broker has set user and password, I forgot about it and I tried the @i-n-g-o mqtt_pub example as is without setUserPwd...
in setup mqtt try connect to broker without success (because user/pass not set) then jump to myDisconnectedCb and causer error on second myMqtt.connect():
esp exception decoder show:
when I set user/pass everything works fine