Blynk is mostly used with boards like Arduino or a Raspberry Pi, but why not run it on other devices? ;)
I've spent a weekend creating an app for my router. System and network charts, stats, notifications, WiFi control, and more! This tutorial explains some basic ideas behind creating such apps, so you could easily adapt it to work with the Raspberry Pi and the like.
You'll need an OpenWrt-compatible router. Alternatively, some IoT development boards come with OpenWrt out-of-the-box, like Onion Omega, VoCore, LinkIt Smart 7688 and others.
Attention! Installing OpenWrt manually can brick your device. But once completed, it unlocks full power and control. I'm not brave enough to provide any instructions here, as they may be different for every router model. But if you already have OpenWrt on your router, you'll be able to start with this tutorial in no time.
On the device side, I'll be using Lua to script the needed functionality. I could also use Python or Node.js, but unfortunately, these options are not always available due to a lack of resources on some routers. Or C/C++, but it's not so convenient to work with (cross-compiling for every change, etc.)
We'll be mostly using pre-installed software (available on any OpenWrt-enabled router). For example, Lua is simple to use and learn, and it's used by the default OpenWrt web interface (LuCI). To access some advanced functionality, I had to install additional software packages.
I assume that you already know:
Open an SSH connection to your OpenWrt router and run:
Replace these lines with the information provided by the Blynk platform:
To save the file, hit Ctrl+O, then Enter. Close the editor by hitting Ctrl+X.
This means a secure, bi-directional connection to the cloud is established! Your device should appear online in the Blynk Cloud and in the App.
The script needs to be manually executed, which is rather inconvenient. I want to make it run in the background automatically when the router is powered up. This is done by creating a system service:
The creation process of this project is explained in this tutorial