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.