-
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
Cannot connect to MQTT over Websocket with Xamarin #612
Comments
Hi, Regards |
I know I had been working with this library and webSockets using the server pieces of the library on the other end. give me some time, and i'll look up how I wrote the connection. I was using username/password authentication, which may make a difference. |
I released a new extension nuget which allows using WebSocket4Net. All you need to do is download the new nuget and call UseWebSocket4Net() on the MqttFactory instance before creating the client. Please let me know if this works with AWS/Xamarin. |
I updated MQTTnet to 3.0.2. |
Hi,
I tried to connect to the AWS iot core over Websockets in my Xamarin App and it fails.
This is how I connect:
The url is a signed url with SigV4 with the cognito AccessKey, SecretKey and Token.
When I call client.ConnectAsync(options) I get the following Exception:
{MQTTnet.Exceptions.MqttCommunicationException}:
Message: "Unable to connect to the remote server"
Source: mscorlib
StackTrace:
at MQTTnet.Adapter.MqttChannelAdapter.WrapException (System.Exception exception) [0x0005a] in <0cba824eb1f047f28db40a990343853f>:0
at MQTTnet.Adapter.MqttChannelAdapter+d__20.MoveNext () [0x000bf] in <0cba824eb1f047f28db40a990343853f>:0
--- End of stack trace from previous location where exception was thrown ---
at MQTTnet.Client.MqttClient+d__30.MoveNext () [0x00152] in <0cba824eb1f047f28db40a990343853f>:0
--- End of stack trace from previous location where exception was thrown ---
at MQTTnet.Client.MqttClient+d__30.MoveNext () [0x00356] in <0cba824eb1f047f28db40a990343853f>:0
--- End of stack trace from previous location where exception was thrown ---
In the inner exception there is a WebSocketErrorCode and it says "System.Net.WebSockets.WebSocketError.Success"
In a little Windows Forms test application with the same parameters it works.
Do I miss something in the parameters for Xamarin?
Any help appreciated.
The text was updated successfully, but these errors were encountered: