You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This method is used to set up the LTE subsystem. After a `deinit()` this method can take several seconds to return waiting for the LTE modem to start-up.
60
+
61
+
Optionally you can specify a carrier name. The available options are: `verizon, at&t, standard`. `standard` is generic for any carrier, and it's also the option used when no arguments are given.
62
+
63
+
For *Power Saving Mode* (PSM), you can use the following four arguments:
64
+
65
+
-`psm_period_value` : Configure at which period the device will connect to the network. Values from 0 to 31 are allowed.
66
+
-`psm_period_unit` : Specify the _unit_ to be used for `psm_period_value`.
67
+
-`psm_active_value` : Configure how long the device will be connected. Values from 0 to 31 are allowed.
68
+
-`psm_active_unit` : Specify the _unit_ for `psm_active_value`.
69
+
70
+
The LTE specification defines the _units_ for configuring PSM. See the [constants](#constants) below. Also see the [PSM example](/tutorials/lte/power) in the tutorials.
58
71
59
-
This method is used to set up the LTE subsystem. After a `deinit()` this method can take several seconds to return waiting for the LTE modem to start-up. Optionally specify a carrier name. The available options are: `verizon, at&t, standard`. `standard` is generic for any carrier, and it's also the option used when no arguments are given.
60
72
61
73
#### lte.deinit(detach=True, reset = False)
62
74
@@ -66,6 +78,10 @@ Disables LTE modem completely. This reduces the power consumption to the minimum
66
78
67
79
-`reset` : reset LTE modem.
68
80
81
+
#### lte.psm()
82
+
83
+
Query the PSM timers. The return value is a 5-tuple with the following structure: `(enabled, period_value, period_unit, active_value, active_unit)`.
-`PSM_PERIOD_2S`, `PSM_PERIOD_30S`, `PSM_PERIOD_1M`, `PSM_PERIOD_10M`, `PSM_PERIOD_1H`, `PSM_PERIOD_10H`, `PSM_PERIOD_320H`: Specify the unit for the PSM period to be 2 seconds, 30 seconds, 1 minute, 10 minutes, 1 hour, 10 hours, or 320 hours, respectively.
230
+
-`PSM_PERIOD_DISABLED`: Specifying the unit for PSM period of `PSM_PERIOD_DISABLED` means turning PSM off.
231
+
-`PSM_ACTIVE_2S`, `PSM_ACTIVE_1M`, `PSM_ACTIVE_6M`: Specify the unit for the PSM active duration to be 2 seconds, 1 minute, or 6 minutes, respectively.
232
+
-`PSM_ACTIVE_DISABLED`: Specifying the active duration unit of `PSM_ACTIVE_DISABLED` means turning PSM off.
There are some trade offs one can do to reduce power consumption of the LTE modem. You can limit connectivity in exchange for saving power consumption.
10
+
11
+
Let's start with the simplest choice: Turn off or not. It's not very sophisticated, but for completeness, let's start with this:
The example above is the simple case where we attach, connect, communicate and then turn the LTE modem off: `lte.deinit()`. This will make sure the LTE modem uses minimal power after the deinit. However, it means that the subsequent attach procedure after waking up will take some seconds. During this attach time the modem already consumes power.
64
+
65
+
## Leave LTE modem on
66
+
67
+
Depending on your use case, you may want to save the time (and energy) for reattching that you get after [turning the modem off](#lte-power-off).
68
+
If your device communicates a lot, then you can choose to not turn it off at all, save the time for the reattach. However, you then trade the higher power consumption during any idle time. For this, simply remove the deinit from the example:
69
+
70
+
71
+
```python
72
+
# lte.deinit()
73
+
```
74
+
75
+
## Power Saving Mode
76
+
77
+
A more sophisticated configuration, is the _Power Saving Mode_. PSM allows you to configure the period how often the device will connect and how long it will stay actively connected. During the sleep
78
+
- the LTE modem will go into a low power state, but
79
+
- it will stay attached to the network, thus no time is spent for `attach()` after waking up.
80
+
81
+
Note that the network needs to cooperate in this, so first there is a negotiation where you propose timers. Then you attach and the network will decide which timers to actually apply. Afterwards you can query the effective values.
82
+
83
+
So you see, here you not only need to make the trade off what is best for your application, but you will also need to do some testing to see which values your provider offers you and how this works out in your application in practise.
84
+
85
+
For the following example, assume you want to wake up once per hour, connect and do some processing, then go to deepsleep for 55 minutes. We would adjust the main part of the example as follows:
0 commit comments