S0 GatewaySoftware
HTTPS
Connecting S0 to Magistrala via HTTPS with TLS
Connecting S0 to Magistrala via HTTPS
Running Magistrala
Ensure that Magistrala is running.
Ensure also you are in the embedded/targets/zephyr/https 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 passwordConfiguring Magistrala Variables
Standard TLS
#define MAGISTRALA_HOSTNAME "messaging.magistrala.absmach.eu" // Replace with your Magistrala instance hostname
#define MAGISTRALA_HTTPS_PORT 443
#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 IDTLS Certificate
To download the Magistrala CA certificate, run the following command:
openssl s_client -connect messaging.magistrala.absmach.eu:443 \
-servername messaging.magistrala.absmach.eu \
</dev/null | openssl x509 > messaging.magistrala.absmach.eu.pemCopy the certificate contents to your src/ca_cert.h.
Building 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