This is a standard Node.js project, just run npm ci
to install the dependencies and npm run dev
to start development mode with live reload. Run npm run build
and then npm start
to run the app in production mode.
- 1 x Raspberry Pi 4GB Link to Pimoroni
- 1 x Wall Mount Bracket Link to Amazon
- 1 x Portable Monitor 15.6 inch. Link to Amazon
We need to configure the Raspberry Pi in Kiosk Mode.
-
Open Terminal in Raspberry Pi and update
sudo apt update sudo apt install rpi-update
-
Launch chromium browser in kiosk mode
-
sudo Path /home/pi/.config/lxsession/LXDE-pi/autostart or sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Copy the details below :
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@point-rpi
@xset s off # Disabled screensaver
@xset /dpms # Disabled DPMS
@xset s noblank # Dont blank the video device
@chromium-browser --noerrors --disable-session-crashed-bubble --disable-infobars --kiosk --incognito http://localhost:3000/lounge #If page is open in incognito mode cache is ignored
Before running the commands, we need to create 2 files inside the api folder; rooms-client.json and rooms.json
Go to the Google Developer Console and create a new Project.
Structure is as below.
{
"lounge": {"name": "Lounge", "slug": "lounge", "position": "right", "id": "[email protected]"}
}
- Go to folder usr/local then git clone project
- sudo apt-get install -y nodejs
- sudo npm install
- We use Pm2 to run nodejs in the background -> npm install PM2@latest -g
- pm2 start server.js
- pm2 startup
- pm2 startup systemd
Install NodeRed
-
Go to folder nodered in this project and change format to json then upload file to nodered
-
Start Nodered as autostart:
sudo systemctl enable nodered.service
Http path to turn on red light is located at localhost:1880/red and green light is localhost:1880/green