Coder Social home page Coder Social logo

harryjubb / bee_iot Goto Github PK

View Code? Open in Web Editor NEW
31.0 5.0 2.0 1.44 MB

Beekeeping IOT project

Home Page: http://centaurea.land

License: MIT License

Dockerfile 2.96% Shell 9.28% Python 40.39% HTML 4.15% TypeScript 32.65% CSS 0.03% JavaScript 7.31% Jinja 3.24%
iot beekeeping raspberry-pi docker python3

bee_iot's Introduction

Bee IOT

A beekeeping IOT project: A/V streaming and sensor monitoring of hive activity.

Setup

Hive Pi setup

Prequisites

  • Recommended for development: Raspberry Pi 4B
  • Ethernet or WiFi connection to the Pi with >= 10 Mbps up / down
  • 32 GB high performance microSD card
  • Microphone: I2S microphone
  • Camera: Raspberry Pi Camera
  • Environment sensing: BME680 / BME688

Write a Raspberry Pi OS Image

  • Insert the microSD card into your computer
  • Confirm that it's the right card, and you've backed up anything important on it!
  • Download and run Raspberry Pi Imager
  • Choose operating system
  • Under Raspberry Pi OS (other), choose Raspberry Pi OS Lite (Legacy)
    • The "Legacy" (Debian Buster-based) version must be used for camera A/V streaming support
    • 64 bit versions may or may not work on Pi 3 / 4 / 400, but have not been tested
  • Choose the correct microSD card
  • Write
  • Remove the microSD card
  • Re-insert the microSD card
  • Navigate to the microSD in a terminal window, e.g. cd /Volumes/boot
  • Run touch ssh to enable SSH access
  • If using WiFi:
  • At the root of the microSD card (e.g. /Volumes/boot), create a wpa_supplicant.conf file, replacing the ssid and psk with the WiFi name, password, and security method as appropriate:
country=GB # Your 2-digit country code
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
    ssid="YOUR_NETWORK_NAME"
    psk="YOUR_PASSWORD"
    key_mgmt=WPA-PSK
}
  • Unmount (software eject) the SD card

  • Remove the microSD card from your computer

  • Ensure all required hardware (Pi camera, microphone, environment sensors) are connected to the Pi

  • Insert the microSD card into the Raspberry Pi and power it on

  • SSH into the Raspberry Pi to confirm it is connected

    • Use arp -a on your computer to help find the Pi on the network

Set up Ansible for deployment

Pi setup to run A/V streaming and environment sensing is automated using Ansible.

Ansible runs on your computer and connects to one or more Pis remotely, and ensures that the hive software is installed and running on each Pi.

Requirements
  • Python 3
  • sshpass
    • Debian-like: sudo apt-get install sshpass
    • On OS X: brew install hudochenkov/sshpass/sshpass
Setup
  • From the root of the repository, cd deployment/hives
  • One time: create a Python virtual environment (virtualenv) to use Ansible with:
python3 -m venv ansible && source ansible/bin/activate && pip3 install -r requirements.txt
  • Run source ansible/bin/activate to activate the virtualenv and make Ansible available
  • Run deactivate to deactivate the virtualenv when done

See the Python documentation for more information on creating virtual Python environments.

Set up the Ansible inventory file

Configurations for hive Pis are kept in deployment/hives/inventory/static.yml.

In the first instance, the static.yml file will need to be created. Copy static.example.yml in the inventory folder to static.yml and edit accordingly: see the comments in the example file.

Running

In a terminal on your computer:

# Activate the virtualenv if not done already
source ansible/bin/activate

# Run the playbook
# Assuming an inventory of Pis has been set up at inventory/static.yml
# see inventory/static.example.yml
ansible-playbook -i inventory/static.yml -v playbooks/hive.yml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.