Run a sample

Run our Hello World sample#

This sample application demonstrates how to connect with Golioth and publish simple Hello messages. Additionally it allows to configure logging backend to send system logs to Golioth. We recommend running the commands here from the modules/lib/golioth folder.

Requirements#

Building and Running#

Configure the following Kconfig options based on your Golioth credentials and server in your own overlay config file:

  • GOLIOTH_SERVER_IP_ADDR - Server IPv4 address
  • GOLIOTH_SERVER_PORT - Server port number - default port is 5684
  • GOLIOTH_SERVER_DTLS_PSK_ID - PSK ID of registered device
  • GOLIOTH_SERVER_DTLS_PSK - PSK of registered device

Platform specific configuration#

Configure the following Kconfig options based on your WiFi AP credentials:

  • ESP32_WIFI_SSID - WiFi SSID
  • ESP32_WIFI_PASSWORD - WiFi PSK

On your host computer open a terminal window, locate the source code of this sample application (i.e., sample/hello) and type:

$ west build -b esp32 samples/hello
$ west flash

or

$ west build -b esp32 samples/hello -- -DOVERLAY_CONFIG="<overlay1.conf>;<overlay2.conf>"
$ west flash

This is the overlay template for WiFi credentials:

CONFIG_ESP32_WIFI_SSID="my-wifi"
CONFIG_ESP32_WIFI_PASSWORD="my-psk"

See ESP32 for details on how to use ESP32 board.