[問題] motion跟sh跟py還有telegram bot的問題

看板Linux作者 (Ka-ui)時間6年前 (2017/08/21 12:58), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/1
小弟我在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.htmlsmailzhu:轉錄至看板 Python 08/21 15:49

08/23 02:16, , 1F
自問自答:把py的路徑改成絕對路徑就可以了
08/23 02:16, 1F

08/25 07:25, , 2F
個人是用Line bot,每2秒掃一次motion儲存的資料夾,當有
08/25 07:25, 2F

08/25 07:25, , 3F
新檔案出現就發送最新的圖檔到聊天室
08/25 07:25, 3F
文章代碼(AID): #1PccXbo1 (Linux)