One step after the other.
Strategy is to follow current structure and make it work. Not changing too much. If all works, there is time to do optimization and cleanup.
- (1) worry about the data arriving from the arduino and proper parsing in python code
- (2) setup threading in python code to receive data, process to database and provide in global variable
- (3) repair flask application to handle request for main page, images ...
- (4) check the flask /up handler to provide proper json
- (5) look into the html, javascript updates to handle new values.
(1) For the arduino part: provide some printout of what your arduino is sending to the host. Use arduino serial console to record ten minutes, 20 records of data. Provide this here (no screenshot, just copy, paste).
why: most people will not have exactly your arduino sensors connected. With the provided data, a test harness can be build
For this record, slightly modify your arduino code to add little timing information.The data printout can be used in a small raspberry pico micropython program to feed the python code and check the receive, decode procedures.
Also prepare a zip or tar file of your project folder and provide here
- include the flask source file
- include the images
- other resources as needed for the web page
- in root folder, include a file 'requirements.txt' which contains the python dependencies with versions
- in root folder, include a script 'setup.sh' which prepares the virtual environment for the application
- in root folder, include a shell script 'run.sh' which starts the flask application in the venv (I do not want to guess what you are typing on
command line)
- do NOT include log files, database files
So people wanting to assist can reproduce your setup by invoking 'setup.sh' and then 'run.sh'
Provide your python interpreter version python --version
Strategy is to follow current structure and make it work. Not changing too much. If all works, there is time to do optimization and cleanup.
- (1) worry about the data arriving from the arduino and proper parsing in python code
- (2) setup threading in python code to receive data, process to database and provide in global variable
- (3) repair flask application to handle request for main page, images ...
- (4) check the flask /up handler to provide proper json
- (5) look into the html, javascript updates to handle new values.
(1) For the arduino part: provide some printout of what your arduino is sending to the host. Use arduino serial console to record ten minutes, 20 records of data. Provide this here (no screenshot, just copy, paste).
why: most people will not have exactly your arduino sensors connected. With the provided data, a test harness can be build
For this record, slightly modify your arduino code to add little timing information.
Code:
void connect() { // test output: print the current time in millis Serial.print("# START "); Serial.println( millis() ); float temp = getTemperature(); // first line of block which is kept // ... // ... leave all the code you have in this part as is // ... Serial.println(LAST_LABEL); // last line of the block which is kept. // test output: print the current time in millis Serial.print("# END "); Serial.println( millis() ); //delay(60000); //delay 1 min to prevent errant readings being logged into the database}Also prepare a zip or tar file of your project folder and provide here
- include the flask source file
- include the images
- other resources as needed for the web page
- in root folder, include a file 'requirements.txt' which contains the python dependencies with versions
- in root folder, include a script 'setup.sh' which prepares the virtual environment for the application
- in root folder, include a shell script 'run.sh' which starts the flask application in the venv (I do not want to guess what you are typing on
command line)
- do NOT include log files, database files
So people wanting to assist can reproduce your setup by invoking 'setup.sh' and then 'run.sh'
Provide your python interpreter version python --version
Statistics: Posted by ghp — Thu Jul 24, 2025 4:04 pm