Best Practice? LoRaWAN and time.sleep or machine.deepsleep?

A quick question re best practice, or perhaps least power draw when using the LoPy4, TTN and sleep.

Assuming my code needs to connects to TTN, read a temperature, upload result and then sleep for a few hours before waking and repeating…

Would it be considered acceptable to establish the TTN connection, then;
a) measure & upload
b) sleep
c) wake & repeat a),b),c)

or should the process be:
i) Connect to TTN
ii) measure & upload
iii) disconnect from TTN
iv) sleep
v) wake & repeat i),ii),iii),iv),v)

As a test I left the machine doing a,b,c last night and today whilst on battery power and all worked fine… Just wondered if there was a better / more acceptable way with regards power, bandwith etc?


Hi Jon,

There is never any need to disconnect from TTN, as there is no connection when a payload is not being sent. There is no true connection when data is not being sent to a gateway, and the system will happily wait forever for another message to be received without using any bandwidth.

1 Like