Closed dbrgn closed 6 years ago
@rnestler rebased. I increased the sleep time to 15 minutes.
Care to take a look? I think we can wait with refactoring until we have some field experience with the sensor itself.
Here's the trace of a full 15min cycle:
It's 235 uA on average. What's strange, is that the RN2483 wakes up 24s too early... is its clock that bad?!
Powertrace (~35 minutes): https://tmp.dbrgn.ch/powertrace-20180605.otii
So I think it would be nice to remove the unnecessary sleep calls to further improve battery time. But afterwards let's merge it and get one prototype deployed for real :smiley:
I'll merge this now since it's already deployed anyways. We can still optimize, but that will require additional testing.
This PR contains code from #18, #23 and #24. Merge those first.
Replaces #12.
Right now, only the commit cf8eac0 is relevant.
This commit adds code to power down the MCU. Here's the power trace:
On the left you can see the MCU waking up and joining via OTAA. Then the measurements are sent and the LPC11U24 enters power down mode, which consumes 134 uA (highlighted area).
Then after 5s interval time, the MCU wakes up again and sends another packet (which arrives). During the next power down phase, current consumption is 2.17 mA. Due to reasons unknown to me, starting during the third power down phase, the current consumption is 4.58 mA.
But the main issue is that after the second sleep phase, the RN2483 does not wake up anymore, even though a break condition + 0x55 byte are sent.
Needs some more debugging. Maybe @rnestler has an idea when he gets back from holidays :slightly_smiling_face:
Once we get this fixed, it should be possible to bring down the power consumption even more by shutting down peripherals we don't use.