-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
OTA using Thread #29740
Comments
Hi, unfortunately, we don't have an out-of-the-box example for OTA with OpenThread. For sure you'd need to enable Two examples of existing FOTA libraries that we currently have in Zephyr are updatehub and hawkbit. The former one uses CoAP to deliver FW, the latter uses HTTP. |
Another option is SMP with UDP as transport layer. |
I have a working FOTA over OT that I'm using successfully for more than a year and half in a test bed of more than 10 FTD and SED devices. It's based on @mike-scott work on https://github.com/foundriesio/dm-lwm2m , but not sure what its license is, and could we use it on Zephyr. If he confirm that it's OK to use it as a base I could push a PR for review here. |
Hello Community, the step follows. I have a problem with updatehub: Cannot connect to UDP remote see the below image. |
Hello retfie, Thanks |
CC: @otavio |
Hi @nvlsianpu , @utzig , I ran UpdateHub using WIFI, just to make sure everything is Ok.
Details:
Q: Why the system is not swamping image-2 on slot-1? |
MCUboot does not start an upgrade unless it is requested by writing the proper metadata in the secondary slot. To do it you can build a padded image, with |
I think we are doing it, see below: zephyr/subsys/mgmt/updatehub/updatehub.c Lines 928 to 946 in 89f6e24
We print the message "Image flashed successfully, you can reboot now". It is the last line before step 3. |
Yeah, the code looks correct; try building MCUboot will debug logging, there may be more helpful messages. |
|
Hi @nandojve I want to use it as a WIFI: nordic border -router. Thanks |
Hi @utzig , it is working now!
I did the test using WIFI to make sure all infrastructure is OK using nrf52840dk_nrf52840 board, and it is. I've been testing UpdateHub using https://docs.zephyrproject.org/latest/boards/shields/esp_8266/doc/index.html shield. We will add UpdateHub overlays for IEEE 802.15.4 and BLE for Zephyr 2.5. In fact, it is a matter of having the transport well configured and have internet access to enable UpdateHub on it. If you already have a Thread Networking with Internet access we can tune UpdateHub to work. |
Hi @nehalrohit I got UpdateHub over 6lowPAN working. The below config was necessary to fix DNS error:
I tested on my local network using RADVD to serve IPs and CoAP block size equal to 64 As I mention, we will update the sample application with the overlays soon.
|
Hi @nandojve, |
No, I used a local server. You can use the cloud server if you have IPv6 on your environment.
We are documenting how to do it. |
Hi @nandojve what parameter i have to update in CONFIG_UPDATEHUB_SERVER="10.42.0.8" ? is it local IP or DNS IP ? |
This is my Linux config:
I added manually 2001:db8::1/64 (may not be the best addr) to the lowpan0 iface. This is the IP address that boards will try reach.
You can add this to your RADVD config:
This means, share eth0 prefix and share any other prefix at interface to lowpan0 network. At board using native IEEE 802.15.4 6lowPAN I got:
Once you can ping Linux Machine, the below config will give you access to UpdateHub docker at same machine:
CONFIG_UPDATEHUB_COAP_BLOCK_SIZE_EXP=2 this will instruct CoAP to use a payload block with 64 bytes. You can try using value 1 (32-bytes) and 0 (16-bytes). I not recommend CoAP blocks >=128 on 6lowPAN networks. PS: If you follow the OT notes about Tayga (NAT-64) you probably will ping internet. Than, you can disable UpdateHub CE and remove CONFIG_UPDATEHUB_SERVER="2001:db8::1" to get access to "coap.updatehub.io" that is UpdateHub cloud server. |
If you follow the OT notes about Tayga (NAT-64) you probably will ping internet. Than, you can disable UpdateHub CE and remove CONFIG_UPDATEHUB_SERVER="2001:db8::1" to get access to "coap.updatehub.io" that is UpdateHub cloud server. Turn on the updatehubCONFIG_UPDATEHUB=y #Minimal Heap mem pool size for the updatehub working CONFIG_NET_IPV4=n CONFIG_NET_IPV6=n #Optional if you would like test on the your server Debug helpersCONFIG_LOG=y I am successfully sending data to https://panel.thethings.io. I still get a DNS error Every time I flashed the HEX file. Is it ok? |
UpdateHub uses sockets so I'm assuming that works with OT.
It is a fault inside memset. Try build samples/net/sockets/echo_client and got same. @rlubos , can you assist with this, please? What is the latest hash that you know is ok?
|
@nehalrohit can you try ping 1- Get IPv4 from coap.updatehub.io
2- Translate IPv4 to IPv6
3- Create the OT IPv6 to be translated to IPv4
4- Try ping coap.updatehub.io from a Joiner
If this works, you can configure DNS and UpdateHub as:
Since UpdateHub uses sockets and you have internet access it should work. |
Hi @nandojve here this setting in prj.conf Add Google 8.8.8.8 DNS ServerCONFIG_DNS_SERVER_IP_ADDRESSES=y Add UpdateHub Cloud#CONFIG_UPDATEHUB_SERVER="64:ff9b::9f59:e141" I am still getting a DNS resolver issue. anything else need to change? |
This error happen with SDK 0.12.0-beta-2. When I switch back to 0.11.3 I didn't see anymore |
I was not able to reproduce the crash on my side, are there any special conditions to trigger it? The radio driver was updated recently (which I'd suspect), but as said I fail to reproduce. Did you call |
You can ignore the run crash. After switch to 0.11.3 I figure out. It was needed to increase RAM from main scope. |
Hi @nehalrohit , By some reason the DNS name can not be resolved. It is not necessary a problem with UpdateHub. I open my development branch By default I'm using UpdateHub CE, so at overlay-ot.conf: Procedure o discover, example from google IPv4 DNS:
For UpdateHub Cloud Server:
|
Hi Nehal, You need mcuboot bootloader on device and a working leshan server to register on. Then use 5/0/0 or 5/0/1 resource to send zephyr.signed.bin to lwm2m_client. Then look for status (5/0/3) to became 2 (ready to apply), then start update with Exec on /5/0/2. |
Hi @nandojve I already try this configuration CONFIG_DNS_SERVER1="64:ff9b::9f59:e141" and CONFIG_DNS_SERVER1="fdaa:bb:1::2" my joiner device can ping the updatehub.io cloud server but the device cant show on the updatehub.io server. |
Hi @nehalrohit I confirmed here yesterday. The UpdateHub Cloud only accept connections with DTLS. I noted that when I enabled DTLS on Zephyr, for some reason, "send" returns with error and packages have been not sent. It seems something goes wrong at DTLS challenge phase. I'll recommend, in the mean time that we are investigating the DTLS issue, you to use UpdateHub CE. You can pull the docker container and run it in your environment or at any service provider (digital ocean, vultr, etc) with docker support. The smallest machine is enough to run the service. |
Hi @nandojve |
Hello Community,
I want to implement OTA using thread on NRF52840dk (PCA10056) and nrf52840 dongle (PCA10059).
How am I suppose to start with OTA and multi broadcasting OTA using thread ? (Documentation and Link)
The text was updated successfully, but these errors were encountered: