Anyone having success with MKRNB1500 and MQTT?

I've spent many hours attempting to get the MKR1500 MQTT to work reliably with the Arduino libraries. It works most of the time but there are conditions where it hangs in different states. My sketch doesn't ever get control back so that it could reset the modem or whatever to recover. I have the latest firmware installed which is faster but it resulted in some different 'hang' conditions. The requirement is that it will run until the battery dies without any manual intervention as the target is remote locations. If anyone has had success with MQTT with or without the Ardunio libraries I'd like to know and get information as to what it took to get it to be reliable. Thanks.

Hi Icole,

I've had to resort to fairly liberal use of the watchdog timer resetting the whole board and then having a modem reset in the setup portion of the sketch.

Due to the limits on the hardware watchdog (8/16s max) being an insufficient timeout for many AT commands, I've had to use the less low-level interrupt based software watchdog as it can be set to an arbitrary length of time. I'm no expert but I believe this means if your program hangs in an interrupt the watchdog will not trigger.

I've found the WDTZero.h library to work well.

Much like others on this forum I've been working on improving stability, in my case for AWS IOT MQTT. I will add my general findings in another thread in the near future.

Hi scouter9000, I've not had time to fool with the MKR1500 recently but should be starting back in the next day or so. The software watchdog may be what I need. At least for now I could live with a timeout say of 5 minutes . The problems I see are timing out waiting for a response and then things get out of sync and my code never gets control again. My guess is that the modem and mqtt code could be modified to handle the timeout in a better manner but that could take a lot of time. I;m about at the point to try another solution for the project, but will give the software watchdog a shot. Thanks for sharing your experiences.

One thing I've recently found that may tie in to your timeout findings is that low/intermittent signal can really destroy reliability of MQTT connection. I've posted a bit more detail in another thread, but if you're trying some last ditch efforts, an antenna swap may help.

A better antenna is a good idea which I may have to change to. I finally have gotten back to this project and last night I added the software watch dog timer you suggested. So far it seems to be working. I'm using a eight minute timeout which is overkill but for the first target application this will not be a problem as it will be reading a sensor and sending the data about 4 times per 24hr period. Thanks for sharing your information.