Connect Thread Node to Golioth

I am following this demo: Create a node on your Thread Network | Golioth Thread Demo
I am using a nrf52840DK. Building in an Ubuntu virtual machine. I seem to get stuck at step 5.
First: golioth-ncs-workspace does not exist. I found the txt in the golioth-openthread/deps/
Second: when I build using west build -b nrf52840dk_nrf52840 app
I get an error “No known devicetree compatible match for ADC shell”

Is there a way to flash my nrf dk using windows instead of linux?

Ah ha, I think the instruction just above step 5 is wrong. Currently it is written as:

pip install -r ~/golioth-ncs-workspace/zephyr/scripts/requirements.txt

instead, I think you want to use the following:

pip install -r ~/golioth-openthread/deps/zephyr/scripts/requirements.txt

That script installs a bunch of the python dependencies you will need, so if it did not install properly, you might not have everything you need to build. Thank you for letting us know about this!

I just tested the process again here (how I found the mistake in the walkthrough), but I was then able to build for the BT510.

image

Once you get the requirements.txt installed, can you first try building for the BT510 and then later try for the nRF52840DK? I believe there might be some additional steps you need to take because the DK doesn’t have all of the sensors we call out enabled. I can help you walk through removing those from the project once you verify you can build for the BT510.

Hello Chris,

Thanks for the response. I was able to build for the BT510 without errors. What would the extra steps be for building for the NRF52840DK?

Wonderful! Glad that first step got you unstuck, I’ll correct the docs.

What would the extra steps be for building for the NRF52840DK?

You’ll mostly need to comment stuff out in the main.c file.

  • Lines 64-92 (where we’re reading from the sensors on the BT510 and turning the results into a JSON string)
  • Lines 266 - 285 (where we initialize the sensors)

Unfortunately, once you do this, you’re no longer taking any sensor readings. That’s why we are compiling for a board that has sensors built in.

You could add a dummy value for sbuf and then transmit that each time through the loop. If you change line 62 to be:

char sbuf[100]="{\"test\":\"value\"}";

Then every time you hit the timer period or hit button1 to trigger a reading, it should write that static value to the RedSensor endpoint over LightDB Stream.

I am still getting the ADC errors. I set the CONFIG_AD=n and CONFIG_ADC_SHELL=n. Then I get the build to complete. After flashing zephyr.elf to the DK and connecting to it via putty serial, I get the errors below:

rebooting gives me:

OK, I’ll look into those ADC errors, thanks for letting us know! I think that may have been an experimental thing that snuck into one of the commits, because there isn’t anything enabled with the ADC in my code.

The errors you’re seeing makes me think I need to replicate this on my 52840DK to make sure it’s running the same way yours is.

Do you already have an OTBR up and running?

I do. I set it up with the default settings from the OTBR steps.

Hi Chris,
I was able to get the Errors resolved by increasing CONFIG_LOG_PROCESS_THREAD_STACK_SIZE and CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE. I then had to rush and get the credentials for golioth configured on the uart. I got it connected, but no messages are being sent to the golioth console. The node program also freezes after a few seconds.

Ah, great, glad to hear you’re moving along on the process of getting things connected!

When you go to the detail page for your device (https://console.golioth.io/devices/<your_device_id>/management), do you see that the device is showing as being online under “Connection Status”?

Did you “Form” a network on the OTBR? Can you access the “Topology” menu on the OTBR?

I can see that it is connected and I am receiving messages on the logs tab. The only problem I have now is that the node will freeze after a few seconds and I will have to press the reboot button on the board. This might be caused by a memory leak from the loop (Maybe?). I will have to look into this later. Thank you for your help. If you are able to get this to work on a nrf52840dk without the same problems I had, please let me know.

Thank you for your time,
Victor

Hello Chris,
Do you know if this thread node example is compatible with the nrf52833DK?

It should compile ok for the 833, but I believe the memory might be the limiting factor. The default elements in the Thread project put it pretty close to 500kB, and the 833 only has 512kB.