Hello, Please find the answers below:
> On Mar 26, 2017, at 12:45 AM, Lm Chew <[email protected]> wrote: > > Hi Vipul, > > Thanks, for the suggestion. > > 1. changed to using: > sudo $(which newtmgr) -c ble image upload slinky.img -ldebug > > 2. double checked, i have pulled the latest from develop branch and build it. > I have also updated blueZ to the latest 5.44 just in case. > > 3. I have physically removed the bluetooth module installed in my laptop to > eliminate the complication, so now I got only hci0 available. > > For some odd reason I was able to make 2 successful upload, but not > sequentially. Since then i can't get it to work again, could this be > something to do with USB bluetooth adapter could not get the timing right? > I did try uploading images sequentially on Friday itself since I was making sure everything was working fine. It seemed ok that day. Are you doing reboots between upgrades or you just uploading the same image repeatedly with doing a complete upgrade ? > Could you tell me what USB bluetooth adapter are you using? I am using Broadcom Corp. BCM20702A0 Bluetooth 4.0. > > I also tried setting up a nrf52 DK with blehci app + BlueZ as explained in > this tutorial(with a few changes). > - http://mynewt.apache.org/latest/os/tutorials/blehci_project/ > <http://mynewt.apache.org/latest/os/tutorials/blehci_project/> > - Use this to connect with btattach instead: sudo btattach -B /dev/ttyACM0 -S > 1000000 -P h4 > - Skip the btmgmt step since in BlueZ 5.44 we no longer need to set the > static-address manually and newtmgr will handle the rest. > - Used the nrf52 DK onboard USB to UART bridge, did not use a FTDI USB TTL > Serial Cable. > I haven’t tried it with blehci. So not sure. Someone more experienced with blehci might be of more help than I am. I will let Chris/Will answer that. > But unfortunately I can't get it to work either, in fact it is one step > backward. > > When i tried sending: > sudo $(which newtmgr) -c ble image list -ldebug > > I get stuck at: > 2017/03/26 15:22:57 [DEBUG] BLE Connection devaddr:[] > 2017/03/26 15:22:57 dev: hci0 up > 2017/03/26 15:22:57 dev: hci0 down > 2017/03/26 15:22:57 dev: hci0 opened > 2017/03/26 15:22:57 [DEBUG] State:PoweredOn > 2017/03/26 15:22:57 [DEBUG] scanning... > > I have also attached the btmon response > > I noticed this line in the btmon log that was highlighted in red in the > terminal: > > HCI Event: Command Complete (0x0e) plen 4 [hci0] > > 4309.724132 > Write Simple Pairing Mode (0x03|0x0056) ncmd 1 > Status: Unknown HCI Command (0x01) > > Best Regards, > Chew > From: Vipul Rahane <[email protected]> > Sent: Saturday, 25 March, 2017 9:05:19 AM > To: [email protected] > Cc: Yz Then; Meili Yeo > Subject: Re: Newtmgr over BLE not Working > > Hello, > > I think there could be a couple of things causing this. > > 1. sudo "$(which newtmgr)" -c ble image upload '/slinky/slinky.img’ . Please > try removing single quotes and try again. I tried with/without single quotes. > It works fine without them and doesn’t work with them. > > 2. newt repo is not updated and so you have an old version of newtmgr. Please > try to update newtmgr and rebuild it. > > 3. newtmgr uses paypal/GATT library in the background. We have observed that > this library has issues when there are more than one bluetooth radios > connected to the linux box. Please disconnect one and try again or you might > have to disable/blacklist one of them. you can do so by using the following > command: > “sudo hciconfig hci0 down”. I am not sure which radio you would want to use > exactly. If you want to use the other radio just issue the command with hci1 > instead. > > 3 above might be the most probable reason for your failure to upload because > in the output you pasted below I see two hci interfaces: > > >>> 2017/03/24 15:16:04 dev: hci0 up > >>> 2017/03/24 15:16:04 dev: hci1 up > >>> 2017/03/24 15:16:04 dev: hci1 reset > >>> 2017/03/24 15:16:04 dev: hci1 down > >>> 2017/03/24 15:16:04 dev: hci1 opened > > > > Regards, > Vipul Rahane > > > On Mar 24, 2017, at 4:54 PM, Lm Chew <[email protected]> wrote: > > > > Hi Vipul, > > > > > > I tried changing LOG_LEVEL: 255, but it is still not working. > > > > > > Best Regards, > > > > Chew > > > > ________________________________ > > From: Vipul Rahane <[email protected]> > > Sent: Saturday, 25 March, 2017 5:42:04 AM > > To: [email protected] > > Cc: Yz Then; Meili Yeo > > Subject: Re: Newtmgr over BLE not Working > > > > Thank you. Can you please try to disable logging and try again. You can do > > this by setting LOG_LEVEL to 255. > > > > Regards, > > Vipul Rahane > > > > > >> On Mar 24, 2017, at 2:39 PM, Lm Chew <[email protected]> wrote: > >> > >> Hi Vipul, > >> > >> > >> Here is the syscfg file: > >> > >> > >> # Package: apps/bleprph > >> > >> syscfg.vals: > >> # Use INFO log level to reduce code size. DEBUG is too large for nRF51. > >> LOG_LEVEL: 1 > >> > >> # Disable central and observer roles. > >> BLE_ROLE_BROADCASTER: 1 > >> BLE_ROLE_CENTRAL: 0 > >> BLE_ROLE_OBSERVER: 0 > >> BLE_ROLE_PERIPHERAL: 1 > >> > >> # Disable unused eddystone feature. > >> BLE_EDDYSTONE: 0 > >> > >> # Log reboot messages to a flash circular buffer. > >> REBOOT_LOG_FCB: 1 > >> LOG_FCB: 1 > >> CONFIG_FCB: 1 > >> > >> # Enable newtmgr commands. > >> STATS_NEWTMGR: 1 > >> LOG_NEWTMGR: 1 > >> > >> # Enable Config. > >> CONFIG_NEWTMGR: 1 > >> > >> # OS main/default task > >> OS_MAIN_STACK_SIZE: 428 > >> > >> > >> Best Regards, > >> > >> Chew > >> > >> ________________________________ > >> From: Vipul Rahane <[email protected]> > >> Sent: Saturday, 25 March, 2017 1:38:09 AM > >> To: [email protected] > >> Cc: Yz Then; Meili Yeo > >> Subject: Re: Newtmgr over BLE not Working > >> > >> Hello, > >> > >> Can you please send me your syscfg settings for the bleprph target ? Thank > >> you. > >> > >> Regards, > >> Vipul Rahane > >> > >>> On Mar 24, 2017, at 2:05 AM, Lm Chew <[email protected]> wrote: > >>> > >>> Here is the output with -ldebug: > >>> > >>> 2017/03/24 17:01:28 [DEBUG] BLE Connection devaddr:[] > >>> 2017/03/24 17:01:28 dev: hci0 up > >>> 2017/03/24 17:01:28 dev: hci1 up > >>> 2017/03/24 17:01:28 dev: hci1 reset > >>> 2017/03/24 17:01:28 dev: hci1 down > >>> 2017/03/24 17:01:28 dev: hci1 opened > >>> 2017/03/24 17:01:28 [DEBUG] State:PoweredOn > >>> 2017/03/24 17:01:28 [DEBUG] scanning... > >>> 2017/03/24 17:01:28 [DEBUG] Peripheral Discovered: nimble-bleprph, > >>> Address:[10 10 10 10 10 10] Address Type:0 > >>> 2017/03/24 17:01:28 [DEBUG] Peripheral Connected > >>> 2017/03/24 17:01:28 [DEBUG] Newtmgr Service Found > >>> 2017/03/24 17:01:28 [DEBUG] Newtmgr Characteristic Found > >>> 2017/03/24 17:01:28 [DEBUG] Writing newtmgr request &{Op:2 Flags:0 Len:99 > >>> Group:1 Seq:0 Id:1 Data:[163 100 100 97 116 97 88 79 60 184 243 150 36 0 > >>> 0 0 32 0 0 0 60 179 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 32 249 128 > >>> 0 0 81 129 0 0 83 129 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >>> 0 0 0 0 143 159 0 99 108 101 110 25 179 128 99 111 102 102 0]} > >>> 2017/03/24 17:01:28 [DEBUG] Serializing request &{Op:2 Flags:0 Len:99 > >>> Group:1 Seq:0 Id:1 Data:[163 100 100 97 116 97 88 79 60 184 243 150 36 0 > >>> 0 0 32 0 0 0 60 179 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 32 249 128 > >>> 0 0 81 129 0 0 83 129 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >>> 0 0 0 0 143 159 0 99 108 101 110 25 179 128 99 111 102 102 0]} into > >>> buffer [2 0 0 99 0 1 0 1 163 100 100 97 116 97 88 79 60 184 243 150 36 0 > >>> 0 0 32 0 0 0 60 179 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 32 249 128 > >>> 0 0 81 129 0 0 83 129 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >>> 0 0 0 0 143 159 0 99 108 101 110 25 179 128 99 111 102 102 0] > >>> 2017/03/24 17:01:28 [DEBUG] Tx packet dump: > >>> 00000000 02 00 00 63 00 01 00 01 a3 64 64 61 74 61 58 4f > >>> |...c.....ddataXO| > >>> 00000010 3c b8 f3 96 24 00 00 00 20 00 00 00 3c b3 00 00 |<...$... > >>> ...<...| > >>> 00000020 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > >>> |................| > >>> 00000030 00 00 01 20 f9 80 00 00 51 81 00 00 53 81 00 00 |... > >>> ....Q...S...| > >>> 00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > >>> |................| > >>> 00000050 00 00 00 00 00 00 00 00 00 00 00 00 8f 9f 00 63 > >>> |...............c| > >>> 00000060 6c 65 6e 19 b3 80 63 6f 66 66 00 |len...coff.| > >>> > >>> 2017/03/24 17:01:28 [DEBUG] Write BLE Packet:buf::c�ddataXO<���$ <� > >>> ��Q�S���clen��coff len::107 > >>> 2017/03/24 17:01:31 [DEBUG] Disconnected%!(EXTRA <nil>) > >>> > >>> Seem like it get Disconnected? > >>> ________________________________ > >>> From: Lm Chew <[email protected]> > >>> Sent: Friday, 24 March, 2017 3:23:39 PM > >>> To: [email protected] > >>> Cc: Yz Then; Meili Yeo > >>> Subject: Newtmgr over BLE not Working > >>> > >>> Hi Everyone, > >>> > >>> > >>> I need some help figuring out why the Newtmgr Image Upload over BLE is > >>> not working. > >>> > >>> > >>> The Image setup I am going for is the "Unified" setup. > >>> > >>> > >>> So now I will describe the procedure that I have done up till the issue > >>> arise. > >>> > >>> > >>> Firstly I pulled all the latest source for the Newt Tool & the Mynewt OS > >>> from the Developer branch and build them. > >>> > >>> > >>> Then I build & created image for 3 Targets with the following setting: > >>> > >>> > >>> targets/nrf52_boot > >>> app=@apache-mynewt-core/apps/boot > >>> bsp=@apache-mynewt-core/hw/bsp/bmd300eval > >>> build_profile=optimized > >>> > >>> targets/unified-bmd300eval > >>> app=@apache-mynewt-core/apps/bleprph > >>> bsp=@apache-mynewt-core/hw/bsp/bmd300eval > >>> build_profile=optimized > >>> > >>> targets/unified2-bmd300eval > >>> app=@apache-mynewt-core/apps/slinky > >>> bsp=@apache-mynewt-core/hw/bsp/bmd300eval > >>> build_profile=optimized > >>> > >>> > >>> > >>> After that I load the bootloader: > >>> > >>> newt load nrf52_boot > >>> > >>> > >>> and then the bleprph app: > >>> > >>> newt load unified-bmd300eval > >>> > >>> > >>> So by now, I am be able to detect the ble advertisement by using the > >>> hcitool (I am using a USB BLE 4.0 dongle, while disabled the build-in > >>> Bluetooth on hci0): > >>> > >>> sudo hcitool -i hci1 lescan > >>> > >>> > >>> Output is as follow: > >>> > >>> LE Scan ... > >>> 0A:0A:0A:0A:0A:0A nimble-g4-node > >>> 0A:0A:0A:0A:0A:0A (unknown) > >>> 0A:0A:0A:0A:0A:0A nimble-g4-node > >>> 0A:0A:0A:0A:0A:0A (unknown) > >>> ^C > >>> > >>> Next thing to do is set the connection profile for the newtmgr: > >>> > >>> newtmgr conn add ble type=ble connstring=nimble-bleprph > >>> > >>> > >>> Then i try to list the image available in the device: > >>> > >>> sudo "$(which newtmgr)" -c ble image list > >>> > >>> > >>> Here is the Output: > >>> > >>> 2017/03/24 15:11:35 dev: hci0 up > >>> 2017/03/24 15:11:35 dev: hci1 up > >>> 2017/03/24 15:11:35 dev: hci1 reset > >>> 2017/03/24 15:11:35 dev: hci1 down > >>> 2017/03/24 15:11:35 dev: hci1 opened > >>> Images: > >>> slot=0 > >>> version: 0.0.0 > >>> bootable: true > >>> flags: active confirmed > >>> hash: b9b1b2a2f1923e181d83c47f6092c3f1779451cf6bed48c863625fb5642c8cbd > >>> Split status: N/A > >>> > >>> Now I want to try to upload slinky image to slot=1: > >>> sudo "$(which newtmgr)" -c ble image upload '/slinky/slinky.img' > >>> > >>> And the output just stop here no matter how long I waited. > >>> 2017/03/24 15:16:04 dev: hci0 up > >>> 2017/03/24 15:16:04 dev: hci1 up > >>> 2017/03/24 15:16:04 dev: hci1 reset > >>> 2017/03/24 15:16:04 dev: hci1 down > >>> 2017/03/24 15:16:04 dev: hci1 opened > >>> > >>> Any Idea why it just stopped here? > >>> > >>> > >>> Best Regards, > >>> > >>> Chew > >> > >
