Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

492
Visualizações
How to use MQTT-JS or JS AWS-SDK (node JS/JS) to send and receive data to a topic of AWS IoT

I am working on a project, in which I need to connect my devices via MQTT protocol to AWS IoT, to send and receive data.

So first I got my endpoint from the AWS Portal. Please check below screenshot: enter image description here

Then I tried using AWS Lambda for RnD purpose, and it is working as expected. Please check below screenshot, what code I did at AWS Lambda:

enter image description here

But now I want to integrate this at the device end.

I tried MQTT JS to connect devices to AWS IoT data. Please check below code: enter image description here

But this code is not working, no error I got in the output, Its just waiting.

In this code, I used the accessKey and secretKey, which I got after creating a user in AWS-IAM, with permission AWSIoTDataAccess.

I tried AWS-SDK also with the same IAM credentials. Please check below code. enter image description here

But unfortunately, it is also not working.

Note: My device is just a Windows system, which will send and receive data for a topic at AWS IoT.

Please help me to solve this. Don't know what I missed. Any suggestion will be helpful for me. Thanks,

EDIT:

After followed the steps mentioned here https://docs.aws.amazon.com/iot/latest/developerguide/device-certs-create.html, suggested in answer by @sokkasokka. Finally getting some error at least. Please check below screenshot for the edited code and error. enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Try creating AWS IoT Thing with proper permissions and use the certificates to authenticate your MQTT device.

https://docs.aws.amazon.com/iot/latest/developerguide/device-certs-create.html

And see this issue as well: Fail to connect to AWS IoT via mqtt.js

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda