I'm looking for some startup advice on how to setup my project and which functions/packages/libaries to use. Is it for example better to use one big script or smaller ones?
I want to automate my own converted Camper RV and I love to measure everything. The things it needs to do are:
* Controle all the lights, make them dimmable and control the RGB (some individual addressable and some via normal RGB strips PWM)
* Read the information of the CAN bus and if possible, control it (Renault Master)
* Combine the four camera's around the RV to make one flat video with a static picture of the top of my RV in the middle, this should also be able to switch to nightvision (I still need to install the camera's and will probably go for USB camera's)
* Start recording 10 seconds before there is a movement on the camera's (record on RAM (if possible) and write to harddisk when movement is detected
* read all kid of sensors (over I2C);
* Log all changes (I'm thinking on using an MySQL server on the Raspberry Pi)
* Display information on small displays (over I2C)
* Be able to control everything via a browser and have a button in my RV the will kill the control from outside
* Make a hotspot from 4G internet of switch to wifi when a know wifi spot is within range and has a good signal
I now planned on making different Python scripts which I planned to run simultaneously. At the center I want to use a Raspberry Pi 4, use an Arduino for the CAN bus conversion and another Raspberry Pi to display and control everything from the dashboard of the RV using a touchscreen. I don't know jet if I should run these in a or multiple virtual environments and how to share variables (can I make them global or write en read to the MySQL server?), so please advise.
Drawing of components see attached.
Here's how I planned my scripts now, but please inform me if there is a better way, while keeping things organised. Everything will be run on the Raspberry Pi 4.
* Read all sensors and log changes
* Read all status from other scripts and log changes
* Read all error messages
* Write all changes and send them to the MySQL server
* Sent warnings by SMS when something important needs to be shown
* Import and control CAN bus
* Button inputs
* Use sensor inputs from other scripts to control outputs
* Control all outputs incl. RGB
* Motion detection on camera's when GPS and XYZ sensor senses no big movements (to avoid recording everything while driving)
* Combine camera's to helicopter view
* Add turning circle on helicopter view
* Write to harddrive (on a NAS over Ethernet)
* Run webserver and add all the controls
* Make the camera's steam over the internet or sent in high quality withing the local network of the RV
* Log who accesses it
* Make access control (also need to find a way the Pi is not easily hacked
* Control all small displays in the RV
* Control a touchscreen in the RV
Script 6: (i think I'll run this on the Raspberry Pi in dashboard/cockpit)
* start a browser in full screen and lock it so it stays in full screen
* Switch automatically to helicopter view when RC is put in reverse
* Turn of screen with the push of an external button (or is it better to shutdown the compleet Pi?)
* I need to find a very light only browser Raspberry Pi distro
I hope you would like to help and educate me and am looking forward to your response!!!