- Raspberry Pi OS Lite (64-bit)
- Python 3.10
- Python Libraries :
- numpy 1.22.2
- pandas 1.4.1
- feather-format 0.4.1
- Python 3.10
- Python Libraries :
- numpy 1.22.2
- pandas 1.4.1
- feather-format 0.4.1
- matplotlib 3.5.2
- RaspberryPi type : RaspberryPi-4
- RaspberryPi name : raspberrypi-projetMOON
- piUser : projetMOON
For windows with powershell :
- Connect to raspberryPi with SSH :
ssh piUser@piName
- Send file to raspberryPi :
scp dataToSend piUser@piName:/home/piUser/folderPath
- Retrieve file from raspberryPi :
scp piUser@piName:/home/piUser/FilePath localFilePath
if you are already in localFilePath, replace localFilePath by ".\"
For raspberry-pi terminal :
- View file in directory :
ls
- change directory :
cd directoryName
if you want to go in parent folder change directoryName by .. - remove file :
rm fileName
- read file :
cat fileToRead
- start pyhton script
python script.py
- start experience script
nohup python experience.py ftrFile.ftr
You need to use the Raspberry Pi Imager software available here : https://www.raspberrypi.com/software/
You need to chose the Raspberry Pi OS Lite(64-bit). Don't use 32-bit OS because some library needs a 64-bit OS.
You can find it in Raspberry Pi OS (other) menu.
Select the SD card you will use for the raspberry pi.
You need to change multiple parameter before writing the OS in the SD card :
You can find the parameter in the gear.
- Chose for all sessions in Image customization options
- Change the raspberry pi name
- Activate SSH :
use authentification by password - Define username and password
- Configurate the wifi
You can write the OS in the SD card and your OS it's ready !
You need to install dependencies.
- Connect to your raspberry pi via SSH :
ssh piUser@piName
use the piUser and piName you have setup in step 3. - Install OS update :
sudo apt update
sudo apt upgrade
- Install python :
sudo apt install python3.10
- Install python library :
pip install numpy
pip install pandas
pip install feather-format
- Create directory :
mkdir data
mkdir userData
All the dependencies are installed you can close the SSH connection by closing the terminal.
You need to transfert all necessary file on raspberry pi.
Download following file from the repository :
- armerPompe.py
- controle.csv
- controle.py
- dataPreparation.py
- experience.py
- resetGPIO.py
repeat the following command for each file in the list to transfert to raspberry pi :
- Send file to raspberryPi :
scp fileToSend piUser@piName:/home/piUser
The setup of the raspberry pi is complete.
- red wire to Mosfet 1 Drain
- black wire to Mosfet 1 Source
- red wire to Mosfet 2 Drain
- black wire to Mosfet 2 Source
- red wire to Mosfet 3 Drain
- black wire to Mosfet 3 Source
- wires to Mosfet 4 Drain/Source
- wires to Mosfet 5 Drain/Source
- wires to Mosfet 5 Drain/Source
- pin 4 (Alimentation 5V) to 5 V
- pin 6 (GND) to GND
- pin 11 (GPIO 17) to Mosfet 1 Gate
- pin 13 (GPIO 27) to Mosfet 2 Gate
- pin 15 (GPIO 22) to Mosfet 3 Gate
- pin 29 (GPIO 5) to Mosfet 4 Gate
- pin 31 (GPIO 6) to Mosfet 5 Gate
- pin 33 (GPIO 13) to Mosfet 6 Gate
The data need to be in csv file. The separator need to be ",".
Your data are presented like this :
time | conc1 | conc2 |
---|---|---|
0 | 1 | 1 |
2 | 6 | 8 |
10 | 2 | 1 |
15 | 4 | 2 |
time correspond of time from the start in second.
conc1 and conc2 it's the concentration of element at time t.
If you have download dataPreparation.py on your computer you can convert your data on your computer directly. For convert your data directly on your computer follow the Step 3 before the Step 2.
Transfert your data on the raspberry pi in the folder userData.
Open terminal in the folder of your data and use this command :
scp dataToSend piUser@piName:/home/piUser/userData
If you have convert your data directly on your computer use this command instead :
scp dataToSend piUser@piName:/home/piUser/data
- Connect to your raspberry pi via SSH :
ssh piUser@piName
- run dataPreparation.py :
python dataPreparation.py
Indicate the name of your data when ask.
Your data is now converted and placed in data.
The data converted is named by the date of creation like this:
year-moth-day_hourminsec.ftr
you can check the name of the data created in the folder data using :
cd data
ls
it will show all the data in the folder data.
Before convert your data on Windows make sure you have the optionnal requirement on your computer.
Create 2 folder in directory of dataPreparation.py:
- userData
- data
Put your data to convert in userData folder.
Run dataPrepartion.py and indicate the name of your data when ask.
Your data is now converted and placed in data.
The data converted is named by the date of creation like this:
year-moth-day_hourminsec.ftr
You can check the data created using the script verificationFtr.py
Now you can do Step 2.
For start experience connect to raspberry pi if it's not already done :
ssh piUser@piName
Run experience.py in background with :
nohup python experience.py dataToUse.ftr
Close the terminal.
The Experience is running Step 5 and 6 will show you how to interact with experience.
If you want take sample or make an observation during the experience you need to suspend the process.
- Connect to raspberry pi :
ssh piUser@piName
- run controle.py
python controle.py
- Chose what you want to do :
- Sample
For take a sample, you need to indicate which quantity you take. - Observation
For observe the cells. - Restart cycle
When you have finished your sample/observation restart the cycle. - Log
For see the last log of the experience. - Stop
Force stop of the experience if something goes wrong. - Cancel
Close controle.py
- Sample
When you have finished dont forget to restart cycle and you can press cancel for close controle.py.
- Connect to raspberry pi :
ssh piUser@piName
- Open the log:
cat output.log
For debug log use instead :
cat nohup.out