Bluetooth connexion issue with ItsyBitsy nrf52840 from Ubunt

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
rarbaud
 
Posts: 2
Joined: Thu May 12, 2022 10:49 am

Bluetooth connexion issue with ItsyBitsy nrf52840 from Ubunt

Post by rarbaud »

Hello

I have an ItsyBitsy nrf52840. Using my phone and LightBlue, I can connect to the board without any issues. However I need to be able to connect to it from my Ubuntu 18.04 laptop, ideally by using a command line like gatttool. So far, I have tried

hcitool lecc [board_address]
gatttool -b [board_address] --char-desc
gatttool -t random -b [board_address] --char-desc

The first two are working with a Nano 33 BLE board based on the same nrf52840 chip as the ItsyBitsy board, but with the ItsyBitsy I get a "Connection timed out" error from hcitool, and a "Connexion refused (111)" error from gatttool (the error takes some time to be displayed, therefore I believe it is also some kind of timeout issue).

So, does anyone have an idea about what could cause the code to work with Lighblue but not with Ubuntu? Maybe I got the board address wrong? I got it using the getAddr() function from the Adafruit Bluefruit52Lib before printing it in Arduino IDE serial terminal... Or could there be some config issue, e.g. in advertising, which makes the board detected properly on Lightblue only?

Thanks in advance.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bluetooth connexion issue with ItsyBitsy nrf52840 from U

Post by mikeysklar »

Which version of bluez are you running?

Code: Select all

apt show bluez
Have you tried connecting with bluetoothctl

Code: Select all

sudo bluetoothctl
scan on
connect CC:FD:D2:4F:82:1D # or whatever you BLE mac is
scan off
info
list-attributes

User avatar
rarbaud
 
Posts: 2
Joined: Thu May 12, 2022 10:49 am

Re: Bluetooth connexion issue with ItsyBitsy nrf52840 from U

Post by rarbaud »

Hello.

I solved it! It appears that the getAddr() function of the Bluefruit lib returns the address in big endian format, while I thought it would be little endian... I was able to notice the name of my device in Bluetoothctl, but couldn't spot the reversed address when I was using hcitool lescan...

So thanks a lot for your advice to try Bluetoothctl, without it I would still be stuck. I didn't know about this tool.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bluetooth connexion issue with ItsyBitsy nrf52840 from U

Post by mikeysklar »

Awesome. Glad you noticed the address reversal. Thank you for the follow up.

Locked
Please be positive and constructive with your questions and comments.

Return to “Itsy Bitsy Boards”