I've been working on a personal project about Raspberry Pi, the whole idea is simple, i needed some basic monitoring (temperature, CPU, Memory Usage) and to send commands to my Pi server, it's tedious when everytime i have to use ssh for those purposes. So I decided to make an Admin Panel, where i can check my Pi condition in real time through the web ;-)
- Login Page (NEW): Log-in with your username and password. If you use pi-admin for the first time, you will be redirected to the sign-up page instead
Status page: this page shows the status of our Pi server
Control: we can see the two options: Basic Mode and God Mode
Basic Mode: in this mode you have some basic controls like Reboot, Shutdown, Kill a running process and Peek at any directory of your PI
Example : peeking at / directory
- God Mode: this is the place where you can truely be the god of your Pi server, you can run every command that you want here
vcgencmd measure_temp to get core temperature of BCM2835 SoC.
- It's mobile first, so you can run this on pretty much all devices that you own ;-)
For this app to run, you will need Node installed, you can see how i've installed Node on my Pi server in the previous post Setting up a self-hosted blog using Raspberry Pi and Ghost
The whole project is available on GitHub, all you have to do is clone it from there
git clone https://github.com/tlnguyen-com/pi-admin.git
And then install it
cd pi-admin npm install
After the installation, open the main.js file in public/js/ directory using
nano public/js/main.js. You should see the line
var socket = io.connect('http://localhost');, change the localhost to your PI server IP address.
Because of the new Log-in mechanism, you will need a mongodb database, I prefer to use http://www.mongohq.com/ service instead of installing mongodb to my Pi server. So make a registration from mongohq.com, create a new database and then specify its url in the file
server/config/config.jsfrom your pi-admin directory. You will find a line
db: 'mongodb://<username>:<password>@oceanic.mongohq.com:10052/pi-admin', replace the db's value with your database url.
You should have everything setted right, now all you have to do is start it up using
forever server.js(if you have forever installed) , whatever command you like. Or you may want to start it as a service so the admin panel will start running right after server start up. You can check how to do it from here
You may now see the app through the the IP address of your Pi : http://yourPiAddress:3000
This project is under MIT license so feel free to use, contribute or modify, however you want \m/