Reolink RLC-423 Doesn't Like Bogus Gateway for Scripts

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
835
Reaction score
1,767
Location
Palos Verdes
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:

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.

:idk:
 

mat200

IPCT Contributor
Joined
Jan 17, 2017
Messages
14,133
Reaction score
23,550
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:

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.

:idk:
Does reolink only accept 192.168.1.1 and other limited address ranges or lists for gateway ?
 

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
835
Reaction score
1,767
Location
Palos Verdes
Does reolink only accept 192.168.1.1 and other limited address ranges or lists for gateway ?
I'm pushing the addresses to it via a DHCP reservation. It will accept 192.168.1.254, because if I change the reservation to push that, reboot the camera, and the log into its web server, its Network configuration shows 192.168.1.254.
 
Last edited:
Top