Mqtt using websockets

I have an Advantech WISE4012 that I’m trying to get it talking to Losant using MQTT.
The documentation says it’s using websockets.
I’m not having any luck.

@Lars_Andersson,

You can find details on how to connect to the Broker using WebSockets here:

However, you mentioned you’re not having any luck. Could you give more info behind what you tried? What may be wrong, or any errors you’re seeing?

The device is just telling me “incorrect user/password configuration”.
I suspect it’s mostly depending on how I have entered the information in the device itself, and the device documentation isn’t really clear on how to configure it unless it’s for iSensing MQTT.
Their support just referred me to https://support.advantech.com/support/KnowledgeBaseSRDetail_New.aspx?SR_ID=1-1L5RLK8&Doc_Source=Knowledge+Base , which is a bit different. But I’ll try that and see what I learn.
I was hoping maybe someone else had been down this road before.

While hiding things like keys/secret, could you send over a screenshot of your configuration?

Looking at the doc you sent over, it looks like those instructions are using mosquitto. This may help:

Could you try broker.losant.com as your Host Name. Instead of ws://broker.losant.com?

I did that.
and I also had the path as: losant/my_device_id/state , I just didn’t show that in my screenshot

@Lars_Andersson,

Can you DM me your full configuration ( with all the correct values )?

Ah, it may be that “WebSocket Path” option. I’ve never seen that. I think it’s changing your Host.

I think it’s appending it to the Hostname, like so: broker.losant.com/losant/my_device_id. This setting should be blank.

if I make it blank, it automatically fills it in to “mqtt”

Unfortunately, that would need to be blank. I’d recommend opening up a support ticket on their end.

For now, it looks like you can configure mosquitto on your device and set up a bridge to Losant. The settings you put in this UI would be to a local mosquitto broker. The local mosquitto broker can forward the messages to Losant.

That’s what this article is covering:

How to Configure a Mosquitto Bridge to Losant

It looks like this WISE device has fixed prefix to the posting topics “Advantech/macaddress/” .
Anyway I can retrieve those within Losant?

@Lars_Andersson,

Yes! You may configure custom topics in the MQTT Trigger node :slight_smile:

ok, cool I’ll try that.
But even if I’m not watching the correct topics, shouldn’t the device log show that the device connects?

I had no problems connecting to cloudmqtt.com using a guide from Advantech.

Hey @Lars_Andersson and @anaptfox,
I am using an Advantech Wise 4050, with is similar to @Lars_Andersson’s device.
Firstly, I’m not sure how the Mosquito bridge can work in this case since we can’t specify the device ID (client ID)?
I assume what @anaptfox is saying that we can connect it to the Losant broker and then subscribe to custom MQTT topics to retrieve the data:

I have tried to connect the device to the Losant broker using all three transport protocols,
TCP:

TLS:

WebSockets:

But none is successfully connecting to the broker.

@Lars_Andersson did you manage to connect yours?
@anaptfox any idea how we could make this work?

It looks like it’s missing the ability to provide a client ID as part of the MQTT configuration. What’s under the Advanced Settings tab?

Hi @Brandon_Cannaday,
See below


I don’t think there is anything useful here

Do you see a potential solution for this device @Brandon_Cannaday?