This is interesting. I've been running this as my live BeeCam for years, including a custom "rotator" script I wrote based on this thread from IPCamTalk.
The script starts with a curl request to login and request a token:
which returns something like
A few days ago I was cleaning up my network, and realized that my DHCP reservations were handing out bogus gateway addresses to all of my cameras (to prevent "phoning home" to China or wherever), except for this one camera.
I changed its DHCP reservation to hand out a gateway address of 192.168.1.254 instead of 192.168.1.1 (the router), and BOOM my rotator script stopped working.
That curl command now returned:
The curl command is coming from a computer on the same subnet, so there should be no gateway involved in the communications, but it threw the error anyway.
But the bogus gateway did NOT affect Blue Iris's ability to pull the RTSP stream, nor the Reolink app's ability to log in and control the camera, nor a login to the camera's internal web server from that same computer running the curl command. It only broke my ability to curl for a token.
I restored the default gateway of 192.168.1.1 to the camera, and now my script works again.

The script starts with a curl request to login and request a token:
Code:
ReolinkToken=`curl -s GET "http://192.168.1.11/cgi-bin/api.cgi?cmd=Login&token=null" -d '[{"cmd":"Login","action":0,"param":{"User":{"userName":"admin","password":"Passw0rd!"}}}]' | jq -r '.[].value.Token.name'`
which returns something like
9a12b3edf210847
and then uses that token to sequence through my presets once per minute, in a loop:
Code:
curl -s POST "http://192.168.1.11/cgi-bin/api.cgi?cmd=PtzCtrl&token=$ReolinkToken" -d '[{"cmd":"PtzCtrl","action":0,"param":{"channel":0,"op":"ToPos","speed":32,"id":'$TheLoop'}}]'
A few days ago I was cleaning up my network, and realized that my DHCP reservations were handing out bogus gateway addresses to all of my cameras (to prevent "phoning home" to China or wherever), except for this one camera.
I changed its DHCP reservation to hand out a gateway address of 192.168.1.254 instead of 192.168.1.1 (the router), and BOOM my rotator script stopped working.
That curl command now returned:
Code:
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>
The curl command is coming from a computer on the same subnet, so there should be no gateway involved in the communications, but it threw the error anyway.
But the bogus gateway did NOT affect Blue Iris's ability to pull the RTSP stream, nor the Reolink app's ability to log in and control the camera, nor a login to the camera's internal web server from that same computer running the curl command. It only broke my ability to curl for a token.
I restored the default gateway of 192.168.1.1 to the camera, and now my script works again.
