This project implements an IoT platform for monitoring and managing public shared dog kennels. It is meant to be used with a companion app, which can be found in the IoTail Companion repository.
- Install Docker and Docker Compose.
- Clone this repository.
- Navigate to the project directory.
- Go to the Thingspeak website, create an account or log in, create a new channel and then note the channel ID and the write and read API keys of the channel, from the "API Keys" section.
- Create the file
settings.jsonwith the following structure (do not change catalog url) and put it inside the root directory:{ "catalog_url": "http://catalog:8080", "channel_id": 1234567, "thingspeak_write_api_key": "your_channel_write_api_key", "thingspeak_read_api_key": "your_channel_read_api_key" } - Create the file
secret_key.txtwith a secret word inside to crypt your tokens and place it inside the root directory - Go to the Firebase Console website, log in with your google account and create a new project to use with the IoTail companion app (Flutter)
- Go into the project settings -> service account, click on Python and then on "Generate new private key". Confirm the generation.
- Rename the json file to
firebase_account_key.jsonand copy it to the root folder of this project - Go to mailgun.com and create an account. In the main page of your account, note the "sending domain", click on your account at the top right corner and go to "API Security", add a new key and copy it.
- Create the file
.envin the "catalog" folder with this structure:
MAILGUN_API_KEY= "your_mailgun_api_key"
MAILGUN_API_URL= "https://api.mailgun.net/v3/your_sending_domain/messages"
FROM_EMAIL_ADDRESS= "Your_Sender <your_sender@email.com>"- From the left menu, go to "Domain settings" in the "SEND" tab, go to "Setup", add an email address you want to send your email to (unfortunately, free mailgun accounts can only send emails to maximum 5 verified accounts) and verify it through the email you receive.
- In a terminal, run
docker-compose up -d --buildfrom the root directory of the project to build and start all services.
- Catalog: Manages system information
- Device Connector: Connect sensors to the IoT platform
- Camera: Manages video feed
- Data Analysis: Processes sensors data
- Reservation Manager: Handles kennel reservations
- ThingSpeak Adaptor: Integrates the platform with ThingSpeak
- Disinfection System: Manages kennel disinfection (simulation)
All connections are referred to a Raspberry Pi 3 model B
- USB Camera
- Adafruit DHT Temperature and Humidity sensor, plugged to pin 15
- Dfrobot DSN-FIR800 Motion sensor, plugged to pin 14
- Green, Yellow, Red LEDs, plugged through a breadboard, respectively, to pin 21, 26 and 16
To check services and devices status (assuming catalog is online), go to http://your_server_ip:8080/status_page
After building, only two commands are needed:
docker compose stopto stop the containersdocker compose startto start the containersdocker compose restartto restart the containers
Additionally, if only specific containers need to be stopped/started/restarted, it is sufficient to put their name after the commands above, separated by a space. The commands are meant to be run in the terminal inside the root directory of the project.
There are two mock users:
-
John Doe
- email: john.doe@gmail.com
- password: 123456789
User with one dog already present
-
Johanna Doe
- email: johanna.doe@gmail.com
- password: 987654321
Completely empty user