Wyze Cam on public Wifi - How to avoid a timeout?

I wanted to connect a v2 cam to a public wifi service in a location a few miles from me. The service has a login portal page which the cam can’t deal with, so i picked up a mini travel router as recommended here on the Wyze forums. (Excellent and cheap bit of kit btw, i also recommend it) and followed the wyze instructions.

This allowed me to get past the portal page and keep the cam connected to the public wifi, hooray! I connected it at about 21:00 last night and it was working fine until at least 05:00, but then around 12 hours later when I went to check it was still working the cam was offline, damn. So i came back to the location just now to find that it was the router that had dropped its connection to the public wifi, so I presume there’s a timeout for connected devices.

Any idea how to get round a timeout like that and keep everything connected?

Can you tell if it was the router that dropped the connection, or if the service provider initiated the termination? The public WiFi service might have kicked it off due to the long duration connection, or perhaps due to excessive ongoing traffic. (the Wyzecam transmits ‘heartbeat’ packets to servers at Wyze HQ ever second or two, even if there is no active media stream). The Mango logs might shed some light on what happened at T+12 hours.

That little GL-iNET Mango router is pretty versatile. I have the same unit. You can log into it as root (under More Settings/Advanced), and get right at the Luci kernel, create scripts, set up cron jobs, etc. I suspect that you could write a script to check if it still had network connectivity, and then do whatever is needed to access the portal page and reconnect. Though exactly how you’d accomplish that is beyond my pay grade. The GL-iNET forums might have some ideas.

2 Likes

Thank you. Yes i suspect it was the public wifi that kicked the router out, probably due to a standard timeout.

I was actually just trying for the first time to write a cron job for the scheduled tasks to either reboot the router or restart the wifi periodically (say, every 3 hours) but I can’t really work out the syntax or anything else that’s required. I copy & pasted & edited code from the inet forums, but in testing nothing happens. If you have any pointers for that they’d be gratefully received.

I don’t even know if the router will automatically reconnect to the public wifi after rebooting, but it’s worth a shot if i can work out how to trial it.

Chris,
I only know a tiny bit about Linux scripts, cron jobs and the like (enough to be dangerous, but not enough to provide any useful advice). I doubt that just rebooting the Mango will be sufficient to re-establish authentication with the public WiFi. You might be able to use a curl command to emulate what you’d normally do manually to activate the portal (accept their terms & conditions, etc), perhaps by sending an HTTP POST with the right parameters.

It’s an interesting problem. Good luck.

1 Like

thanks. that looks way beyond me lol
i might try buying a simple electrical plug timer socket and try turning the router on / off every few hours, see if that works.

It would not be uncommon for a public wifi to require re-authentication through its portal page periodically. I fear that this is your problem.

3 Likes

If the portal page is a simple “click this button to accept terms” then you can probably capture the click using Google Chrome’s Developer Tools:

  1. Open the login page in Chrome, click the 3 dots at the top right and choose More Tools > Developer Tools.
  2. Click the “Network” tab at the top, then click the portal page login button.
  3. You should see an event for clicking the button. Just right-click on that event, then select Copy > Copy as cURL (bash).

That should at least give you somewhere to start, though it may take a few tries to figure out exactly which element and events you need to trigger from your script.

1 Like

aahhh how interesting, thank you. Never come across that but i’ll give it a try. Where would I paste that cURL once I have it?

As @kyphos mentioned, the MT300N has the ability to run scripts, so once you get the correct curl command to trigger the login page, you can set up a script to run that command and then check for an internet connection, perhaps retrying the command a few times until it succeeds. You may or may not get data back from the curl request giving you a “Success” message or indicating why it failed.

You’ll want to test the curl command by running it in the MT300N shell first to make sure it works, tweaking as necessary. Without access to the actual login page it’s hard to provide more specifics, but if you can try it out and post your results here we might be able to figure something out.

Little update here.
I’ve plugged the MT300N into a smart plug (tp-link kasa), then set up a schedule in the plug so it turns the router off for 60 seconds then on again, every 2 hours, (pretty sure that’s under the timeout threshold).
Tests so far show the router reconnecting to the public wifi each time without needing to re-authenticate in any way, and the cam coming back online shortly after the router reconnects.

I’m using the tp-link plug because the schedules live on the device itself and still operate even if the socket loses its internet connection (which it will do every two hours, as it turns off the router)

I’m about to go abroad for two weeks, so let’s see how it holds up.

1 Like

Chris,
Very nice - thanks for the update.