Re: NuttX BLE. Pairing with a device
Hi all, I am also trying to pair my ESP32 running NuttX with a bluetooth device. I was wondering if you managed to do it Petro. Also a problem I ran into is when I am trying to advertise from my ESP32 with "bt bnep0 advertise start" I can't see the ESP32 on any other devices I tried. Any info would be appreciated. Best regards, Alexandru În mar., 25 apr. 2023 la 20:33, Alan C. Assis a scris: > On 4/25/23, Brennan Ashton wrote: > > > > I should probably have added this in more detail to the docs, but see the > > testing section of the PR where I added it. I think it shows exactly what > > you are trying to do > > > > https://github.com/apache/nuttx/pull/1655 > > > > Petro is right, we need to improve the "bt bnep0 scan get" command to > include a human readable device name. > > It is very difficult to figure out which device we want to connect to. > > Another nice improvement will be listing devices by their RSSI, this > way nearby devices tend to appear first in the listing. > > BR, > > Alan >
Re: NuttX BLE. Pairing with a device
On 4/25/23, Brennan Ashton wrote: > > I should probably have added this in more detail to the docs, but see the > testing section of the PR where I added it. I think it shows exactly what > you are trying to do > > https://github.com/apache/nuttx/pull/1655 > Petro is right, we need to improve the "bt bnep0 scan get" command to include a human readable device name. It is very difficult to figure out which device we want to connect to. Another nice improvement will be listing devices by their RSSI, this way nearby devices tend to appear first in the listing. BR, Alan
Re: NuttX BLE. Pairing with a device
On Tue, Apr 25, 2023 at 6:54 PM Petro Karashchenko wrote: > Is this going to work on OSX? Or Linux only is verified? XCode has PacketLogger utility that should help :-) Also you will see additional information when pressing Buetooth icon with Alt key pressed :-) Some folks recommend Ubertooth One from Great Scott Gadgets (creator of HackRF One) with Wiershark.. but I am not sure if it will capture latest BT 5.x traffic. On FreeBSD I did not manage to capture BT5.0 with SDR, nor nRF52840, nor internal hci snooping, only older BT transmissions and also with some trouble, so I gave up. I once had access to Ellisys hardware sniffer that was so easy to use but its initial price and the price of updates can cause headache :-) -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
Re: NuttX BLE. Pairing with a device
Ok. Thank you. I was able to monitor traffic from Ubuntu bluetooth port and found out that my device sends advertising reports not frequently, so I did a few more tries with duplicates on NuttX ESP32 and finally was able to identify the needed string. So what is the next step? How to pair with the device? Best regards, Petro вт, 25 квіт. 2023 р. о 20:05 Brennan Ashton пише: > Unfortunately this is coupled to the Linux kernel Bluetooth stack since it > is relying on the User Channel of the hcisocket which let's your > application (NuttX in this case) have a virtual HCI device and temporarily > provide it largely isolated control over it (you cannot scan from the host > anymore for example). > There is a good description of this feature in the patch that introduced > it. https://marc.info/?l=linux-bluetooth&m=137757846631034&w=2 > > On Tue, Apr 25, 2023, 5:54 PM Petro Karashchenko < > petro.karashche...@gmail.com> wrote: > > > Is this going to work on OSX? Or Linux only is verified? > > > > вт, 25 квіт. 2023 р. о 19:45 Brennan Ashton > > пише: > > > > > On Tue, Apr 25, 2023, 5:41 PM Brennan Ashton < > bash...@brennanashton.com> > > > wrote: > > > > > > > > > > > On Tue, Apr 25, 2023, 5:36 PM Petro Karashchenko < > > > > petro.karashche...@gmail.com> wrote: > > > > > > > >> Hello, > > > >> > > > >> I'm starting to experiment with NuttX BLE support. I have a device > > that > > > I > > > >> can successfully pair with my phone and I would like to try pairing > it > > > >> with > > > >> the NuttX based device. I chose ESP32 for my experiments. For now I > > > >> enabled > > > >> (and fixed) esp32-devkitc:ble configuration, but that is basically > > > all... > > > >> I > > > >> do not have much knowledge in bluetooth, but definitely want to > master > > > it. > > > >> When I'm pairing from my phone I see the device name in the list of > > > >> scanned > > > >> devices, so the device advertises some human readable string in > data. > > > Then > > > >> I'm running "bt bnep0 scan start" -> "bt bnep0 scan stop" -> "bt > bnep0 > > > >> scan > > > >> get" on my ESP32 and expecting to see some of the same human > readable > > > >> string in the printed output as I do not known the MAC address of my > > > >> device, but there is not such data sequence in "bt bnep0 scan get" > > > output. > > > >> I would appreciate some guidance for the BLE dummy like me, so I can > > > move > > > >> forward a bit. > > > >> > > > >> Best regards, > > > >> Petro > > > >> > > > > > > > > > > > > I have not touched it in a bit, but I found the sim support I added > > with > > > > the hci socket made debugging the Bluetooth stack a lot easier > because > > I > > > > could use Wireshark/btmon on the actual host machine to show all the > > hci > > > > traffic to and from the NuttX stack transparently. I highly > recommend > > > > trying that to verify there is not anything fundamentally broken. > > > > > > > > --Brennan > > > > > > > > > > I should probably have added this in more detail to the docs, but see > the > > > testing section of the PR where I added it. I think it shows exactly > what > > > you are trying to do > > > > > > https://github.com/apache/nuttx/pull/1655 > > > > > > > > > --Brennan > > > > > >
Re: NuttX BLE. Pairing with a device
Unfortunately this is coupled to the Linux kernel Bluetooth stack since it is relying on the User Channel of the hcisocket which let's your application (NuttX in this case) have a virtual HCI device and temporarily provide it largely isolated control over it (you cannot scan from the host anymore for example). There is a good description of this feature in the patch that introduced it. https://marc.info/?l=linux-bluetooth&m=137757846631034&w=2 On Tue, Apr 25, 2023, 5:54 PM Petro Karashchenko < petro.karashche...@gmail.com> wrote: > Is this going to work on OSX? Or Linux only is verified? > > вт, 25 квіт. 2023 р. о 19:45 Brennan Ashton > пише: > > > On Tue, Apr 25, 2023, 5:41 PM Brennan Ashton > > wrote: > > > > > > > > On Tue, Apr 25, 2023, 5:36 PM Petro Karashchenko < > > > petro.karashche...@gmail.com> wrote: > > > > > >> Hello, > > >> > > >> I'm starting to experiment with NuttX BLE support. I have a device > that > > I > > >> can successfully pair with my phone and I would like to try pairing it > > >> with > > >> the NuttX based device. I chose ESP32 for my experiments. For now I > > >> enabled > > >> (and fixed) esp32-devkitc:ble configuration, but that is basically > > all... > > >> I > > >> do not have much knowledge in bluetooth, but definitely want to master > > it. > > >> When I'm pairing from my phone I see the device name in the list of > > >> scanned > > >> devices, so the device advertises some human readable string in data. > > Then > > >> I'm running "bt bnep0 scan start" -> "bt bnep0 scan stop" -> "bt bnep0 > > >> scan > > >> get" on my ESP32 and expecting to see some of the same human readable > > >> string in the printed output as I do not known the MAC address of my > > >> device, but there is not such data sequence in "bt bnep0 scan get" > > output. > > >> I would appreciate some guidance for the BLE dummy like me, so I can > > move > > >> forward a bit. > > >> > > >> Best regards, > > >> Petro > > >> > > > > > > > > > I have not touched it in a bit, but I found the sim support I added > with > > > the hci socket made debugging the Bluetooth stack a lot easier because > I > > > could use Wireshark/btmon on the actual host machine to show all the > hci > > > traffic to and from the NuttX stack transparently. I highly recommend > > > trying that to verify there is not anything fundamentally broken. > > > > > > --Brennan > > > > > > > I should probably have added this in more detail to the docs, but see the > > testing section of the PR where I added it. I think it shows exactly what > > you are trying to do > > > > https://github.com/apache/nuttx/pull/1655 > > > > > > --Brennan > > >
Re: NuttX BLE. Pairing with a device
Is this going to work on OSX? Or Linux only is verified? вт, 25 квіт. 2023 р. о 19:45 Brennan Ashton пише: > On Tue, Apr 25, 2023, 5:41 PM Brennan Ashton > wrote: > > > > > On Tue, Apr 25, 2023, 5:36 PM Petro Karashchenko < > > petro.karashche...@gmail.com> wrote: > > > >> Hello, > >> > >> I'm starting to experiment with NuttX BLE support. I have a device that > I > >> can successfully pair with my phone and I would like to try pairing it > >> with > >> the NuttX based device. I chose ESP32 for my experiments. For now I > >> enabled > >> (and fixed) esp32-devkitc:ble configuration, but that is basically > all... > >> I > >> do not have much knowledge in bluetooth, but definitely want to master > it. > >> When I'm pairing from my phone I see the device name in the list of > >> scanned > >> devices, so the device advertises some human readable string in data. > Then > >> I'm running "bt bnep0 scan start" -> "bt bnep0 scan stop" -> "bt bnep0 > >> scan > >> get" on my ESP32 and expecting to see some of the same human readable > >> string in the printed output as I do not known the MAC address of my > >> device, but there is not such data sequence in "bt bnep0 scan get" > output. > >> I would appreciate some guidance for the BLE dummy like me, so I can > move > >> forward a bit. > >> > >> Best regards, > >> Petro > >> > > > > > > I have not touched it in a bit, but I found the sim support I added with > > the hci socket made debugging the Bluetooth stack a lot easier because I > > could use Wireshark/btmon on the actual host machine to show all the hci > > traffic to and from the NuttX stack transparently. I highly recommend > > trying that to verify there is not anything fundamentally broken. > > > > --Brennan > > > > I should probably have added this in more detail to the docs, but see the > testing section of the PR where I added it. I think it shows exactly what > you are trying to do > > https://github.com/apache/nuttx/pull/1655 > > > --Brennan >
Re: NuttX BLE. Pairing with a device
On Tue, Apr 25, 2023, 5:41 PM Brennan Ashton wrote: > > On Tue, Apr 25, 2023, 5:36 PM Petro Karashchenko < > petro.karashche...@gmail.com> wrote: > >> Hello, >> >> I'm starting to experiment with NuttX BLE support. I have a device that I >> can successfully pair with my phone and I would like to try pairing it >> with >> the NuttX based device. I chose ESP32 for my experiments. For now I >> enabled >> (and fixed) esp32-devkitc:ble configuration, but that is basically all... >> I >> do not have much knowledge in bluetooth, but definitely want to master it. >> When I'm pairing from my phone I see the device name in the list of >> scanned >> devices, so the device advertises some human readable string in data. Then >> I'm running "bt bnep0 scan start" -> "bt bnep0 scan stop" -> "bt bnep0 >> scan >> get" on my ESP32 and expecting to see some of the same human readable >> string in the printed output as I do not known the MAC address of my >> device, but there is not such data sequence in "bt bnep0 scan get" output. >> I would appreciate some guidance for the BLE dummy like me, so I can move >> forward a bit. >> >> Best regards, >> Petro >> > > > I have not touched it in a bit, but I found the sim support I added with > the hci socket made debugging the Bluetooth stack a lot easier because I > could use Wireshark/btmon on the actual host machine to show all the hci > traffic to and from the NuttX stack transparently. I highly recommend > trying that to verify there is not anything fundamentally broken. > > --Brennan > I should probably have added this in more detail to the docs, but see the testing section of the PR where I added it. I think it shows exactly what you are trying to do https://github.com/apache/nuttx/pull/1655 --Brennan
Re: NuttX BLE. Pairing with a device
On Tue, Apr 25, 2023, 5:36 PM Petro Karashchenko < petro.karashche...@gmail.com> wrote: > Hello, > > I'm starting to experiment with NuttX BLE support. I have a device that I > can successfully pair with my phone and I would like to try pairing it with > the NuttX based device. I chose ESP32 for my experiments. For now I enabled > (and fixed) esp32-devkitc:ble configuration, but that is basically all... I > do not have much knowledge in bluetooth, but definitely want to master it. > When I'm pairing from my phone I see the device name in the list of scanned > devices, so the device advertises some human readable string in data. Then > I'm running "bt bnep0 scan start" -> "bt bnep0 scan stop" -> "bt bnep0 scan > get" on my ESP32 and expecting to see some of the same human readable > string in the printed output as I do not known the MAC address of my > device, but there is not such data sequence in "bt bnep0 scan get" output. > I would appreciate some guidance for the BLE dummy like me, so I can move > forward a bit. > > Best regards, > Petro > I have not touched it in a bit, but I found the sim support I added with the hci socket made debugging the Bluetooth stack a lot easier because I could use Wireshark/btmon on the actual host machine to show all the hci traffic to and from the NuttX stack transparently. I highly recommend trying that to verify there is not anything fundamentally broken. --Brennan >
NuttX BLE. Pairing with a device
Hello, I'm starting to experiment with NuttX BLE support. I have a device that I can successfully pair with my phone and I would like to try pairing it with the NuttX based device. I chose ESP32 for my experiments. For now I enabled (and fixed) esp32-devkitc:ble configuration, but that is basically all... I do not have much knowledge in bluetooth, but definitely want to master it. When I'm pairing from my phone I see the device name in the list of scanned devices, so the device advertises some human readable string in data. Then I'm running "bt bnep0 scan start" -> "bt bnep0 scan stop" -> "bt bnep0 scan get" on my ESP32 and expecting to see some of the same human readable string in the printed output as I do not known the MAC address of my device, but there is not such data sequence in "bt bnep0 scan get" output. I would appreciate some guidance for the BLE dummy like me, so I can move forward a bit. Best regards, Petro