JobeeArm

ARM computer: small & "powerfull"

We will try a video monitoring with OpenCV to count bees and possibily detect a borning swarm.

We need amore powerfull computer than a router like, to fetch image and run OpenCV on it.

Olimex Olinuxino A10 Lime

https://www.olimex.com/Products/OLinuXino/A10/A10-OLinuXino-LIME/

  • Allwinner A10 Cortex-A8 processor typically running at 1GHz and Mali 400 GPU
  • 512MB DDR3 RAM memory

Olimex A20-OLinuXino-MICRO

https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-MICRO/open-source-hardware

Raspberry PI3

Keyboard configuration

dpkg-reconfigure keyboard-configuration

Locales configuration

dpkg-reconfigure locales

Configure timezone

dpkg-reconfigure tzdata

Installed packages

openssh-server autossh opencv-data python-opencv screen inotify-tools git

Disable wifi

# create the file
#/etc/modprobe.d/local-blacklist.conf
# Disable wifi

blacklist brcmfmac
blacklist brcmutil

Disable Bluetooth

# create the file
#/etc/modprobe.d/local-blacklist.conf
# Bluetooth
blacklist btbcm
blacklist hci_uart

SSH configuration

ssh-keygen -t rsa

Autossh configuration

autossh -M 10984 -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -R 6666:localhost:22 jobeeuser@jodaille.org -p 22

With root, try at least one time to accept server key:

autossh -M 10984 -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -i /root/.ssh/jobee_jodaille -R 6666:localhost:22 jobeeuser@jodaille.org -p 22
#/etc/rc.local

# autossh
autossh -M 10984  -N -f -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -i /root/.ssh/jobee_jodaille -R 6666:localhost:22 jobeeuser@jodaille.org -p 22
 

Autossh with systemd

#/etc/systemd/system/autossh.service
# cf: http://nlug.ml1.co.uk/2016/03/resilient-ssh-with-autossh-andor-systemd/5148
[Unit]
Description=AutoSSH tunnel service port 7777
After=network.target

[Service]
Environment="AUTOSSH_GATETIME=0"
Environment="AUTOSSH_DEBUG=1"

ExecStart=/usr/bin/autossh -M 0 -N -T -q -o ServerAliveInterval=30 -o ServerAliveCountMax=3 -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -i /root/.ssh/andaines_jodaille -R 7777:localhost:22 jobeeuser@jodaille.org -p 22


[Install]
WantedBy=multi-user.target
 

Log output of screen

~/.screenrc

deflog on
shelltitle monitor
logfile /home/jobee/screen.log

Take a screenshot and scp to server

#!/bin/bash

IMAGENAME=`date +%Y-%m-%d%H%M%S`
echo $IMAGENAME



wget  http://admin:admin@192.168.1.13/tmpfs/snap.jpg -O $IMAGENAME.jpg && scp "$IMAGENAME.jpg" "jodaille.org:/var/www/wiki/snapshots/$IMAGENAME.jpg"
 
#crontab -e
* * * * * /home/jobee/snapshot.sh >> ~/snaplog.log
 

Make a gif

for file in `ls 2016-10*`;do echo $file;convert $file -crop 800x700+310+280 "thumb/$file.jpg" ;done;

convert *.jpg bees.gif