-->
Page 1 of 1

Is it possible to use mqtt over websockets [AWS IOT]? YES!

PostPosted: Fri Mar 18, 2016 5:05 pm
by Fabio
is there any limitation? I thought there aren't, but I keep getting a 403 forbidden error at my first request.

I've posted the details here: http://stackoverflow.com/questions/36091956/mqtt-over-websocket-request-x-amzn-errortype-forbiddenexception

But it seems possible. We connect to AWS via 443 port (SSL), send the connection request using websocket protocol over http and them use the websocket connection to trade mqtt packages.

Does some one tried this path? Is there something I am missing?

Thanks

Re: Is it possible to use mqtt over websockets [AWS IOT]? YE

PostPosted: Thu Mar 24, 2016 2:37 am
by Fabio
I've edited the title because finally I got it to work \o/

It does not reconnect after losing the connection yet and I havent test it a lot (like stress test, many messages, etc), but in simple tests it is working (publish and subscribe to topics) and can be used as starting point for further developments.

https://github.com/odelot/aws-mqtt-websockets

I've made a video showing it sending and receiving mqtt messages. It is in Portuguese but there are english captions.

Re: Is it possible to use mqtt over websockets [AWS IOT]? YE

PostPosted: Mon Apr 25, 2016 8:48 pm
by Shreya
I tried running your code on a NodeMCU ESP8266 and I keep getting "error connection to the web socket server" and the rc value returned from ipstack.connect(aws_endpoint, port) is 0. Why could this be happening? Is there any way to fix it?