Disable lora on boot?
-
Is there a way to stop the lora radio on the lopy4 powering up automatically? Something like 'pycom.lora_on_boot(0)' or 'pycom.lora_modem_en_on_boot(0)' ?
-
The 2 above comments are about OTAA, but ABP has a 'join' that has no transmit/listening AFAIK.
-
@kjm No, it's quite different IMHO. Wi-Fi and LTE actively maintain connections, so even if you don't send anything, the underlying stack will send keepalives and similar things in the background. Depending on settings, the radio may also be actively listening, which means trying to decode whatever they receive, even if it's just noise. Some power-saving modes will reduce, change or disable this behaviour.
LoRaWAN does not maintain connections. Once you've joined, it assumes you're still on the network, and does not try to check if a gateway is reachable or anything.
It will transmit:
- When you join (as you noted, once you've started the join procedure, it continues trying to join);
- When you send a packet
It will be listening (in class A):
- At the right time after each join request
- At the right time after each uplink
Other than that, the radio is completely idle. That's a design goal of LoRaWAN to save as much energy as possible.
LoRa.join
does not terminate when it doesn't receive a join accept, it always returns immediately, and just initiates the join process (with retries) in the background.
-
@jcaron Possibly, but even with the wifi/lte radios at idle there is jitter in the adc readings that isn't there when they're off & I'm guessing it will be likewise for lora. The problem with the lora radio is that I don't trust it. I've already found an example of it trying to join a gateway every 37s indefinitely after the program that initially ran the lora.join command had terminated due to a failure to get a join accept from the gateway.
-
@kjm Even if the chip is powered, I doubt the radios will be doing anything unless you attempt a join, send a packet, or switch to class C.
-
@kjm LoPy4/ESP32 ADC ? If so, it is better to use an external ADC as ESP32 ADC has many issues :
https://github.com/bboser/IoT49/blob/master/doc/analog_io.md
-
@robert-hh Well that's a pain Rob because my adc readings are always better with the radios off.
-
@kjm No. Lora is always initialized when the Micropython task starts or restarts.