LTE Power Consumption

There are some trade offs one can do to reduce power consumption of the LTE modem. You trade connectivity in exchange for power consumption. The sections below show different options.

Don’t enable on boot

If you don’t need LTE connectivity at all, you can make sure the modem is not initialized at boot with the following command:

import pycom

This setting is persisted across reboots.

Turn off after use

If you do use LTE connectivity, but you want the modem to go into low power consumption after you are done with the communication, you can disable it with deinit() at the end.

from network import LTE
import time
import socket
import machine
import pycom

def attach():
    start = time.time()
    if lte.isattached():
        print("already attached")
        lte.attach(band=20, apn="")
        while not lte.isattached():
    print("attached after", time.time() - start, "seconds")

def connect():
    start = time.time()
    while not lte.isconnected():
    print("connected after", time.time() - start, "seconds")

def http_get(url = ''):
    _, _, host, path = url.split('/', 3)
    addr = socket.getaddrinfo(host, 80)[0][-1]
    s = socket.socket()
    s.send(bytes('GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n' % (path, host), 'utf8'))

# main
lte = LTE()
machine.deepsleep(55 * 60 * 1000) # 55m

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.

Leave LTE modem on

Depending on your use case, you may want to save the time (and energy) for reattaching that you get after turning the modem off. If your device communicates frequently, then you can choose to not turn the modem off at all and save the time for the reattach. Then you trade the higher power consumption during any idle time for the quicker response. For this, simply remove the deinit from the example:

# lte.deinit()

Power Saving Mode

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

  • the LTE modem will go into a low power state, but
  • it will stay attached to the network, thus no time is spent for attach() after waking up.

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.

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.

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:

# main
# period 1h, active 10s
lte = LTE(psm_period_value=1, psm_period_unit=LTE.PSM_PERIOD_1H,
          psm_active_value=5, psm_active_unit=LTE.PSM_ACTIVE_2S )
lte.deinit(detach=False, reset=False)
machine.deepsleep(55 * 60 * 1000) # 55m