Im trying to use sgcwebsocketClient to connect to AWS IoT , the connection is successful but when i suscribe to a topic a weird behavior happens , the mqtt Connect event fires again and again , i got Connected.. connected... in and endless loop.
Hello Again , thanks for your help , I tried with the component for AWS but the only way to use it is trough Certificates , we are not using certs , we use username and password , ssl , port 443 , and is mqtt over web socket , I found that I can disable the certificate functionality but I don't find how to set the credentials.
The credentials must be set in MQTT component, but in this component the object is protected. You can access if you inherit a new class from TsgcIoTAmazon_MQTT_Client and then you can access to "MQTT" property.
After reading the Amazon AWS IoT Documentation, I've updated the Amazon IoT client and now supports MQTT over websockets using SignatureV4 as authentication. I've added the possibility to set the MQTT username/password for custom authentications too.
Hello again , I get the beta version but when I tried to connect I always get a host not found , we use an endpoint like this: bus.mydomain.com/mqtt. , if I remove the /mqtt it don't throw error but of course I don't get any response , in the MQTT normal component I use Parameter to add the /mqtt , but I don't have that option in amazon component.
If you use SignatureV4 as authentication, you musn't set "/mqtt" in host because this is set automatically by component when creates the connection parameters. If you check the prior screenshot, you will see that I only set the Amazon Endpoint without any parameter. SignatureV4 requires an API and Secret key linked to an user, this user has enough privileges to get IoT messages? in my test works well.
Kind regards,
Sergio
Hello again , I get the beta version but when I tried to connect I always get a host not found , we use an endpoint like this: bus.mydomain.com/mqtt. , if I remove the /mqtt it don't throw error but of course I don't get any response , in the MQTT normal component I use Parameter to add the /mqtt , but I don't have that option in amazon component.
I've implemented a new authentication type: custom authentication, which allows to set custom parameters (by default is /mqtt) and custom headers. So now, if you enable CustomAuthentication, you can set the Parameters of the MQTT connection