Skip to main content

A Farm Monitoring Bot

Project description

Agrothon

A Farm Monitoring Bot

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

Introduction

  • This project has three parts

    • The Agrothon-Client Module which will be running in Raspberry Pi
    • API Server
    • Telegram Bot
  • API Server handles Everything, All the routes are shown below

    API Docs

  • Telegram bot is just a frontend for the whole Project

    Telegram Bot

  • Agrothon-Client Sends Sensor data, Intruder images to the API Server which will be analysed there and Stored in the Database

Installation

  • Via pip

    • First fill the variables in agrothon-sample.env and rename it to agrothon.env

    • you can extend all tha variables from Base Config

    • Get the latest Release of data directory and untar in it the same directory where you placed agrothon.env

      tar -xzf Agrothon-Data.tar.gz
      
    • Then Create a Virtual Environment (Optional but Recommended) and then install Agrothon with

      pip install Agrothon
      
    • There are two commands in Agrothon

      • agroserver - Which actually starts the Uvicorn Server on a Unix Domain Socket at /usr/agrothon.sock, So you should use a Reverse proxy (Preferably Caddy)
      • agrothon - Which starts the telegram bot
  • Via Docker

    • Download Docker compose and Map the ports according to your use
      • wget -q https://viswanathbalusu.github.io/Agrothon/docker-compose.yml
    • Download agrothon.env and Fill the Variables (can be extended from Base Config)
      • wget -q https://viswanathbalusu.github.io/Agrothon/agrothon-sample.env -O agrothon.env
    • Finally do docker-compose up it will pull the image from container registry and run the services

Variables in agrothon.env

Variable Value Example Required Description
- - Bot Configuration - -
TELEGRAM_APP_ID Telegram API APP ID 1234567 True Can be obtained from Telegram
TELEGRAM_API_HASH Telegram API Hash 022d29afxxxxxxxxf825980a7974ec42 True Can be obtained from Telegram
BOT_TOKEN Telegram Bot Token 123456:abcdefghij True Can be obtained from Bot Father
API_BASE_URL Api base Host URL https://mysite.com/ True Must be host Without port (i.e Port 80/443* only)
ALERT_CHANNEL_ID Alert channel ID -100123456789 True Intruder Alerts will be posted to this channel
STATE name of the state Andhra Pradesh True Must be a state in India 🤔
DISTRICT name of the district East Godavari True name of your district
DEF_LANG Default Language english False Can be choosen from english, telugu, tamil, hindi (Default is english)
DEF_CITY Default City Vijayawada True City from which weather should be fetched
- - Server Configuration - -
OPEN_WEATHER_API Open weather API Key d6778a1acdd67c4xxxxxxe500e81987d True API to get the weather data of a particular region, Get this from OpenWeather
API_KEY An API Key for your Server Agrothon True This is like a Password for your API Server, So choose Wisely (Alphanumeric only)
DB_URL MongoDB URL mongodb+srv://xxx:xxx@hmmm.mongodb.net True Database to Store All the data, get this from MongoDB

* if there are Other ports too the Bot will Work but it may not be able to post images

Note

  • We are using heavy modules like tensorflow and Yolov3, so make sure you have atleast 2.5GB RAM free to get this running

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

Agrothon-1.2.5.tar.gz (46.2 kB view details)

Uploaded Source

Built Distribution

Agrothon-1.2.5-py3-none-any.whl (61.0 kB view details)

Uploaded Python 3

File details

Details for the file Agrothon-1.2.5.tar.gz.

File metadata

  • Download URL: Agrothon-1.2.5.tar.gz
  • Upload date:
  • Size: 46.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for Agrothon-1.2.5.tar.gz
Algorithm Hash digest
SHA256 3b9b1b95ba0964bf2b54cb3996f332ad70d69eef3fe8fb2754fdd77369af0ea7
MD5 0bf500eacb683b7abe7d3aa436a52878
BLAKE2b-256 a65bc917320172722ad6d16a4c8deaa3397742b6b87312129c3b9cb8edb727de

See more details on using hashes here.

File details

Details for the file Agrothon-1.2.5-py3-none-any.whl.

File metadata

  • Download URL: Agrothon-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 61.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for Agrothon-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 62859e9ff3fa17f6e4d92097f3265810ea1017762525f2777fc25fafef5df24f
MD5 2e9c55ebed58fc30e5dcd397d0d0d3bd
BLAKE2b-256 304ca31a2d590abf8a0485792d5b601a19aa400f2b6517bbd6c0ede9583d959b

See more details on using hashes here.

Supported by

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