TITLE: BTI plant phenotyping system: Raspi computer and image collection
AUTHORS: Li'ang Yu

[DESCRIPTION]
Instructions on how to set up automated synching between Raspberry Pi operated PhenoRig and the server through WiFi connections 

[STEPS]
SECTION: Installation RaspiOS on Raspi Computer
1. Here, we download the archived RaspiOS to support the camera mode of Raspi camera. Then we used an image installer (eg: Etcher) to install the system into a micro-SD card. 

 
SECTION: Internet connection setup
3. Please use a router to set up the internet (WIFI). Here we use the LINKSYS app as an example to show the necessary configuration : 

For example :
Log in to the system using the following ID and password:   
 

SECTION: Connect raspi computer by server and PCs
6. To provide easy access to check information on each raspi. Please use ssh proxy to connect each raspi computer to your PC and working server. Here, we use the WinSCP to connect the device. 

Download the WinSCP: https://winscp.net/eng/index.php
SECTION: Internet connection setup
4. Check the devices connected to the internet by checking the "Local Network" icon under the "Status" tab. Further, click the "DHCP Client Table" to check each device. 
 
NOTE:
Please make sure that the "Client name" on LINKSYS matched the "HostName" of Raspi computer.  
 

SECTION: Connect raspi computer by server and PCs
7. Connect Raspi to PC 
Click "New Sites" and manually create the address as follows. Please make sure the Host Name and Port Number match the record from the step above and click Login to reach the connection.  
 

SECTION: Connect raspi computer by server and PCs
8. Connect Raspi to the SERVER
Using any existing users of SERVER in lab to login first. For example, use the Raspis user ID to log in. (If using SSH command: ssh -p 12345 Raspis@***.***.***.**) 

To log in to specific Raspi, use the ssh command to log in as same as the IP address and port number above. For instance, to connect RaspiR with SERVER

 


SECTION: Connect raspi computer by server and PCs
9. Using ssh command to transfer files by crontab 
Please install "sshpass" first using the following link: 
https://gist.github.com/arunoda/7790979

IMPORTANT!: Please use the ssh command to connect from host to client, as well as the client to host from two sides (As known as a handshake). Otherwise, the "sshpass" fails to transfer files. Using RaspiR as an example:

 

SECTION: Using Crontab to initiate the experiment
10. The code is used to launch each new experiment and realize the data transfer from each Raspi Computer to VASH server for storage.  

Config the raspi computer file and folder (For example):
 

Log in to vash and launch the setup code:

 


SECTION: Raspi Computer setup
2. 
 
If this is a new device, please use a monitor (or screen) to connect the Raspi computer and finish up the initial setup as follows: 

 
 
 Enter a new name in the hostname field and click Ok. For lab internal use, please set up the "Hostname" using the raspi device number and the same password for each device. 
For example: 
 
 
Remember to enable the camera under the  Raspberry Pi Configuration panel, as well as SSH transfer and I2C function:

 
SECTION: Internet connection setup
5. Match the "IPv4 address" of the connected devices to the port setup page. For instance, the "To IP address" of "raspiN" should be manually updated as same as the IPv4 address" listed in step above.