Skip to main content

A Client module for Agrothon

Project description

Agrothon Client

A Client for Agrothon Running in Raspberry Pi

PyPI PyPI - Python Version PyPI - Wheel PyPI - Implementation PyPI - Downloads GitHub license GitHub issues GitHub forks GitHub stars

Installation

  • First Install the dependencies

    sudo apt-get update
    sudo apt-get install python3-opencv python3-rpi.gpio
    
  • from Pypi

    pip3 install AgroClient
    
  • From git

    pip3 install -U git+https://github.com/viswanathbalusu/Agrothon-Client
    
  • Using Docker

    • First install docker

      curl -sSL https://get.docker.com | sudo sh
      sudo usermod -aG docker ${USER}
      
    • Get the docker-compose.yml and agrothonclient.env to a local directory

      wget -q https://raw.githubusercontent.com/viswanathbalusu/Agrothon-Client/main/docker-compose.yml
      wget -q https://raw.githubusercontent.com/viswanathbalusu/Agrothon-Client/main/agroclient-sample.env -O agroclient.env
      
    • Edit the Variables in agroclient.env and start docker container

      pip3 -q install docker-compose
      docker-compose up -d
      
    • Docker method only works one arm-v7 host OS

Usage

usage: AgroClient [-h] -y HOSTNAME -a APIKEY [-u USB] [-p1 PIR1] [-p2 PIR2]
                  [-p3 PIR3] [-p4 PIR4] [-br BAUDRATE] [-r RELAY]

optional arguments:
  -h, --help, show this help message and exit
  -y, --hostname HOSTNAME, API Server host name
  -a, --apikey APIKEY, API Key of host
  -u, --usb USB, USB Port of Arduino
  -p1, --pir1 PIR1, GPIO Pin of PIR1
  -p2, --pir2 PIR2, GPIO Pin of PIR2
  -p3, --pir3 PIR3, GPIO Pin of PIR3
  -p4, --pir4 PIR4, GPIO Pin of PIR4
  -br, --baudrate BAUDRATE, Baud rate of USB Port to read sensor data
  -r, --relay RELAY, Relay Signalling GPIO pin

Circuit Diagram

Circuit

Hardware

Hardware

Pin Configuration (Default)

  • Raspberry Pi

    GPIO Device Use Mode
    12 Relay To Switch on/off Relay OUT
    25 PIR1 Motion Detection IN
    8 PIR2 Motion Detection IN
    7 PIR3 Motion Detection IN
    1 PIR3 Motion Detection IN
  • Arduino nano

    Pin Device Device pin Mode
    A0 Moisture Sensor* Analog Out IN
    D12 DHT11 Signal IN

    * For multiple sensors use differnet Analog pins

  • Connect the Pi camera to CSI Port

  • Use SSH to access the terminal and run the Python Code

  • Connect all the Vdd's and GND's to 5V and GND (or as per instructions given in spec sheet)

Note

  • To get the USB Device ID, Use

    ls /dev/tty*
    

    Most Probably the Value will be /dev/ttyUSB0

  • Sensor data should be sent in the following pattern

    mositure1,moisture2,moisture3, .... ,moistureN, Temperature,Humidity
    ex : 55.29,52.59,32.5,65.26
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

AgroClient-1.1.2.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

AgroClient-1.1.2-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file AgroClient-1.1.2.tar.gz.

File metadata

  • Download URL: AgroClient-1.1.2.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.10

File hashes

Hashes for AgroClient-1.1.2.tar.gz
Algorithm Hash digest
SHA256 1e5ab428208f6c241e3819354084ff9737f6d3bde69ad86fd4ab98531103eace
MD5 5f74674803d3cac0c1725b7bfd42e231
BLAKE2b-256 d4c9b19a34267efae725b806dc20a4afd7fafbc033249e43713709b054ffb810

See more details on using hashes here.

File details

Details for the file AgroClient-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: AgroClient-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.10

File hashes

Hashes for AgroClient-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 daaec602e3e55e5585c2865f57a85fa157e30d685649af6bbe72bb7eee64c438
MD5 2b4ab337ce514d99a5f792adaeaf566c
BLAKE2b-256 89f40ec61c1fbfa8cbab0e4bd630424a7b629cedf30d57d277250115a108a7c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page