Tenvis TH671

Moderator: leecollings

Post Reply
User avatar
khel
Posts: 5
Joined: Friday 20 February 2015 21:13
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Portugal
Contact:

Tenvis TH671

Post by khel »

Hello,
Anyone able to configure these successfully with domoticz?

Have found this but none of the URLs work,
JPEG
http://[IPADDRESS]/snapshot.cgi?user=[USERNAME]&pwd=[PASSWORD]
JPEG
http://[IPADDRESS]/snapshot
MJPEG
http://[IPADDRESS]/videostream.cgi?user=[USERNAME]&pwd=[PASSWORD]&resolution=32
VLC
rtsp://[IPADDRESS]:554/nph-h264.cgi
VLC
rtsp://[IPADDRESS]:554/CAM_ID.[PASSWORD].mp2
VLC
rtsp://[IPADDRESS]:8001/0/av0
Any help very appreciated, thanks
User avatar
khel
Posts: 5
Joined: Friday 20 February 2015 21:13
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Portugal
Contact:

Re: Tenvis TH671

Post by khel »

After contactating tenvis support i got the following URL and are able to browse to it and get a snapshot,

http://1.1.1.1/web/snap.html?user=#USER ... =#PASSWORD

Where 1.1.1.1 is the camera IP.

But in domoticz this url does not work.
I have configured it the following way,
Name: Cam1
IP Address: 1.1.1.1 (camera lan IP)
Port: 80
Username: camera_username (replace by yours)
Password: camera_password (replace by yours)
ImageURL: http://1.1.1.1/web/snap.html?user=#USER ... =#PASSWORD

But no luck, any ideia what im missing?

Thanks again.
User avatar
khel
Posts: 5
Joined: Friday 20 February 2015 21:13
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Portugal
Contact:

Re: Tenvis TH671

Post by khel »

Opening a browser to,

http://1.1.1.1/web/snap.html

Works without authentication, any ideia whats missing in domoticz config to get this model to work?

Putting in ImageURL,
web/snap.html
/web/snap.html
/snap.html
snap.html

Does not get me anywhere

Note: Replace 1.1.1.1 with your IP address.

Thanks
User avatar
bizziebis
Posts: 182
Joined: Saturday 19 October 2013 14:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8805
Location: The Netherlands
Contact:

Re: Tenvis TH671

Post by bizziebis »

I also have a Tenvis HD camera. It doesn't have a motion jpeg stream or a snapshot stream.

The snapshot page you have will get a snapshot from a variable in javascript. This is only updated when you request the page. So it is useless for using in Domoticz.

I made a custom script which will retrieve the snapshot every second and save it as snapshot.jpg in domoticz. Still not useful for domoticz, but at least I can send a snapshot when the doorbell is pressed.
User avatar
khel
Posts: 5
Joined: Friday 20 February 2015 21:13
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Portugal
Contact:

Re: Tenvis TH671

Post by khel »

Hi,
Can you share that please?

Thanks
User avatar
bizziebis
Posts: 182
Joined: Saturday 19 October 2013 14:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8805
Location: The Netherlands
Contact:

Re: Tenvis TH671

Post by bizziebis »

Code: Select all

#!/bin/sh
ip_camera="10.0.0.253"

a=10
cd /tmp

while [ $a -ge 10 ]
do
        rm param.cgi?cmd=snap*
        wget http://$ip_camera/cgi-bin/hi3510/param.cgi?cmd=snap > /dev/null 2>&1
        output=$(cat param.cgi\?cmd\=snap | sed 's/.*"\(.*\)"[^"]*$/\1/') > /dev/null 2>&1
        wget -O camera.jpg http://$ip_camera$output > /dev/null 2>&1

        file=camera.jpg
        minimumsize=30000
        actualsize=$(wc -c "$file" | cut -f 1 -d ' ')
        if [ $actualsize -ge $minimumsize ]; then
                echo size is over $minimumsize bytes. Name: $output
                mv camera.jpg /home/pi/domoticz/www/snapshot.jpg
                sleep 0.6
        else
        echo "Connection to IP camera failed :("
        fi

done

I have this script running in the background. It's an infinite loop. Definitly no nice approach, but I'm not a programmer. Maybe there is a better way to do it.

You can use only this piece inside a script if you want to get a single snapshot:

Code: Select all

ip_camera="10.0.0.253"
wget http://$ip_camera/cgi-bin/hi3510/param.cgi?cmd=snap > /dev/null 2>&1
output=$(cat param.cgi\?cmd\=snap | sed 's/.*"\(.*\)"[^"]*$/\1/') > /dev/null 2>&1
wget -O camera.jpg http://$ip_camera$output > /dev/null 2>&1
rm param.cgi?cmd=snap*
fpatou
Posts: 16
Joined: Tuesday 03 November 2015 20:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Tenvis TH671

Post by fpatou »

Hello

with the same camera i made a custom configuration to be able to send a mail with a snapshot after a PIR motion detection :

pre requisits :
-mailutils + ssmtp : http://www.raspberry-projects.com/pi/so ... end-emails
-domticz
-PIR

I made a directory snap : /home/pi/snap

snaping.sh : to generate the snapshot image located in snap folder

Code: Select all

#!/bin/sh
#generate the dynamic snapshot path
curl http://ipcamera:port/cgi-bin/hi3510/param.cgi?cmd=snap -o /home/pi/snap/locate.txt
#change the file to be ok for Curl -K
sed -i 's/ var path=\"/url=\"http\:\/\/ipcamera:port/g' /home/pi/snap/locate.txt/locate.txt
#generate the dynamic snapshot image
curl -K /home/pi/snap/locate.txt -o /home/pi/snap/snapshot.jpg

exit 1
chmod 777 for snapsing.sh

Then
Lua device script : PIR_Notification send a mail if motion is detected

Code: Select all

commandArray = {}

 if (otherdevices['PIR'] == 'Motion') then
    os.execute('sudo /home/pi/snap/snaping.sh')
    os.execute('sudo /usr/bin/mailx -s Snapshot -A /home/pi/snap/snapshot.jpg [email protected]')
end

return commandArray
Et voila !
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest