Getting Started with S0
Quick start guide for S0 IoT Gateway
Getting Started with S0
This guide will help you get up and running with the S0 IoT Gateway.
What You'll Need
Hardware
- S0 IoT Gateway module
- USB-C cable for power and programming
- Optional: S0 Base Board for expanded functionality
Software
- Zephyr SDK
- Serial terminal (minicom, screen, or PuTTY)
- Git
Accounts
- Magistrala account (cloud or local instance)
- Optional: NB-IoT/LTE-M SIM card with data plan
Development Environment Setup
Install Zephyr OS
To program and build firmware for the S0 board, install Zephyr OS from the official website:
https://docs.zephyrproject.org/latest/develop/getting_started/index.html
Zephyr provides:
- Hardware abstraction for ESP32-C6 peripherals
- Real-time task scheduling
- Networking and protocol stacks
- Secure communication and TLS support
Once Zephyr is installed, you can build and flash applications directly to the S0 board using west.
Clone the Embedded Repository
Zephyr code for the various protocols can be accessed by cloning the Embedded Repository:
git clone https://github.com/absmach/embeddedMagistrala Setup
-
Navigate to Magistrala and sign up.
-
Create a domain, channel, and client.
-
Connect the client to the channel you created.
-
Note down the
CHANNELID,DOMAINID,CLIENTID, andCLIENTSECRET— you will need these when configuring firmware.
Uploading Code
Before uploading any code, be sure to have activated a virtual environment as guided in the Zephyr documentation.
Download and install the binary blobs that the Espressif HAL needs:
west blob fetch hal_espressifNavigate to the Zephyr protocol examples:
cd embedded/targets/zephyr
lsChoose the protocol you want to communicate over by moving into that directory. Make sure the directory contains:
CMakeLists.txt
prj.conf
src/Change the variables in src/config.h to match your SuperMQ environment:
CLIENTIDCLIENTSECRETDOMAINIDCHANNELID
Build the code:
west build -p always -b esp32c6_devkitcThe board parameter can be changed to whichever board you are using as long as it is recognized by Zephyr. See Zephyr supported boards for more information.
To upload code to the S0 and monitor the serial output:
west flash
west espressif monitorNext Steps
- S0 Pinouts — Pin assignments and header descriptions
- S0 Architecture — Board schematics and circuit diagrams
- Software Overview — Communication protocols and examples
- Base Board — Expand S0 with Ethernet, M-Bus, and power management