Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build examples? #24

Open
nikolac opened this issue Feb 27, 2022 · 5 comments
Open

How to build examples? #24

nikolac opened this issue Feb 27, 2022 · 5 comments

Comments

@nikolac
Copy link

nikolac commented Feb 27, 2022

First of all, thank you for all of the great work you've done. Of all the Nordic sdk examples, other tutorials, your MQTTSN over docker is the only example that I've been able to get to working consistently.

I was hoping to explore your SED mqttsn cpp example, but I'm not exactly sure what the build and flash process is. For context, I'm using the NRF52840 dongles (PCA10059).

I tried a few shots in the dark: make/cmake from the openthread/src directory, gcc the .cpp, but the build references seem off. Not sure what the build context is supposed to be.

@kyberpunk
Copy link
Owner

Hi @nikolac. Unfortunately, I don't have easy answer for you. You could follow these options:

  • Take referenced OpenThread fork and replace examples/apps/cli/main.c code with example code. Then build OpenThread as usual and flash CLI example binary. It is more or less described in this guide.
  • Build referenced OpenThread fork for your platform as described in official guide. Then create new project for your NRF (use some example project) and just refence required header files in compiler flags and link OpenThread ".a" files. You can get inspiration from this project where I build MQTT-SN application with HTU21 sensor for NRF52840 dongle. Makefiles were generated by Eclipse, project also contains already built libraries. I'm just not sure now which bootloader type I've used.

Also keep in mind that examples were tested with this reference of my OpenThread fork with MQTT-SN feature: https://github.com/kyberpunk/openthread/tree/ac5d8364a6d3cf479409d261efb162091e276dd0. It could work also with latest master, but OpenThread API may have changed slightly.

@nikolac
Copy link
Author

nikolac commented Mar 1, 2022

Thanks for the info, solid options. I will play around and post an update for closure.

@ajlennon
Copy link

Thanks will give it a go

@ajlennon
Copy link

I've put some code to build a publication example in a fork here @kyberpunk. Am in the middle of soak testing but happy to provide a PR if you're interested

https://github.com/DynamicDevices/openthread/tree/ajl/adding-examples

@kyberpunk
Copy link
Owner

Hi @ajlennon thanks, will check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants