What is Pi Dashboard?

Pi Dashboard (Pi Dashboard) is an open source IoT device monitoring tool. At present, it is mainly targeted at the Raspberry Pi platform, and it is compatible with other hardware products which are similar to Raspberry Pi. You only need to install the PHP server environment on the Raspberry Pi, and you can easily deploy a Pi dashboard, and monitor the status of the Raspberry Pi through the cool WebUI!

What can be measured?

  • CPU info, status and usage, etc.
  • RAM, cache and swap usage
  • TF card usage
  • Real time workload
  • Real time number of threads
  • Real time data from the network interface
  • IP address, up time, OS and Host information

Preview of Pi Dashboard

How to install?

There are 2 steps to install, first install Nginx (or Apache) and PHP. Then deploy the program for this project via SFTP or GitHub in the Nginx directory.

Install Nginx and PHP

Run the following command in the terminal of Pi.

sudo apt-get update
sudo apt-get install nginx php7.0-fpm php7.0-cli php7.0-curl php7.0-gd php7.0-mcrypt php7.0-cgi
sudo service nginx start
sudo service php7.0-fpm restart

If successfully installed the softwares, you can access the address http://Pi's IP and see the default page of Nginx. The root directort of Nginx is in /var/www/html.
Do the following to get Nginx to handle PHP.

sudo nano /etc/nginx/sites-available/default

modify the following lines,

location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

replace with,

location / {
index  index.html index.htm index.php default.html default.htm default.php;
}

location ~\.php$ {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

Use the command below to save and exit,

Ctrl + O
Ctrl + X

Use the following command to restart the Nginx Service.

sudo service nginx restart

Deploy Pi Dashboard

Here are two ways to deploy Pi Dashboard on Nginx.

Upload with SFTP

Download the project source code on GitHub. Upload the extracted directory to the Raspberry Pi's /var/www/html directory through FTP software such as FileZilla. The address of Repo is:

https://github.com/YuanGao-NAU/Pi-Utility

Then you can access the deployed Pi Dashboard through

http://Raspberry Pi IP/pi-dashboard

If the page cannot be displayed, you can try to add run permissions to the source code on the Raspberry Pi terminal. For example, the path after you upload is /var/www/html/pi-dashboard, then run commands below,

cd /var/www/html
sudo chown -R www-data pi-dashboard

Deploy with GitHub

If you know the basic operation of GitHub, it will be quite convenient to download this project to Pi through GitHub.

#If you have installed git client you can skip the next line
sudo apt-get install git
cd /var/www/html
sudo git clone https://github.com/YuanGao-NAU/Pi-Utility.git

Then you can access the deployed Pi Dashboard through

http://RaspberryPiIP/pi-dashboard

Similarly, if the page cannot be displayed, you can try to add run permissions to the source code on the Raspberry Pi terminal. For example, the path after you upload is / var / www / html / pi-dashboard, then run the commands below,

cd /var/www/html
sudo chown -R www-data pi-dashboard

If you have any problems in deploying the software, leave a comment below.

Last modified: February 15, 2020

Author

Comments

Leave a Reply