Skip to content

winzlebee/beebit-iot

Repository files navigation

BeeBit IoT Component

This repository contains all the necessary files to run the BeeBit IoT software that automatically counts individuals in a space in a number of ways.

Instructions

Linux

Building on Linux is relatively straightforward. The below instructions are designed for debian-based distros. such as Ubuntu

Make sure you don't have OpenCV installed from the default package manager.

sudo apt remove libopencv*
  1. Run the unified install script to install all dependencies and run the program
sudo make deps && ./beetrack

Uninstallation

If you'd like to uninstall the dependencies and tracker at any time, simply run;

make clean
./scripts/install_opencv.sh uninstall

Raspberry Pi

Support for raspbian, specifically raspbian stretch is provided by a unified install script. The requirement of one version of the distribution is due to our use of source-controlled pre-compiled OpenCV binaries. This limitation would subside if compilation time on the raspberry pi of OpenCV was feasable.

NOTE: This process installs all the dependencies and sets up the tracker to run on boot of the device. It will use a lot of CPU. The beebit service can be disabled with systemctl stop beebit

make depsPi
sudo make install

The netconf.py script is also installed as a service. The purpose of this script is to allow configuration of wireless networks on the device remotely, from the convenient web user interface. Rest assured the netconf script will not hijack network connections - it instead works by injecting information about available networks into wpa_supplicant.conf

Uninstallation

The pi installation can be reversed with

sudo make uninstall

Manual installation of OpenCV libraries

If for some reason the install script doesn't work, the below instructions should assist the debugging process.

  1. Install all the required dependencies.
sudo apt install libcurl4-openssl-dev build-essential libgtk2.0-dev
  1. Download opencv 4.1.1 (the lastest version as of the time of writing) from here
  2. Download the opencv contrib repository here
  3. Use the following commands to extract the archive and install OpenCV with the contrib modules. The default flags are fine.
unzip opencv-4.1.1.zip
unzip opencv_contrib-4.1.1.zip

cd opencv_contrib-4.1.1/modules
rm -r !("tracking"|"plot")
cd $HOME/Downloads

mkdir opencv-4.1.1/build && cd opencv-4.1.1/build
cmake ../ -D OPENCV_EXTRA_MODULES_PATH=$HOME/Downloads/opencv_contrib-4.1.1/modules
make -j4
sudo make install
  1. OpenCV is now installed to /usr/local/. Let's make sure that our linker knows where to find the libraries. NOTE: This will change depending on your environment.
cd /etc/ld.so.conf.d/
sudo echo /usr/local/lib/ >> x86_64-linux-gnu.conf
sudo ldconfig