KrishiSahay is a project that uses technology to help farmers in India. It focuses on identifying crop diseases quickly and providing solutions that are good for the environment. The project uses a WhatsApp bot because many farmers in India have smartphones and can easily use WhatsApp. The goal is to empower farmers and promote sustainable agriculture.
1.Arjun C
2.Amal K
3.Vishnu Prakash J
4.Hariprasad G Yadhav
- flask
- sqlite3
- AI/ML
- Tensorflow
- A Meta developer account — If you don’t have one, you can create a Meta developer account here.
- A business app — If you don't have one, you can learn to create a business app here. If you don't see an option to create a business app, select Other > Next > Business.
- If you're not an ngrok user yet, just sign up for ngrok for free.
- Download the ngrok agent.
- Go to the ngrok dashboard, click Your Authtoken, and copy your Authtoken.
- Follow the instructions to authenticate your ngrok agent. You only have to do this once.
- On the left menu, expand Cloud Edge and then click Domains.
- On the Domains page, click + Create Domain or + New Domain. (here everyone can start with one free domain)
create a .env
file inside python-whatsapp-bot directory
ACCESS_TOKEN="<ACCESS_TOKEN>"
APP_ID="<APP_ID>"
APP_SECRET="<APP_SECRET>"
RECIPIENT_WAID="9467XXXXXX" # Your WhatsApp number with country code (e.g., +31612345678)
VERSION="v18.0"
PHONE_NUMBER_ID="<PHONE_NUMBER_ID>"
VERIFY_TOKEN="<VERIFY_TOKEN>"
All the values can be found in the meta account
Clone the repository
https://github.com/H4K3R13/KrishiSahay.git
Change the directory
cd KrishiSahay
Setup virtual env
python3 -m python3 -m venv venv
source venv/bin/activate
Install the modules
pip3 install -r requirements.txt
Change directory to bots
cd python-whatsapp-bot
Run flask app
flask --app run.py --debug run
Once your app is running successfully on localhost, let's get it on the internet securely using ngrok!
ngrok http 8000 --domain your-domain.ngrok-free.app
- ngrok will display a URL where your localhost application is exposed to the internet (copy this URL for use with Meta).
In the Meta App Dashboard, go to WhatsApp > Configuration, then click the Edit button.
- In the Edit webhook's callback URL popup, enter the URL provided by the ngrok agent to expose your application to the internet in the Callback URL field, with /webhook at the end (i.e. https://myexample.ngrok-free.app/webhook).
- Enter a verification token. This string is set up by you when you create your webhook endpoint. You can pick any string you like. Make sure to update this in your
VERIFY_TOKEN
environment variable.