Creating a temperature monitoring system in AWS

1,126 views
Skip to first unread message

Nayeema Sadeque

unread,
Jan 23, 2017, 12:56:17 PM1/23/17
to Node-RED
Hello everyone,

I am looking for help to some basic stuff. I have setup a temperature monitoring system with my dht22 sensor and Raspberry Pi using Node-RED. I have connected the Pi to AWS IoT, which sends values via MQTT to AWS. Now, I want to receive the values in a Node-RED application in AWS, and do some processing to send E-mail notifications when the temperature goes too high/low. I am in search of an appropriate tutorial for AWS and have been searching for sometime. Can anyone kindly point me to one? 

Furthermore, I came across node-red-contrib-aws-iot-hub node and wondering how this is different from the mqtt node already available in Node-RED? Looking forward to your answers. Thanks in advance.
   

Mark Setrem

unread,
Jan 23, 2017, 12:58:27 PM1/23/17
to Node-RED
So are you asking for help in installing node-red in AWS or are you stuck in creating a flow within node-red?

Nayeema Sadeque

unread,
Jan 23, 2017, 2:43:30 PM1/23/17
to Node-RED
I could install node-red in AWS following the documentation at http://nodered.org/docs/platforms/aws

I need help with creating a flow in node-red in AWS that displays the temperature values sent from my Pi via MQTT in the debug console. 

Mark Setrem

unread,
Jan 23, 2017, 4:51:16 PM1/23/17
to Node-RED
where are you stuck? As it should be as simple as linking a MQTT-IN node up to a debug node

Nayeema Sadeque

unread,
Jan 30, 2017, 3:59:59 AM1/30/17
to Node-RED

Hi Mark, thanks a lot for your response. I thought it would be fairly simple as well, I tried a few things, here's where the issue is. 


Below is my flow in my Rpi, which connects to the AWS IoT broker via TLS and publishes to the platform


Below is my flow in node-red in ec2 instance, I connect to the same broker, with the same port (8883) without TLS. It displays connecting, but does not connect. I am stuck with the TLS part here and not sure how to fix it. Do I need to generate another certificate in AWS IoT to connect my ec2 node-red to the AWS IoT platform?

I would appreciate it if you can point me the right direction here. Thanks!

Pedro ET Ferreira

unread,
Jan 30, 2017, 7:28:24 AM1/30/17
to Node-RED
Hi Nayeema,

Since you are using AWS IoT, you need to create a "thing" for each device you want to connect. In this case, you need to create a certificate for the aws ec2 instance too and configure it accordingly. After that, everything should be OK.

Regards

Nayeema Sadeque

unread,
Jan 31, 2017, 3:45:01 AM1/31/17
to Node-RED
Hi Pedro,

It works now (after creating a thing, attaching a certificate and configuring the mqtt-in node). Thanks so much for clearing my concept with AWS IoT. Have a great day. 

sama...@gmail.com

unread,
Feb 10, 2017, 8:00:56 AM2/10/17
to Node-RED

Hi Nayeema,

It's really frustrating to me :(
Could you please share your settings to MQTT-node in AWS so that I may do the same? .... you don't need to put your keys or certificate but just guide me by steps how and which keys to use in each field of MQTT-node and where to put the security private and certificate keys in EC2.

Thanks in advance!

Nayeema Sadeque

unread,
Feb 12, 2017, 8:43:25 AM2/12/17
to node...@googlegroups.com
Hi,

Thanks for your question. By following the Getting Started with AWS IoT section and the youtube link below I created two things in AWS IoT, one for my sensor and another for my Node-Red app. 




Inline image 1

When I created these things, I also created two different certificates, one for my sensor and another for my app. I created a policy next and attached the same policy to both certificates. I copied the certificate (.pem.crt), private key (.pem.key) and the rootCA files to my ubuntu instance hosting my Node-Red app (as shown in the youtube link). Next, I added a MQTT-in node from the Node-Red palette and then added the path of the certificate, private and rootCA respectively in the TLS configuration section. The last bit was to copy and paste the Rest API endpoint from the Interact tab of my Node-Red thing in AWS IoT and type in the topic (/values) that I wanted to subscribe to.
Inline image 2


Inline image 3

I hope that helps. Feel free to ask if you run into issues. Cheers.

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/PYKQ9nsmsAo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/c1c28ec9-0ca3-4d91-99e8-e0bbcd682ed8%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages