Leutenegger, Sabine. Clock, Studio for Immediate Spaces Graduation Show 2024. Photograph. June, 2024.
- 100 RGB LED WS2812B mini PCBs
- 6x WorldSemi WS2812B Digitale 5050 RGB LED 32x8 Matrix
- 2x Raspberry Pi (3 B+ and 4 1GB)
- 4x Joy-it SBC-NodeMCU-ESP32
- TP-Link Archer MR200 Wifi Router
- Various power supplies, cabeles, and so on… (wip)
- WLED Version 0.15.0-b3
- MQTT Broker (Mosquitto)
- Raspberry Pi OS
- Express Node.js Server with native Twig HTML Forms
Excuse me for the spaghetti code. It had to be done, rather than beautiful.
Note: incomplete
- Connect through SSH
- Setup MQTT broker and make sure to start a service on boot (Mosquitto Nice Tutorial)
- If SSH keys are not installed yet, navigate to the .ssh directory (
cd ~/.ssh
) and generate some withssh-keygen -t ed25519 -C "[email protected]"
and add publickey as a deployment key in your repository (fork it repository first). - Optionally, you can paste your computers public key to
authorized_keys
in the folder (or create it withnano authorized_keys
). - Clone the repository
- Install nvm
- Navigate into repository folder
- Install and use correct npm version with
nvm use
- Copy and rename
.env.example
to.env
, and add correct values to.env
- Install dependencies
npm install
- Test with
npm run dev
- Install pm2 globally with
npm install -g pm2
(to run the script on startup) pm2 startup
- Paste in the resulting command as instructed.
- Type
pm2 start ./bin/www
pm2 save
- Reboot Raspberry Pi and test if webapp is running on
https://raspberrypi.local/api
- Alternatively, there is a .service file that somebody could make work
- Set the time on the Raspberry Pi with the countdown correctly by either connecting to the internet and chosing a time server or by setting it manually with
sudo date -s '2021-01-04 13:04:00'
Number | Displays | MQTT Topic | Settings URL | Config File |
---|---|---|---|---|
1 | Circle | wled/circle | http://clock-01.local | clock-01_cfg.json |
2 | Solar Flares | wled/solarflares | http://clock-02.local | clock-02_cfg.json |
3 | Value | wled/value | http://clock-03.local | clock-03_cfg.json |
4 | Countdown | wled/countdown | http://clock-04.local | clock-04_cfg.json |
- Connect with the SIS2024 Wifi
- Go to http://raspberrypi.local:9000/api
If you change the code of your server, you only need to restart the running process on the Raspberry Pi without the need to reboot it completely. For that, access the Raspberry Pi with SSH, navigate to the project folder (maybe that's not even needed) and type pm2 restart 0
wheras the 0 stands for the ID of the service. If not sure what's the ID, type pm2 list
and read from the list.
It is very likely that when the Raspberry Pi is turned off once and restarted, the microcontrollers need to be rebooted after that as well before they receive new data.
To reboot the Raspberry Pi, login with SSH and run sudo reboot
.
- Connect with Wifi
- Open Microntroller URL (see ESP Mapping table)
- Tab on the information icon (i)
- Scroll to the bottom and press the reboot button
- Confirm
- Wait until the microcontroller is back up
- Connect laptop to Wifi
- Open “Terminal” app on Macos
- Type
ssh [email protected]
- Enter password
- Enter
sudo reboot
- Wait until Raspberry Pi is back up
Somehow, the a forth channel created issues with the performance while blocking another channel that was updated frequently. Therefore, we added an additional Raspberry Pi with the same setup but without all the channels running on them. This way, a Raspberry Pi can also be rebooted without the whole clock turning off.
- Enno Pötschke (http://ennopoetschke.com, @enno.poetschke)
- Lucas de Montalembert (@lucasmontalembert)
- Vinzenz Leutenegger (https://vinze.nz, @znezniV @znezniV)
- Zhiyi Cao (https://zhiyicao.co/, @zyc.revisionaire)