-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connecting to AWS IoT broker (without Websocket) #452
Comments
Hi, the topic about MQTTnet and AWS is open since a while and some people are able to connect but they do not report what they need to do 😄 So for now I cannot fix the issue. |
Maybe this will help some people. My team's been digging for a few days, and while we haven't completely solved the issue, we've made some progress. The biggest thing is that AWS doesn't support QoS 2 or the retain flag. It will automatically close the connection if either of those are requested. Now, changing the QoS to 1 and setting retain to false allows us to connect with MQTTnet on some of our systems. Other systems will connect for a few millseconds and then disconnect. It's very odd, and the same thing happens with M2MQTT, but not with MQTT.fx. If we are able to solve the issue, I'll update this thread and hopefully help some others who are struggling with the same thing. So, in short, I was too quick to suggest it could be a bug in MQTTnet :) |
Yep - I also have the same issue, with the same trace (I didn't try alternative clients). What is required to report the issue? |
Same issues here - any updates / advice from anyone please? |
Setting retain to false and QoS to a maximum of 1 doesn't work for either of you? I've been able to connect to AWS just fine since Oct 23, 2018. |
Thanks Paul. |
Hm, yeah I was thinking about publishing rather than connecting. I looked over my original post here and honestly I don't remember how I fixed the connection issue. Our system would publish immediately after connecting though, so maybe it really was just a publishing issue for me all along. I wish I could be more helpful. The only other thing I can remember getting hung up on with AWS was encryption. Are you providing certificates? |
Thanks Paul - sorry for long delay replying (doing 'other things'). |
It would be a very helpful if the wiki presented some documentation on how to connect up to the AWS IoT Broker without web sockets with version 3.0.x of MQTTnet. BTW, There are some examples provided by the AWS team on how to do this using web sockets, but they also use the older 2.8.5 release of MQTTnet to do this, and they too provide no examples using 3.0.x of MQTTnet. |
Do you have some links for me, @jminnihan? I would like to add this to the wiki. |
@PaulFake do you know/remember what version of MQTTnet you were using? |
also, what OS and .Net runtime version? |
I was just able to publish to AWS IoT using a
The My connection does get dropped pretty often but I am able to publish. Maybe I need to change my keepalive. |
@x37v Sorry for the long delay - I don't regularly sign into GitHub and see my messages. I believe we were using 2.8.5 with .NET Core 2.0, and I think it happened on both Win7 and Win10 systems. |
There is now a short documentation under https://github.com/chkr1011/MQTTnet/wiki/Client#connecting-with-amazon-aws and the library version is 3.0.8 right now... I will close this issue now. Feel free to contact us again if this still occurs and I will re-open it. |
When I try to connect to an AWS IoT broker, I get an MqttCommunicationClosedGracefullyException. Here is a trace:
The server doesn't log anything useful, aside from a generic connection error ("status": "Failure", "eventType": "Connect"). I've ruled out TLS issues as the culprit, as I've been able to connect to the same server using the same certificates and key using M2MQTT and MQTT.fx. I've also been able to connect to other non-AWS brokers with MQTTnet without issue (and using TLS). This problem is unique to MQTTnet with AWS, and I can't help but think there's a bug somewhere.
The text was updated successfully, but these errors were encountered: