SPOTLED Python Library
This allows you to control bluetooth led name badges which use the SPOTLED app. You can buy them here:
Disclaimer
Notice! This library is not affilated with the creator of this product.
If you brick your device (albeit unlikely) with this library, DO NOT BLAME ME!
Installation
You need python3-gattlib, which is installable on debian with:
sudo apt install python3-gattlib
Then install the package with:
sudo pip3 install spotled
Example usage
import spotled
sender = spotled.LedConnection('mac address of your device')
sender.set_screen_mode(spotled.ScreenMode.NORMAL)
sender.set_brightness(100)
sender.set_text('Hello world!')
sender.set_text(' Static', effect=spotled.Effect.NONE)
sender.set_text('Static Text!', effect=spotled.Effect.NONE, font="4x6")
sender.set_text_lines("You can show several pages of text!\nNewlines\nare allowed.")
sender.set_text_lines("A long time ago in a galaxy far, far away....", effect=spotled.Effect.SCROLL_UP)
sender.send_data(spotled.SendDataCommand(spotled.NumberBarData([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 11, 10, 9]).serialize()))
sender.send_data(
spotled.SendDataCommand(
spotled.AnimationData([
spotled.FrameData(48, 12, spotled.gen_bitmap(
'111111111111111111111111111111111111111111111111'
'1..............................................1'
'1..............................................1'
'1..............................................1'
'1..............................................1'
'1..............................................1'
'1..............................................1'
'1..............................................1'
'1..............................................1'
'1..............................................1'
'1..............................................1'
'111111111111111111111111111111111111111111111111'
))
], 0, 0, spotled.Effect.NONE).serialize()
)
)
See the example_monika.py
file for an example animation and example_pepsi.py
for an example
scrolling bitmap text display. You can replay existing payloads from Wireshark as well fairly
easily by using the SendDataCommand
and chopping off the header (first 15 bytes).
Fonts from this software are from https://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html and are public domain.
You can get more fonts here: https://github.com/robhagemans/hoard-of-bitfonts