1.點擊下列網址(line developers官網)https://developers.line.biz/zh-hant/
10.點擊Messaging API,按下最下方Channel access token內的issue,就會出現channel專屬的access token(紅色方框區域),python程式碼需要使用
1.點擊下列網址(line official account官網)https://tw.linebiz.com/
1.點擊下列網址(ngrok官網)https://ngrok.com/
tar zxvf FileName.tgz
ngrok http 5000
所有程式碼都在以下網址(即上方linebot資料夾)https://github.com/andy258741/IOT--Pet-Feeding-Machine/tree/main/line_bot
sudo apt-get line-bot-sdk
sudo apt-get install ssmtp mailutils
接著請按照下列網址設定ssmtp和gmail https://ithelp.ithome.com.tw/articles/10196110
備註:若按照網址中測試指令( echo "這是信件內容。" | ssmtp recipient@your.domain.com) 得到回應為ssmtp:(raspberrypi) 是正常的,因為ssmtp無法在buster底下使用。
若要測試請使用以下網址的程式碼並在python環境底下進行測試https://github.com/andy258741/IOT--Pet-Feeding-Machine/blob/main/mail_test.py
app.py:設定此python程式在(http://127.0.0.1:5000) 上運行
if __name__ == "__main__":
app.run(host='127.0.0.1', port=你想要的port號, debug=True)
line_bot_api = LineBotApi('your channel secret token')
handler = WebhookHandler('your channel secret')
備註:這四個.py檔需存放在同個目錄底下,範例是放在Desktop資料夾
cd Desktop
sudo python3 app.py
timethreading:https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/693491/
Picamera:https://projects.raspberrypi.org/en/projects/getting-started-with-picamera/0
紅外線感測器:http://hophd.com/raspberry-pi-sensor-infrared/
ngrok:https://noob.tw/ngrok/
tgz解壓縮:http://note.drx.tw/2008/04/command.html
時間加減:https://www.twblogs.net/a/5c9e9e3bbd9eee73ef4b66dc
smtp內容:https://forums.raspberrypi.com/viewtopic.php?t=263695
smtp設定:https://ithelp.ithome.com.tw/articles/10196110
傳送照片:https://www.itread01.com/content/1548600499.html
ssmtp測試:https://forums.raspberrypi.com/viewtopic.php?t=263695