Node-red mqtt connection problem conneting to Amazon web services OS: ubuntu 16.04LTS

1,422 views
Skip to first unread message

Luis GCU

unread,
May 14, 2017, 5:42:09 PM5/14/17
to Node-RED
Hello ,
I followed this tutorials   http://docs.aws.amazon.com/iot/latest/developerguide/iot-sdk-setup.html  and this on  you-tube Amazon Web Services (AWS) IoT MQTT Node-RED Raspberry Pi   to connect my raspberry pi to AWS , I  successfully made mqtt connection using node-red on raspberry pi,  my problem now is that I am trying to do the same on my laptop (ubuntu 16.04 LTS)  runing Node-red, I just did the same steps used the same certificates and simply the mqtt node won't connect to AWS.. not sure how to debug that, if there is a missing permission to node red use the port 8883, or  if there any issue that mqtt node have to read the certificates? any help appreciated.

this is the log that  I getting:

14 May 17:37:33 - [info] [mqtt-broker:8eb3d00b.993ab] Connection failed to broker: IO4FUN@mqtts://a5232nmw94345f2jj.iot.us-east-1.amazonaws.com:8883

thanks

Luis GCU

unread,
May 16, 2017, 9:00:53 PM5/16/17
to Node-RED
Is  really frustrating that I can't get this to work, I made  a third test on another raspberry pi (2) +node-red,  and I got the same problem that I  had on node-red running on Ubuntu, the mqtt simply won't  connect to AWS IoT thing that I have created.
I decided to create a new thing on the AWSIoT console, generate new certificates ,attached a policy,  I use all that data to setup mqtt-broker node  and  as I mention before it won't connect, I tried that on my RPI2 and Ubuntu having the same problem.. only it works fine on my raspberry pi 3, I was suspecting that the port 8883 is blocked.. I tried a telnet  to make sure the port 8883 is open and  I got connected successful in my booth cases that the mqtt connection is not working.

Trying 34.197.147.56...
Escape character is '^]'.

any ideas? 

Colin Law

unread,
May 17, 2017, 3:35:28 AM5/17/17
to node...@googlegroups.com
Have exported and then imported the relevant part of the flow from the
working one to the failing one in order to be certain that you have
identical flows?

If you have then check the versions of node-red, node.js and the mqtt
node to make sure they are identical.

Colin
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@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/ea08554f-6ad7-4d0c-abdd-61bd29aec378%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Luis GCU

unread,
May 17, 2017, 9:50:20 PM5/17/17
to Node-RED

Hi Colin,

I did  copy the flow from the node-red on raspberry pi 3 and that didn't make any difference..   mqqt node just show connecting.. and hangs there

I did another test a  few minutes ago in that laptop is running ubuntu , I tried  with mosquitto  mqtt and the connection was successfully.

angel@angel-Latitude-E6430:/etc/ssl/certs/aws$  mosquitto_sub --cafile rootCA.pem --cert new-certificate.pem.crt --key new-private.pem.key -h xxxxxxxxx.iot.us-east-1.amazonaws.com -p 8883 -q 0 -d -t topic/test -i new
Client new sending CONNECT
Client new received CONNACK
Client new sending SUBSCRIBE (Mid: 1, Topic: topic/test, QoS: 0)
Client new received SUBACK
Subscribed (mid: 1): 0

below are the node-red and node.js version, now  can i see the raspberry pi 3 have older versions compared to  ubunto and RPI2,   could be that the reason?
what is your suggestion?  
is possible to downgrade  node-red and node.js version on my RPI2 just to try?


Ubunto  laptop where  mqtt node connection to aws do not work:   node -v =v4.2.6  ,   npm -v= 3.10.10
Raspberry pi 2 where  mqtt node connection to aws do not work:   node -v =v6.10.3  , npm -v= 3.10.10

Raspberry pi 3 where  mqtt node connection to aws  works fine:  node -v = v4.2.1  , npm -v= 4.1.2

thanks for any further advise..

////////////////////////////////////////////////////////////////////////////

Mark Setrem

unread,
May 18, 2017, 4:14:34 AM5/18/17
to Node-RED

You listed the version of node.js and npm but not the version of node-red you are running.   What version of node-red is installed on each machine?

Luis GCU

unread,
May 18, 2017, 6:30:03 PM5/18/17
to Node-RED
all machine  have  installed node red version V0.16.2
thanks 

Luis GCU

unread,
May 18, 2017, 9:55:12 PM5/18/17
to Node-RED
guys I finally have the 2 machines  with NR  and Mqtt connected to AWS, I still investigating and trying to replicate the problem,  since the beginning  at AWS I have  created only  one thing , one certificate and one policy  I was using   and messing with those credential on the 3 machines , what I  was  doing  was just to delete (temporary)  and deploy the mqtt node on RPI3 and try the mqtt node on the other devices.. seems like  somehow the mqtt connection keep alive  some sort of link to aws  on my rpi3 that stops the other mqtt nodes to connect,  only when I decided to turn  off the rpi3 then  the mqtt connection was possible on  the other machines.
Now on AWS  I have created 2  pairs of things certificate and policy and setup each mqtt node with different certificates and seems to be working .

Marcos Pinello

unread,
Aug 4, 2017, 2:44:45 PM8/4/17
to Node-RED
I´m not using raspberry (yet), only a normal Ubuntu with node-red configured, so I don´t have the same issue as you had.
But I´m not getting to connect to AWS IoT.
Any help ?
Reply all
Reply to author
Forward
0 new messages