dwyl / learn-aws-iot

:bulb: Learn how to use Amazon Web Services Internet of Things (IoT) service to build connected applications.
GNU General Public License v2.0
101 stars 29 forks source link

IoT WebSockets in Web Browser with Cognito #9

Open nelsonic opened 8 years ago

nelsonic commented 8 years ago

Original text for StackOverflow Question:


Does anyone know of any good working examples or tutorials for using AWS IoT as a websocket connection in the browser with AWS Cognito? I've been looking at the AWS IoT Documentation but I've only been able to find server-side examples. If anyone has any experience with this or knows of any good resources please let me know!


Re-written as:

How to use AWS IoT to send/receive messages to/from Web Browser

We are trying to use Amazon Web Services Internet of Things (AWS IoT) to send messages from/to a Web Browser (e.g: . Given that the AWS IoT supports JavaScript we expect that this is possible ...

We have searched at the AWS IoT Documentation but only found server-side examples (which expose AWS secrets/keys...)

Are there any good working examples or tutorials for using AWS IoT to send/receive messages via WebSockets/MQTT in the browser (e.g: authenticating with AWS Cognito)? Thanks!


Possible answer: https://medium.com/@jparreira/receiving-aws-iot-messages-in-your-browser-using-websockets-9b87f28c2357#

nelsonic commented 8 years ago

In the tweet asking for help we should cc:

@jeffbarr @taraw @IanMmmm @amichelu

e.g:


Trying to connect to @awscloud #AWS #IoT from Browser. stuck #Question: http://stackoverflow.com/questions/35439742/how-to-use-aws-iot-to-send-receive-messages-to-from-web-browser @jeffbarr @taraw @IanMmmm @danilop @amichelu

jackcarlisle commented 8 years ago

Link to tweet: https://twitter.com/carlisle_jack/status/699891110450171906

jackcarlisle commented 8 years ago

Reply to tweet: LIght bulb example https://s3.eu-central-1.amazonaws.com/iotjam/bulb.html (inspect the source)

nelsonic commented 8 years ago

This is the most complete tutorial we have found: http://dev.classmethod.jp/cloud/aws/aws-iot-mqtt-over-websocket/ access in Chrome to get auto-google-translate (its in Japanese...!) :wink:

dandonahoe commented 7 years ago

@nelsonic I'm trying to do this exact thing as well and have hit the same wall as you. Did you ever make any progress?

nelsonic commented 7 years ago

@dandonahoe we got the IoT part working: https://github.com/dwyl/chat the "cognito" part was a bit more effort than we had time for. if you manage to get it all working we'd love to know how. thanks! 👍

Tee88 commented 6 years ago

@nelsonic any possibility of making a tutorial? 😛

nelsonic commented 6 years ago

@Tee88 what specifically are you hoping to learn? 🤔

Tee88 commented 6 years ago

@nelsonic I have multiple IoT things that a generating time-series data. Each device is owned by a different user. Users should be able to monitor sensors readings in real time.How can achieve that using AWS IOT, WebSockets and Cognito?

Jun711 commented 6 years ago

@nelsonic Hi, could you share what u did on aws console to configure IoT to enable this?

I haven't used aws IoT but aws iot describe-endpoint does return an endpoint which I don't know why it is there.

nelsonic commented 6 years ago

@Jun711 GOTO: https://github.com/dwyl/aws-lambda-iot-chat/blob/master/iot.js