Bluetooth Low Energy everywhere!

coding python ble bluetooth rasperry pi zero w

Written on October 4, 2019

Bluetooth device are very talkative in the street.

Here is some code and results of the noise in my street from cars, cars accessories, fitness tracker, bikes (rent), what else?

It is just crazy that so many devices broadcast so much through Bluetooth Low Energy!

Inspired by a thread on Hacker News: Retail stores use Bluetooth beacons to track customers.

4 millions recording later…

Raspberry pi zero W

Setup: database + raspberry pi zero W

T4 (PostgreSQL) β€” RPI0W

Bluepy

  • NOTE that LE scanning must be run as root. :warning:
  • and loop around…

References:

from bluepy.btle import Scanner, DefaultDelegate

class ScanDelegate(DefaultDelegate):
    def __init__(self):
        DefaultDelegate.__init__(self)

    def handleDiscovery(self, dev, isNewDev, isNewData):
        if isNewDev:
            print "Discovered device", dev.addr
        elif isNewData:
            print "Received new data from", dev.addr

scanner = Scanner().withDelegate(ScanDelegate())
devices = scanner.scan(10.0)

for dev in devices:
    print "Device %s (%s), RSSI=%d dB" % (dev.addr, dev.addrType, dev.rssi)
    for (adtype, desc, value) in dev.getScanData():
        print "  %s = %s" % (desc, value)

Code on GitHub

Coming soon

Some result

Name cloud

Name Cloud

Manufacturer cloud

Manufacturer Cloud

App screenshot

Screenshot

Next

(?)

Also, RF with TPMS



β—€ Welcome to Jekyll! β–  β–  β–  Xonsh the shell for XXIth century β–Ά


In the same category: