bisitariak-koloretsua/README.md

33 lines
1.3 KiB
Markdown
Raw Normal View History

2024-09-01 06:16:42 +02:00
# bisitariak & koloretsua
those scripts are used to made a lamp who illuminates with various colors (generated based on visitor's IP address) when someone visit my websites (detection based on nginx logs)
to use them, you need a MQTT broker
if you want to use a public broker: <https://www.maqiatto.com/>
'bisitariak' means 'visitors' and 'koloretsua' means 'colorful' in Basque
## bisitariak
this script monitors nginx access logs and advertises any new visits to a MQTT broker
it comes with it's sibbling script (`koloretsua`) wich turn on a LED strip for each visitor, using an ESP microcontroller
TODO:
- [x] properly detect any new visits
- [ ] FIXME: to test properly
- [x] extract their associated IP address
- [x] generate a color based on this IP address
- [x] advertise new visitors (and their associated color) on the MQTT broker
## koloretsua
this script is using [CircuitPython](https://circuitpython.org/) and [MiniMQTT](https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT)
### install
- flash an ESP card with CircuitPython (i used a Wemos S2 mini)
- put the files from the `koloretsua/lib` directory in the `lib` directory of your ESP card
- put the `code.py` file in the root of your ESP
- copy the `settings.toml.example` file into the root of your ESP, rename it to `settings.toml` and configure it