emuola
Posts: 24
Joined: Wed Jun 19, 2013 5:50 pm

Possible to reboot a rpi kiosk remotely without ssh (and opening ports)?

Tue Dec 04, 2018 10:33 am

Running a headless rpi3b+ which is hardcoded to display a certain webpage (via chromium). I have total control over the website data, if it does help here, but the rpi itself does not run any webserver and won't. The webpage, which the rpi is displaying is running on a hosted server though https, if it does mean anything.

The rpi is inaccessible - literally as it's over 4 metres above the floor on a wall behind a 65" tv. I have a cron job that reboots the rpi every morning, but in case of emergency (=something does not work), I'd need means to reboot the rpi remotely over the internet without ssh as I cannot open any additional ports at the location.The rpi can be accessed inside the lan with ssh (putty) with a certain network name (= dhcp, static ips are not possible at the location), which is fine, except for it requires me to travel to the location :/

Is there *any way* to accomplish this remotely? I'm not a network expert here :) Otherwise I would not be asking this :D I know this probably would require opening some ports (which I cannot so), but I still wanted to ask :)

Thanks :)

Andyroo
Posts: 2823
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Possible to reboot a rpi kiosk remotely without ssh (and opening ports)?

Tue Dec 04, 2018 11:12 am

VNC has an option where it opens a link to the realvnc.com web site without any router ports being open.

You create an account on the site
You have to visit site once more to log in to the client VNC with that account
You then ‘visit’ the Pi via VNC connect on your machine

This used to be free for 5 machines and included in the Pi software but I read here that this was changing.
Need Pi spray - these things are breeding in my house...

fruitoftheloom
Posts: 19483
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Possible to reboot a rpi kiosk remotely without ssh (and opening ports)?

Tue Dec 04, 2018 11:22 am

Andyroo wrote:
Tue Dec 04, 2018 11:12 am
VNC has an option where it opens a link to the realvnc.com web site without any router ports being open.

You create an account on the site
You have to visit site once more to log in to the client VNC with that account
You then ‘visit’ the Pi via VNC connect on your machine

This used to be free for 5 machines and included in the Pi software but I read here that this was changing.

https://www.realvnc.com/en/raspberrypi/
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Stretch.

Andyroo
Posts: 2823
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Possible to reboot a rpi kiosk remotely without ssh (and opening ports)?

Tue Dec 04, 2018 3:40 pm

Note the none commercial use - that may give the OP an issue.
Need Pi spray - these things are breeding in my house...

emuola
Posts: 24
Joined: Wed Jun 19, 2013 5:50 pm

Re: Possible to reboot a rpi kiosk remotely without ssh (and opening ports)?

Wed Dec 05, 2018 6:33 am

Thanks for the heads up regarding realvnc :) Seems to be a great solution indeed. I probably need the commercial licence though - at least I hope this will eventually be a business :)

Thanks again :)

ejolson
Posts: 2861
Joined: Tue Mar 18, 2014 11:47 am

Re: Possible to reboot a rpi kiosk remotely without ssh (and opening ports)?

Wed Dec 05, 2018 4:59 pm

emuola wrote:
Tue Dec 04, 2018 10:33 am
but in case of emergency (=something does not work), I'd need means to reboot the rpi remotely over the internet without ssh as I cannot open any additional ports at the location.
What about enabling the built-in watchdog timer?

bzt
Posts: 343
Joined: Sat Oct 14, 2017 9:57 pm

Re: Possible to reboot a rpi kiosk remotely without ssh (and opening ports)?

Thu Dec 06, 2018 5:01 pm

I'm not sure that's possible. Connecting to any device over the internet per definition requires an open port, where a server is listening (regardless if that's an ssh, vnc, http, ping, syslog-udp whatever server). But luckily you have other options.

You mentioned that you can connect to the pi over ssh from the LAN. I assume what you're looking for is a port forward on the router. Let's say:

Code: Select all

internet ----- [wan interface, ip X] router [lan interface] --------- [pi, ip Y]
Then you have to set up (for example) X:2222 to be forwarded to Y:22. After that, when you want to access the pi from a remote location (over the internet), you'll have to ssh to X:2222. If you can't do that on the router, then maybe, with a little luck, your router already accepts UPnP without further configuration. Then you need to install an upnp client (e.g. miniupnpc) on the pi, which will explain the router to set up that port forward for you (this also benefitial if Y is changing all the time).

If your router lacks upnp daemon, as a last resort, you can set up a cron job to query a special, well-protected website over https (I'd suggest to use auth too) with curl every minute. When you want to reboot your pi, you place a passphrase there. When your pi asks for that page and there's a passphrase to send, you must clear that (otherwise your pi would enter in an endless reboot loop). The advantage of this solution is that it works from anywhere (router, LAN, IP masq, firewall etc. doesn't matter) because the connection is initiated from your pi and not to your pi. The downside is you'll need a simple webserver and a minimal webscript somewhere.

On Pi, called from cron every minute:

Code: Select all

[ "`curl https://.../reboot.php -O -`" == "RebootPassphrase" ] && reboot
On the server:

Code: Select all

<?php
$data=file_get_contents("reboot.txt");
unlink("reboot.txt");
header("Content-Type: text/plain");
header("Content-Length: ".strlen($data));
die($data);
Now whenever you want to reboot the pi, you ssh to the server and place the passphrase in reboot.txt. Next time your pi queries it from cron, it will reboot (provided the passphrase is correct).

Cheers,
bzt

rln
Posts: 172
Joined: Wed Apr 09, 2014 1:43 pm
Location: Sweden
Contact: Website

Re: Possible to reboot a rpi kiosk remotely without ssh (and opening ports)?

Mon Dec 10, 2018 10:13 am

What is the basic problem? Why do you need to reboot so often? It really shouldn't be necessary.
Author of the robust Nard distro http://www.nard.se

Return to “Networking and servers”