Bluetooth Gateways with Golioth and Zephyr

Originally published at: Bluetooth Gateways with Golioth and Zephyr - Golioth

Turn your Bluetooth devices into a connected IoT fleet using Golioth. This post walks through the process of creating a Bluetooth to Cellular gateway and sending sensor data to the cloud.

3 Likes

Hey Mike does this example still works?
I couldnt fix error below


-- Including generated dts.cmake file: //home/golioth-ncs-workspace/zephyr/samples/bluetooth/central_ht/build/central_ht/zephyr/dts.cmake

warning: Deprecated symbol NET_SOCKETS_POSIX_NAMES is enabled.


warning: Experimental symbol NET_SOCKETS_SERVICE is enabled.


warning: Experimental symbol NET_CONNECTION_MANAGER is enabled.


//home/golioth-ncs-workspace/zephyr/samples/bluetooth/central_ht/prj.conf:20: warning: attempt to assign the value 'y' to the undefined symbol GOLIOTH_SAMPLE_PSK_SETTINGS

//home/golioth-ncs-workspace/zephyr/samples/bluetooth/central_ht/boards/nrf9160dk_nrf9160_ns.conf:20: warning: attempt to assign the value 'y' to the undefined symbol LTE_CONNECTIVITY
Parsing /home/golioth-ncs-workspace/zephyr/Kconfig
Loaded configuration '/home/golioth-ncs-workspace/zephyr/boards/nordic/nrf9160dk/nrf9160dk_nrf9160_ns_defconfig'
Merged configuration '//home/golioth-ncs-workspace/zephyr/samples/bluetooth/central_ht/prj.conf'
Merged configuration '//home/golioth-ncs-workspace/zephyr/samples/bluetooth/central_ht/boards/nrf9160dk_nrf9160_ns.conf'
Merged configuration '//home/golioth-ncs-workspace/zephyr/samples/bluetooth/central_ht/build/central_ht/zephyr/.config.sysbuild'

error: Aborting due to Kconfig warnings

CMake Error at /home/golioth-ncs-workspace/zephyr/cmake/modules/kconfig.cmake:396 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  /home/golioth-ncs-workspace/nrf/cmake/modules/kconfig.cmake:29 (include)
  /home/golioth-ncs-workspace/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
  /home/golioth-ncs-workspace/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  /home/golioth-ncs-workspace/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:4 (find_package)


-- Configuring incomplete, errors occurred!
CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
  CMake configure failed for Zephyr project: central_ht

  Location:
  //home/golioth-ncs-workspace/zephyr/samples/bluetooth/central_ht
Call Stack (most recent call first):
  cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)
  cmake/modules/sysbuild_default.cmake:20 (include)
  //home/golioth-ncs-workspace/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
  //home/golioth-ncs-workspace/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  //home/golioth-ncs-workspace/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
  template/CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "//home/golioth-ncs-workspace/zephyr/samples/bluetooth/central_ht/build/CMakeFiles/CMakeOutput.log".
FATAL ERROR: command exited with status 1: /usr/bin/cmake -DWEST_PYTHON=/home/golioth-ncs-workspace/.venv/bin/python3 -B/home/golioth-ncs-workspace/zephyr/samples/bluetooth/central_ht/build -GNinja -DBOARD=nrf9160dk_nrf9160_ns -S/home/golioth-ncs-workspace/zephyr/share/sysbuild -DAPP_DIR:PATH=/home/golioth-ncs-workspace/zephyr/samples/bluetooth/central_ht

Hey @ash.vetchip,

From the warnings in the console output, it looks like you are not using Firmware SDK v0.12.0 for the project.

Can you confirm which Firmware SDK version you are using?

Hey @marko yes v0.12.0 solved the issue.
But I had other issues (not relevant to Golioth ) of connecting the 9160dk and 5340dk to each other under those samples. I’ll get bottom of it :slight_smile:

Hey @marko
Would you be able to help me with an issue I’m having connecting to Golioth since this morning.
Current Setup: Application uses Certificate Provisioning example/guide. I’m using mcumgr to copy device certificate and key (like in the repo and blog’s guide). Cohorts is setup for remote updates for this device.
Till 4 hours ago both of the services were working as expected. i.e. I can new device via device certificate and key. Perform OTA for new version of the app
Issue: Error after connection to LTE
[00:15:32.481,079] golioth_coap_client_zephyr: Failed to connect to socket: -22
[00:15:32.481,475] golioth_coap_client_zephyr: Failed to connect: -22
Way to replicate: golioth/reference-design-template 's shell commands to set credentials
OR
certificate_provisioning example with device certificate and key located on device

Project Config
west.yaml
path: modules/lib/golioth-firmware-sdk
revision: v0.16.0

prj.conf

CONFIG_GOLIOTH_SAMPLE_COMMON=y

CONFIG_LOG_BACKEND_GOLIOTH=y

CONFIG_GOLIOTH_FIRMWARE_SDK=y

CONFIG_GOLIOTH_FW_UPDATE=y

CONFIG_GOLIOTH_SETTINGS=y

CONFIG_FLASH=y

CONFIG_FLASH_MAP=y

CONFIG_STREAM_FLASH=y

CONFIG_IMG_MANAGER=y

CONFIG_IMG_ERASE_PROGRESSIVELY=y

CONFIG_FILE_SYSTEM=y

CONFIG_FILE_SYSTEM_LITTLEFS=y

CONFIG_FILE_SYSTEM_SHELL=y

CONFIG_HEAP_MEM_POOL_SIZE=4096

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304

CONFIG_ZCBOR=y

CONFIG_MCUMGR=y

CONFIG_CONSOLE=y

CONFIG_UART_CONSOLE=y

CONFIG_UART_CONSOLE_MCUMGR=y

CONFIG_SHELL=y

CONFIG_SHELL_BACKEND_SERIAL=y

CONFIG_BASE64=y

CONFIG_MCUMGR_TRANSPORT_SHELL=y

CONFIG_MCUMGR_GRP_FS=y

CONFIG_SHELL_BACKEND_DUMMY=y

CONFIG_MCUMGR_GRP_SHELL=y

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304

CONFIG_MAIN_STACK_SIZE=2048

CONFIG_GOLIOTH_AUTH_METHOD_CERT=y

CONFIG_GOLIOTH_SAMPLE_HARDCODED_CREDENTIALS=n

CONFIG_LOG_CMDS=y

CONFIG_SETTINGS_FILE=y

CONFIG_SETTINGS_FILE_PATH=“/lfs1/settings”

Debugging notes

  1. Two devices used (with different sim provider): Thingy91 and 9160DK
  2. Cleared any secure credentials stored via Cellular Monitor → Certificate Manager
  3. Build examples with no modification
  4. Altering app version numbers

Hey @ash.vetchip,

I’ve created a separate forum post where we can debug the issue.