r/embedded • u/Fearless-Comb5250 • 4h ago
Cooja-NG: The open-source simulator that runs real Zephyr, RIOT, OpenThread and Contiki-NG firmware in one 802.15.4 network (runs in your browser too)
Hi r/embedded, we've been working on Cooja-NG, a network simulator that runs the same firmware image you'd flash: unmodified Zephyr, RIOT, OpenThread and Contiki-NG builds on emulated nRF52840, CC2538, CC13x2 and MSP430 boards, from the CPU and peripherals up to the radio chip, all in one simulated IEEE 802.15.4 network.
Some things you can do:
- cngsim run build/zephyr/zephyr.elf: your own west build output; it reads the board from the build directory
- mix OSes: a Zephyr node answering a Contiki-NG node, or a RIOT node joining a Contiki-NG RPL network
- a Thread network of CC2538s from OpenThread's own ot-cli-ftd, typing state / router table into each node's console
- the same seed gives the same run, byte for byte, so it works as a test in CI (every run ends PASSED or FAILED, exit code 0 or 1)
Try it in the browser, no install: https://mikroverk.github.io/cooja-ng/
Code and releases (macOS and Linux): https://github.com/mikroverk/cooja-ng
A first read for Zephyr, RIOT and OpenThread users: https://github.com/mikroverk/cooja-ng/blob/main/docs/zephyr-riot-openthread.md
Short "commercial" video: https://www.youtube.com/watch?v=A9dHKvVhu1k (80 seconds)
Honest limits: Zephyr, RIOT and OpenThread support is newer than Contiki-NG's. It's 802.15.4 only, with no Bluetooth LE yet, and OpenThread on the nRF52840 runs at about real time or below, because its main loop never sleeps.
I'd love feedback, especially on what boards and samples you'd want next, and on anything that breaks with your own builds.