Installation

Bofu Chen edited this page Oct 27, 2018 · 24 revisions

There are two ways to install BerryNet:

  1. Install from pre-built image (suggested for new comer)
  2. Install from source

If the reference command listed below starts with host, it means you should do it on the host machine (a Linux PC is preferred). If it starts with rpi, it means you should do it on Raspberry Pi.

Install From Pre-Built Image

  1. Download the latest image. To check the integrity of the downloaded image, you can check the md5sum of the image and compare it with the checksum file.

    Assuming that the image is saved to /home/DT42/Downloads/ directory.

    host $ md5sum /home/DT42/Downloads/berrynet-2.3.0.img
    60482eab1245a898fabbaf960475a4ec  berrynet-2.3.0.img
    

    Note:

    1. The image size is quite big (>6G), please make sure you have stable internet connection and be patient :).
    2. You can get older releases from prior release notes
  2. Write image to SD card

    Assuming that the inserted SD card is represented as /dev/sdb on system. (If you see other similar device notes like /dev/sdb1 or /dev/sdb2, you can ignore them without causing any problem.)

    host $ sudo dd bs=4M if=/home/DT42/Downloads/berrynet-2.3.0.img of=/dev/sdb status=progress
    
  3. (Optional. you can do this step now, or later after installation is completed) Setup Wifi, do this if you plan to use Wifi to send out inference results or if you plan check the dashboard from another machine instead of connecting the monitor directly to Raspberry Pi.

    Edit Wifi configuration

    host $ sudo vim /media/<user>/<fs-partition>/etc/wpa_supplicant/wpa_supplicant.conf
    

    and add your Wifi AP information

    network={
        ssid="<ap-name>"
        psk="<ap-password>"
        key_mgmt=WPA-PSK
    }
    
  4. Boot RPi3 with the SD card, and login.

    1. Connect keyboard, mouse, and monitor to RPi3.
    2. Insert SD card to RPi3.
    3. Connect camera to RPi3.
    4. Connect power adapter to RPi3.
  5. Resize filesystem size manually

    Launch raspi-config

    rpi $ sudo raspi-config
    

    and choose "Advanced Options" -> "Expend Filesystem".

  6. Reboot RPi3 and login again.

  7. BerryNet is ready to go now.

  8. (Optional) Restart mongodb service if broker keeps restarting

    If there is MongoError: failed to connect to server in log:

    rpi $ berrynet-manager log | grep MongoError
    

    Please stop BerryNet, restart mongodb, and start BerryNet again, then this issue will disappear.

    rpi $ berrynet-manager stop
    rpi $ sudo service mongodb restart
    rpi $ berrynet-manager start
    

Install From Source

Steps for JavaScript Codebase

Here are the steps to install BerryNet on RPi:

  1. Get BerryNet source codes

    $ git clone https://github.com/DT42/BerryNet.git
    $ cd BerryNet
    
  2. Execute installation script

    $ ./configure
    

The installation will take a while.

If the installation is completed successfully, next step is to configure your BerryNet.

Steps for Python Codebase

  1. Get BerryNet source codes

    $ git clone https://github.com/DT42/BerryNet.git
    $ cd BerryNet/berrynet
    
  2. Build Python Wheel package

    $ python3 setup.py bdist_wheel
    
  3. Install Wheel

    $ pip3 install dist/berrynet-<version>-py3-none-any.whl
    

    Note: Example clients are also included.

Enable BerryNet Repository

Our goal is to push BerryNet SW components into Debian repository as many as possible. Before the process is completed, or some components will not be accepted because of Debian policy violation (e.g. close sourced Movidius SDK), you can install these SW components from BerryNet repository.

Steps to enable BerryNet repository (included in JS installation script):

  1. Add repository source config

    $ sudo cat "deb https://raw.githubusercontent.com/DT42/BerryNet-repo/master stretch/" > /etc/apt/sources.list.d/berrynet.list
    $ sudo apt-get update
    

Meet Troubles

If the installation fails, you can

  1. Check is it an known issue
  2. Create an issue report
  3. Share the problem with the community

and we will try our best to check it.


In The Future

We are packaging BerryNet and its dependencies to be Debian packages. The long-term goal is that user only needs to execute

$ sudo apt install berrynet
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.