If you ever ask yourself, where can you see the most pristine dark skies in the world? Well, I’m lucky enough to work in one of those places; in the middle of the desert, where humidity levels on average are less than 20%, and no civilization is in sight.

I work as a Software Engineer over there, since the workplace is literally in the middle of the desert, we usually work in shifts, I arrive on a Tuesday, and stay until the next Tuesday, over +1.000km away from my home.

That means I get to live in the middle of nowhere for a week, in a (rather nice) residency with a good enough internet connection. I don’t possess a gaming laptop, but I do have a somewhat decent desktop rig at my place, and I wondered, how hard could it be to setup anything to do remote gaming nowadays, considering the birth (and death) of some cloud gaming services?

I wanted to do this while exposing as little of my home network to the internet, and with this requirement in mind, I discovered Tailscale. So far, I’ve been impressed by their offerings, including supporting over 50+ devices on their free tier!

With this great tool, you can basically host any service you want within your VPN (in the true sense of VPN), without fiddling with port routing, domains, exposing your public IP, etc.

The next logical step was to search for a tool to stream my desktop with fairly low latency, and for that I discovered Sunshine, which works similarly to how the NVIDIA shield used to — by using HW accelerated encoding if available. Setting this up was quite straightforward; you can just check their getting started.

Moonlight is basically the client for Sunshine (or NVIDIA experience if you have that). This application runs almost anywhere – it was even ported for the Nintendo Switch! I also tested their app for the LG TVs and to my surprise, I was able to plug-in directly a controller to the TV and play as well.

During the gameplay I felt it was quite stable, I usually saw 27ms of latency with ~2ms of variance, and the plot shows a somewhat similar value too:

ping results

Of course, since I’m running all my games on a desktop, it is not optimal to leave it running all the time, since its idle power consumption is… non-negligible, I then arrived to a very cheap solution: Wake-On-Lan with an ESP32.

ESP32 to the rescue

I know some routers support Wake on Lan natively, but sadly, after testing mine and researching online, I found that in my case, it was not possible. I could upgrade to a better router, or instead… I could spend a measly USD $3 for a computer that could fulfill this specific requirement.

Since I suffer a small case of NIH syndrome, I decided to experiment a bit on the topic myself, and instead of using an out of the box solution, I implemented my own. I wrote a very simple WOL broadcaster in Arduino’s programming language, that you can get from here.

This was my first time experimenting with these devices, I’ve always had an interest in embedded systems, and although I personally don’t consider this an ’embedded’ project, I was still amazed at how much you can do with these teeny devices.

The big caveat

As I said earlier in this post though, I wanted to do this exposing as little as possible from my network. However, it’s currently not possible to run Tailscale on a ESP32, which makes sense, these devices are tiny in the true sense of that word (although I think there are some current efforts on getting that running), so, to overcome this big limitation, and since I already owned a domain in Namecheap, I opted for using their DDNS (which it is supported by the router), and open a single port to the internet, with this, I could simply do

echo "my_passphrase" | nc my.domain.com 9999

and boom! the PC will turn on.

I know, the code you saw before and this method is by no means secure at all, but the worst they can do is just turn on my pc! (famous last words I guess), but, if you ask me, this is a big win over having my big pc ON all the time consuming more power than it should!

To get all this working, I had to do some changes in Windows as well, I followed the moonlight guide which worked quite well for me.

Conclusion

Of course, at the end of the day, all of this could have been simply solved by buying a laptop with a GPU, after all, I don’t play very intensive games nowadays… but, my commute is of around 8 hours 4 times a month, and carrying a bulky laptop plus the working laptop… doesn’t sound too attractive to me.

Also, with this I gain other benefits, like for example, I can access my own jellyfin installed at home, and use my own IP as exit node!

I hope you learned something from this small read, or at least had fun, I certainly had while writing this (and setting this up!) Pardon any grammatical mistake, my first language is not English (as you can see from the rest of this blog) :).