Page 1 of 1

problems with script rasp1b to rasp3 with stretch doorbel telegram

Posted: Saturday 21 April 2018 18:18
by BigDog
hi guys
when i was using the old rasp with linux whezzy all is good but when i use the script on my new rasp3 with stretch i dont work anymore :(
meby someone can help me with it

i run in in shell and is says this

Code: Select all

pi@raspberrypi:~/domoticz/scripts $ ./door.sh
{"ok":true,"result":{"message_id":2541,"from":{"id":xxxxxx,"is_bot":true,"first_name":"DomoticzDog","username":"Domoticzdog    bot"},"chat":{"id":-xxxxxxxxx,"title":"domoticz thuis","type":"group","all_members_are_administrators":true},"date":xxxxxxxx,    "text":"Er is zojuist aangebeld!"}}--2018-04-21 16:03:47--  http://127.0.0.1:8080/camsnapshot.jpg?idx=1
Verbinding maken met 127.0.0.1:8080... verbonden.
HTTP-verzoek is verzonden; wachten op antwoord... 200 OK
Lengte: 0 [image/jpeg]
Wordt opgeslagen als: ‘STDOUT’

-                                   [ <=>                                                  ]       0  --.-KB/s    in 0s

2018-04-21 16:03:47 (0,00 B/s) - geschreven naar standaarduitvoer [0/0]

{"ok":true,"result":{"message_id":XXXX,"from":{"id":XXXXX,"is_bot":true,"first_name":"DomoticzDog","username":"Domoticzdog    bot"},"chat":{"id":-XXXXXX,"title":"domoticz thuis","type":"group","all_members_are_administrators":true},"date":xxxxxxxxx,    "text":"Kijk wie er aangebeld heeft:"}}{"ok":false,"error_code":400,"description":"Bad Request: file must be non-empty"}
the script that i use and always had worked is below

Code: Select all

   #!/bin/sh
    #################################################################
    IP="192.168.178.13"                                     # IP address Camera
    ##########################################################
curl "https://api.telegram.org/botXXXXXXXXX:XXXXXXXXX/sendMessage?chat_id=-XXXXXXX&text=Er is zojuist $
    if ping -c 1 $IP > /dev/null ; then  # if IPCAM is online then:
       wget -O - http://127.0.0.1:8080/camsnapshot.jpg?idx=1 > /tmp/snapshot.jpg
curl "https://api.telegram.org/botXXXXX:XXXXX/sendMessage?chat_id=-XXXXXX&text=Kijk wie er aa$
     sleep 1
curl -s -X POST "https://api.telegram.org/botXXXXXX:XXXXXXX/sendPhoto" -F chat_id=-XXXXXXX -F pho$

       /bin/rm /tmp/snapshot.jpg
    else
curl "https://api.telegram.org/botXXXX:XXXXX/sendMessage?chat_id=-XXXXXX&text=IP-cam niet be$
    fi


Re: problems with script rasp1b to rasp3 with stretch doorbel telegram

Posted: Saturday 21 April 2018 18:53
by jvdz
Are you sure the CAM is defined in Domoticz running on that raspberry?
What happens when you use this url from your browser: http://domoticz-ip:8080/camsnapshot.jpg?idx=1 ?

Jos

Re: problems with script rasp1b to rasp3 with stretch doorbel telegram

Posted: Saturday 21 April 2018 18:58
by BigDog
that isnt working indeed when i put the info in it and press test then i see 1 second the camera feed and then nothing

the snapshot shows this

<img src="http://192.168.178.21:8080/camsnapshot.jpg?idx=1" alt="De afbeelding ‘http://192.168.178.21:8080/camsnapshot.jpg?idx=1’ kan niet worden weergegeven, omdat deze fouten bevat.">

Re: problems with script rasp1b to rasp3 with stretch doorbel telegram

Posted: Saturday 21 April 2018 19:02
by jvdz
What is the url in domoticz for this camera in the Setup/More Options/Cameras window when you hover the mouse of the "take snapshot" icon?
... and what happens when you click that?

Jos

Re: problems with script rasp1b to rasp3 with stretch doorbel telegram

Posted: Saturday 21 April 2018 19:26
by BigDog
the icon says the link

http://192.168.178.21:8080/camsnapshot.jpg?idx=1
is there maby a package missing ?
it looks like domoticz cant reed the feed correct
in jessy is worked ok