Post In Progress!
Starting this blog post so I’m forced to follow through on my hare-brained idea.
Okay so picture this: You have a license to a brand-spanking-new copy of Solidworks 2014 sitting on your desktop computer. You live in the mountainous South West, it’s summer, and the idea of air conditioning never caught on in your town so you try to keep all of your electronic equipment off at all times unless it’s in use.
Finally! Relief! You find yourself a cool dark place to set up shop for the day and open your laptop so you can remote into your desktop back at home and do some designing on Solidworks! But wait. Your computer isn’t on, and home is a half hour away! Oh no! I wish there was some way to leverage this internet-of-bullshit to my advantage.
Well say hello to WoWLAN! Wake on Wireless LAN. This is the greatest idea that will never catch on. And unfortunately for me, it’s not available on my PC. Well, it is, but only from hibernate mode and windblows10 likes to wake up my PC from hibernation periodically so that option is OUT. Time for some hardware.
Step 1: Raspberry Pi
I’m purchasing a raspberry pi zero w for this project because they’re small and have wireless built in. Unfortunately they’re the slowest of the Pi’s so Raspbian isn’t going to work. Go ahead and install dietPi. It’s worked great for me and has low overhead.
Step 2: Software
Sudo apt-get install python3 and paho-mqtt on your Pi and download MQTT Dash on your smartphone. From here you can write a python script that connects to the MQTT test broker and you can start sending and receiving messages and debugging any issues that come along the way. I am leaving my code unpublished at the moment because it isn’t robust enough to deploy. But it’s in my best interest to fix it so it’ll be released eventually.
Step 3: More Hardware
It’s kind of a dick move to use a public MQTT broker (also insecure) to handle your web traffic so get a piece of hardware that is web-facing that you can install Mosquitto MQTT on. This can be a webserver you have or, in my case, an AWS instance. You get a free year of the t2.micro after that the t2.nano should run around $50/year and work just fine. If I ever figure out how to field Mosquitto on my lightsail instance it’ll save me from paying double for AWS services. I’ll update that here.
Be sure to use DuckDNS and your domain to adapt to your dynamic IP address. Also don’t forget to start Mosquitto MQTT on boot.
Step 4: Even more hardware
I started out with the idea of using a solid state relay to emulate a button press. Here’s my schematic:
And here’s my PCB.
Here’s My Bill of Materials:
Step 5: Integration
Build up your PCB, solder it on to the raspberry pi and install it on your PC.
Hey, you’re done!