Experiment 1: Registration Trace
Experiment 1: Registration Trace
Lab Model
The lab uses five reusable states. A real module will expose different command names and event codes, but the design logic stays similar.
This page does not claim to replace a modem, carrier account, or RF test. It is a teaching lab for the state machine. Real acceptance still requires final hardware, antenna, enclosure, SIM profile, operator coverage, firmware, and measured current traces.
Experiment 1: Registration Trace
Start with the simplest successful trace. Read each step as a state transition your firmware must be able to log.
Step 1: Trace registration as a local state model
- In a local Python terminal, start at
SEARCHINGand advance oncell found,SIM ready,registration accepted, andpacket context active. - The run here ended
REGISTERED --packet context active--> DATA_READY; the complete trace also passedCAMPEDandREGISTERING. - On a real modem, replace each invented event with its timestamped URC or command response, plus the selected cell, SIM status, and APN.
- Compare the modem’s evidence with the five states in the trace below; a skipped or repeated transition should remain visible in the log.
- This run modeled firmware state transitions only. It did not attach to an operator, authenticate a SIM, or verify a packet context.
- SEARCHING: modem scans supported LTE-M bands and reports candidate cells.
- CAMPED: modem selects a suitable cell and can monitor network information.
- REGISTERING: modem starts network registration and SIM-based authentication.
- REGISTERED: modem is accepted for service by the selected operator or roaming partner.
- DATA_READY: packet context is configured, activated, and ready for a small test payload.
Write down the minimum log fields you would keep for this trace: radio mode, registration result, signal metrics, SIM/profile state, APN, packet context result, IP/session result, and timestamp. If your firmware cannot record those fields, field support will be guessing.
Compact Lab Pseudocode
This short pseudocode is the model for the exercises. Real firmware should also handle URCs, timeouts, SIM faults, APN faults, DNS/TLS failures, and modem resets.
state = SEARCH
on cell_found:
state = REGISTER
on registered:
state = DATA_READY
on small_payload and supported:
send_control_plane_style()
on large_payload or session_needed:
send_user_plane_style()
on movement_event:
record_signal_and_delivery()
on idle_window:
choose_psm_or_edrx()
The names above are intentionally generic. Standard AT commands exist for many modem functions, but module vendors add their own socket, MQTT, TLS, PSM, eDRX, and diagnostic commands. Use the module’s current command manual and keep the state machine testable.
Trace One Wake, Send, Listen, and Sleep Cycle
Mark every state in one cycle. Record start time, signal condition, search time, attach result, send size, reply window, current, sleep entry, and the reader’s final record. Keep the card, device, software, network, and test version with the trace.
Repeat the cycle with strong and weak signal, a blocked service, a moved device, a rejected identity, a delayed reply, a restart, and no coverage. Check retries, current peaks, total awake time, duplicate records, and the path back to sleep. Compare the model with a real meter before making a life claim.
Use this wake cycle check:
- Mark each state change.
- Time each awake step.
- Test the weak site.
- Test the lost site.
- Prove return to sleep.
Start simple: run one message through the state machine and record how coverage and power mode change the outcome.
Technical boundaries. The local run models firmware state transitions with invented events. It does not attach to an operator, authenticate a SIM, or verify a packet context; real acceptance requires final hardware and measured current traces.