I didn't know where else to ask this question so am asking it here.
I have been looking at esp-aws-iot to use our product with aws iot and looking at the iot-core-poc example it seems to almost be a completely different sdk, and incredibly verbose and horrible. If we already have firmware written in esp-idf and just wanted to use aws mqtt and device shadow, can we just do that with esp-idf or is there some compelling reason to use esp-aws-iot?
Is it really necessary to use esp-aws-iot to use aws iot?
-
- Posts: 40
- Joined: Mon Mar 18, 2019 12:34 pm
Re: Is it really necessary to use esp-aws-iot to use aws iot?
Edit: Forgot to answer your main question, NO it's not required or necessary. esp-aws-iot is just an implementation of aws-iot-sdk. Don't use coreMQTT at all, esp_mqtt is a lot easier and better. You are better off just manually testing for your topic strings than integrating the aws sdk.
Since I went through the trouble of trying to integrate aws-iot-sdk. I'll tell you my experience since I think it is better the information is out there.
I was integrating our new product with our existing simple aws iot implementation. Decided to use the aws-iot-sdk, after following and finding the odd proper documentation I managed to replicate their implementation.
I started with device provisioning, I realised all their device provisioning SDK did was match the provisioning MQTT topic. I did use it, but the syntax was annoying to write and I quickly realised that since we are using just one template, it's literally a static string I am trying to match. So I didn't use the provisioning SDK. Their own MQTT implementation is also super convoluted compared to the comparatively simple and straightforward esp-idf one. They used CoreJSON to parse JSON strings, I was tempted to eventually replace that with cJSON but CoreJSON seems to be less resource intensive so I still use that throughout my project to find keys in JSON strings.
With the device shadow API, I implemented that too, it does help you create the topic strings, but you can just do that with a smart formatted string or something. I did use it originally but eventually replaced it with a easier to use asprintf and feed it the thing name.
The ONLY real use I found for the API eventually was using it to match the topic string when the device shadow response is done arriving. That did reduce my work but I am afraid that if I had just written the few lines of code required to match topic string, I would have saved the time finding it's documentation.
The only sdks I found use for was coreJSON ( can be replaced by cJSON ) and for the device shadow sdk ( can be replaced by a few sprintfs and strcmp but still useful if you want to handle all types of responses )
Since I went through the trouble of trying to integrate aws-iot-sdk. I'll tell you my experience since I think it is better the information is out there.
I was integrating our new product with our existing simple aws iot implementation. Decided to use the aws-iot-sdk, after following and finding the odd proper documentation I managed to replicate their implementation.
I started with device provisioning, I realised all their device provisioning SDK did was match the provisioning MQTT topic. I did use it, but the syntax was annoying to write and I quickly realised that since we are using just one template, it's literally a static string I am trying to match. So I didn't use the provisioning SDK. Their own MQTT implementation is also super convoluted compared to the comparatively simple and straightforward esp-idf one. They used CoreJSON to parse JSON strings, I was tempted to eventually replace that with cJSON but CoreJSON seems to be less resource intensive so I still use that throughout my project to find keys in JSON strings.
With the device shadow API, I implemented that too, it does help you create the topic strings, but you can just do that with a smart formatted string or something. I did use it originally but eventually replaced it with a easier to use asprintf and feed it the thing name.
The ONLY real use I found for the API eventually was using it to match the topic string when the device shadow response is done arriving. That did reduce my work but I am afraid that if I had just written the few lines of code required to match topic string, I would have saved the time finding it's documentation.
The only sdks I found use for was coreJSON ( can be replaced by cJSON ) and for the device shadow sdk ( can be replaced by a few sprintfs and strcmp but still useful if you want to handle all types of responses )
-
- Posts: 40
- Joined: Mon Mar 18, 2019 12:34 pm
Re: Is it really necessary to use esp-aws-iot to use aws iot?
Thanks, that's very helpful! I will abandon esp-aws-iot as I can't even subscribe to the device shadow properly and I know it'll take 5 mins in esp-idf.
Who is online
Users browsing this forum: Google Adsense [Bot] and 84 guests