By using AWS re:Post, you agree to the Terms of Use
/How to design Mobile App to connect to MQTT Broker/

How to design Mobile App to connect to MQTT Broker

0
  • I am trying to make professional app. User purchases our IoT device. It connects to the IoT device with the mobile application we developed. I am able to design my IoT(ESP32) device to connect AWS IoT with JITR feature. The IoT device can successfully connect to the cloud with own certificate associated our CA. Also Every IoT device will have a unique policy generated automatically by Lambda function.
  • There is no problem with the above steps.
  • The user will sign in to the mobile application to connect our IoT device. How can I pair this user with the own IoT device? Thus user is able to control IoT device, even if sign in from another phone. Do I have to do anything in AWS console for this(like creating Lambda function)? Is there such an example android code or blog?
  • Should IoT device send own certificate and thing ID to the mobile application via Bluetooth? But in this case, IoT will have to send it again when user sign in from the other phone.
  • We gonna use only Pub/Sub method(not shadow)
3 Answers
1

You need to authenticate the mobile user to use MQTT. You can use Cognito to do this. This Blogpost describes this in more Detail: https://aws.amazon.com/blogs/iot/configuring-cognito-user-pools-to-communicate-with-aws-iot-core/

answered 7 months ago
1

Have a look at this blog where i guide you through on setting this up using BLE and iOS app: https://aws.amazon.com/blogs/iot/connecting-with-mobile-ble-to-aws-iot-core-using-freertos-and-nordic/

answered 7 months ago
0

How are your web application users being authenticated?. If using Cognito with API Gateway then the userId is provided in the request to your backend. You could map the userId and the deviceIds in a DynamoDB table. This allows the user to access its devices, independently of the device he uses for login.

Hope this may help.

Best regards,

answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions