[This project is forked from my another GitHub account for showcase purposes]
This project is a web-based pet feeder application that allows users to schedule feeding times and manually dispense food. It consists of a backend server, a frontend web interface, and an ESP8266-based hardware component for controlling the pet feeder.
- Backend (Python/Flask)
- Frontend (HTML/CSS/JavaScript)
- ESP8266 Firmware (C++)
- User authentication
- Schedule feeding times
- Manual food dispensing
- MQTT communication for real-time control
- WiFi configuration for the ESP8266 module
The backend is built with Flask and provides the following functionality:
- User authentication
- CRUD operations for feeding schedules
- MQTT communication to control the pet feeder
- SQLite database for storing user data and feeding schedules
The frontend consists of two main pages:
- Login page (login/index.html)
- Main application page (index.html)
The frontend uses Materialize CSS for styling and SweetAlert2 for user-friendly notifications.
The ESP8266 firmware handles:
- WiFi connection and configuration
- MQTT communication with the server
- Control of the pet feeder hardware
-
Set up the Python environment and install required packages:
Copy
pip install flask flask_cors paho-mqtt pytz
-
Set up the SQLite database by running the backend for the first time.
-
Upload the ESP8266 firmware to your device.
-
Configure the WiFi credentials for the ESP8266 using the AP mode.
-
Update the MQTT broker address and credentials in both the backend and ESP8266 firmware.
-
Run the Flask server:
Copy
python main.py
-
Access the web application through a browser.
- Log in using your user ID and password.
- Add feeding times using the time picker.
- Edit or delete existing feeding times as needed.
- Use the "Dispense" button for manual food dispensing.
- Ensure to use secure passwords and API keys.
- The current implementation stores passwords in plain text. For production use, implement proper password hashing.
- Consider using HTTPS for the web server and encrypted MQTT communication.