Fullmoon and Teapot
I'm working on building a testbed to evaluate some hypothesis related to a smart light project. This test bed involves a cctv camera and multiple adjustable light sources. Light sources are LEDs which made adjustable by connecting to raspberry pi units. Then leveraging the (P)ulse (W)idth (M)odulation to adjust the brightness. In addition to light source there are also lux sensors(bh1750) plugged into raspberry pi.
The design of the software system is to make the raspberry pi units as much as dumb. So it only does the bare minimum required. Reason behind this is troubleshooting, deploying and maintaining the system resources on these raspberry pi units are bit difficult. Then using a server as a central processor to do the rest.
For the raspberry pi I developed a tiny web server named teapot. And for the central processor a application named fullmoon.
Teapot is a flask app which runs behind gunicorn server that have 3 endpoints
- [GET] /dc - to receive the PWM duty cycle value.
- [POST] /dc - to set the PWM duty cycle value.
- [GET] /lux - to receive the lux values from lux sensors plugged in to raspberry pi.
And that's all the functionality of the teapot.
Fullmoon can communicate with multiple teapots. It's being deployed using docker-compose.
It has 3 services
- app - the logic of the application.
- records the lux and duty cycle values.
- can call the 3 end points of teapot.
- postgre - relational database to store the recorded values.
- admineer - front end for the database.
That's it for the base system.
I hope, with the time fullmoon will be grow into be really smart and teapot will get better with doing what's being asked.