Using the Camera Network Package


After successful installation, start the Client GUI by navigating to:

cd cameranetwork/scripts_client

then run python

You should now see


after pressing on servers, you should see all connected cameras, in this case camera id 236.


pressing on the camera ID should lead to the camera interface screen


sun Shader


The angle slider allows manual setting of sunshader angle. The scan button moves the sunshader throughout it’s whole range, then according to the point with least sunlight (as shown in the graph) determines the sunshader optimal angel.



The Sprinkle tab and corresponding button allows to manually activate the sprinkler system in order to clean the camera len dome. Period Refers to activation time in seconds.

Camera (server)

Field Deployment

  1. Verify Case Screws fully tightened.
  2. Verify plugs fully screwed.
  3. Verify sprinklers are pointing in the right direction
  4. Verify camera alignment with north-south


After changing any parameter, need to run again.


There are options to connect to the camera

Serial connection

On the Client’s PC, from cameranetwork folder:

bash scripts/ to list all connected usb devices and to find the relevant one. Should be /dev/tty/USB0 (replace ‘0’ with relevant number)

  1. Follow driver installation instructions by Odroid.
  2. Linux: Run sudo minicom in Client PC’s terminal. Windows: Use Teraterm.
  3. Enter odroid username
  4. Enter odroid password


  1. Via SSH


  1. Via GUI (as mentioned in the client section)


To connect to the proxy

sudo ssh -i <path_to_key> ubuntu@<proxy_ip>


sudo chmod 400 <path_to_private_key> if permission error is encountered.


<path_to_key> is the path and name of the proxy’s private key <proxy_ip> is defined in Currently

If this is the initial setup of the proxy server:

screen -S session_name
python ./code/cameranetwork/scripts_proxy/ --log_level info

Should be run from the root of the server, otherwise the logs would be put in a different location each time. Screen is used to be able to detach and retrieve when ever needed.

  • Press ctrl+a then ctrl+d to detach the from the terminal
  • screen -ls to see detached processes. then screen -r <name> to bring it back.

Noticable stuff

tunnel_port_<camera_id>.txt stores the odroid’s password and tunnel_port (random int between 20,000 and 30,000).

/proxy_logs/cameralog_<date+time of ____ initialization>_proxy.txt is a log. Mainly shows Heartbeats from connected cameras and notification of message transmissions to/from the client.


Image Acquisition flow

On Odroid: rc.local –> main( –> start( –> loop_timer( –> handle_loop( –> safe_capture( –> IDSCamera.capture (

Useful commands

  • ps -ef | grep python to view running python processes (should see!)
  • sudo netstat -a -nlp -o | grep 198 to see status of relevant ports
  • adding ssh key to ssh-agent.
  • How to use scp to transfer files. For example to retrieve proxy log from proxy to client: scp ubuntu@ /home/shubi/Desktop/log
  • gparted for microsd / eMMC partitioning & direct copying.
  • sudo dd if=/dev/sdb of=~/xu4_lab.img status=progress to create an image of odroid
  • etcher to flash image onto the SD card
  • grep -a -e "Unregistering worker 236" -e "Registering new worker 236" cameralog_190929_092735_proxy.txt
    to see connections and disconnections. replace log.txt with * for all logs in folder.
  • du -ah --max-depth=1 | sort -hr to see size of all subfolders and files

Data Structures

When looking at a specific camera, under captured_images, for each that the camera recorded a folder <%Y-%M-%D> is created. Inside, the images are stored as .mat files. In addition there is a thumbnail .jpg version, add metadata as .pkl. The name is utctime_date+exact time. The .pkl file stores the following data:

img = pd.read_pickle('~/captured_images/2019_10_02/1570011900.0_2019_10_02_10_25_00_3.pkl')

In addition, one database.pkl is created and stored per day:

database = pd.read_pickle('~/captured_images/2019_10_02/database.pkl')

Time                hdr   path                                                                            longitude  latitude   altitude  serial_num
2019-10-02 00:00:00 0    /home/odroid/captured_images/2019_10_02/1569974400.05_2019_10_02_00_00_00_0.mat  35.024963  32.775776  229       4103098529
2019-10-02 00:30:00 0    /home/odroid/captured_images/2019_10_02/1569976200.05_2019_10_02_00_30_00_0.mat  35.024963  32.775776  229       4103098529
2019-10-02 01:00:00 0    /home/odroid/captured_images/2019_10_02/1569978000.05_2019_10_02_01_00_00_0.mat  35.024963  32.775776  229       4103098529
2019-10-02 01:30:00 0    /home/odroid/captured_images/2019_10_02/1569979800.05_2019_10_02_01_30_00_0.mat  35.024963  32.775776  229       4103098529
2019-10-02 08:48:03 0    /home/odroid/captured_images/2019_10_02/1570006083.33_2019_10_02_08_48_03_0.mat  35.024963  32.775776  229       4103098529

Analyzing Results

On Client PC:

cd /cameranetwork/scripts_client
python <path_to_experiment_data>


  • Make sure to activate environment beforehand: conda activate cn_client
  • -l flag is used for local proxy (instead of real proxy server)
  • -d flag is for opening gui separately.

workflow + data structure:

#. Run python -d ~/experiment_23_09_2019 in the background where experiment_date is a folder containing cam_ID folder for each camera involved. Each cam_ID should consist of

  1. captured_images folder which stores inside a folder with images(.jpg, .mat & .pkl versions) and database.pkl for each day that the camera recorded.
  2. dark_images folder
  3. sun_positions folder, containing a folder with .csv containing the positions of the sun (and moon!) with format: timestamp, object, pos_x, pos_y, sunshader_angle, row each 6 minutes for sun and every 1 minute for moon.
  4. Additional pkl’s and json’s and other (important!) files.
  1. Run python
  2. You should see a list of all real & virtual cameras.