How to design Mobile App to connect to MQTT Broker
- 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)
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/
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/
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.
How to design Mobile App to connect to MQTT Brokerasked 7 months ago
IoTSampleSwift Not Connecting to MQTT Clientasked 3 years ago
How to connect an IoT Thing to Greengrass V2asked a year ago
Publish/Subscribe to IoT device messages via Java SDK?asked 4 months ago
Unexpected Response 403 today with no changes to my app.asked 2 years ago
com.aws.greengrass.mqttclient.AwsIotMqttClient: Unable to connect to AWS IoT CoreAccepted Answerasked 6 months ago
Connect to AWS GreenGrass without aws device SDKasked 2 years ago
unable to Sub scribing with Mqtt data in AWS IoT core with greengrass deploymentasked 2 months ago
How to implement authentication in AWs IoT Greengrass Component deployed to the Greengrass Core Device?asked 2 months ago
How to receive IoT device simulator's data to AWS IoT core.Accepted Answerasked 8 days ago