Hi,
I recently purchased several ItsyBitsy nRF52840 Express Bluetooth LE boards, which I have used successfully in the past. Unfortunately, none of them are working as expected. They won't pair with my mobile phone app using known working code.
That code (i.e. both firmware and Swift code for my iPhone) has working for several months. In fact, as a test, I just reprogrammed two older Itsy Bitsy nRF52840 Express boards that I have and paired them to my phone no problem using this same firmware!
Could there be some systemic issue with all seven new boards I just bought (i.e. a bad batch) or is there something I am forgetting to do? I am scratching my head. It seems unlikely that there would be an issue on all the boards, but then again, none of them are working.
Thanks.
https://www.adafruit.com/product/4481
Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- dolsen_RPi
- Posts: 12
- Joined: Wed Jul 22, 2020 1:20 am
- danhalbert
- Posts: 4649
- Joined: Tue Aug 08, 2017 12:37 pm
Re: Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
Could you elaborate on what is running on the Itsy's? CircuitPython, Arduino, or something else?
- dolsen_RPi
- Posts: 12
- Joined: Wed Jul 22, 2020 1:20 am
- danhalbert
- Posts: 4649
- Joined: Tue Aug 08, 2017 12:37 pm
Re: Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
What version of the bootloader is running on the old vs the new boards? Look at INFO_UF2.TXT in the ...BOOT drives.
- dolsen_RPi
- Posts: 12
- Joined: Wed Jul 22, 2020 1:20 am
Re: Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
They look to be the same.
Old Board:
UF2 Bootloader 0.2.13 lib/nrfx (v1.1.0-1-g096e770) lib/tinyusb (legacy-755-g55874813) s140 6.1.1
Model: Adafruit ItsyBitsy nRF52840 Express
Board-ID: nRF52840-ItsyBitsy-revA
Date: Sep 25 2019
New Board:
UF2 Bootloader 0.2.13 lib/nrfx (v1.1.0-1-g096e770) lib/tinyusb (legacy-755-g55874813) s140 6.1.1
Model: Adafruit ItsyBitsy nRF52840 Express
Board-ID: nRF52840-ItsyBitsy-revA
Date: Sep 25 2019
Old Board:
UF2 Bootloader 0.2.13 lib/nrfx (v1.1.0-1-g096e770) lib/tinyusb (legacy-755-g55874813) s140 6.1.1
Model: Adafruit ItsyBitsy nRF52840 Express
Board-ID: nRF52840-ItsyBitsy-revA
Date: Sep 25 2019
New Board:
UF2 Bootloader 0.2.13 lib/nrfx (v1.1.0-1-g096e770) lib/tinyusb (legacy-755-g55874813) s140 6.1.1
Model: Adafruit ItsyBitsy nRF52840 Express
Board-ID: nRF52840-ItsyBitsy-revA
Date: Sep 25 2019
- danhalbert
- Posts: 4649
- Joined: Tue Aug 08, 2017 12:37 pm
Re: Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
I inquired about whether there was some difference in the nRF modules between the old and new boards. The nRF52840 chip underwent a revision, but otherwise they should be the same.
Is the source code for your program available in a GitHub repo or similar, or could you upload it as a zip file here/
Could you also take a clear top-view close-up picture of an old and new board side by side? I want to make sure the new boards have the antennas in place.
Is the source code for your program available in a GitHub repo or similar, or could you upload it as a zip file here/
Could you also take a clear top-view close-up picture of an old and new board side by side? I want to make sure the new boards have the antennas in place.
- dolsen_RPi
- Posts: 12
- Joined: Wed Jul 22, 2020 1:20 am
Re: Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
Sure, thanks for your help.
Here is a stripped-down version of the code in which the pairing is made.
Here is a stripped-down version of the code in which the pairing is made.
- Attachments
-
- SimpleBLEPairing.zip
- (3.61 KiB) Downloaded 20 times
- dolsen_RPi
- Posts: 12
- Joined: Wed Jul 22, 2020 1:20 am
Re: Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
And, here is a picture of the two boards:
The old one (top) has the pins soldered on. The new one does not.
The old one (top) has the pins soldered on. The new one does not.
- Attachments
-
- ItsyBitsy_Old&New.jpg (664.03 KiB) Viewed 483 times
- hathach
- Posts: 1270
- Joined: Tue Apr 23, 2013 1:02 am
Re: Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
hi, I am maintainer of the arduino nrf52 core. I have tried your code, since I don't have your swift app, I tested with our Bluefruit Connect and it seems to connect just fine. Although there is minor module revision changes, but I don't think it is relevant at all. My current best guess is set-up issue e.g for swift app can only pair/manage that much of connection.
Please try with a few of following scenario to test the mobile app
1. If you have another phone: try to test with new phone with new itsybitsy
2. unpair one of the old itsybitsy then try to pair with new one to see if that could free up some slot on the phone app
3. Try to pair with a different mobile app e.g Adafruit Bluefruit Connect to see if could work with both old + new boards
For the firmware side:
1. Can you attached the compile log as txt here. It would allow us to see your current library version combo, if they are not updated, maybe update them first.
2. Try to increase the Tools->Debug Level to 1 or 2, it may give some hints on reason why the pairing is failed. And post it here (as attached txt if too long) for analysis
Please try with a few of following scenario to test the mobile app
1. If you have another phone: try to test with new phone with new itsybitsy
2. unpair one of the old itsybitsy then try to pair with new one to see if that could free up some slot on the phone app
3. Try to pair with a different mobile app e.g Adafruit Bluefruit Connect to see if could work with both old + new boards
For the firmware side:
1. Can you attached the compile log as txt here. It would allow us to see your current library version combo, if they are not updated, maybe update them first.
2. Try to increase the Tools->Debug Level to 1 or 2, it may give some hints on reason why the pairing is failed. And post it here (as attached txt if too long) for analysis
- dolsen_RPi
- Posts: 12
- Joined: Wed Jul 22, 2020 1:20 am
Re: Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
Thank you for your help.
I didn't quite follow what you meant by: "swift app can only pair/manage that much of connection." Can you please explain what you mean?
Also, here are some responses to your main points:
***
I tried 3 different phones with all 9 boards I have - i.e. the original 3 boards I had from before plus the 6 that I recently purchased, running the same firmware on each and using the Bluefruit Connect app on the iPhones
In the Bluefruit Connect app, I can only see the "Bluefruit52" network being advertised when the old board is connected. (Same goes when running the app on all three phones.) The "Bluefruit52" network just does not show up when I try any of the new boards. There are other networks visible in the app, but none of them is from the ItsyBitsy board (i.e. "Bluefruit52"). I also can't see the network in the console output on my Mac either when running my own BLE app in XCode, but I can for the 3 original boards.
***
Also, there does not seem to be any BLE networks to unpair from on my phones
***
BTW - One of my boards cannot be programmed at all for some reason. Here is the log:
Timed out waiting for acknowledgement from device.
Failed to upgrade target. Error is: Attempting to use a port that is not open
Traceback (most recent call last):
File "__main__.py", line 296, in serial
File "dfu\dfu.py", line 235, in dfu_send_images
File "dfu\dfu.py", line 203, in _dfu_send_image
File "dfu\dfu_transport_serial.py", line 155, in send_init_packet
File "dfu\dfu_transport_serial.py", line 241, in send_packet
File "serial\serialwin32.py", line 306, in write
serial.serialutil.PortNotOpenError: Attempting to use a port that is not open
Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
Please upgrade the Bootloader or select correct version in Tools->Bootloader.
- Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.
I tried to update the bootloader through the Arduino tools, but I cannot. I get this message:
Opened serial port COM20
Starting DFU upgrade of type 3, SoftDevice size: 151016, bootloader size: 39728, application size: 0
Sending DFU start packet
Timed out waiting for acknowledgement from device.
Sending DFU init packet
Failed to upgrade target. Error is: Attempting to use a port that is not open
Traceback (most recent call last):
File "__main__.py", line 296, in serial
File "dfu\dfu.py", line 226, in dfu_send_images
File "dfu\dfu.py", line 203, in _dfu_send_image
File "dfu\dfu_transport_serial.py", line 155, in send_init_packet
File "dfu\dfu_transport_serial.py", line 241, in send_packet
File "serial\serialwin32.py", line 306, in write
serial.serialutil.PortNotOpenError: Attempting to use a port that is not open
Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
Please upgrade the Bootloader or select correct version in Tools->Bootloader.
- Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.
***
Below is the Compile Log you requested:
Library Adafruit_BANNED has been declared precompiled:
Using precompiled library in C:\Users\dave_\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\1.3.0\libraries\Adafruit_BANNED\src\cortex-m4\fpv4-sp-d16-hard
Sketch uses 158912 bytes (19%) of program storage space. Maximum is 815104 bytes.
Global variables use 15044 bytes (6%) of dynamic memory, leaving 222524 bytes for local variables. Maximum is 237568 bytes.
***
And below is the Level 02 Debug Log from programming one of the boards:
(Not much to be seen here...)
Upgrading target on COM30 with DFU package C:\Users\dave_\AppData\Local\Temp\arduino_build_788247\2e_BenchUnit_v3.ino.zip. Flow control is disabled, Single bank, Touch disabled
########################################
########################################
########################################
########################################
########################################
########################################
########################################
###############################
Activating new firmware
Device programmed.
It's not looking good. Can these 6 boards be sent somewhere for inspection / repair?
Thanks
Dave
I didn't quite follow what you meant by: "swift app can only pair/manage that much of connection." Can you please explain what you mean?
Also, here are some responses to your main points:
***
I tried 3 different phones with all 9 boards I have - i.e. the original 3 boards I had from before plus the 6 that I recently purchased, running the same firmware on each and using the Bluefruit Connect app on the iPhones
In the Bluefruit Connect app, I can only see the "Bluefruit52" network being advertised when the old board is connected. (Same goes when running the app on all three phones.) The "Bluefruit52" network just does not show up when I try any of the new boards. There are other networks visible in the app, but none of them is from the ItsyBitsy board (i.e. "Bluefruit52"). I also can't see the network in the console output on my Mac either when running my own BLE app in XCode, but I can for the 3 original boards.
***
Also, there does not seem to be any BLE networks to unpair from on my phones
***
BTW - One of my boards cannot be programmed at all for some reason. Here is the log:
Timed out waiting for acknowledgement from device.
Failed to upgrade target. Error is: Attempting to use a port that is not open
Traceback (most recent call last):
File "__main__.py", line 296, in serial
File "dfu\dfu.py", line 235, in dfu_send_images
File "dfu\dfu.py", line 203, in _dfu_send_image
File "dfu\dfu_transport_serial.py", line 155, in send_init_packet
File "dfu\dfu_transport_serial.py", line 241, in send_packet
File "serial\serialwin32.py", line 306, in write
serial.serialutil.PortNotOpenError: Attempting to use a port that is not open
Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
Please upgrade the Bootloader or select correct version in Tools->Bootloader.
- Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.
I tried to update the bootloader through the Arduino tools, but I cannot. I get this message:
Opened serial port COM20
Starting DFU upgrade of type 3, SoftDevice size: 151016, bootloader size: 39728, application size: 0
Sending DFU start packet
Timed out waiting for acknowledgement from device.
Sending DFU init packet
Failed to upgrade target. Error is: Attempting to use a port that is not open
Traceback (most recent call last):
File "__main__.py", line 296, in serial
File "dfu\dfu.py", line 226, in dfu_send_images
File "dfu\dfu.py", line 203, in _dfu_send_image
File "dfu\dfu_transport_serial.py", line 155, in send_init_packet
File "dfu\dfu_transport_serial.py", line 241, in send_packet
File "serial\serialwin32.py", line 306, in write
serial.serialutil.PortNotOpenError: Attempting to use a port that is not open
Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
Please upgrade the Bootloader or select correct version in Tools->Bootloader.
- Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.
***
Below is the Compile Log you requested:
Library Adafruit_BANNED has been declared precompiled:
Using precompiled library in C:\Users\dave_\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\1.3.0\libraries\Adafruit_BANNED\src\cortex-m4\fpv4-sp-d16-hard
Sketch uses 158912 bytes (19%) of program storage space. Maximum is 815104 bytes.
Global variables use 15044 bytes (6%) of dynamic memory, leaving 222524 bytes for local variables. Maximum is 237568 bytes.
***
And below is the Level 02 Debug Log from programming one of the boards:
(Not much to be seen here...)
Upgrading target on COM30 with DFU package C:\Users\dave_\AppData\Local\Temp\arduino_build_788247\2e_BenchUnit_v3.ino.zip. Flow control is disabled, Single bank, Touch disabled
########################################
########################################
########################################
########################################
########################################
########################################
########################################
###############################
Activating new firmware
Device programmed.
It's not looking good. Can these 6 boards be sent somewhere for inspection / repair?
Thanks
Dave
- hathach
- Posts: 1270
- Joined: Tue Apr 23, 2013 1:02 am
Re: Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
thank you for more inputs, this is only programming logs, once programmed, could you click serial monitor to see what the board print out. In the debug mode your sketch/firmware has line that wait for Serial before running in setup()
Also if possible, please enable IDE Menu -> Preferences -> Show verbose output during -> complication and post your compile log as txt here as well (don't paste it as text since it is very long)
Code: Select all
#if CFG_DEBUG
// Blocking wait for connection when debug mode is enabled via IDE
while ( !Serial ) yield();
#endif
- dolsen_RPi
- Posts: 12
- Joined: Wed Jul 22, 2020 1:20 am
Re: Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
Attached is the compile log. Unfortunately, I get no print statements on the serial console with the new boards.
As an experiment, I tried changing the syntax of the #if to which you alluded to #ifdef and manually #define'd CFG_DEBUG but still no printouts.
When I changed to the old board, however, I do get prints. This is what I see on the serial console:
Bluefruit52 BLEUART Example
---------------------------
[CFG ] SoftDevice's RAM requires: 0x200038A0
Please use Adafruit's Bluefruit LE app to connect in UART mode
Once connected, enter character(s) that you wish to send
BSP Library : 1.3.0
Bootloader : s140 6.1.1
Serial No : BFFB4373B87CAC8F
--------- SoftDevice Config ---------
Max UUID128 : 10
ATTR Table Size : 4096
Service Changed : 1
Peripheral Connect Setting
- Max MTU : 247
- Event Length : 100
- HVN Queue Size : 3
- WrCmd Queue Size: 1
--------- BLE Settings ---------
Name : Bluefruit52
Max Connections : Peripheral = 1, Central = 0
Address : F3:6A:C4:AA:59:56 (Static)
TX Power : 4 dBm
Conn Intervals : min = 20.00 ms, max = 30.00 ms
Conn Timeout : 2000 ms
Peripheral Paired Devices:
As an experiment, I tried changing the syntax of the #if to which you alluded to #ifdef and manually #define'd CFG_DEBUG but still no printouts.
When I changed to the old board, however, I do get prints. This is what I see on the serial console:
Bluefruit52 BLEUART Example
---------------------------
[CFG ] SoftDevice's RAM requires: 0x200038A0
Please use Adafruit's Bluefruit LE app to connect in UART mode
Once connected, enter character(s) that you wish to send
BSP Library : 1.3.0
Bootloader : s140 6.1.1
Serial No : BFFB4373B87CAC8F
--------- SoftDevice Config ---------
Max UUID128 : 10
ATTR Table Size : 4096
Service Changed : 1
Peripheral Connect Setting
- Max MTU : 247
- Event Length : 100
- HVN Queue Size : 3
- WrCmd Queue Size: 1
--------- BLE Settings ---------
Name : Bluefruit52
Max Connections : Peripheral = 1, Central = 0
Address : F3:6A:C4:AA:59:56 (Static)
TX Power : 4 dBm
Conn Intervals : min = 20.00 ms, max = 30.00 ms
Conn Timeout : 2000 ms
Peripheral Paired Devices:
- Attachments
-
- CompileLog_112222.txt
- (102.75 KiB) Downloaded 8 times
- hathach
- Posts: 1270
- Joined: Tue Apr 23, 2013 1:02 am
Re: Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
I couldn't spot any issue in your compile log. Maybe there is weird issue with bootloader on the new itsybitsy. Do you mind trying to upgrade the bootloader as following guide to see it would help to improve the situation. It is rather simple using Arduino IDE (pick the right board & programmer) and be patient for a minute.
https://learn.adafruit.com/bluefruit-nr ... bootloader
Once burning the new bootloader, please try uploading the sketch again to see if that helps. You could double reset then check the INFO_UF2.TXT contents to see if bootloader is indeed updated.
https://learn.adafruit.com/bluefruit-nr ... bootloader
Once burning the new bootloader, please try uploading the sketch again to see if that helps. You could double reset then check the INFO_UF2.TXT contents to see if bootloader is indeed updated.
- dolsen_RPi
- Posts: 12
- Joined: Wed Jul 22, 2020 1:20 am
Re: Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
Thanks. Unfortunately, I don't see a Tools > Bootloader menu option. (Please see attached screenshot.)
- Attachments
-
- Screenshot.png (27.25 KiB) Viewed 395 times
- hathach
- Posts: 1270
- Joined: Tue Apr 23, 2013 1:02 am
Re: Adafruit ItsyBitsy nRF52840 Express not pairing with mobile app
That is ok, just select correct board and click Burn. The menu name changed recently since guide is written
Please be positive and constructive with your questions and comments.