Code Monkey home page Code Monkey logo

Comments (3)

martin-ger avatar martin-ger commented on May 24, 2024

Just to understand a few questions:

  • you are using the lib as a client and the exception happens on the client?
  • if so, could you try with i-n-g-os origial mqtt-client lib. https://github.com/i-n-g-o/esp-mqtt-arduino
  • you can reproduce this more or less deterministically?

Thanks,
Martin

from umqttbroker.

reaper7 avatar reaper7 commented on May 24, 2024

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 ?

from umqttbroker.

Marais-M avatar Marais-M commented on May 24, 2024

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

from umqttbroker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.