Electron + Asset Tracker V2 Deep Sleep for 12 hours [SOLVED]

Hi All,

I’m having trouble with waking up my Electron after 12 hours (or 43200 seconds) of deep sleep. What am I doing wrong? Is it a variable C++ programming issue or Electron hardware issue? Note: the below code works fine for non-Product devices, i.e. fleet OTA devices.

My core code is below.

if (Time.hour() == 15) { // If it is 3pm local time, then go to bed/sleep for 12 hours and wake up at 3am
  System.sleep(SLEEP_MODE_DEEP, 12*60*60UL); // Put device into deep sleep for 12 hours
}

Thanks for your help!

What system version are you running?
What have you got on your WKP pin?

IIRC there are several system versions that won’t wake the device when WKP is HIGH on entering deep sleep.

2 Likes

System firmware is 0.7.0 and V005 hardware. I’m also using AssetsTrack V2 board. To my knowledge, I have nothing connected to WKP pin or A7- unless I missing something?! If I do, it doesn’t make sense as it works perfectly fine for 1 hour deep sleep times… but not 12 hour.

With the Asset Tracker (V1 & V2) the accelerometer is connected to WKP and if the LIS3DH is setup to indicate movement and this happens when your device goes to sleep chances are that it won’t wake again.

There are some discussions about this in this forum and @rickkas7 has helped people with that issue.

2 Likes

Yes… I read that post a few weeks ago. Thanks @ScruffR. I will look over this again today.

However, I did an experiment last night, and put the same code on all Products (my 10 device fleet) and brought the non-Product Electron (the device which I am prototyping on, and is working) into my Product/Fleet. The result, all my Products (10 devices fleet) are still asleep this morning except the one I brought into the Product (my prototype device). What the?! It does not make sense?!

(Hope this is clear… if not, let me know what I’ve written does not make sense)

Apologies all… I’m a little tired and frustrated. I’ve looked over peoples post and Particle documentation, and most people want the Asset Tracker V2 to wake on movement. But I don’t… or the accelerometer!

How do I disable the Asset Tracket V2 wake on movement or accelerometer? Please provide example code. Alternatively, what electrical track do I need to cut/Dremel?!

Thanks again for your help.

As long as you don’t call the AssetTracker begin() method, the LIS3DH accelerometer won’t be initialized and it should have no effect.

However, since the most common reason for not waking up from timed sleep is that WKP was high at the time you went to sleep, I’d connect WKP to GND and see if makes a difference.

1 Like

Thank you, @rickkas7. I will try this today and get back to you.

@rickkas7 I connected WKP to GND, and it worked perfectly! Thank you for your assistance :+1:

For a test connecting to GND is a quick try, but I’d rather be safe than sorry and add a current limiting resistor between WKP and GND no smaller than 22Ohm. I’d go for 1k or 2k2.

Especially if you want to keep the power consumption as low as possible (as mentioned in your other thread) I’d select the highest value that works.

2 Likes

Okay. But, what happens if you don’t add a current limiting resistor? Will it damage my Electron?

If you should happen to drive the WKP pin HIGH (e.g. by flashing the wrong firmware) your connection to GND will cause a current exceding the 20mA max rating through the output stage of the GPIO most likely frying it and potentially also impair other functions of that pin if not the µC itself.

1 Like

I will try some k’s ohm resistors. Aside thought, since I’m not using the accelerometer and it appears to be causing me grief, maybe I should remove/desolder it? Thoughts? I have the tools to do so.

I’d not remove the accelerometer.
If you really need, you could cut the trace leading from the accelerometer to WKP.

This way you could bridge it again, in case you’d decide to want it back.

@ScruffR and @rickkas7 the 1k ohm resister between WKP and GND pins worked great!. Thank you for solving my issue. Its great to get so much support from the community!

3 Likes