Advertisement
metalx1000

Controlling Bluetooth LED Strip from Shell

Jan 6th, 2025
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.11 KB | None | 0 0
  1. # control Cheap Bluetooth LED Stip
  2. # from Linux without App
  3. # based on instructions found at
  4. # https://linuxthings.co.uk/blog/control-an-elk-bledom-bluetooth-led-strip
  5.  
  6. sudo apt install python3-gattlib
  7.  
  8. # scan to get bluetooth Device's Address
  9. sudo hcitool lescan
  10.  
  11. #mine is BE:58:94:03:02:0B
  12.  
  13. gatttool -b BE:58:50:00:54:15 --char-write-req -a 0x0009 -n 7e0004f00001ff00ef # POWER ON
  14. gatttool -b BE:58:50:00:54:15 --char-write-req -a 0x0009 -n 7e000503ff000000ef # RED
  15. gatttool -b BE:58:50:00:54:15 --char-write-req -a 0x0009 -n 7e0005030000ff00ef # BLUE
  16. gatttool -b BE:58:50:00:54:15 --char-write-req -a 0x0009 -n 7e00050300ff0000ef # GREEN
  17. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e000503ff550000ef # YELLOW
  18. gatttool -b BE:58:50:00:54:15 --char-write-req -a 0x0009 -n 7e0004000000ff00ef # POWER OFF
  19.  
  20. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e000503FFFFFF00ef # White
  21. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e000503FF000000ef # Red
  22. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e00050300FF0000ef # Lime
  23. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e0005030000FF00ef # Blue
  24. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e000503FFFF0000ef # Yellow
  25. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e00050300FFFF00ef # Cyan
  26. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e000503FF00FF00ef # Magenta
  27. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e000503C0C0C000ef # Silver
  28. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e00050380808000ef # Gray
  29. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e00050380000000ef # Maroon
  30. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e00050380800000ef # Olive
  31. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e00050300800000ef # Green
  32. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e00050380008000ef # Purple
  33. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e00050300808000ef # Teal
  34. gatttool -b BE:58:94:03:02:0B --char-write-req -a 0x0009 -n 7e00050300008000ef # Navy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement