Code
- Available via git
Start the camera server
- ssh onto the pi: ssh e320@e320pi
- (optional/advanced): start a 'screen' session with 'screen'.
Then you can detach from the server via CTRL+A, CTRL+D (the server remains alive even after you close the ssh connection)
run 'screen -r' to reattach - run the server code as root
Troubleshooting
- If the pi is not reacting: toggle powerstrip to reboot it (takes 30-60 seconds)
Start the viewer on a facet control computer (e.g., trailer)
You are already logged onto the control computer, but you need to establish a port forwarding (or use x-forwarding):
- ssh back to mcclogin: ssh smeuren@mcclogin -Y
- make sure you have bash (on mcclogin): bash
- source /afs/slac/g/lcls/package/anaconda/envs/python3.8env/bin/activate
- git clone /afs/slac/g/cd/swe/git/repos/slac/FACET/facet-E320.git/
- cd facet-E320/tunnelpi/cameraserver
- python3 camviewer.py
Start the viewer: on mcclogin
- Log onto the FACET control server with a proper ssh port tunnel and X-window forwarding:
- get onto the SLAC network: ssh smeuren@rhel6-64.slac.stanford.edu -Y
- get onto mcclogin: ssh smeuren@mcclogin -Y
- make sure you have bash: bash
- get a python3 env: source /afs/slac/g/lcls/package/anaconda/envs/python3.8env/bin/activate
- clone into git if needed: git clone /afs/slac/g/cd/swe/git/repos/slac/FACET/facet-E320.git/
- get to the right folder: cd facet-E320/tunnelpi/cameraserver
- run the script: python3 camviewer.py
Start the viewer: on the FACET control server
- Log onto the FACET control server with a proper ssh port tunnel and X-window forwarding:
- get onto the SLAC network ssh smeuren@rhel6-64.slac.stanford.edu -Y
- get onto mcclogin ssh smeuren@mcclogin -Y
- get onto the control server ssh fphysics@facet-srv01 -Y -R 42000:e320pi:42000
- get a python environment source $PACKAGE_TOP/anaconda/envs/python3.7env/bin/activate
- clone into git if needed git clone ssh:///afs/slac/g/cd/swe/git/repos/slac/FACET/facet-E320.git
- go to the right folder cd facet-E320/tunnelpi/cameraserver/
- run the viewer script python3 camviewer.py
Streaming of color video from standard webcam (Apr 2022)
- Currently used webcam supports a maximum of 5 FPS at 1920x1080 pixel
- Data a read in YUV format from the camera, converted to BGR via OpenCV (c++ code)
- One core of the Raspberry pi devotes 20% CPU time to the image conversion
- Data can be read directly into a numpy array for display on the client side (3x8-bit BGR)