Hi,
Is there an option to turn a Raspberry that is running Hass.io into an IBeacon? I had this setup when I was running Hassbian, and it made my location more accurate in combination with the IOS app.
If somebody could help, please!
Hi,
Is there an option to turn a Raspberry that is running Hass.io into an IBeacon? I had this setup when I was running Hassbian, and it made my location more accurate in combination with the IOS app.
If somebody could help, please!
I found this somewhere on the net, I haven’t tried it yet tho’…
Turning a Raspberry Pi 3 into an iBeacon
Wow, that was easy. Straight out of the box, you can turn your Raspberry Pi 3 into an iBeacon. All you need is Raspbian Jessie – it’s got hcitool installed.
Here’s how to do it. First, decide on your iBeacon UUID and major/minor. For instance, I picked at random:
UUID: c9407f30-f5f8-466e-aff9-25556b57fe6d
Major: 179
Minor: 3
Next, convert the UUID to 16 byte big-endian hex, and convert major/minor to 4 byte big-endian hex:
UUID: C9 40 7F 30 F5 F8 46 6E AF F9 25 55 6B 57 FE 6D
Major: 00 B3
Minor: 00 03
Plug those numbers into the magic command:
sudo hcitool cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 UUID Major Minor C8
For example:
sudo hcitool cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 C9 40 7F 30 F5 F8 46 6E AF F9 25 55 6B 57 FE 6D 00 B3 00 03 C8
Finally, turn advertising on with:
sudo hcitool cmd 0x08 0x000A 01
or turn it off with
sudo hcitool cmd 0x08 0x000A 00
That was too easy!
Incidentally, the 4C 00 is the magic bit that says it’s an Apple product, 02 means iBeacon, 15 is the (hex) length of the
remaining data. The trailing C8 is the two’s complement of the transmit power at 1m, so c8 is -56. More details can be found at:
https://stackoverflow.com/questions/18906988/what-is-the-ibeacon-bluetooth-profile.
I have no idea if it will work with has.io as I use the AIO installer.
Hi Keithhh666, thanks for your reaction. Hass.io is running on Resinos and not Raspbian. So I’m not sure this would work on Resinos. Also I have no experience with Resinos.
Me neither No experience of either ResinOS or Docker.
I’ve been using this script with not-very-satisfactory results to turn the Pi into an iBeacon:
Just to mention there’s nothing wrong with the script, just OwnTracks on iOS isn’t very reliable in that respect.