Mar 01, 2024

Public workspaceBTI plant phenotyping system: Raspi computer and image collection

  • 1Boyce Thompson Institute
Open access
Protocol CitationLi'ang Yu 2024. BTI plant phenotyping system: Raspi computer and image collection. protocols.io https://dx.doi.org/10.17504/protocols.io.j8nlkk156l5r/v1
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: June 22, 2022
Last Modified: March 01, 2024
Protocol Integer ID: 65125
Abstract
Instructions on how to set up automated synching between Raspberry Pi operated PhenoRig and the server through WiFi connections
Installation RaspiOS on Raspi Computer
Installation RaspiOS on Raspi Computer
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.


Raspi Computer setup
Raspi Computer setup


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:
Hostname: RaspiR
Password: ******
Remember to enable the camera under the Raspberry Pi Configuration panel, as well as SSH transfer and I2C function:


Internet connection setup
Internet connection setup
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:


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.


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.



Connect raspi computer by server and PCs
Connect raspi computer by server and PCs
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.

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.


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

ssh -p 9005 pi@***.***.***.**


Using ssh command to transfer files by crontab
Please install "sshpass" first using the following link:

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:

Login to VAHS first and type in:
ssh -p 9005 pi@.***.**.**

Login to raspiR then and type in:
ssh -p 14817 Raspis@***.***.***.***

Using Crontab to initiate the experiment
Using Crontab to initiate the experiment
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):
### Create an image factory for each Raspi (Using R as example)
mkdir /home/pi/Documents/raspiR_image_factory

### Create a text file with raspi password included
nano /home/pi/Documents/raspiR_image_factory

Log in to vash and launch the setup code:

### Reach the setup code:
bash /mnt/Knives/image_factory/new_experiment.sh