Bluetooth scan cannot find device



  • Hello guys

    I have some troubles with my pycom WiPy 2.0 and a Bluetooth device (EMBC02). If I scan with my WiPy, it doesn’t find the EMBC02. Other device does it find very well.
    If I scan with my Smartphone (Samsung Galaxy S7), it does find the EMBC02.

    Has anyone an idea why I can’t see the EMBC02 with my WiPy?

    I use follow code(from pycom docs):
    from network import Bluetooth
    bluetooth = Bluetooth()
    bluetooth.start_scan(-1) # start scanning with no timeout
    while True:
    print(bluetooth.get_adv())

    The Datasheet from EMBC02:
    Datasheet

    Thank you, for your help!



  • @Arthur

    I did a scan with an Ubertooth One laying around, just to confirm that my embc02 is working and to trace the exact content of its advertisements (hope will be useful for someone).

    systime=1503417955 freq=2402 addr=8e89bed6 delta_t=1008.339 ms rssi=-39
    02 25 b4 46 0b ee f3 0c 0f 09 45 4d 42 65 61 63 6f 6e 31 38 30 39 31 00 0e ff 5a 00 bf f8 30 32 29 00 07 d2 e1 c0 01 23 21 3f 
    Advertising / AA 8e89bed6 (valid)/ 37 bytes
        Channel Index: 37
        Type:  ADV_NONCONN_IND
        AdvA:  0c:f3:ee:0b:46:b4 (public)
        AdvData: 0f 09 45 4d 42 65 61 63 6f 6e 31 38 30 39 31 00 0e ff 5a 00 bf f8 30 32 29 00 07 d2 e1 c0 01
            Type 09 (Complete Local Name)
               EMBeacon18091.
            Type ff (Manufacturer Specific Data)
               Company: EM Microelectronic-Marin SA
               Data: bf f8 30 32 29 00 07 d2 e1 c0 01
    
        Data:  b4 46 0b ee f3 0c 0f 09 45 4d 42 65 61 63 6f 6e 31 38 30 39 31 00 0e ff 5a 00 bf f8 30 32 29 00 07 d2 e1 c0 01
        CRC:   23 21 3f
    
    systime=1503417956 freq=2402 addr=8e89bed6 delta_t=1002.886 ms rssi=-40
    02 25 b4 46 0b ee f3 0c 0f 09 45 4d 42 65 61 63 6f 6e 31 38 30 39 31 00 0e ff 5a 00 bf f8 30 32 29 00 07 d2 e2 c0 01 d1 91 99 
    Advertising / AA 8e89bed6 (valid)/ 37 bytes
        Channel Index: 37
        Type:  ADV_NONCONN_IND
        AdvA:  0c:f3:ee:0b:46:b4 (public)
        AdvData: 0f 09 45 4d 42 65 61 63 6f 6e 31 38 30 39 31 00 0e ff 5a 00 bf f8 30 32 29 00 07 d2 e2 c0 01
            Type 09 (Complete Local Name)
               EMBeacon18091.
            Type ff (Manufacturer Specific Data)
               Company: EM Microelectronic-Marin SA
               Data: bf f8 30 32 29 00 07 d2 e2 c0 01
    
        Data:  b4 46 0b ee f3 0c 0f 09 45 4d 42 65 61 63 6f 6e 31 38 30 39 31 00 0e ff 5a 00 bf f8 30 32 29 00 07 d2 e2 c0 01
        CRC:   d1 91 99
    
    systime=1503417957 freq=2402 addr=8e89bed6 delta_t=1002.474 ms rssi=-40
    02 25 b4 46 0b ee f3 0c 0f 09 45 4d 42 65 61 63 6f 6e 31 38 30 39 31 00 0e ff 5a 00 bf f8 30 32 29 00 07 d2 e3 c0 01 80 41 68 
    Advertising / AA 8e89bed6 (valid)/ 37 bytes
        Channel Index: 37
        Type:  ADV_NONCONN_IND
        AdvA:  0c:f3:ee:0b:46:b4 (public)
        AdvData: 0f 09 45 4d 42 65 61 63 6f 6e 31 38 30 39 31 00 0e ff 5a 00 bf f8 30 32 29 00 07 d2 e3 c0 01
            Type 09 (Complete Local Name)
               EMBeacon18091.
            Type ff (Manufacturer Specific Data)
               Company: EM Microelectronic-Marin SA
               Data: bf f8 30 32 29 00 07 d2 e3 c0 01
    
        Data:  b4 46 0b ee f3 0c 0f 09 45 4d 42 65 61 63 6f 6e 31 38 30 39 31 00 0e ff 5a 00 bf f8 30 32 29 00 07 d2 e3 c0 01
        CRC:   80 41 68
    

    Logged in GitHub as https://github.com/pycom/pycom-micropython-sigfox/issues/54



  • @Arthur
    I got a dev kit this morning and did some test.
    These beacons are pre-programmed with a three modes state machine, and you can iterate through modes with a short press of the button.

    Mode 1: advertise every second forever (but it's not a standard beacon advertisement, see update below)
    Mode 2: advertise every 100 ms for 60 seconds after movement
    Mode 3: advertise every 100 ms for 10 minutes after fall detection

    In first mode, it takes time to recognize a beacon advertising every 1 second, but eventually WiPy catches it.
    In second mode, WiPy gets adverts more quickly, because the beacon is transmitting 10x times faster than mode 1, but after 60 seconds it stops advertising by design. Are these the 60 seconds of visibility you are referring to ? If yes, it's ok.

    UPDATE:
    In mode 1 WiPy detects adverts very rarely. It's not a standard beacon advert (it's lacking major and minor).

    WiPy gets it one time in 5 minutes (if you are lucky). Why ?

    Claudio



  • Thanks @Arthur
    Hell :) I am waiting for some EMBC02 myself, and I hoped that the issue was solved.
    Anyway BLE is better, but not totally reliable (yet), from what I see.

    Claudio



  • Hi @duffo64

    Yes, the update was helpful! But only for the other devices (Smartphone, ...)- works much better now.
    With the EMBC02 I have still some problems, I find them only all 60 seconds…

    Follow link you will find the logfile and the new BLE code:
    Code and Log

    Arthur



  • Hi @Arthur

    Did you try with the just released version to see if EM beacons are detected now ?

    Claudio



  • @littlebat Interesting. We cant apply that on a WiPy by ourself, can we?





  • @littlebat Do you have the Changefile for said update? Would be quite interesting to see this.

    Sometimes there is also a problem that the WiPy 2.0 can't find any BLE device, which is quite Strange.



  • There are some recent bugfixes in esp32 SDK which may solve this, I don't think pycom has applied them yet



  • Hi @bucknall

    Thank you, for your support!

    Scanned three different Bluetooth devices:

    • EMBC02 (didn’t work)
    • ESTIMOTE (worked)
    • Notebook (worked)

    With the EMBC02 I received nothing, it looked like this:
    PYB: soft reboot
    None
    None
    None
    None
    None
    None
    None
    None
    None

    With the ESTIMODE and Notebook I received something, it looked like this:
    PYB: soft reboot
    (mac=b'\xcb\xdf\xf2E\xe9\xf9', addr_type=1, adv_type=0, rssi=-37, data=b'\x02\x01\x06\x1a\xffL\x00\x02\x15\xb9@\x7f0\xf5\xf8Fn\xaf\xf9%UkW\xfem\xe9\xf9\xf2E\xc4\x00')
    None
    None
    None
    (mac=b'\xcb\xdf\xf2E\xe9\xf9', addr_type=1, adv_type=0, rssi=-38, data=b'\x02\x01\x06\x1a\xffL\x00\x02\x15\xb9@\x7f0\xf5\xf8Fn\xaf\xf9%UkW\xfem\xe9\xf9\xf2E\xc4\x00')
    None

    I scanned 20 seconds, multiple times, the result was always the same.
    I uploaded the complete scan and screenshots from my smartphone (which did find all Bluetooth device):
    Link

    I hope you can help me to find a solution of my problem.



  • @Arthur Can you please provide the output of the REPL console when you run this code? It might not list the exact name of your device, it might be slightly different.

    Thanks!



  • Hi bucknall
    Yes, I worked with the newest version. I had also tested with different WiPy.

    Edit:
    To verification:
    os.uname()
    (sysname='WiPy', nodename='WiPy', release='1.7.8.b1', version='v1.8.6-724-g2b9ed601 on 2017-07-28', machine='WiPy with ESP32')



  • Hi @Arthur,

    Have you updated your device to the latest firmware? It should be version v1.7.8.b1

    Thanks,

    Alex



Pycom on Twitter