-
Hello!
i am trying to start/stop the patrol via API. It was working some months ago, but now no more. Maybe you have changed something in the API? Currently I am using this (within a linux bash script):
# Get token
TOKEN=$(curl -H 'Content-Type: application/json' \
-X POST \
--data '[{"cmd":"Login","action":0,"param":{"User":{"userName":"Username","password":"Password"}}}]' \
"http://IP-address/cgi-bin/api.cgi?cmd=Login&token=null" \
| jq -r '.[0].value.Token.name')
# Start tour
curl -v -H 'Content-Type: application/json' \
-X POST \
--data '[{"cmd":"PtzCtrl","action":0,"param":{"channel":0,"op":"StartPatrol","id":0}}]' \
"http://IP-address/cgi-bin/api.cgi?cmd=PtzCtrl&token=$TOKEN"
Could you please give me some advise?
Many thanks for your kind assistance!Reply QuoteShare0- Share this Post
-
copy the link
Copied!
-
@das-dos_208145718501556 Try this without token and ensure https is enabled. None of my cameras have the patrol feature :(.
curl -s -k -X POST -H "Content-Type: application/json" -d "[{\"cmd\":\"PtzCtrl\",\"action\":0,\"param\":{\"channel\":0,\"op\":\"StartPatrol\",\"id\":0}}]" "https://192.168.1.X/cgi-bin/api.cgi?user=${username}&password=${passwd}" -
@joseph_1979
Thank you Joseph for your kind assistance. Unfortunately this is not working.
Maybe you or someone else has another idea? -
@das-dos_208145718501556 I replaced the '5' with '0'. Please insert your IP and credentials and try again. What is the error received? Ensure https is enabled. I tried the command on a non-patrolled PTZ camera and hereunder find the expected response. This is because parameter StartPatrol is not accepted on my camera.
-
@joseph_1979 Hi Joseph,
I changed your 4 to 0 before (and also tested 1) and used the code as follows:
#!/bin/bash
curl -s -k -X POST -H "Content-Type: application/json" -d "[{\"cmd\":\"PtzCtrl\",\"action\":0,\"param\":{\"channel\":0,\"op\":\"StartPatrol\",\"id\":0}}]" "https://$IP_adress_of_cam/cgi-bin/api.cgi?cmd=PtzCtrl&user=$XXX&password=$YYYY"
The script does not respond anything, it does not come back.
https is activated.
Any ideas? -
@das-dos_208145718501556 No response!! So command is not reaching the camera as otherwise there is a response. Can you please send the command directly rather than executing the script? Can you ping the camera?
Try this simple cmd to get the time
curl -s -k -X POST -H "Content-Type : application/json" -d "[{\"cmd\":\"GetTime\",\"action\":1}]" "https://camera_IP/cgi-bin/api.cgi?user=USER&password=PASSWORD" -
This post is deleted! -
Hi Joseph,
your time command is working. But your PTZ command not. The PTZ command is not giving any response at all.
So it´s not a connection issue. The connection is really good. I do not have any interruptions at all even in full HD stream.
Strange. I still think the cam does not understand all of the Reolink API command.Maybe because this RLC-823A 16X version is completely new or they changed the API.
Highly appreciated if you have further ideas which I could test. -
@das-dos_208145718501556 stupid mistake in writing at my end. Your PTZ code is running fine!
Sorry for wasting your time with my reply´s and many many thanks for your support! -
@das-dos_208145718501556 Ha ha ha............. it's normal. Sometimes a glass of wine and some nuts will help together with a good movie :).
Start/Stop patrol API issue on RLC-823A 16X
-
Hello!
i am trying to start/stop the patrol via API. It was working some months ago, but now no more. Maybe you have changed something in the API? Currently I am using this (within a linux bash script):
# Get token
TOKEN=$(curl -H 'Content-Type: application/json' \
-X POST \
--data '[{"cmd":"Login","action":0,"param":{"User":{"userName":"Username","password":"Password"}}}]' \
"http://IP-address/cgi-bin/api.cgi?cmd=Login&token=null" \
| jq -r '.[0].value.Token.name')
# Start tour
curl -v -H 'Content-Type: application/json' \
-X POST \
--data '[{"cmd":"PtzCtrl","action":0,"param":{"channel":0,"op":"StartPatrol","id":0}}]' \
"http://IP-address/cgi-bin/api.cgi?cmd=PtzCtrl&token=$TOKEN"
Could you please give me some advise?
Many thanks for your kind assistance!