See what esoteric art & messages it displays on the mastodon bot:
https://mastodon.social/@giantpompom
Ever wanted to spend days winding a ton of yarn to make a giant pom pom? What that pom pom to be able to react to hugging to send cryptic ASCII art and a short esoteric message to multiple e-ink displays? Don't have the latest PI due to the shortages but have an old RPI lying around?
Well, here ya go!
- Adafruit QT Py ESP32-S2
- Conductive thread
- Ridiculous amount of yarn
- Cardboard (to make a pom pom template)
- 400mAh LiPo battery (optional)
- Adafruit QT PY ESP32-S2 BFF Lipo backpack (optional)
- Waveshare 7.5 e-ink screen w/ Pi HAT
- Raspberry Pi (Works with multiple, but I used an old RPi 3)
- Picture frame (there's one that works from ikea or this one from modulor)
- format sd card w/ raspberry pi imager
- install nvm (
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
) - install node using nvm (
nvm install --lts
) npm i
npm start
- Add a
.env
file with secrets:OPENAI_API_KEY MQTT_HOST # broker url MQTT_USER MQTT_PASSWORD CLIENT_ID TOUCH_TOPIC OPENAI_CONTENT # your prompt
- Download
.uf2
file: CircuitPython 8.2.0-beta (Necessary for touchalarm functionality!) - Put in bootmode and drag/drop circuitpython to drive in finder view
- Using MU editor, create a
settings.toml
file with following secrets:ssid="" wifi_pw="" broker="" port= user="" pw="" client_id="" topic=""
- Add necessary dependencies to
lib
folder from Adafruit circuitpython bundle:[adafruit_minimqtt](https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT)
(copy entire folder)
-
Make sure node and npm are symlink since we use nvm:
sudo ln -s "$(which node)" /usr/bin/node sudo ln -s "$(which npm)" /usr/bin/npm
-
Setup a
eink.service
file:sudo nano /lib/systemd/system/eink.service
with:
[Unit] Description=chatgpt ascii art displayer After=network-online.target Wants=network-online.target [Service] Type=simple User=pi WorkingDirectory=/home/pi/love-notes-chatgpt ExecStart=/usr/bin/npm start Restart=on-failure RestartSec=30 [Install] WantedBy=multi-user.target
-
Test the config:
sudo systemctl start eink
-
Check for errors in log:
sudo journalctl -xfu eink
-
If need to edit, restart it with:
sudo systemctl daemon-reload
-
Restart it:
sudo systemctl restart eink
-
To stop:
sudo systemctl stop eink
-
To enable it once it looks good:
sudo systemctl enable eink
andsudo reboot