Get started with Bluetooth and Golioth Connectivity

When we started talking about building Bluetooth devices at Golioth, I got so excited. While I’ve used chipsets with Bluetooth onboard in the past, I’ve never had the ability to do a full end-to-end application because of all the elements involved. I figured I would need 2 to 3 other people to help me out. Hardware, firmware, software, cloud, app development…there really is a lot to do!

Golioth Connectivity makes it easier with a couple of predefined elements that will get you started, and you will be able to make Bluetooth devices do amazing things…all on your own. We’re going to walk through each piece required to do a fully encrypted end-to-end demo. Tomorrow, we’re going to do a livestream where we walk through each step.

Join the livestream at 2 pm ET / 11 am PT on August 29th

Step 1 – Cloud control

This step is exceedingly easy, and you’ve surely already completed it: get yourself a Golioth account. This takes care of the cloud side of the equation: no setting up databases or creating IAM profiles and hoping you don’t give the wrong people the right access.

Step 2 – App / Gateway control

Another easy step! This one replaces the need to learn how to design an app. Instead, you can download a binary that goes onto one of these 3 development boards:

  • NXP FRDM-RW612
  • Nordic Thingy: 91X
  • Nordic nRF9160-DK

Follow the instructions on the repository to download the pre-compiled binary, create a device on your Golioth console, and assign credentials to the gateway. Bingo, you have a bluetooth-to-cloud gateway.

Step 3 – Bluetooth node control

This is the bulk of the activity we’ll be focusing on during the livestream tomorrow, since the Bluetooth nodes in your fleet contain the smarts (firmware) and the credentials to talk through the gateway up to the cloud.

First, you need to look at our Pouch repository, which has a ble_gatt example. This is the basis for sending up a packet that has been encrypted with the cloud but is still allowed to traverse the gateway.

NT Managed Gateway Managed Device

Unstated in the directions is how to create a Zephyr workspace. If you are working from a fresh environment, it might look like this:

Install the Python virtual environment (recommended)

cd ~
mkdir pouch-test
cd pouch-test
python -m venv .venv
source .venv/bin/activate
pip install wheel west ecdsa

Use west to initialize and Install

west init -m [email protected]:golioth/pouch.git .
west update --narrow -o=--depth=1
west zephyr-export
pip install -r zephyr/scripts/requirements.txt
pip install -r pouch/requirements.txt

From here, you would build against the board you’re looking to try out. The pouch repository was extensively tested against nrf52840dk/nrf52840:

west build -p -b nrf52840dk/nrf52840 pouch/examples/ble_gatt
west flash

We also have been testing a range of other vendor hardware that is supported in Zephyr. Check out the new Bluetooth section on our forum to try chips from different vendors and see what you might need to do differently (and ask questions about each, as needed).

Step 3a – Using certificates

One of the biggest differences everyday Golioth users might notice is that Bluetooth nodes must use certificates in order to connect to the cloud (through a gateway). This is explained in our introduction video for Golioth Connectivity and we’ll continue to publish about the role of security in our new paradigm of indirectly connected devices.

The example application we just built has a “Little Filesystem” (littlefs or lfs) included with it. That allows us to push certificates onto the device using some standard SMP tooling. You will first need to generate your own certificates using openssl; follow the Public Key Infrastructure (PKI) docs page to do so.

Step 4 – Put it all together

Once your gateway is booted up and your Bluetooth node connects through the gateway to the cloud, you will see both devices on your console. If you create a node with a brand new Certificate ID, that node will be created on your project account the first time it connects (allowing zero-touch provisioning). Add a new device setting LED as a boolean, and that will be passed down over the gateway to the node and will toggle the LED. The node will also publish a simulated temperature every 20 seconds (the pre-defined advertising interval). We’ll show all of this in action in the Livestream on the 29th.

See it in action right now

Yesterday we posted a video of a Bluetooth device talking using Pouch through a standard gateway up to the Cloud to complete an Over-The-Air firmware update. This is a preview of Golioth Connectivity in action. Want to learn how to do it yourself? Sign up for the livestream on August 29th at 2 pm ET / 11 am PT…or watch it on demand!

Chris Gammell
Chris Gammell
Chris is the Head of Developer Relations and Hardware at Golioth. Focusing on hardware and developer relations at that software company means that he is trying to be in the shoes of a hardware or firmware developer using Golioth every day. He does that by building hardware and reference designs that Golioth customers can use to bootstrap their own designs.

Post Comments

No comments yet! Start the discussion at forum.golioth.io

More from this author

Related posts

spot_img

Latest posts

Bluetooth Support is here: Golioth Connectivity enables a new class of devices

Golioth Bluetooth Support enables Bluetooth devices running Zephyr RTOS to communicate securely back through standard gateways to the Golioth cloud. This enables popular features such as streaming telemetry, OTA firmware updates, settings management, and event logs.

Open sourcing the Tikk demo board

The Tikk is a demo board that showcases Golioth's Bluetooth-to-Cloud capabilities. It solders to a ProMicro form factor development board and has LEDs, motor drivers, sensors, NFC tag emulation, and a battery interface.

Adding Espressif ESP32 to the Golioth Bluetooth-to-Cloud Service

The ESP32 and the product line variants often run Bluetooth alongside Wi-Fi. This post shows how you can use the Bluetooth capabilities of an Espressif chip to talk back to the internet when a Wi-Fi signal isn't the right fit for your application.

Want to stay up to date with the latest news?

Subscribe to our newsletter and get updates every 2 weeks. Follow the latest blogs and industry trends.