0

Bluetooth connexion issue with ItsyBitsy nrf52840 from Ubunt
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Bluetooth connexion issue with ItsyBitsy nrf52840 from Ubunt

by rarbaud on Thu May 12, 2022 11:16 am

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.

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

Re: Bluetooth connexion issue with ItsyBitsy nrf52840 from U

by mikeysklar on Thu May 12, 2022 6:16 pm

Which version of bluez are you running?

Code: Select all | TOGGLE FULL SIZE
apt show bluez


Have you tried connecting with bluetoothctl

Code: Select all | TOGGLE FULL SIZE
sudo bluetoothctl
scan on
connect CC:FD:D2:4F:82:1D # or whatever you BLE mac is
scan off
info
list-attributes

mikeysklar
 
Posts: 7753
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bluetooth connexion issue with ItsyBitsy nrf52840 from U

by rarbaud on Fri May 13, 2022 4:36 am

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.

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

Re: Bluetooth connexion issue with ItsyBitsy nrf52840 from U

by mikeysklar on Fri May 13, 2022 5:29 pm

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

mikeysklar
 
Posts: 7753
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.