The first result with the new control panel …
The python – flask – web server.
I told you that I will publish the program code to communicate with the Raspberry Pi via web interface. This is part one. I show you the requirements.
We need python (already installed) and an additional package, named flask. Flask is a powerful framework for python. No worry, it’s easy to use.
To install flask, we need the python pip module. So, you must install two packages (as root, or using sudo):
apt-get install python-pip pip install flask
The next step is creating the folder structure. For our project, we need a main folder. I name this folder waterdrops.
In this folder we need the following subfolder: static and templates.
/ |-- waterdrops |-- static |-- templates
In the subfolder static we store images, which we use at the web page. The html pages are stored into the template subfolder.
The main program is stored in the main folder (waterdrops).
The files we use:
– index.html (the main web page)
– layout.html (the master web page )
– favicon.ico (a small icon like google, not necessary)
– wassertropfen.JPG (a picture for our web page)
– drops.py (the main python program)
|-- waterdrops | drops.py |-- static | favicon.ico | Wassertropfen.JPG |-- templates index.html layout.html
So, that’s are all requirements we need.
In the next part I show you the complete program codes of the project.
I finished the next part of another project: water drops photography.
There are a lot of amazing photos about this theme. I decided to try this self. I started with a simple equipment. First with an injection set, a flash light and a lot of time! The result was great! The next step was to buy a light barrier to trigger the camera and a solenoid valve to produce the water drops. The solenoid valve is already controled by the Raspberry Pi.
Now, I removed the light barrier and trigger the camera with the Raspberry Pi too.
This is the current state.