SiPy Bluetooth



  • My program isn't finding my phone (which has its bluetooth visible to all). Is there a certain time I need to scan for, currently I scan for 10 seconds.

    Program:

    from network import Bluetooth
    bluetooth = Bluetooth()
    
    bluetooth.start_scan(10)
    while bluetooth.isscanning():
        adv = bluetooth.get_adv()
        if adv:
            print(adv)
        else:
            print("NONE")


  • @jmarcelino is there any way to configure this? Any libraries or plug ins for the board's BT sensor I could use?



  • @sk
    If your phone isn't advertising (as a BLE peripheral) then the SiPy will have no knowledge of it.



  • @jmarcelino is there any way to see a list of devices that SiPy has found whether or not it is advertising? Bluetooth must do an initial acknowledgement of some sort with other bluetooth devices, right? Is there a way to see the devices they acknowledge?



  • @jmarcelino Thank you.
    I understand the problem now. I just wanted SiPy to act as a sniffer for cellphones with their bluetooth or wifi/hotspot on.



  • The only way for your phone to appear in the scan is to turn it into a Bluetooth LE (BLE) peripheral device, for example by running some app that puts it into that mode.

    Phones are normally BLE central, so they don't advertise on BLE - they only scan for peripherals much like you're doing.

    (You may be be thinking of Bluetooth Classic, which is different)


 

Pycom on Twitter