Copyright ©

Mongoose OS Forum


Core Dump on esp32 after upgrading to mos 1.15

I upgrade to mos 1.15 and start seeing Core dump with my app. See:

I revert to mos 1.14 and build/flash the same project, then everything work correctly. Was there any similar problem reported? I am fairly new with mongoose, I wonder what is the best way for me to troubleshoot this issue.


  • BTW, all my code are in js using mjs. I don't have any native c code at the moment.

  • SergeySergey Dublin, Ireland

    Could you show your JS code please ?

  • Thank for the response.
    Sure. Please see the attached js file. This code is used to drive a watering system that I am trying to build. Essentially, there are two major logics in the code
    1. Periodically use mqtt to pub a "heartbeat"message to the server every 60 seconds
    2. The device listen for "startWater" mqtt event and turn GPIO pin on for a short amount of time, and then shut it off.

    I read more about the watch dog and it seems to suggest that I could be spending too much time doing the processing in my timer callback function? However, I could not see anything very obvious in the code as the most expensive operation I can see it just sending/receiving a mqtt message.

    To reproduce the issue, I just keep sending few "startWater" messages, and then after few minutes, I got a core dump. I haven't had luck narrowing down the cause yet, but the same code run very robustly on 1.14. Any pointer is greatly appreciated. Thanks!

  • I was able to play a bit more with the code today. Looks like it is a bug with my javascript, though I am a bit surprise this actually crash the system :wink: . When my startWater is called, it will schedule a timer to call stopWater. Inside my stopWater function, I will attempt to cancel the timer by calling Timer.del() on the exact timer that invokes the stopWater function. Not sure exactly how this behavior translates to the actual code in the underlying system. But I guess this is probably what caused the system to puke somehow. Really curious why this doesn't happen on 1.14 before. I comment out the Timer.del() call and then everything seems to be working without crashing again. :)

Sign In or Register to comment.