Git Product home page Git Product logo

boxus's Introduction

Boxus

PyPI version Build Status Maintainability Test Coverage Issue Count

About

Inspired by Ruby on Rails ActiveRecord and powered by Nanpy high-level framework for easy control of multiple devices connected to the Raspberry Pi and Arduino via GPIO. Core of the open DIY project of building automated plants grow pod.

Currently supported out of the box sensors:

  • DHT digital temperature and humidity sensor (DHT11 tested)
  • Analog soil moisture sensor (1. turn on power; 2. read analog input; 3. turn off power in order to minimize galvanic corrosion)
  • Generic (digital and analog reads from one input pin)

and devices:

  • Relay (turned on – LOW output state; turned off – default and HIGH output states)
  • Generic (turned on – HIGH output state; turned off – default and LOW output states)

Use declarative YAML syntax to specify how your sensors and devices are connected, e.g.:

sensors:
  -
    _id: sensor_1
    description: DHT11 Temperature and humidity sensor
    type_name: dht
    control: native
    measurements:
      - temperature
      - humidity
    pins:
      input:
        type: digital
        number: 4
        dht_version: 11

devices:
  -
    _id: dev_1
    description: Main water pump
    type_name: relay
    control: arduino
    arduino_port: /dev/ttyUSB0
    pins:
      power:
        type: digital
        number: 4

Put all seed info into the yml file (see e.g. seed.example.yml) and use DB class to import it into the CouchDB:

from boxus import DB

db = DB()
db.seed('/path/to/seed.yml')

Then easily read all your sensors and save data into the CouchDB

from boxus import DB, Sensor

db = DB()

sensors = Sensor.all(db)

for s in sensors:
    s.read()

turn on/off your devices

from boxus import DB, Device

db = DB()

dev = Device.find(db, 'dev_1')
dev.on()
dev.off()

or create a watchdog script (see watchdog.py example) and install CRON job using Manager:

from boxus import Manager

manager = Manager()
# E.g. every 10 minutes
manager.install_cron('/path/to/python /path/to/watchdog.py', 10)

Installation

Requirements

MacOS

brew install couchdb

or Linux

sudo apt-get install couchdb

The latest development build

git clone https://github.com/boxus-plants/boxus.git
cd boxus
pip install -e .

The latest stable release

pip install boxus

Requirements

Hardware

  • Raspberry Pi (Pi 3 tested)
  • Arduino (Nano v3 tested)

Software

Required

Optional

boxus's People

Contributors

ololobus avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

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.