RT Cunningham

Blogging For As Long As I'm Able

Establishing a Future Remote Connection

Tagged with computers, linux, raspberry pi, remote connection, surge protector, uninterruptible power supply, vnc on March 24, 2024

system drive As I mentioned when I wrote “Travel From the Philippines to the United States and Back”, plans are in place to spend from 10 to 12 months in California starting in March 2025. I’m not disconnecting our fiber Internet service since several relatives will still be using it for Wi-Fi.

I’ll be leaving my Raspberry Pi 400 (“Pi” for short) in the same unoccupied bedroom as the router. I intend to keep it powered up so I can connect to it from the United States. Like the last time we left, for seven months, only a couple of sisters-in-law will enter the house while we’re gone. My wife, Josie, will probably be talking to them by Messenger fairly often, just like last time.

Maintaining Power

Three power adapters will be plugged into a surge protector. The surge protector will be plugged into a UPS. Only the portable computer monitor will remain turned off. Although the Pi itself can power my external SSD, I’ll have the SSD plugged into a powered USB hub, which itself will be plugged into the Pi.

The UPS only provides power for about five minutes, which is plenty of time when an intentional power outage only lasts for two or three minutes. After a longer outage, it will automatically power up and recharge when electricity is restored.

Since the Pi doesn’t have a power switch, and the portable computer monitor doesn’t have a power switch, I’ve been using inline power switches to turn them both on and off. When I shut down the Pi with the operating system, I have to turn its switch off as well. If I want it to start back up automatically when electricity is restored, all I have to do is remove the inline power switch.

The Dilemma

Until a few days ago, I only knew of two ways to connect to the Pi, but not really remotely. One was with SSH and the other was with VNC, but only with the local IP address for the Pi. I knew I couldn’t use the Internet IP address because that address was the same for every device connected to the router. Since I only want to visually connect to the Pi, I won’t even bother to enable SSH on it.

I needed a dynamic DNS service. Even with that service, I wouldn’t have a clue as to how to use it for VNC instead of a local website. I didn’t want to run a local website. Over the course of more than a couple of days, I searched for information to solve my dilemma. I didn’t find a solution, but I eventually figured things out for myself.

The Dynamic DNS Service

Although there are plenty to choose from, I chose Duck DNS. It’s no nonsense, and they even explain how to update the IP address at five-minute intervals. I followed the instructions and I already have a cron job regularly connecting to the service. Cron is a Linux thing. I guess it would be called a scheduler on other platforms.

I selected a short subdomain name I knew I wouldn’t forget. The subdomain is the part just before “.duckdns.org”. According to the website, I can select four more. I don’t know why I would need more than one.

Router Settings

It won’t do any good to tell you where the settings are on any particular router. All the brands tend to have their own menu structures. The two areas I needed to add information to are in different places on my router, which is a Chinese brand.

On the router, I had to go to “LAN/DHCP Static IP Configuration” and enter the MAC address for the Pi and the desired IP address. The MAC address is the address following “ether” when entering “ifconfig” on the terminal command line. I chose 200 as the last octet of the IP address, 192.168.1.200, because I knew no other devices currently connected were using it.

Because I have to specify which computer is going to receive the VNC connection, I had to go to “Forward Rules/Port Mapping Configuration” and enter the Pi’s new static IP address and 5900 as the port number. While I was at it, I forwarded port 443 as well, even though I’m unlikely to ever set up a web server on it.

The Remote Connection

It’s easy to test LAN connections since the local IP addresses are easily obtained. It isn’t so easy to test connections over the Internet. I know I’m almost a year early in all this, but I hate waiting until the last minute. It only takes one mistake to disrupt my plans.

I’m pretty happy with the results. Now that I’ve figured out how to configure everything and turn my Pi into a remote computer, I don’t need to use the dynamic DNS service right away. I can actually wait until just before departure to use it again. Figuring out the router settings was the hardest and I don’t want to do that again, so I’ll still keep the static IP address in place and port 5900 forwarded.

A lot of things can happen in a year. Unless I think of something better, I probably won’t be mentioning this again.

← Previous ArticleNext Article →