Model cellular PSM and eDRX energy versus reachability
Plan PSM, eDRX and retry choices against a hypothetical whole-device energy and downlink-latency requirement.

Radio Remi
Plan PSM, eDRX, retries and service-continuity checks; record assumptions and retest triggers as required by the Cellular IoT module guide.
Predict the reading, then compare it with the measurement.
Python 3 in your browser (JupyterLite)
Python · no installOpen the notebook in your browser and run each Python cell; no install or account is needed.
Three ways to run: use JupyterLite here with no install; run main.py locally from the downloadable lab folder; or open the same notebook in Google Colab.
Steps
Step 1
- Do
- In the notebook editor, run the Step 1 notebook cell. Freeze whole-device current and timer assumptions.
- You will see
Run the cell. You should see:
- The run prints 24 reports/day, 90 mA active current, 8 mA listen current and 0.02 mA PSM current.
- Why it matters
- Power calculations need an explicit measurement boundary.
Code for step 1#!/usr/bin/env python3 """Hypothetical cellular PSM/eDRX energy and reachability model, not a modem trace.""" import argparse def show(title, rows): lines = [title, *rows] assert 4 <= len(lines) <= 15 print("\n".join(lines)) def daily_mah(reports, retries, active_s, active_ma, listen_s, listen_ma, sleep_ma): active = reports * (1 + retries) * active_s listen = reports * listen_s sleep = 86400 - active - listen assert sleep >= 0 return (active * active_ma + listen * listen_ma + sleep * sleep_ma) / 3600 def stage1(): show("Step 1 | Freeze hypothetical current assumptions", [ "Reports/day=24; active=8 s/report; post-report listen=20 s.", "Active=90 mA; listen=8 mA; PSM=0.02 mA; battery=2400 mAh.", "These are invented whole-device currents, not modem measurements.", "Check granted network timers and device current before field use.", ]) def stage2(): rows = ["retries active_s/day daily_mAh"] for retries in (0, 1, 2): rows.append(f"{retries:>7} {24*(1+retries)*8:>12} {daily_mah(24,retries,8,90,20,8,.02):>9.3f}") rows.append("A retry repeats the assumed 8-second active event.") show("Step 2 | Price the retry budget", rows) def stage3(): rows = ["listen_s/report daily_mAh"] for seconds in (0, 20, 60): rows.append(f"{seconds:>15} {daily_mah(24,1,8,90,seconds,8,.02):>9.3f}") rows.append("Longer reachable time costs energy in this PSM model.") show("Step 3 | Change the post-report reachable window", rows) def stage4(): show("Step 4 | Model eDRX reachability", [ "Hypothetical eDRX cycle=40 s; paging listen=2 s/cycle.", "Worst-case queued downlink waits about 40 s for next listen.", "Mean wait under uniform arrival is about 20 s.", "eDRX still needs network support and granted cycle values.", ]) def stage5(): base = daily_mah(24, 1, 8, 90, 20, 8, .02) rows = ["policy daily_mAh ideal_days"] rows.append(f"PSM_20s {base:>9.3f} {2400/base:>10.1f}") edrx = (24*2*8*90 + (86400-24*2*8)*(2/40*8+38/40*.02))/3600 rows.append(f"eDRX_40s {edrx:>8.3f} {2400/edrx:>10.1f}") rows.append("Ideal days omit self-discharge, temperature and capacity derating.") show("Step 5 | Compare a continuously paged eDRX scenario", rows) def stage6(): show("Step 6 | Record the approval boundary", [ "PSM can make downlink unavailable between report/listen periods.", "eDRX gives periodic reachability at an energy cost in this model.", "Retries raise active time; coverage and attach delays are unmodelled.", "Measure whole-device current and granted timers on the target network.", "Choose policy only after checking the application's latency bound.", ]) STAGES = (stage1, stage2, stage3, stage4, stage5, stage6) import platform try: import pyodide runtime = f"Python {platform.python_version()} / Pyodide {pyodide.__version__}" except ImportError: runtime = f"Python {platform.python_version()} (local or Colab)" print(f"Runtime: {runtime}") print("Runner check: Python calculation from this notebook") stage1()
Step 1 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Step 2
- Do
- In the notebook editor, run the Step 2 notebook cell. Price zero, one and two retries.
- You will see
Run the cell. You should see:
- The run prints daily energy for each retry case using repeated eight-second active events.
- Why it matters
- Coverage retries can erase apparent sleep savings.
Code for step 2stage2()
Step 2 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Step 3
- Do
- In the notebook editor, run the Step 3 notebook cell. Change post-report reachability time.
- You will see
Run the cell. You should see:
- At one retry, daily energy rises from 10.078 mAh at zero listen time to 13.270 mAh at 60 seconds.
- Why it matters
- Reachability has an energy cost in the model.
Code for step 3stage3()
Step 3 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Step 4
- Do
- In the notebook editor, run the Step 4 notebook cell. Model a hypothetical eDRX cycle.
- You will see
Run the cell. You should see:
- A 40-second eDRX cycle with two seconds of paging yields about 20 seconds mean wait.
- Why it matters
- Downlink latency must be checked alongside battery life.
Code for step 4stage4()
Step 4 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Step 5
- Do
- In the notebook editor, run the Step 5 notebook cell. Compare PSM and continuous eDRX scenarios.
- You will see
Run the cell. You should see:
- The model gives 11.142 mAh/day for PSM and 19.611 mAh/day for continuous 40-second eDRX.
- Why it matters
- An energy comparison should state its duty cycle.
Code for step 5stage5()
Step 5 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Step 6
- Do
- In the notebook editor, run the Step 6 notebook cell. Record the field approval boundary.
- You will see
Run the cell. You should see:
- The run calls for whole-device current and granted network timers before choosing a policy.
- Why it matters
- Requested timer values are not proof of granted behavior.
Code for step 6stage6()
Step 6 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture.
Chapter checks
These questions refer to the chapter’s examples. Use the return links to review their answers.
A prototype requests long PSM timers and the spreadsheet shows excellent battery life, but the test report only includes requested values and a modem-only sleep-current measurement. What should the reviewer do?
Return to the chapter’s knowledge checkA fleet uses PSM for normal daily reports and eDRX during a monthly maintenance window. Which evidence best proves the under-the-hood state machine is safe?
Return to the chapter’s knowledge check
Caution
Before you start
Read this before you start.
The currents and timers are hypothetical. This is an engineering model, not an NB-IoT or LTE-M attach trace; test granted timers and whole-device current on the target network.
Technical details
- Version tested
- Version tested: Python 3.12.7 / Pyodide 0.27.6 in JupyterLite 0.6.4; Chromium 151.0.7922.34; captureSource playwright:jupyterlite. Date: 2026-10-08.
https://iotclass.org/labs/cellular-psm-edrx-budget.html