Class Minion runs with python 2.7
- Setup Raspbian Lite on an SD card and boot RPI Zero
- Update distribution
sudo apt-get update && sudo apt-get upgrade -y
- Configure local, Wi-Fi, and enable ssh
- Connect to the pi over ssh and try:
# Install pip (required for installation of Minion's drivers)
# sudo apt install python3-pip
sudo apt install python-pip
# Install picamera (not available by default raspian lite)
# sudo apt install python3-picamera
sudo apt install python-picamera
# Change default python version system-wide (not needed, keep 2.7)
# sudo update-alternatives --install $(which python) python $(readlink $(which python2)) 1
# sudo update-alternatives --install $(which python) python $(readlink $(which python3)) 2
# Download software repository (git need to be installed on raspian lite)
sudo apt install git
git clone https://github.com/OceanOptics/Class_Minion2
# Read installation script and run it by hand step by step (might need to reboot half-way through)
sudo python setup.py
Upload MinionSleepMCU/MinionSleepMCU.ino to the Arduino Nano using Arduino IDE. Note that depending on your version of Arduino Nano, you might have to check the (Arduino Nano (older version)) in the board parameters to prevent issues.
When the RPi is turned on the script minion.py
is called. The script's logic is as follows:
- Check if known Wi-Fi in range:
- If available, the script stops and keep the RPi alive;
- Otherwise, it continues
- Check if the maximum number of pictures was captured:
- If true, the script stops and the system goes into sleep forever. A power cycle is needed to boot the system.
- Otherwise, it continues
- It takes a burst of pictures.
- Check if known Wi-Fi in range again
- If available, the script stops and keep the RPi alive;
- Otherwise, the system goes into deep sleep: powering off the RPi; which will be waked up by the Arduino X minutes later.
Test camera
raspistill -o picture.jpg
Test flash
python Class_Minion_tools/flasher.py
Set Real-Time Clock (Assume computer time is synchronized with internet time)
sudo hwclock -D -r
sudo hwclock -w
Test Real-Time Clock (get time)
sudo hwclock -r
Turn on Wi-Fi
sudo ifconfig wlan0 up
Turn off Wi-Fi
sudo ifconfig wlan0 down