-
I tried to implement MQTT-SN protocol with OpenThread and everything works normally within OpenThread. When I tried to build the same program in Zephyr(exactly same source code), my board doesn't send out the CONNECT unicast message to the broker(I built up a sniffer, and it can't detect the CONNECT message). While I tried to debug it, I couldn't find out the final function to send out the radio. So I want to seek advice on what could be the possible reason for my issue. Platform: NRF52840-DK
overlay-ot.conf:
Source code:
Thanks for the help in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
@rlubos Can I have a quick online discussion with you about my issue? Thanks a lot. |
Beta Was this translation helpful? Give feedback.
-
@rlubos Could you tell me your email address? That would be great! Thank! |
Beta Was this translation helpful? Give feedback.
-
@oubotong Just ping me on slack, same username. |
Beta Was this translation helpful? Give feedback.
-
Hi, you shouldn't set up the OpenThread manually in the main() function - in Zephyr we initialize OpenThread during system startup (in the default configuration), and have a separate thread to process OpenThread: In your case, as you need to register state handler, you'd need to start the OpenThread manually though (as it has to be done before the network is running). The following should be enough in your main:
You'd need to set some extra configs as well:
I assume you have a border router in your setup as well, so you might need to set either of the following options, in order to be able to configure global IPv6 address:
|
Beta Was this translation helpful? Give feedback.
Hi, you shouldn't set up the OpenThread manually in the main() function - in Zephyr we initialize OpenThread during system startup (in the default configuration), and have a separate thread to process OpenThread:
https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/net/l2/openthread/openthread.c#L410
https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/net/l2/openthread/openthread.c#L262
In your case, as you need to register state handler, you'd need to start the OpenThread manually though (as it has to be done before the network is running). The following should be enough in your main: