Problem sleeping/waking Multitech mDot

09 Aug 2017

I am completely new to mbed to mDots. I have some Multitech mDots to use on a LoRa network. I'm just trying to get an understanding of coding and building with these devices, and the online Compiler.

Right now, I'm stuck trying to sleep/wake. My test code can be seen here: https://developer.mbed.org/users/kellybs1/code/mDot_helloworld_bk_sleep/

On serial output I see:

[INFO] Hello world! I am an mDot
[WARNING] This mDot hardware version does not support deep sleep... using sleep.

Then five seconds later a "Cá" is appended to the serial output and then nothing else happens, when I would be expecting the same "hello world" output and sleep again.

What am I missing/doing wrong?

12 Aug 2017

I managed to understand fix this before this post got moderator approval.

So I'm leaving this here for future newbies:

The problem was that I didn't understand the thread picks up from where it left off after sleeping, whereas I thought it would start the code from the beginning automatically. So I needed to put it in a loop of some sort. I have updated the example to sleep and include a counter that shows the count's value is not lost between sleeps as it is declared outside of the loop's scope.