Fw: [問題] motion跟sh跟py還有telegram bot的問題
※ [本文轉錄自 Linux 看板 #1PccXbo1 ]
作者: smailzhu (Ka-ui) 看板: Linux
標題: [問題] motion跟sh跟py還有telegram bot的問題
時間: Mon Aug 21 12:58:09 2017
小弟我在Rpi上裝了
motion(搭配logetic C310)當監視系統
主要是照這篇做的
https://goo.gl/A8Phe1
(https://blog.gtwang.org/ 的網站)
在motion 的 on_picture_save 事件呼叫一個sh檔
#!/bin/bash
# 名稱:picture_save.sh
# 說明:將儲存的照片以 Email 發送
filename=$1
mpack -s "發現變動畫面" $filename <email address>
python send_pic_tel_bot.py $filename
send_pic_tel_bot.py
import telepot
import sys
# Connect to our bot
bot = telepot.Bot(token="****bot_botken****")
# Sets the id for the active chat
chat_id=*********
# Sends a message to the chat
bot.sendPhoto(chat_id=chat_id, photo=open(sys.argv[1], 'rb'))
如果我下指令./picture_safe.sh pic.jpg 或 python send_pic_tel_bot.py pic.jpg
telegram跟email都可以收到照片
可是透過motion來做就只有email會收到
請問各位前輩這是哪裡出問題了嗎
謝謝
--
███◣ ██◣ ███◣ ██◣ █◣ ███◣ █◣◥◣ █◣◥◣
████ ███◣ ████ ◥██ ██ ◥███ ██◣█ ██◣█
██▆▆ █▉▉▉ ██▆█ ◣ █ ███◣ ◣◢█◤ ████ ████
◥▆▆█ ◥▉◥▉ ◥█ █ ◥██ ◥███ ◥███ ◥█◣█ ◥██◤ ★
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▃▃▃▃▂▂▂▁▁
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 49.159.186.41
※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1503291493.A.C81.html
※ 發信站: 批踢踢實業坊(ptt.cc)
※ 轉錄者: smailzhu (223.137.37.141), 08/21/2017 15:49:52
Python 近期熱門文章
PTT數位生活區 即時熱門文章