Last active
January 8, 2017 07:29
-
-
Save hidenorly/aa5459248ac7bb01bab97fea0538cd80 to your computer and use it in GitHub Desktop.
Bluetooth LE (BLE) SATECHI LED電球 を Raspberry Pi3 から 制御 ref: http://qiita.com/hidenorly/items/757ce2d949846e035bc2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo rfkill unblock bluetooth | |
$ sudo hciconfig hci0 up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo hcitool lescan | |
LE Scan ... | |
D0:5F:B8:XX:XX:XX SATECHILED-0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./bleBulbDriver.rb on -b D0:5F:B8:XX:XX:XX | |
$ ./bleBulbDriver.rb off -b D0:5F:B8:XX:XX:XX | |
$ ./bleBulbDriver.rb toggle -b D0:5F:B8:XX:XX:XX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo gatttool --device D0:5F:B8:XX:XX:XX --primary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo gatttool --device D0:5F:B8:XX:XX:XX --char-desc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo gatttool --device D0:5F:B8:XX:XX:XX --char-desc | grep fff3 | |
handle = 0x002b, uuid = 0000fff3-0000-1000-8000-00805f9b34fb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gatttool --device=D0:5F:B8:XX:XX:XX --char-write-req --handle=0x002b --value=0f0d0300ffffffc800c800c8000059ffff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gatttool --device=D0:5F:B8:2F:AA:EC --char-write-req --handle=0x002b --value=0f0d0300ffffff0000c800c8000091ffff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./bleBulbDriver.rb | |
Usage: listDevices|on|off|allOn|allOff | |
bleBulbDriver Copyright 2016 hidenorly | |
-b, --target= Set target device's mac address | |
-t, --type= Set device type (default:SATECHILED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo ./bleBulbDriver.rb listdevices | |
D0:5F:B8:XX:XX:XX SATECHILED-0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo ./bleBulbDriver.rb allon | |
$ sudo ./bleBulbDriver.rb alloff | |
$ sudo ./bleBulbDriver.rb alltoggle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment