Mqtt Js Amqjs0007e Socket Error:undefined.

Hi, Roman,I'm trying to establish the connection with Azure IoT Hub through mqtt over websockets these days. The reason I have to do this is because I have a senario to communicate with Azure IoT Hub in the web browser. Now I can successfully connect to Azure IoT Hubusing the MQTTBox(through mqtts) with the help of another post you write. But when I tried the Eclipse Paho web client(with the same setup), it cannot work both in Firefox and Chrome.Then I checked the network status. If I ckick the 'connect' button on the page. Two websocket appear. Hi, RomanJust FYI.

  1. Mqtt Js Amqjs0007e Socket Error:undefined. Adapter

I also tried the HiveMQ these days. The reason that it cannot connect to Azure IoT Hub is that the HiveMQ will modify the host url by itself.For example, If we put '-.azure-devices.net/$iothub/websocket' in the host field and 443 in the port field. After config other fields and click 'connect', the HiveMQ website client will parse the url into '-.azure-devices.net/$iothub/websocket:443/mqtt'.You can see it in the network traffic in the browser's developer tools. Guess the HiveMQ is just a test tool for its own products, not compliant with other mqtt brokers. I am also very confused by this. I am trying out the Paho web-based client and I have all the settings just like in the screenshots here, but I am unable to connect. The reply is just like the one in the reply posted by ShengChen on February 7: '400WebSocket sub-protocol is not supported'.

Mqtt Js Amqjs0007e Socket Error:undefined. Adapter

I just want to make a few things clear here:- password is the access token from the IOT hub's Shared Access Policies tab (I'm using the 'device' policy's token, if that matters)- username is.azure-devices.net/device-name/api-version=2016-11-14- Client ID in this case is 'device-name' (can be anything, so long as it is the same as in the username)- path is /$iothub/websocketAll these are correct, right? I have not done any configuration in the portal apart from creating a new hub (not like there is a lot to configure anyway).I've tried this with IE/Edge/Chrome/FF and they all give the same response.

Mqtt Js Amqjs0007e Socket Error:undefined.

I tried MQTTBox but it does not work either (and does not expose the error messages anywhere, it seems, which makes using it really difficult). Hi Mikko,try one more time:- open on IE11for your device let me say Device10 configure paho client:Host: xxxxxxxxxx.azure-devices.net Port: 443 Client ID: Device10 Path: /$iothub/websocket Username: xxxxxxxxxx.azure-devices.net/Device10/api-version=2016-11-14 Password: SharedAccessSignature sr=xxxxxxxxxx.azure-devices.net%2Fdevices%2FDevice10&sig=XXXXXXXXXXXXXXXXXXXX%3D&se= TLS: Checkedfor Password use the Device Explorer tool:- select Management Tab- click on SAS Token. Button to popup the SASTokenForm dialogfrom this Form dialog select your device, let me say Device10- setup the TTL, let me say 300and from generated SASToken take the value of the SharedAccessSignature such as the Password for the MQTT Client.the following screen snippet shows an eclipse paho client connected from the IE11 browser:ThanksRoman. Ok, thanks, now I got this to connect at least. I was totally unaware of the fact that I need to register a device. I can connect, but using the Paho web client I can not seem to be able to do much else, all publish or subscribe requests fail.

Can you confirmif you are able to perform those actions too, and please enlighten me in case there is something that needs to be configured before those work too.In my use case I could be interested in having just one device with different topics. I assume topics do not need to be explicitly created anywhere before subscribing/publishing?EDIT: going through the documentation I can see that the topic names are fixed and map to different scenarios, e.g. There is a topic name for cloud to device messages etc.EDIT2: I can get e.g. Cloud-to-device messages working between MQTTBox (on Mac) and the Device Explorer tool, but the Paho web client fails to subscribe/publish to that topic.

Posted on