M
@jcaron Hello I'm here again, I was trying solving it without disturbing you but I can't understand how it works.
I downloaded a few apps to advertise, but nothing solves my problem.
To understand it more, I thought start using another lopy4 as an advertiser. I used this code:
from network import Bluetooth
bluetooth = Bluetooth()
bluetooth.set_advertisement(name='LoPyNA', manufacturer_data="lopy_v1", service_uuid=b'1234567890123456')
def conn_cb (bt_o):
events = bt_o.events() # this method returns the flags and clears the internal registry
if events & Bluetooth.CLIENT_CONNECTED:
print("Client connected")
elif events & Bluetooth.CLIENT_DISCONNECTED:
print("Client disconnected")
bluetooth.callback(trigger=Bluetooth.CLIENT_CONNECTED | Bluetooth.CLIENT_DISCONNECTED, handler=conn_cb)
bluetooth.advertise(True)
Now I come back to my first lopy with the BLE scanner and this is what I obtain:
Mac: b'30aea474bc8e'.
Data: b'02010607094c6f50794e41020aeb05122000400002010608ff6c6f70795f7631110731323334353637383930313233343536000000000000000000000000'.
Adv name: LoPyNA.
Thus, my code is working fine because I can find BLE devices. But not good enough because it can't find my two cell phones or my computer (or if it does, I'm unable to recognize them).
Some suggestion or idea?
Thank you very much!