2 posts • Page 1 of 1
I have to develop a web page to monitor humidity and temperature for my school project. i will have to Capture real data (air temperature and relative humidity) with r414a01 temperature sensor connected to raspberry pi3 using usb rs485 . The reading will be store at sqlite database which i have done . I do not know how to extract the reading use python and store it at sqlite .then make everything appear online through local web server created using python and flask
you should learn python flask in detail, it is very powerful, and fun, but possibly your time is short.
in the last days i programmed in python3 one shortcut to bring some small stuff online,
and just today i put it in a template you can use.
the strange point about that concept is, the program you play with is a pure python3, has nothing to do with flask and webserver.
but what it does, it sends the line you print on the terminal ( text, sensor data ) also to a file
and manually you can start ( in a other terminal window )
( what the program ( at the beginning) also creates..)
and that puts/serves that html file to the local LAN
so the flask server is used in the most simple way, to serve a static index.html file.
my trick is just when you run the program again ( kind of offline ) it is overwriting that html file...
my blog at the end find just the web-job template and the code
worst case you can have 3 separate programs running:
-a- your program what reads the sensors and writes it to the database
-b- my template where you change
++ read from database
++ optional some evaluation like min avg max..
++ print to terminal
( i do the rest by copy it to html )
-c- my flask server ( you have to start manually )