QBOAT SUNNY結合 GOOGLE SPEECH及 DIALOGFLOW 進行語音控制

三重教書匠
Join to follow...
Follow/Unfollow Writer: 三重教書匠
By following, you’ll receive notifications when this author publishes new articles.
Don't wait! Sign up to follow this writer.
WriterShelf is a privacy-oriented writing platform. Unleash the power of your voice. It's free!
Sign up. Join WriterShelf now! Already a member. Login to WriterShelf.
科技阿宅 作筆記
664   0  
·
2018/01/29
·
3 mins read


前言
一直以來都比較專注在控制與感測方面的開發,但是…只有工業跟野外會需要嗎?家庭不就是一個最好的物聯網應用場景嗎?想想看:有電器用品的開關、空氣品質偵測器、溫度計、空調…這些不就是最好發揮的材料了!於是呢,就想到乾脆把物聯網跟家庭看照的功能結合但是要很多人去找按鈕或面板按實在很不方便,既然QBoat Sunny就有Audio In/Out的功能,那乾脆做成語音遙控不就得了?所以就有了這次的大冒險啦~~

材料
QBoat Sunny
麥克風
擴音機
MediaTek LinkIt 7697兩個;一個做感測的範例,一個做控制的範例
DHT11溫溼度感測器
內附繼電器Relay的可控制電源插座
杜邦線

架構圖

注意上圖採用Container,是因為會用Ubuntu跑Python的程式,透過SpeechRecognition來錄音以及透過eSpeak播音;有興趣更了解Container和使用方法的,可以參考  如何使用軟體容器工作站

透過SpeechRecognition錄音成功後,會把錄音的結果上傳到Google的Speech to Text API取得繁體中文的純文字串,繁體中文的純文字串又會再被轉傳到DialogFlow這個線上服務進行自然語意的斷字,了解真實對於物聯網控制的項目以及含意,收到對於物聯網控制的項目以及含意之後,QBoat Sunny上用Node-red寫的QIoT Application再以MQTT通訊協定為基礎,自DHT11每兩秒定時取得溫溼度讀值,或者對指定的Topic張貼內容控制繼電器開或關。

※附帶說明:MQTT通訊協定可以想像成一份報紙,有體育、財經、生活…等各項標題內容,MQTT的node是透過預先設定要讀或寫的標題內容,對照著跟QBoat Sunny互動而已。MQTT node若是寫內容給QBoat Sunny叫做發行Publish,反之若是讀內容叫做訂閱Subscribe 

硬體線路部分

  

軟體部分

Linkit 7697:  

<< linkit7697_ino_code/MQTTRelay.ino >>

<< linkit7697_ino_code/ MQTTNode.ino >>

Node-red:

大概如下圖,可以下載這個檔案import到你的QIoT Suite Lite上

<<QIoT_export/MQTTHome.json>>

 

Python:

<< speak/mqtt.py >>

所有程式碼可參考: https://github.com/blackmesataiwan/qboat_voice_control

教學影片參考: 

 

結尾
QNAP真正想做的,其實就是要把AI應用開發在家庭看照上,讓生活更容易智慧化。藉由這次的實作我們指揭露了一小部分,接下來有機會,我們將透過QuAI來時做更多家庭看照上的應用。


WriterShelf™ is a unique multiple pen name blogging and forum platform. Protect relationships and your privacy. Take your writing in new directions. ** Join WriterShelf**
WriterShelf™ is an open writing platform. The views, information and opinions in this article are those of the author.


Article info

Categories:
Tags:
Total: 635 words


Share this article:



Join the discussion now!
Don't wait! Sign up to join the discussion.
WriterShelf is a privacy-oriented writing platform. Unleash the power of your voice. It's free!
Sign up. Join WriterShelf now! Already a member. Login to WriterShelf.