Build a FastAPI website with pdf output on raspberry Pi for local network.
Budget: €30 – €250 EUR
Hello,
here we have a little project with a local raspberry pi wich provides a website to a local device.
The existing main program (picture generator) should not be modofied (much), only for integrating a flask - Task as background task (thread)? Thanks a lot, Step 4-5 is finished. So only 6 (start subprocess) is the needes.
Hello, we have following things to do:
Environment:
1. Program running on Linux on Raspberry Pi 4b.
2. Programming Language is Python (3.7, later 3.9)
3. The Pi hast to provide an internet page (https://biophoton.local
or http://biophoton.local)
Tasks
4. An main program (program1.py) is
- capturing images (png, or jpeg) and
- know meta data (local time, individual number, other parameters, string)
5. this existing program provides the pictures – either in memory or stored locally and parameters.
6. AS SOON AS the images are fully captured (2 images each “shot”), this program can run a subprocess, which dues following:
A: transfer the two image and metadata to the website, show the image on the website.
B: Add a second bunch (another 2) of pictures to the website {maybe more}
{each: full aspect ration, not comprimized, later also reduced pixel size} – as soon as the pictures are generated on raspi side (external trigger)
C: on the web surface we have two or three input fields.
NO DATA HAS TO Transfer from Webpage to Raspberry!
D: Take the input from the website- variables, and
E: generate a pdf with
- Pictures
- Text – layer on the picture
- Last page = variables, a) from the raspberry, b) from the input folders
- jspdf should be used, each picture on a new page (full resolution here)
F: “store as” – button on the webpage: By clicking a pdf is generated (and stored locally on the client, not on raspberry)
G: send a signal (string or field: [“stored”,1]) to the raspberry {this will create an physical signal that we are ready for next shot} (FastAPI)
H: clear input fields, pictures, as soon as saving is performed correctly.
I: If specific metadata comes (“shutdown”), this will be shown on website.
Usable things:
7. Local solution (all .js … local on raspberry stored!)
8. Preferred:
- fastAPI (or Flask if all also works there) https://www.analyticsvidhya.com/blog/2020/11/fastapi-the-right-replacement-for-flask/
- All .js stored on the Raspberry (has to work without internet, only local intranet, little modofication)
Additional tasks:
9. Website location: „BioPhoton.local“
10. Secure ssh transmission
- Using port 80, redirection to 443 (https)
- how to use signed keys?
- How to generate keys?
11. Non writable boot partition / only writable data- section (folder on same partition? Or do we need another partition. How to use this with pishrink for rollout)
12. UTF8- compatible
13. Save a LOCAL (client, NOT on the Pi) logfile (Number, Picture- Name, Comments)
14. Second site with “settings”: read from Raspberry, fill some text fileds, Button “Upload” to raspberry (shere stored on a local file in the Pi).
- Example: picture position (left upper corner), picture width and height (lower right corner)
- how parameters (how many ms delay, exposure time, etc.)
Thanks a lot, greetings Michael
here we have a little project with a local raspberry pi wich provides a website to a local device.
The existing main program (picture generator) should not be modofied (much), only for integrating a flask - Task as background task (thread)? Thanks a lot, Step 4-5 is finished. So only 6 (start subprocess) is the needes.
Hello, we have following things to do:
Environment:
1. Program running on Linux on Raspberry Pi 4b.
2. Programming Language is Python (3.7, later 3.9)
3. The Pi hast to provide an internet page (https://biophoton.local
or http://biophoton.local)
Tasks
4. An main program (program1.py) is
- capturing images (png, or jpeg) and
- know meta data (local time, individual number, other parameters, string)
5. this existing program provides the pictures – either in memory or stored locally and parameters.
6. AS SOON AS the images are fully captured (2 images each “shot”), this program can run a subprocess, which dues following:
A: transfer the two image and metadata to the website, show the image on the website.
B: Add a second bunch (another 2) of pictures to the website {maybe more}
{each: full aspect ration, not comprimized, later also reduced pixel size} – as soon as the pictures are generated on raspi side (external trigger)
C: on the web surface we have two or three input fields.
NO DATA HAS TO Transfer from Webpage to Raspberry!
D: Take the input from the website- variables, and
E: generate a pdf with
- Pictures
- Text – layer on the picture
- Last page = variables, a) from the raspberry, b) from the input folders
- jspdf should be used, each picture on a new page (full resolution here)
F: “store as” – button on the webpage: By clicking a pdf is generated (and stored locally on the client, not on raspberry)
G: send a signal (string or field: [“stored”,1]) to the raspberry {this will create an physical signal that we are ready for next shot} (FastAPI)
H: clear input fields, pictures, as soon as saving is performed correctly.
I: If specific metadata comes (“shutdown”), this will be shown on website.
Usable things:
7. Local solution (all .js … local on raspberry stored!)
8. Preferred:
- fastAPI (or Flask if all also works there) https://www.analyticsvidhya.com/blog/2020/11/fastapi-the-right-replacement-for-flask/
- All .js stored on the Raspberry (has to work without internet, only local intranet, little modofication)
Additional tasks:
9. Website location: „BioPhoton.local“
10. Secure ssh transmission
- Using port 80, redirection to 443 (https)
- how to use signed keys?
- How to generate keys?
11. Non writable boot partition / only writable data- section (folder on same partition? Or do we need another partition. How to use this with pishrink for rollout)
12. UTF8- compatible
13. Save a LOCAL (client, NOT on the Pi) logfile (Number, Picture- Name, Comments)
14. Second site with “settings”: read from Raspberry, fill some text fileds, Button “Upload” to raspberry (shere stored on a local file in the Pi).
- Example: picture position (left upper corner), picture width and height (lower right corner)
- how parameters (how many ms delay, exposure time, etc.)
Thanks a lot, greetings Michael