Closed apiep closed 4 years ago
Connection issue are fixed now, it was because I put the wrong port number. I think I need some rest now 😣.
But, if I keep / add those connection message, it still did not want to connect.
With this error:
2020-03-13 20:44:01.668 -- SynchronousMqttBrowserConnectionHandler::internalConnect entered
20:44:01.670 dart_sdk.js:22313 2020-03-13 20:44:01.669 -- SynchronousMqttBrowserConnectionHandler::internalConnect - initiating connection try 0
20:44:01.676 dart_sdk.js:22313 2020-03-13 20:44:01.676 -- MqttBrowserWsConnection::connect - WS URL is wss://mqtt.qiscus.com:1886/mqtt
20:44:01.682 dart_sdk.js:22313 2020-03-13 20:44:01.681 -- MqttBrowserWsConnection::connect - connection is waiting
20:44:02.857 dart_sdk.js:22313 2020-03-13 20:44:02.857 -- MqttBrowserWsConnection::connect - websocket is open
20:44:02.858 dart_sdk.js:22313 2020-03-13 20:44:02.858 -- MqttBrowserConnection::_startListening
20:44:02.861 dart_sdk.js:22313 2020-03-13 20:44:02.860 -- SynchronousMqttBrowserConnectionHandler::internalConnect - connection complete
20:44:02.861 dart_sdk.js:22313 2020-03-13 20:44:02.861 -- SynchronousMqttBrowserConnectionHandler::internalConnect sending connect message
20:44:02.862 dart_sdk.js:22313 2020-03-13 20:44:02.862 -- MqttBrowserConnectionHandler::sendMessage - MQTTMessage of type MqttMessageType.connect
Header: MessageType = MqttMessageType.connect, Duplicate = false, Retain = false, Qos = MqttQos.atMostOnce, Size = 0
Connect Variable Header: ProtocolName=MQIsdp, ProtocolVersion=3, ConnectFlags=Connect Flags: Reserved1=false, CleanStart=false, WillFlag=true, WillQos=MqttQos.atMostOnce, WillRetain=false, PasswordFlag=false, UserNameFlag=false, KeepAlive=0
MqttConnectPayload - client identifier is :
20:44:02.867 dart_sdk.js:22313 2020-03-13 20:44:02.867 -- SynchronousMqttBrowserConnectionHandler::internalConnect - pre sleep, state = Connection status is connecting with return code noneSpecified
20:44:03.011 dart_sdk.js:22313 2020-03-13 20:44:03.011 -- MqttBrowserConnection::_onData
20:44:03.012 dart_sdk.js:22313 2020-03-13 20:44:03.012 -- MqttBrowserConnection::_onData - message received MQTTMessage of type MqttMessageType.connectAck
Header: MessageType = MqttMessageType.connectAck, Duplicate = false, Retain = false, Qos = MqttQos.atMostOnce, Size = 2
Connect Variable Header: TopicNameCompressionResponse={0}, ReturnCode={MqttConnectReturnCode.identifierRejected}
20:44:03.013 dart_sdk.js:22313 2020-03-13 20:44:03.013 -- MqttBrowserConnection::_onData - message processed
20:44:03.015 dart_sdk.js:22313 2020-03-13 20:44:03.015 -- SynchronousMqttBrowserConnectionHandler::_connectAckProcessor
20:44:03.015 dart_sdk.js:22313 2020-03-13 20:44:03.015 -- SynchronousMqttBrowserConnectionHandler::_connectAckProcessor connection rejected
20:44:03.016 dart_sdk.js:22313 2020-03-13 20:44:03.016 -- SynchronousMqttBrowserConnectionHandler:: cancelling connect timer
20:44:03.017 dart_sdk.js:22313 2020-03-13 20:44:03.016 -- SynchronousMqttBrowserConnectionHandler::internalConnect - post sleep, state = Connection status is disconnected with return code identifierRejected
20:44:03.017 dart_sdk.js:22313 2020-03-13 20:44:03.017 -- SynchronousMqttBrowserConnectionHandler::internalConnect - initiating connection try 1
20:44:03.017 dart_sdk.js:22313 2020-03-13 20:44:03.017 -- MqttBrowserWsConnection::connect - WS URL is wss://mqtt.qiscus.com:1886/mqtt
20:44:03.019 dart_sdk.js:22313 2020-03-13 20:44:03.019 -- MqttBrowserWsConnection::connect - connection is waiting
20:44:03.020 dart_sdk.js:22313 2020-03-13 20:44:03.020 -- MqttBrowserConnection::_startListening - websocket is closed
20:44:03.020 dart_sdk.js:22313 2020-03-13 20:44:03.020 -- MqttBrowserConnection::_onDone - calling disconnected callback
20:44:03.021 dart_sdk.js:22313 2020-03-13 20:44:03.021 -- SynchronousMqttBrowserConnectionHandler::disconnect
20:44:03.021 dart_sdk.js:22313 2020-03-13 20:44:03.021 -- MqttBrowserConnectionHandler::sendMessage - MQTTMessage of type MqttMessageType.disconnect
Header: MessageType = MqttMessageType.disconnect, Duplicate = false, Retain = false, Qos = MqttQos.atMostOnce, Size = 0
20:44:03.022 dart_sdk.js:92337 Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
Your getting this return code form your MQ broker
ReturnCode={MqttConnectReturnCode.identifierRejected}
its rejecting your client identifier for some reason.
Ah yes, seems like clientId
provided in the constructor got overwriten by connectionMessage
.
Hi, I'm trying to use mqtt inside my dart package. I have tried to use ServerClient and BrowserClient without success, even though I can connect to my broker using mqtt.js and mqttbox (mqttbox configuration below).
This is my connection configuration:
I have tried to change any configuration from protocols to use all 3, or just 'mqtt', but neither are working.
Here is the error from browser:
Full log here
MQTTBox configuration: