這張圖找好久, 果然還是有好心人畫, 感謝
reference: https://hughchao.hackpad.com/ep/pad/static/wrP2bgGpbe5
2016年11月17日 星期四
2016年11月14日 星期一
[阿宅專區] 藍牙歷史
一些藍牙歷史名詞可參考
藍牙
Bluetooth
* Bluetooth Versions Walkthrough, and Bluetooth 4.0 Low Energy Development Resources
藍芽藍牙傻傻分不清楚
藍牙新標誌,smart & smart ready
* 藍牙協議分析(1)_基本概念
* 藍牙協議分析(2)_協議架構
* 藍牙協議分析(3)_藍牙低功耗(BLE)協議棧介紹
http://www.wowotech.net/sort/bluetooth
值得一讀與分享的BT 4.0 (BLE)低功耗藍芽介紹
* Bluetooth - How it works
* Bluetooth Basics
* Connectivity of the Internet of Things
3
蓝牙3.0
藍牙多模應用與認證規範面面觀
4.1
解析如何選擇藍牙4.1和藍牙4.0?
瞄準物聯網應用 藍牙4.1版功能全面升級
藍牙4.1深入詳解:其實並不遙遠
4.2
Bluetooth LE 4.0 / 4.1 / 4.2 新增功能簡介
BLE
* Introduction to Bluetooth Low Energy (Adafruit)
Bluetooth Low Energy (BLE) 是什麼?
科普
[置頂] 享受藍牙(一): 開始享受
分析封包
假日藍芽工程師, 先動起來再說
hcitool and gatttool example
藍牙
Bluetooth
* Bluetooth Versions Walkthrough, and Bluetooth 4.0 Low Energy Development Resources
藍芽藍牙傻傻分不清楚
藍牙新標誌,smart & smart ready
* 藍牙協議分析(1)_基本概念
* 藍牙協議分析(2)_協議架構
* 藍牙協議分析(3)_藍牙低功耗(BLE)協議棧介紹
http://www.wowotech.net/sort/bluetooth
值得一讀與分享的BT 4.0 (BLE)低功耗藍芽介紹
* Bluetooth - How it works
* Bluetooth Basics
* Connectivity of the Internet of Things
3
蓝牙3.0
藍牙多模應用與認證規範面面觀
4.1
解析如何選擇藍牙4.1和藍牙4.0?
瞄準物聯網應用 藍牙4.1版功能全面升級
藍牙4.1深入詳解:其實並不遙遠
4.2
Bluetooth LE 4.0 / 4.1 / 4.2 新增功能簡介
BLE
* Introduction to Bluetooth Low Energy (Adafruit)
Bluetooth Low Energy (BLE) 是什麼?
科普
[置頂] 享受藍牙(一): 開始享受
分析封包
假日藍芽工程師, 先動起來再說
hcitool and gatttool example
2016年11月12日 星期六
[RPi] Raspberry Pi 3 Bluetooth Beacon
兩行就可以了
欄位的意義可參考這篇
http://blog.itist.tw/2014/05/ibeacon.html
這篇的欄位更清楚
https://hackaday.io/project/10314-raspberry-pi-3-as-an-eddystone-url-beacon
使用 physical web, iOS 讀取 notification 沒問題, 但 Android 反而讀不到, 可以參考這篇的作法(雖然目前還是沒收到...)
https://community.estimote.com/hc/en-us/articles/218451777-How-to-enable-Physical-Web-in-Chrome-
這篇是 Pi 3 + Android(Node.js) 的應用
https://www.hackster.io/inmyorbit/build-a-mobile-app-that-connects-to-your-rpi-3-using-ble-7a7c2c
實做 physical web(eddystone-url) 的套件
Node.js: https://github.com/don/node-eddystone-beacon
Python: https://github.com/google/eddystone/tree/master/eddystone-url/implementations/PyBeacon
sudo hciconfig hci0 leadv 3 sudo hcitool -i hci0 cmd 0x08 0x0008 18 02 01 06 03 03 aa fe 10 16 aa fe 10 00 00 65 64 75 70 6f 6c 69 2e 66 69 00 00 00 00 00 00 00
欄位的意義可參考這篇
http://blog.itist.tw/2014/05/ibeacon.html
這篇的欄位更清楚
https://hackaday.io/project/10314-raspberry-pi-3-as-an-eddystone-url-beacon
使用 physical web, iOS 讀取 notification 沒問題, 但 Android 反而讀不到, 可以參考這篇的作法(雖然目前還是沒收到...)
https://community.estimote.com/hc/en-us/articles/218451777-How-to-enable-Physical-Web-in-Chrome-
這篇是 Pi 3 + Android(Node.js) 的應用
https://www.hackster.io/inmyorbit/build-a-mobile-app-that-connects-to-your-rpi-3-using-ble-7a7c2c
實做 physical web(eddystone-url) 的套件
Node.js: https://github.com/don/node-eddystone-beacon
Python: https://github.com/google/eddystone/tree/master/eddystone-url/implementations/PyBeacon
2016年11月8日 星期二
2016年11月6日 星期日
[Android] AndroidScreencast
因為 ubuntu 版本是 10.04 LTS 太舊了, 所以一堆問題要解決
要把 Android 的畫面打到 ubuntu 應該要有一堆方法, 記得之前用 Droid@Screen, 可是現在不知道怎麼了不能用
後來又看到 AndroidScreencast, 雖然感覺有點慢也將就著用吧
$ git clone https://github.com/xSAVIKx/AndroidScreencast
$ cd AndroidScreencast
$ mvn package
馬上報錯, 因為沒有裝 maven
$ sudo apt-get install maven2
結果軟體最低限制 Java 7 and Maven 3.2.5, 只好想辦法裝 maven3
因為沒有 apt, 只好抓 binary, 參考這篇文章, 可是現在只剩下 maven-3.2.2, 就加減用吧
再來是修改環境變數 JAVA_HOME, M2_HOME, MAVEN_HOME, M2 一堆
修改完還要把 maven2 移除掉才行
$ sudo apt-get autoremove maven2
確認版本
$ mvn -v
Apache Maven 3.2.2
終於可以編譯了
$ mvn package
編譯完成後執行發現又錯, 錯誤訊息在 app.properties, 要把
最後終於可以執行了
$ java -jar target/androidscreencast-0.0.7s-executable.jar
唉, 舊版本就是該死
要把 Android 的畫面打到 ubuntu 應該要有一堆方法, 記得之前用 Droid@Screen, 可是現在不知道怎麼了不能用
後來又看到 AndroidScreencast, 雖然感覺有點慢也將就著用吧
$ git clone https://github.com/xSAVIKx/AndroidScreencast
$ cd AndroidScreencast
$ mvn package
馬上報錯, 因為沒有裝 maven
$ sudo apt-get install maven2
結果軟體最低限制 Java 7 and Maven 3.2.5, 只好想辦法裝 maven3
因為沒有 apt, 只好抓 binary, 參考這篇文章, 可是現在只剩下 maven-3.2.2, 就加減用吧
再來是修改環境變數 JAVA_HOME, M2_HOME, MAVEN_HOME, M2 一堆
修改完還要把 maven2 移除掉才行
$ sudo apt-get autoremove maven2
確認版本
$ mvn -v
Apache Maven 3.2.2
終於可以編譯了
$ mvn package
編譯完成後執行發現又錯, 錯誤訊息在 app.properties, 要把
adb.path=adb.exe改為
adb.path=adb記得 adb 也要 export 到環境變數, 我是用鳥鳥的 appinventor 帶的 adb
最後終於可以執行了
$ java -jar target/androidscreencast-0.0.7s-executable.jar
唉, 舊版本就是該死
[RPi] 藍牙通訊
硬體:Pi 3
軟體:2016-05
Android 手機安裝 BlueTerm, 原始碼
修改 /etc/systemd/system/dbus-org.bluez.service, 將
$ sudo systemctl daemon-reload
Pi 3 藍牙設定
$ sudo bluetoothctl
[bluetoothctl] power on
[bluetoothctl] scan on
[bluetoothctl] agent on
[bluetoothctl] pair MAC_ADDRESS
[bluetoothctl] trust MAC_ADDRESS
[bluetoothctl] exit
sudo rfcomm bind 0 MAC_ADDRESS
Pi 3 程式碼:
reference:
* An Introduction to Bluetooth Programming
* Using smart phone (Android) to control LED on Raspberry Pi 3 through Bluetooth connection
如果透過 App Inventor 寫 Android 端程式, 可以參考這篇文章
http://howtomechatronics.com/tutorials/arduino/how-to-build-custom-android-app-for-your-arduino-project-using-mit-app-inventor/
目前還沒搞定, 之後會再打通這邊...
列出有用到的 PORT
軟體:2016-05
Android 手機安裝 BlueTerm, 原始碼
修改 /etc/systemd/system/dbus-org.bluez.service, 將
ExecStart=/usr/lib/bluetooth/bluetoothd改為
ExecStart=/usr/lib/bluetooth/bluetoothd --compat重新載入設定檔
$ sudo systemctl daemon-reload
Pi 3 藍牙設定
$ sudo bluetoothctl
[bluetoothctl] power on
[bluetoothctl] scan on
[bluetoothctl] agent on
[bluetoothctl] pair MAC_ADDRESS
[bluetoothctl] trust MAC_ADDRESS
[bluetoothctl] exit
sudo rfcomm bind 0 MAC_ADDRESS
Pi 3 程式碼:
#!/usr/bin/python
import bluetooth
import thread
import time
server_sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )
port = 1
server_sock.bind(("",port))
server_sock.listen(1)
client_sock,address = server_sock.accept()
print "Accepted connection from ", address
def receive_thread():
while True:
try:
data = client_sock.recv(1024)
print "received [%s]" % data
except:
print "SerialException: "
time.sleep(0.1)
thread.start_new_thread(receive_thread, ())
while True:
s = raw_input("RPi] ")
client_sock.send(s)
client_sock.close()
server_sock.close()
reference:
* An Introduction to Bluetooth Programming
* Using smart phone (Android) to control LED on Raspberry Pi 3 through Bluetooth connection
如果透過 App Inventor 寫 Android 端程式, 可以參考這篇文章
http://howtomechatronics.com/tutorials/arduino/how-to-build-custom-android-app-for-your-arduino-project-using-mit-app-inventor/
目前還沒搞定, 之後會再打通這邊...
列出有用到的 PORT
import serial.tools.list_ports
ports = list(serial.tools.list_ports.comports())
for p in ports:
print p
訂閱:
文章 (Atom)

