apache / mynewt-newtmgr

Newt Manager (newtmgr) is the application tool that enables a user to communicate with and manage remote devices running the Mynewt OS
https://mynewt.apache.org/
Apache License 2.0
35 stars 77 forks source link

Fails to upload image over BLE using Zephyr with SMP Server Sample #169

Closed rmal30 closed 4 years ago

rmal30 commented 4 years ago

Hi all, I believe that one of the recent pull requests merged in (#162) broke DFU functionality over bluetooth as discussed in this issue:

In that issue, @caco3 encountered a bug where image upload on both newtmgr and mcumgr would fail with the following error: > sudo mcumgr --conntype ble --connstring peer_name='Zephyr' image upload smp_svr.signed.bin -t 100 0 B / 182.61 KiB [--------------------------------------------------------------------------------------------------] 0.00% panic: send on closed channel goroutine 493 [running]: mynewt.apache.org/newtmgr/nmxact/nmp.(*Listener).AfterTimeout.func1() /home/ubuntu/go/src/mynewt.apache.org/newtmgr/nmxact/nmp/dispatch.go:50 +0x64 created by time.goFunc /usr/lib/go-1.13/src/time/sleep.go:168 +0x44

I could reproduce this issue on Mac OSX with the smp_svr example in Zephyr. When I checked out the git commit with version hash 61395d2a705611c376226fa5114ea81392ded671 before the breaking pull request, image upload on mcumgr and newtmgr works.

utzig commented 4 years ago

Does it work if you do an image erase first?

nkaje commented 4 years ago

Thanks for reporting this. I see this error with --conntype ble. I had tested with oic_ble profile and that worked fine. I will look into this.

nkaje commented 4 years ago

@rmal30 Could you please check if https://github.com/apache/mynewt-newtmgr/pull/170 works for you?

rmal30 commented 4 years ago

Thanks for the fix, #170 works for me

nkaje commented 4 years ago

Fixed with https://github.com/apache/mynewt-newtmgr/pull/170. Closing.

caco3 commented 4 years ago

Works for me as well, thank you!