7656 questions

9090 answers


12041 members

0 votes
1,194 views 4 comments
I could not set up the MQTT over Websocket for RUT240(FW ver. RUT2XX_R_00.01.07).

I added the following 2 lines to the "mosquitto.conf" via CLI.

listener 9001

protocol websockets

Please tell me how to set put the MQTT over websocket.

4 Answers

0 votes

Can I ask what you were trying to achieve with "listener 9001" and "protocol websocket" lines in config file? Do you have some specific firewall rules or use configuration that requires that? Also I would like you to clarify few other things.

Are you trying to run Broker or Publisher? For usual Broker configuration, you have to select "Enable remote access", and either have Public IP address or set up DDNS for it to be reachable over the internet.

And are you using TLS/SSL for connection security. If so, try establishing connection without security, and if it connects double check certificates used for secure connection.


Thanks for your answer. This is not security issue.

You will find "MQTT over Websocket" by http://www.steves-internet-guide.com/mqtt-websockets/ .

I would like to receive the data(messages) on the Web browser from MQTT broker by using Websocket of mosquitto like the following web.

I would like to configure the "mosquitto.conf" by CLI and use the Websocket function of mosquitto. Is it possible to use the Websocket function on the RUT240? 



Then, I am sorry, but there is no Websocket support in mosquito used by RUT240 routers, for this kind of application, at this moment.
VidasKac, is this valid for RUT955 too? And are You sure? Because the mqtt broker on the RUT955 is version 1.4.15, which should have websocket integrated. See http://mosquitto.org/blog/2015/02/version-1-4-released/

Question is, how to enable it. Because changes in /etc/mosquitto.conf are overwritten on restart of the broker. Are there options to put into /etc/config/mosquitto ?

Ok, to check it, I did this:

/etc/init.d/mosquitto stop

and then I restarted it manually with a modified config in /etc/mosquitto/mosquitto.conf containing this:

user root
port 1883
allow_anonymous true
listener 9001
protocol websockets

by doing this:

mosquitto -v -c /etc/mosquitto/mosquitto.conf

The broker replies with

Error: Websockets support not available.

which is the typical answer when the websockets function is not compiled. So, all there would be needed to do is to compile the already available option into the mqtt package. Is somebody from teltonika reading here to maybe add this feature to the roadmap?

0 votes

I also want to setup the mqtt for my new account. I have read some guide article related to mqtt network.

0 votes
These are the solutions i can think of:

1. You have to recompile mosquitto with websocket  support. (be sure to use an uptodate websocket lib, since the default debian ones have problems i think)

2. Install websockify. (this may be problematic too, since it has pretty huge dependencies)

3. Install websockify to a different server, and let it connect to RUT on TCP instead of websocket.
0 votes
Try to force reinstall mosquitto-ssl package and install libwebsocket

It's works on my TRB2xx but w/o official support. Mosquitto-ssl include websocket since v1.4.7