but more on that later. I decided to add an LCD display on the front with vital stats, including the IP (since these are going on DHCP networks). I found what I was looking for on eBay for ~$13, but fortunately I also found them for considerably less at GearBest (for ~$7, but it did take 2 weeks to get here from Belgium). Here is what I received:
This simply dropped onto my Raspberry Pi kiosk (after removing the top of the case):
So now to get it to show some information. First off, thanks go out to Raspberry Pi Vietnam for getting me on the right path. Let's start by SSHing into the kiosk, updating it and a little clean up:
Then we can install the pre-requisites:
sudo apt-get update sudo apt-get upgrade -y sudo apt-get autoremove -y sudo apt-get autoclean
and download the code:
cd ~ git clone git://git.drogon.net/wiringPi cd wiringPi ./build
Now let's customize the content:
wget http://www.wsiab.net/cpushow/cpu_show.zip(moved) wget https://johnlester.rocks/downloads/cpu_show.zip unzip cpu_show.zip cd ~/cpu_show
and customize the lines:
Once done, we are ready to compile and run this:
int contrast = 45; bool showLogo = true; bool showHeader = true; char headerText; sprintf(headerText, " SEPHORA NST "); bool showUptime = true; bool showCPU = true; bool showRAM = true; bool showTemp = false; bool showIP = true; char adapter; sprintf(adapter, "wlan0");
Ta da, you should see the info below:
cc -o cpushow rpi.c PCD8544.c -L/usr/local/lib -lwiringPi sudo ./cpushow
So now we are ready to make this run at start up. Kill the running cpushow using
then add this line to the bottom (above any exit command):
sudo nano /etc/rc.local
Now reboot and you should be ready to go.
* Note: this method of startup only works if you start the gui (have a monitor attached). If you are using your Raspberry Pi headless you should create a cron job to run cpushow on start up.
This was correct at time of writing, sorry if any parts have become outdated. I will not be updating this anymore as I am working on other projects.
Post a Comment