pith. sign in

arxiv: 2605.21136 · v1 · pith:ZJPRDTREnew · submitted 2026-05-20 · 💻 cs.NI · cs.SY· eess.SY

LoRa and LoRaWAN simulator-cum-emulator with CAD and capture effect in Python

Pith reviewed 2026-05-21 01:36 UTC · model grok-4.3

classification 💻 cs.NI cs.SYeess.SY
keywords LoRaLoRaWANsimulatorcapture effectfirmware emulationdiscrete-event simulationPythonSTM32
0
0 comments X

The pith

A Python discrete-event simulator for LoRaWAN reproduces the capture effect through a three-phase packet model and runs real STM32 firmware via CFFI redirection.

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The paper sets out to replace large, complicated C++ LoRaWAN simulators with a simpler Python alternative that still supports every device class. It introduces a three-phase packet delivery model that lets a stronger signal prevail during overlaps, thereby reproducing the capture effect. The same simulator embeds a full LoRaWAN 1.0.4 stack and a containerized cross-compilation path that takes actual STM32 C firmware, redirects its hardware-abstraction calls through CFFI, and executes the code inside the event loop. This combination removes the need for external simulation frameworks or heavy dependencies. If the model and redirection prove faithful, developers could test firmware changes and network scenarios in minutes rather than hours on physical hardware.

Core claim

The simulator is built on a custom asyncio-based simulation kernel, incorporates a three-phase packet delivery model to reproduce the capture effect, implements a full LoRaWAN 1.0.4 stack, and features a containerized system that cross-compiles real STM32 C firmware and redirects its HAL calls into the simulator using CFFI, all without requiring any external simulation framework or dependencies.

What carries the argument

The three-phase packet delivery model that reproduces the capture effect together with CFFI redirection of HAL calls from real STM32 firmware.

If this is right

  • The simulator supports evaluation of all LoRaWAN device classes through its complete 1.0.4 stack implementation.
  • Real STM32 firmware can be tested inside the simulation environment without physical radios.
  • Users obtain the tool as a standard Python package that needs no external frameworks.
  • Network scenarios involving the capture effect become directly observable in discrete-event runs.

Where Pith is reading between the lines

These are editorial extensions of the paper, not claims the author makes directly.

  • The CFFI redirection pattern could be reused for other embedded wireless stacks that expose similar hardware-abstraction layers.
  • Direct head-to-head runs against physical testbeds would reveal whether the three-phase model needs calibration for particular spreading factors or environments.
  • Large-scale parameter sweeps that are impractical on hardware become feasible, potentially guiding deployment choices before any nodes are installed.

Load-bearing premise

The three-phase packet delivery model and CFFI redirection of hardware calls accurately capture real radio behavior and firmware timing without introducing simulation artifacts absent on physical hardware.

What would settle it

Run identical firmware on the simulator and on physical STM32 LoRa hardware under controlled overlapping transmissions of differing strengths, then compare measured packet delivery rates and timings.

Figures

Figures reproduced from arXiv: 2605.21136 by Matthijs Reyers, Niels Hokke, R.R. Venkatesha Prasad.

Figure 1
Figure 1. Figure 1: Simplified UML class diagram of the simulator’s core components. [PITH_FULL_IMAGE:figures/full_fig_p004_1.png] view at source ↗
Figure 2
Figure 2. Figure 2: Comparison of normal and simulated firmware architectures. In the containerized [PITH_FULL_IMAGE:figures/full_fig_p007_2.png] view at source ↗
read the original abstract

Existing LoRaWAN/LoRa simulators consist of large, complicated C++ codebases and often do not support all device classes. This paper presents the design of a simple to use, Python-based discrete-event simulator that addresses these gaps while also introducing a novel method for evaluating real device firmware in the simulator. The simulator is built on a custom asyncio-based simulation kernel, a three-phase packet delivery model that reproduces the capture effect, a full LoRaWAN 1.0.4 stack, and a containerized firmware system that cross-compiles real STM32 C firmware and redirects HAL calls into the simulator via CFFI. The simulator is distributed as a Python package via Github (https://github.com/MatthijsReyers/lora-simulator) and requires no external simulation framework or dependencies.

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, simulated authors' rebuttal, and a circularity audit. Tearing a paper down is the easy half of reading it; the pith above is the substance, this is the friction.

Referee Report

2 major / 2 minor

Summary. The paper presents the design of a Python-based discrete-event simulator for LoRa and LoRaWAN networks. It uses a custom asyncio simulation kernel, a three-phase packet delivery model intended to reproduce the capture effect, a complete LoRaWAN 1.0.4 protocol stack, and a containerized cross-compilation setup that redirects STM32 HAL calls into the simulator via CFFI to allow evaluation of real C firmware. The simulator is released as a standalone Python package with no external dependencies.

Significance. If the models prove accurate, the work would supply a lightweight, dependency-free alternative to existing large C++ LoRa simulators and enable direct testing of production firmware inside a controlled simulation environment. The combination of CAD support, capture-effect modeling, and firmware emulation is a practical contribution for protocol and firmware evaluation studies.

major comments (2)
  1. [Packet delivery model] The central claim that the three-phase packet delivery model reproduces the capture effect rests on the architectural description alone. No quantitative comparison (e.g., packet success rates, collision outcomes, or CAD detection latency) against measurements from physical LoRa radios is provided, leaving the fidelity of the model unverified.
  2. [Firmware emulation system] The CFFI-based HAL redirection for real STM32 firmware is presented as faithfully emulating timing and radio behavior. Without side-by-side traces comparing simulator output (end-to-end timing, packet delivery under interference) to hardware execution, it is not demonstrated that the emulation introduces no artifacts absent from physical devices.
minor comments (2)
  1. [Abstract] The abstract states support for all device classes; the main text should explicitly enumerate which classes (A, B, C) are implemented and any limitations.
  2. [Introduction] A feature-comparison table against prior LoRa simulators would help readers quickly assess the claimed advantages in simplicity and firmware support.

Simulated Author's Rebuttal

2 responses · 0 unresolved

We thank the referee for the constructive feedback on our manuscript. We address each major comment below and indicate the planned revisions to strengthen the presentation of our simulator's models and emulation capabilities.

read point-by-point responses
  1. Referee: [Packet delivery model] The central claim that the three-phase packet delivery model reproduces the capture effect rests on the architectural description alone. No quantitative comparison (e.g., packet success rates, collision outcomes, or CAD detection latency) against measurements from physical LoRa radios is provided, leaving the fidelity of the model unverified.

    Authors: We agree that the manuscript currently supports the claim of reproducing the capture effect primarily through the description of the three-phase packet delivery model. The model incorporates established LoRa physical-layer behaviors for preamble detection, payload demodulation, and interference handling. To address this, the revised manuscript will include a dedicated validation subsection with quantitative comparisons to physical LoRa radio measurements, reporting metrics such as packet success rates and collision outcomes under controlled interference conditions. revision: yes

  2. Referee: [Firmware emulation system] The CFFI-based HAL redirection for real STM32 firmware is presented as faithfully emulating timing and radio behavior. Without side-by-side traces comparing simulator output (end-to-end timing, packet delivery under interference) to hardware execution, it is not demonstrated that the emulation introduces no artifacts absent from physical devices.

    Authors: The emulation approach uses CFFI to redirect STM32 HAL calls and containerized cross-compilation to integrate real firmware. While the current text describes the architecture, we acknowledge that direct comparative traces would better demonstrate absence of simulation artifacts. In revision, we will add example side-by-side timing traces and packet delivery results from simulator runs versus equivalent hardware executions to illustrate the fidelity of the emulation for end-to-end scenarios. revision: yes

Circularity Check

0 steps flagged

No circularity in simulator design description

full rationale

The manuscript describes the architecture of a Python-based discrete-event LoRaWAN simulator, including an asyncio kernel, a three-phase packet delivery model, a LoRaWAN 1.0.4 stack, and CFFI-based redirection of STM32 HAL calls. No mathematical derivations, first-principles predictions, or fitted parameters are claimed. The central engineering claims concern implementation mechanisms rather than results that reduce to self-definition, self-citation load-bearing premises, or renaming of known patterns. The work is therefore self-contained as an artifact whose correctness is intended to be assessed against external hardware traces.

Axiom & Free-Parameter Ledger

0 free parameters · 2 axioms · 0 invented entities

The central contribution rests on the assumption that the three-phase delivery model plus CFFI redirection faithfully reproduces hardware behavior; no free parameters are introduced in the abstract, and no new physical entities are postulated.

axioms (2)
  • domain assumption The three-phase packet delivery model accurately reproduces the capture effect observed in real LoRa radios.
    Invoked in the description of the packet delivery model; if false, the simulator's interference modeling would not match physical deployments.
  • domain assumption CFFI redirection of STM32 HAL calls preserves firmware timing and behavior sufficiently for evaluation purposes.
    Central to the firmware-in-the-loop claim; appears in the containerized firmware system description.

pith-pipeline@v0.9.0 · 5680 in / 1486 out tokens · 32220 ms · 2026-05-21T01:36:36.601065+00:00 · methodology

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Reference graph

Works this paper leans on

9 extracted references · 9 canonical work pages · 1 internal anchor

  1. [1]

    2012 , url =

    Semtech Acquires Wireless Long Range IP Provider Cycleo , journal =. 2012 , url =

  2. [2]

    Sensors , volume=

    A survey of LoRaWAN for IoT: From technology to application , author=. Sensors , volume=. 2018 , publisher=

  3. [3]

    Sensors , volume=

    LoRa scalability: A simulation model based on interference measurements , author=. Sensors , volume=. 2017 , publisher=

  4. [4]

    2022 18th International Conference on Wireless and Mobile Computing, Networking and Communications (WiMob) , pages=

    Experimental throughput models for LoRa networks with capture effect , author=. 2022 18th International Conference on Wireless and Mobile Computing, Networking and Communications (WiMob) , pages=. 2022 , organization=

  5. [5]

    Simulation of LoRa in NS-3: Improving LoRa Performance with CSMA , year=

    To, Thanh-Hai and Duda, Andrzej , booktitle=. Simulation of LoRa in NS-3: Improving LoRa Performance with CSMA , year=

  6. [6]

    Comparison of LoRa Simulation Environments

    Bouras, Christos and Gkamas, Apostolos and Katsampiris Salgado, Spyridon Aniceto and Kokkinos, Vasileios. Comparison of LoRa Simulation Environments. Advances on Broad-Band Wireless Computing, Communication and Applications. 2020

  7. [7]

    2025 , howpublished =

    Statista , title =. 2025 , howpublished =

  8. [8]

    Proceedings of the November 17-19, 1970, fall joint computer conference , pages=

    The ALOHA system: Another alternative for computer communications , author=. Proceedings of the November 17-19, 1970, fall joint computer conference , pages=

  9. [9]

    Employing p-CSMA on a LoRa Network Simulator

    Employing p-CSMA on a LoRa network simulator , author=. arXiv preprint arXiv:1805.12263 , year=