Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

用Raspberry Pi做手機 - PiPhone

77,806 views

Published on

用Raspberry Pi做手機。
硬體包括Raspberry Pi Model B,Adafruit PiTFT 2.8" Touchscreen,EFCom Pro GPRS/GSM Module,鋰電池等。
軟體使用AT command和GSM模組溝通,Tkinter處理畫面,Xstroke與tegaki為手寫輸入。

Published in: Technology
  • Copas Url to Read PDF Format === http://letobodome.best/8576269589-Portugus-Para-Concursos-Teoria-e-900-Questes-Volume-1.html
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

用Raspberry Pi做手機 - PiPhone

  1. 1. Raspberry Pi好好玩 - PiPhone 台灣樹莓派 <sosorry@raspberrypi.com.tw> Sep 29, 2014/Raspberry Pi #7
  2. 2. 2 about台灣樹莓派 ● Element14指定台灣地區Raspberry Pi獨家經銷商 http://farnell.com/raspberrypi-consumer/approved-retailers.php?region=apac&MER=MER-LM-OB-RPICC-76315
  3. 3. about台灣樹莓派 ● 專注於Raspberry Pi應用與推廣 ● 舉辦Raspberry Pi社群聚會和工作坊 ● Facebook : ● 搜尋RaspberryPiTaiwan
  4. 4. 4 分享x社群 ● COSCUP, MakerConf講者 ● 投影片, http://www.slideshare.net/raspberrypi-tw/presentations ● 程式碼, https://github.com/raspberrypi-tw
  5. 5. PiPhone新聞 ● David Hunt用 Raspberry Pi,PiTFT和SIM900 GSM/GPRS 組合成一支手機 http://www.davidhunt.ie/piphone-a-raspberry-pi-based-smartphone/
  6. 6. ● Raspberry Pi Model B ● Adafruit PiTFT 2.8” Touchscreen ● SIM900 GSM/GPRS module ● 2000mAh LiPo battery ● DC-DC boost converter ● Cables, connectors, switch, etc. ● MIC and Speaker 所需硬體
  7. 7. 所需硬體
  8. 8. 完成圖
  9. 9. GSM通訊模組 ● EFCom Pro GPRS/GSM Module(AT commands) ● IO List: GND , +5V , RX , TX , PWR , RST. ● Quad-Band 850/ 900/ 1800/ 1900 MHz ● Power Supply: +5V http://goo.gl/7jCgpd
  10. 10. 顯示與觸控 ● Adafruit PiTFT 2.8” Touchscreen , 適合Model B https://www.adafruit.com/product/1601
  11. 11. 電源供應 ● 3.7V鋰聚合物(記得配充電器) ● 升壓模組可將3.7V電壓升到5V ● Input voltage: 3V - 35V ● Output voltage: 4 - 35V ● Output Current: 3A (MAX) http://www.elecfreaks.com/store/lm2596-dcdc-stepdown-module-bkdc010-p-292.html
  12. 12. ● 收發電話, 傳送簡訊, GSM/GPRS狀態 ● AT command ● 畫畫面, 互動介面 ● Tkinter ● 文字輸入 ● Xstroke, tegaki 所需軟體
  13. 13. AT Command ● Hayes command set, for Hayes Smartmodem (1981) ● Dialing, hanging up, and changing the parameters of the connection ● AT - "Attention" http://www.elecfreaks.com/wiki/index.php?title=EFCom_Pro_GPRS/GSM_Module
  14. 14. 如何溝通 ● Pi to Modem : 直接透過UART(TX/RX) ● PC to Modem : 或者用FT232(FTDI)轉接板 http://www.elecfreaks.com/wiki/index.php?title=EFCom_Pro_GPRS/GSM_Module
  15. 15. 終端機程式 ● putty, picocom, minicom ● sudo picocom /dev/ttyAMA0 -b 115200 -l
  16. 16. AT Command速成 ● 基礎類命令 ● 參數類命令 ● 擴展類命令 http://elecfreaks.com/store/download/datasheet/rf/SIM900/SIM900_AT%20Command%20Manual_V1.03.pdf
  17. 17. ● AT<X><n> ● 開啟命令回呼 – ATE1 ● 關閉命令回呼 – ATE0 基礎類命令
  18. 18. ● 範例:AT+CEER (錯誤報告) ● 測試命令 AT+<x>=? – AT+CEER=? ● 查詢命令 AT+<x>? – AT+CEER? ● 設定命令 AT+<x>=<y> – AT+CEER=0 ● 執行命令 AT+<x> – AT+CEER 擴展類命令
  19. 19. ● 寄簡訊 ● AT+CMGF=1 ● AT+CMGS=”0987654321” ● Ctrl + Z ● 撥電話 ● ATD0987654321; ● 掛電話 ● ATH ● 接電話 ● ATA AT Command範例
  20. 20. AT Command範例 ● AT+CSQ # 檢查目前GSM信號(Max 31.99) ● AT+CREG? # 查詢目前是否連上網路 ● AT+COPS? # 查詢目前連上的Operator ● AT+CLIP=1 # 顯示來電號碼 ● AT+GSN # 查詢IMEI ● AT+CMGF=1 # 選擇簡訊顯示為readable
  21. 21. TKinter ● Python binding to the Tk GUI toolkit ● Raspberry Pi內建Tkinter模組 ● Layout, widget and event http://oreilly.com/catalog/pythonwin32/chapter/ch20.html
  22. 22. MVC in Tkinter ● Model-View-Controller模式 ● View = UI畫面 ● Controller = 分派動作 ● Model = 實際AT command, 更新UI畫面 AT命令 UI畫面 分派動作 http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller
  23. 23. 接電話問題 ● 硬體是獨占資源 ● 如何在電話來時, 顯示畫面&來電號碼? ● 背景跑多執行緒監聽Serial port ● 來電時叫起UI並將號碼傳送過去
  24. 24. ● 沒有鍵盤輸入, 只能用觸控輸入 ● 螢幕這麼小(2.8”), 用虛擬鍵盤不適合 ● 用手寫輸入 傳送簡訊問題
  25. 25. Xstroke手寫輸入 ● Full-screen Gesture Recognition for X http://ozzmaker.com/2014/06/17/raspberry-pi-with-stroke-and-gesture-recognition/
  26. 26. tegaki手寫輸入 ● Open-Source Chinese and Japanese Handwriting Recognition http://tegaki.org/
  27. 27. DEMO
  28. 28. 打電話 - 查詢網路狀態/註冊資料
  29. 29. 打電話 - 帶起鍵盤UI
  30. 30. 打電話 - 撥通後顯示相關資訊
  31. 31. 接電話
  32. 32. 接電話 - 任何時候都會帶起來電畫面
  33. 33. 參考資料 ● http://www.davidhunt.ie/piphone-a-raspberry-pi-based- smartphone/ ● https://github.com/climberhunt/PiPhone
  34. 34. Raspberry Pi Rocks the World Thanks

×