CubeCell sleeping w/LoRaWAN

Hey folk,

I’ve been messing around with interrupts (LSM303 accelerometer triggered) and sleeping. It’s working well (20/20 hindsight note, don’t power the sensor with Vext…because it turns ~off on sleep. I got 1.8v out of it too, which was weird).

The main loop doesn’t sleep if there is LoRaWAN traffic pending, which is great, and the LoRaWAN timer wakes up when required in parallel with my pin interrupt. It’s taken a little while to get working, so I though I’d share my happiness. Nice work Heltec team.

It may not be obvious (there is comment in the sleep example code) but the board only sleeps fully (loop() stops) after calling sleep successfully six times. I suspect it’s progressing down through a sleep level on every call? If someone knows please enlighten me.

Also…millis() resets. I’ve not yet found a way to track the passing of time, although there must be something in the stack as it surely respects the duty cycle.


Hi Bwooce,

I have tried to do ABP connection with the external wake up code provided by Aaron Lee. But was could not get it to work. Can you please help me on it?

Sure, post/link to some code and describe the problem in more detail please? Is it not sleeping?

It is sleeping, but after replacing the commented line where it says “put your main code here” with


on Aaron Lee’s code. It sends the first message successfully and then it wakes up when GPIO7 goes LOW but no message is being sent. There must be something wrong with my code!

Hey Riyadh99,

You shouldn’t need to rejoin after sleeping. A better base for your code is the normal LoRaWAN sketch, and then just add in some interrupt code.

Check out this, which is OTAA and designed to send different periodic and on-interrupt messages. Remember to set your keys.

Hi Sorry been Busy, Did you solve your issue? I see Bwooce Responed,I agree with his comments