Skip to content

Read RPi DHT sensors for temperature and humidity and publish to SQS

License

Notifications You must be signed in to change notification settings

cjww-development/iot-environment-monitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apache-2.0 license

iot-environment-monitoring

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.

Basic architecture

image info

How to run

  • 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

External Dependencies

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.

Outbound messages

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
}

License

This code is open source software licensed under the Apache 2.0 License

About

Read RPi DHT sensors for temperature and humidity and publish to SQS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages