Couple issues with BLE sniffer on OS X

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
dancavallaro
 
Posts: 2
Joined: Fri Dec 16, 2022 1:20 pm

Couple issues with BLE sniffer on OS X

Post by dancavallaro »

I'm up and running now, but I ran into a couple issues getting my BLE sniffer working correctly on OS X and wanted to post here in case it helps anyone else.

The first issue was a bug in the nRF Sniffer Python code which someone else already reported at viewtopic.php?t=196495. It's an easy enough fix, but it's *very* difficult to debug in the first place (and I'm a software engineer, very comfortable with debugging) since the underlying error doesn't wind up in the log. Might be worth mentioning this in the tutorial, since it looks like it'll bite anyone who has a hyphen in the name of the device for their sniffer (which I *think* is always the case on OS X).

Once I fixed that, I was able to see BLE packets in Wireshark, but only advertising-related packets. I never saw any packets related to connecting or data exchange, and I did make sure to try many times to work around the issue described at https://learn.adafruit.com/introducing- ... aq-2317991. Very rarely I was able to see a single CONNECT_REQ or CONNECT_IND packet, but nothing beyond that. At first I was using 4.1.1 (latest version) of the Nordic software, then I tried downgrading to 4.0.0, but that didn't work either. As a last-ditch attempt before giving up I tried version 4.1.0, and that worked! I was finally able to follow a device through a connection and see data packets.

To be honest, I'm not 100% certain about my findings because the "channel hopping" limitation makes it very difficult to consistently reproduce tests, but I retried my tests many many times with the 4.1.1 and 4.0.0 software so I'm fairly sure my issue was with those versions rather than simply being random. If you've tried everything else, worth giving it a shot.

User avatar
mgtheone
 
Posts: 3
Joined: Mon Dec 12, 2022 9:56 am

Re: Couple issues with BLE sniffer on OS X

Post by mgtheone »

Thank you!
Last week I had trouble getting any reading from the sniffer and that's when I've encountered viewtopic.php?t=196495. Few days have passed and I've experienced what you have noted being able to sniff only advertisements.
Weirdly enough, trying to downgrade while following your advice I've mistakenly downloaded 4.0.0 instead of 4.1.0 and it seems like the issue resolved.
Admittedly, I have yet to fully tested if 4.0.0 works for me. But from a simple test it does seems to be able to sniff packets between my phone and an ESP32 running a UART basic example which is far better than anything else I've got so far.

It's been a frustrating ride, but it seems like I'm finally headed in the right direction.

User avatar
dancavallaro
 
Posts: 2
Joined: Fri Dec 16, 2022 1:20 pm

Re: Couple issues with BLE sniffer on OS X

Post by dancavallaro »

mgtheone wrote: Wed Dec 21, 2022 6:00 am ...
Weirdly enough, trying to downgrade while following your advice I've mistakenly downloaded 4.0.0 instead of 4.1.0 and it seems like the issue resolved.
...
Interesting! When I finally got it working on 4.1.0, I did have to retry my test many times before finally successfully following a connection, so I can't really definitively say that version 4.0.0 didn't work. I tried my test a bunch of times on version 4.0.0 too, but the success rate seemed so low even on 4.1.0 that it's hard to draw any clear conclusions.

User avatar
mgtheone
 
Posts: 3
Joined: Mon Dec 12, 2022 9:56 am

Re: Couple issues with BLE sniffer on OS X

Post by mgtheone »

Yesterday after my slight optimism, I've got to try and sniff the actual device I'm working on.
Without really thinking I've just started Wireshark and surprisingly first try and I could see data transfer between the device and my phone!
Sadly it seems like I've been struck with luck as later I tried sniffing again and I couldn't even though I tried like 50 other times.
After already giving up and leaving it to rest for about 10 minutes I've decided to try for the final time and it worked again! Being so excited and anxious that it finally works I've done about a third of the sniffs I need. worried something will crash I decided to save the log file to make sure I'll have something to work with. Of course, trying to resniff the other two thirds I needed it couldn't follow a connection.

There's something to be said about the fact the device I'm sniffing doesn't pair (at least the traditional way via the android settings) and instead the dedicated app controls the connection. Truthfully I don't quite understand Bluetooth communication yet and it definitely doesn't help.

I'm truly loss on how should I use the sniffer, whenever it does work it is so helpful but making it work is almost impossible. I'm starting to regret trying to save the shipping fee from digykey on Nordic's nRF52840 Dongle.

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

Return to “Wireless: WiFi and Bluetooth”