Deployed onto a Raspberry Pi equipped with a DHT11 sensor, this project reads environment data.
Specifically designed to read air temperature and humidity, it will publish a json message to an AWS SQS message queue.
- Clone project
- Create a virtual environment
sudo pip3 install virtualenv
virtualenv venv
- Install dependencies
venv/bin/pip3 install -r requirements.txt
- Run project
venv/bin/python3 -m iotenvmonitoring
This project relies on an AWS SQS Queue.
During development (and how this project runs in its current state), localstack is used to simulate an SQS queue. There is a docker compose file in utils
that can launch localstack.
cd utils
docker-compose up -d
Once up and running, create a SQS using the aws cli.
aws --endpoint-url=http://localhost:4576 sqs create-queue --queue-name env-data-dev
For a "live" environment go into config/application.conf
and change the aws.sqs
config block to connect to actual AWS services.
Sample outbound message from this project
{
"collected-at" : "2020-01-01:12:00:00",
"temperature-c": 10.0,
"temperature-f" : 50.0,
"humidity" : 0.57
}
This code is open source software licensed under the Apache 2.0 License