Trying to continuously list all bluetooth devices in range on a Raspberry Pi. I don't need to monitor any traffic, just list the devices. My hope is that I can get that information from the advertisement packets (frames?).
I did some experiments on Ubuntu 18.04 and was able to see those packets in Wireshark, but not until I had the system actively scan for bluetooth devices. Is there a way to just passively receive those advertisements, or to have the system continuously scan? I'd like to be able to trigger it from a shell script.
Ideally I'd have a shell script run tshark with the appropriate filters and get output including any devices advertising their presence. If there's some reason that won't work, I am game to write a custom program to do this.
I'm not really clear why the system is not receiving anything from bluetooth until I scan for devices, and if there's a way to enter this mode from a script. From there I guess the question is whether tshark can do what I need or if it will have to be a program.
All the bluetooth instructions I've found so far would have me using a GUI to start scanning. I haven't seen anything that tells me how to control this more directly.