MKR 1400 stops sending data after 24 hours

I have a project, using Arduino MKR1400, reading sensors and send them to Thinger in every 20 minutes. Everything works fine (data is sent, charts are created and visible) but only for 24 hours. After 24 hours, the board stops sending, or thinger stops reading data. Every other function is working on the board perfectly such as sending text message and operate a relay, but no data is visible in charts or buckets. Everithing works fine after a reset, but only for another 24 hours. Exactly 24 hours. Is it something to do with the free account or just some setting problem. I have tryed different time intervals for communication like 10 minutes, 15 minutes etc. but it still stops communicating.

Any advice is greatly appreciated.

I’ve experimented some similar behaviour, what I’ve done is to keep reseting the thinger process, calling thinger.stop(); and after few minutes calling thinger.handle(); again.

What would be interesting is to see the serial output with the verbose debug enabled #define _DEBUG_ to see what is doing the device when stops sending data and keep working the other process.

Thank you for the advice. Did it work for you? I am just checking my sketch and actually it is written the way, thinger.handle(); happens every 20 minutes (or equivalent counter function) followed by thing.stop(); after the task is executed. it means, the communication stops between. I reduced the number of connections as well from every 10 minutes to 20 minutes in case i have reached the maximum uploads in 24 hours if there was such a thing. I was thinking to program the board to reset itself every 22 hours but I see a good program should not be reset at all. For some reason i feel it is something to do with rather than the program but I could be wrong. I was hoping this is a common error and easy fix.

The limitation in the public server is up to one by minute, that is not the lmitation, that is why I suggest if its possible to see the serial debug on this device as the behaviour is pretty regular as you described.

I would be happy to investigate this debug thing but I have to be honnest, this is my very first project, therefore i have no experience with debugging. how would you suggest, I just hook the board to the laptop and leave it on for 24 hours and integrate a debug code into the sketch? or is it enough if i jus define th e debug in the global and it will do the trick? Thank you for your time.

Ok I see… No worries it is easier than you may think.

Just add the line
#define DEBUG

At the very first line of your sketch, should be loaded before the thinger library.

And with this sketch, the device will report by serial console what it is doing, so you will be able to see any message related to thinger connection.

I recommend for testing purposes to avoid the usage of the thinger.stop(); command, because the device should not loose connection, and if it losses it, should reconnect without issues, and running this command you will see all the messages related to the disconnection and reconnection, will be more difficult to detect error or other messages.

Let us know how it goes, and paste here the serial output, and of course let me know if I explained myself well, any doubt you may have just drop it here (or in a new topic if is an isolated situation from this).


You also have got Internet providers who cut the internet connection and change the IP daily…

Thats brilliant, thank you. It is absolutely clear. I will also reudce the serial prints otherwise I will have 50 thousend lines. I will carry out this test during the weekend when i wont need my laptop. If I take the “thinger.stop();” command out, do I have to move thinger.handle(); out to the start of the loop? Or it does not matter?

The thinger.handle(); command may go wherever you want in the sketch, just need to be sure that is available to run frequently by the uC, if it is in a conditional loop that forbids to run, it wont communicate with the cloud of course.

And when you execute the thinger.stop(); the recommendation is to let it by 30 seconds at least before try to connect again, so you need to be sure that the stop command will run once, and after 30 seconds (for example) is when the thinger.handle(); command will run again.

But for testing with the laptop avoid to use the stop command. just let it connected to see what reports.