Use by AWS IoT SDK
By connecting their devices to AWS IoT, users can securely work with the message broker, rules, and the device shadow (sometimes referred to as a thing shadow) provided by AWS IoT and with other AWS services like AWS Lambda, Amazon Kinesis, Amazon S3, and more.
You should be create resource on AWS console.
In this demo, your must create Thing that name is “waterflower”
http://docs.aws.amazon.com/iot/latest/developerguide/register-device.html
http://docs.aws.amazon.com/iot/latest/developerguide/create-device-certificate.html
http://docs.aws.amazon.com/iot/latest/developerguide/create-iot-policy.html
http://docs.aws.amazon.com/iot/latest/developerguide/attach-policy-to-certificate.html
http://docs.aws.amazon.com/iot/latest/developerguide/attach-cert-thing.html
Install Driver for sensor
sudo curl -kL dexterindustries.com/update_grovepi | bash
pip install AWSIoTPythonSDK
And then reboot the raspberry
git clone git@github.com:cncoder/water-iot.git
endpoint = "XXXX.iot.XXXX.amazonaws.com" (BJS will be diff)
rootCAPath = "cert/rootCA.cert"
certificatePath = "cert/certificate.pem"
privateKeyPath = "cert/private.pem.key"
thingName = "waterflower"
> reporter = true
& change WECHAT_URL with https://sc.ftqq.com/3.version
run.sh
Must be change in the code:
if your just want to run this demo without sensor, you can return random sensor data in sensordata.py
if your have LCD , please insert it on the I2C port.
If the LCD show in blue color, it is starting now.
If the LCD show in red color, your must shutdown the raspberry(must be power off), and power on again.
https://github.com/cncoder/MQTT-IoT-WebServer