Skip to content

phenobox setup

Sebastian Seitner edited this page Jan 4, 2018 · 1 revision

Setup

This page will outline the required software setup to get the Phenobox up and running.

Prerequisites

  • Raspberry Pi 3 with Raspbian
  • Network File Share (NFS) to store the taken images to

Installation

  1. Allow the user pi access to the GPIO pins without sudo

    • Add a group called gpio and add the user pi to it
        sudo groupadd gpio
        sudo adduser pi gpio
    • Give this new group the necessary privileges for the according memory regions used to access the GPIO pins
       sudo chown root:gpio /dev/gpiomem
       sudo chmod g+rw /dev/gpiomem 
    • Finally if everything went right the permissions should look like this
        ls -l /dev/gpiomem 
        crw-rw---- 1 root gpio 244, 0 Nov 23 19:54 /dev/gpiomem
  2. Allow the user pi to shutdown the system without entering a password

    • use visudo to edit the sudoers file and add the following
       pi ALL=(ALL) NOPASSWD: /sbin/shutdown
    
  3. Automount the NFS on startup

    • Use an entry to /etc/fstab to accomplish this. Please refer to any tutorial on the web on how to do this.
  4. Install zBar

    sudo apt-get install libzbar-dev
    sudo apt-get install git-core
    sudo apt-get install python-dev 
    sudo pip install git+https://github.com/npinchot/zbar.git
  5. Install gphoto2

    • To install gphoto2 and libgphoto2 please use gphoto2-updater
    • To install the python bindings use
      pip install -v gphoto2
  6. Download the code under /phenobox from the repository onto the Pi and run the following in the root directory of the project

    pip install -r requirements
  7. Create a file called 'production_config.py' under 'phenobox/config' and fill it according to the description of a sample file

  8. Set up a cronjob for user pi to execute the autorun.sh script on reboot

    • Use the following to create a new cronjob
      sudo crontab -e -u pi
    • Enter the following to run the autorun.sh script contained in the repository on ever reboot
      @reboot cd /home/pi/photobox; /usr/bin/python autostart.py >> /home/pi/phenobox_cron.log 2>&1
      

Congratulations your Raspberry Pi should be ready to power the Phenobox