Skip to content

Connecting S0 to Magistrala via WebSockets#

Running Magistrala#

Ensure that Magistrala is running in your browser.

Ensure also you are in the embedded/targets/zephyr/websocket directory when executing the below steps

Modify the configuration file in src/config.h

Start with the WiFi credentials as S0 in this case is in Station Mode.

#define WIFI_SSID "SSID"    // Replace `SSID` with WiFi ssid
#define WIFI_PSK "PASSWORD" // Replace `PASSWORD` with Router password

Configuring Magistrala variables#

#define MAGISTRALA_HOSTNAME "messaging.magistrala.absmach.eu" // Replace with your Magistrala instance hostname or IP
#define MAGISTRALA_WS_PORT 8186
#define DOMAIN_ID "DOMAIN_ID"         // Replace with your Domain ID
#define CLIENT_ID "CLIENT_ID"         // Replace with your Client ID
#define CLIENT_SECRET "CLIENT_SECRET" // Replace with your Client secret
#define CHANNEL_ID "CHANNEL_ID"       // Replace with your Channel ID

Bulding and Flashing Code#

Once you update the configuration file, build and run the code:

west build -p always -b esp32c6_devkitc
west flash
west espressif monitor