Creating an Eddystone beacon?
Hi, i have sucessfully implemented an iBeacon using the 'bluetooth.set_advertisement' function with the proper manufacturer_data.
Now I would like to create an Eddystone beacon, but I am unable to determine the proper parameters.
Has anyone made an Eddystone beacon using a pycom module?
@b.veen Changing the firmware is not an option for me, considering how much maintenance is still done on it. E.g. continuous Bluetooth scanning (that I need in another project) is still unstable. The UUID insertion seems "magical", as the data is only partly available in the actual packet. I have a slew of dedicated beacons as part of my main offering CliqTags (I even sell beacons, not successfully though). What I'm experimenting with is making a remotely configurable beacon. Especially changing the URL for Eddystone would be interesting, so I've made a converter to the compressed URL format used by Eddystone. What remains is essentially pushing or pulling (more likely the latter, to avoid firewall issues) the URL.
For my purposes I do not need TLM so I did not try to get that working.
My solution was to change the bluetooth.setadvertisement function to include an extra option to enable/disable the TX and interval information.
I have got the UUID working by providing the full google eddystone UID as registered on the bluetooth website. This resulted in a 'Complete 16 bit service UUD list'.
The broadcasting of the URL is working too.
(Since this project I have bought a couple of commercial beacons, it was fun experimenting with the PyCom though).
@b.veen You don't have to advertise UID as well. TLM is practical though. I got it working too, but from where did you get the UUID?
I actually managed to get the 16 bit UUID in the frame by using the full 128-bit ID.
from network import Bluetooth
b = Bluetooth()
uuid = bytes([0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0xaa, 0xfe, 0x00, 0x00])
data = bytes([0xAA, 0xFE, 0x10, 0xF8, 0x00, ord('p'), ord('y'), ord('c'), ord('o'), ord('m'), ord('.'), ord('i'),ord('o')])
This seems to work to create an Eddystone URL frame.
But, to be Eddystone compliant you need an UID frame too.
The frame takes all 32 bytes, so there is no room for extra information.
The Pycom framework unfortunately adds TX power and beacon interval information. This is hardcoded in modbt.c
adv_data.set_scan_rsp = false;
adv_data.include_txpower = true,
adv_data.min_interval = 0x20;
adv_data.max_interval = 0x40;
Hi everybody, I have come a little step closer to my goal.
By using bluetooth.set_advertisement(service_data=bytes([0xAA, 0xFE,0x10,0xF8,0x00,ord('p'),ord('y'),ord('c'),ord('o'),ord('m'),ord('.'),ord('i'),ord('o')]))
the WiPy is simulating a 'Physical Web Beacon' with the Eddystone Url http://www.pycom.io
The framedata looks like this
LEN, TYPE, VALUE
2, 0x01, 0x06
2, 0x0A, 0xEB
5, 0x12, 0x20004000
14 ,0x16, 0xAAFE10F8007079636F6D2E696F
Question is: how to add the field 'Complete 16 bit service UUID list' containing the Eddystone uid (AAFE) ?
I would expect it should be possible to add this line to the raw data above.
LEN, TYPE, VALUE
0x03, 0x03, 0xAAFE
This post is deleted!