Skip to content

Latest commit

 

History

History
295 lines (181 loc) · 8.92 KB

install.rst

File metadata and controls

295 lines (181 loc) · 8.92 KB

Installation

The CameraNetwork system is made of three logical parts:

  1. Server: The camera unit. The server performs the actual measurements.
  2. Client: A program that enables remote control of servers.
  3. Proxy: A program that bridges and manages the communication between the Servers and Clients.

There can be multiple Servers and Clients but only one proxy.

The CameraNetwork package contains the code for both the Server, Client and Proxy subsystems. This simplifies the deployment and enables code reuse. The installation procedures is similar for the three components but differs due to the different platforms.

The CameraNetwork is implemented completely in Python <http://www.python.org/>_.

  1. Install conda. Tested on conda 4.7.11

  2. Clone the cameranetwork package:

    git clone https://github.com/Addalin/cameranetwork.git
    
  3. Navigate to it:

    cd cameranetwork
    
  4. Create virtual env:

    LINUX: Create conda virtual environment from cn_client_ubuntu18.yml

    conda env create -f cn_client_ubuntu18.yml
    

    Note

    The first line of sets the new environment's name (currently cn_client)

    WINDOWS (exact procedure):

    # Create new environment with name: cn_client
    
    conda create -n cn_client --yes
    
    conda activate cn_client
    
    conda config --env --set restore_free_channel true
    
    conda config --env --append channels conda-forge
    
    conda install python=2.7 pip paramiko cython tornado=4.5.3 futures numpy scipy matplotlib beautifulsoup4 scikit-learn scikit-image pyside requests ephem pandas=0.19.2 ipython pyfirmata joblib pyzmq enaml pillow traits pyqtgraph pyopengl vtk mayavi opencv git mercurial
    
    
    
    # pip install pymap3d, traits-enaml and pyfisheye
    # Note, this installs pyfisheye without cloning it. For development of pyfisheye clone and install manually from https://bitbucket.org/amitibo/pyfisheye (TODO: migrate pyfisheye codebase to github)
    
    python -m pip install pymap3d==1.1.1 git+https://github.com/enthought/traits-enaml.git@update-data-frame-table  hg+https://bitbucket.org/amitibo/pyfisheye
    
  5. Activate the environment:

    conda activate <venv_name>
    
  6. Install the cameranetwork package

    python setup.py develop --user
    

    Note

    without --user it installs the scripts for all users (Windows: C:ProgramDataAnaconda2Scripts)

  7. Verify successful installation by opening the GUI:

    python scripts_client/camera_client.py
    

The server software is run on an Odroid U3 as at the time of selection it offered a unique balance between capabilities and cost. Nonetheless it should be straight forward to install the CameraNetwork package and its prerequisites on other platforms like newer Oroids and even on the RaspberrPi.

In the following we detail the procedure of installing the required prerequisites and main package. Note that once the package is installed on one computer, it is much more time effective to create an image of the Odroid memory card and duplicate it as needed.

Currently the code assumes that the proxy server is run on an ec2 instance. Installation on the proxy follows the same steps of installation on the client.

Before running make sure to update in the global setting the ip address: DEFUALT_PROXI_PARAMS And make sure this is updated in all end units!

To run the proxy program, do::

python ./code/cameranetwork/scripts_proxy/start_proxy.py --log_level info

or

start_proxy.py

Savox SunShader Servo pins:

  1. Brown (Gnd) = Gnd
  2. Red (5V) = 5V
  3. Orange (Signal) = PIN NUM

To use CameraNetwork several software package are needed. This can be installed using the following commands. Copy paste these to a commandline:

> sudo apt-get install python-pip git mercurial screen autossh
> sudo pip install paramiko
> sudo pip install cython
> sudo pip install pyzmq --install-option="--zmq=bundled"
> sudo pip install tornado==4.5.3
> sudo pip install futures
> sudo apt-get install python-numpy python-scipy python-matplotlib
> sudo pip install beautifulsoup4
> sudo pip install sklearn
> sudo pip install skimage
> sudo pip install ephem
> sudo pip install pandas
> sudo pip install pymap3d
> sudo pip install ipython
> sudo pip install pyfirmata
> sudu pip install joblib

To install opencv3 follow a tutorial relevant to your system, e.g. on Odroid XU4 the following tutorial was usefull opencvsh_for_ubuntu_mate.

Install the python wrappers to the ids SDK:

> mkdir code
> cd code
> git clone https://github.com/amitibo/ids.git
> cd ids
> sudo python setup.py install

Install the pyfisheye module:

> cd ~/code
> hg clone https://[email protected]/amitibo/pyfisheye
> cd pyfisheye
> sudo python setup.py install

Some platforms might require the installation of modem software:

> sudo apt-get install network-manager
> sudo apt-get install network-manager-gnome

The first instal nmcli (used for activating the connection). The second intalls nmcli-connection-editor used for defining the mobile network connection.

Install a recent version of usb_modeswitch (required on raspberryPi). Follow the usb_modeswitch tutorial. To compile the above code you will need to install the libusb-1 dev files:

> sudo apt-get install libusb-1.0-0-dev

Prepare a device reference file from the following device reference file and run it using the command:

> sudo usb_modeswitch -c <path to device file>

Download and install the package:

> git clone https://[email protected]/amitibo/cameranetwork_git.git cameranetwork
> cd cameranetwork
> python setup.py develop --user

Note

The first command downloads a slim version of the code that only includes the Server components.

To make the system start automatically at boot time, we use the rc.local script:

> sudo cp cameranetwork/scripts/rc.local/rc.local /etc/rc.local

Run the camera setup script to setup the camera environment.

> setup_camera.py

You will be asked for a camera id. Enter a unique camera id number.

It is recommended to install python using the Anaconda distribution. Install the CameraNetwork package:

> git clone https://[email protected]/amitibo/cameranetwork_git.git cameranetwork
> cd cameranetwork
> python setup.py develop --user

It is recommended to install python using the Anaconda distribution. Install the CameraNetwork package:

> git clone https://[email protected]/amitibo/cameranetwork_git.git cameranetwork
> cd cameranetwork
> python setup.py develop --user
  1. Create conda virtual environment:

    conda create --name <venv_name> --no-default-packages
    conda config --add channels conda-forge
    conda activate cnvenv
    
  2. Install prerequisites:

    conda install python=2.7 pip paramiko cython tornado=4.5.3 futures numpy scipy matplotlib beautifulsoup4 scikit-learn scikit-image ephem pandas ipython pyfirmata joblib
    pip install pyzmq --install-option="--zmq=bundled"
    pip install pymap3d
    conda install enaml pillow traits pyqtgraph pyopengl vtk mayavi opencv
    
  3. Install additional modules:

    pip install ephem
    conda install -c anaconda pil
    conda install -c anaconda enaml
    conda install -c anaconda traits pyqtgraph pyopengl
    conda install -c anaconda vtk
    pip install mayavi
    
  4. Install traits-enaml:

    git clone https://github.com/enthought/traits-enaml.git --branch update-data-frame-table
    cd traits-enaml
    python setup.py install
    cd..
    
  5. Install the cameranetwork package
    1. Navigate back to cameranetwork:

      cd ..
      
    2. Install the cameranetwork package:

      python setup.py develop --user
      

    Note

    without --user it installs the scripts for all users (Windows: C:ProgramDataAnaconda2Scripts)