Tutorial: Zbus - the Lightweight & Flexible Zephyr Message Bus
summary
Zbus claims a tiny, Zephyr-native message bus that enables many-to-many channels and an event-driven flow; the tutorial shows working sample code (GitHub branch Zephyr_tutorial) with a sensor thread, core, LoRa transmit thread and a payload/transmission_done chain that actually runs in the demo. Key implementation details: subscriber notification queue size (e.g. 4, global pool 8), static vs dynamic observers, channel validators and a cannot call inside ISR limitation because Zbus uses mutexes. The heartbeat runs on a timer (2s) and retry loops are shown and tested.
AI-written summary · about
chapters (13)
- 0:00Zbus introduction
- 5:24Basic setup and config
- 15:43Reading channel info
- 19:22Adding sensor thread
- 36:26Core thread and payload
- 44:03LoRa thread and TX channel
- 50:19Refactor heartbeat with timer
- 55:42Core thread as listener
- 1:03:47Channel locking with validator
- 1:12:55Fixing execution sequence
- 1:16:52Handling channel loops
- 1:21:14Best practices
- 1:28:53Q&A
related talks
15mA Reusable Zbus Based Architecture, Abstracting Core Application...
46mZbus - New Features and Roadmap
15mLightning Talk: A Reusable Zbus Based Architecture, Abstracting Core Application Components
39mZBus - New Features and Roadmap
43mZbus 2030: Community-Driven Directions for Zbus
30mCombining Zephyr & C++20 to Build Safe, Low-footprint, Event-based Applicati...
42mInter Process Confusion - Navigating Zephyr's IPC APIs
41mFuture of Zephyr Device Model
