tanner87661
Posts: 2
Joined: Sun Jul 29, 2018 1:53 am

Raspberry Pi 3 - Jessie - Mosquitto 1.5 - Websocket Paho Client Connect Problem

Sun Jul 29, 2018 2:06 am

I have Mosquitto 1.5 running on Raspberry Pi 3 Jessie with Websocket. Log file shows that websocket gets initialized.

I am trying to run the Paho Client from a web page. As soon as I load the page, it keeps calling the connect function. The web page becomes sluggish. The messages are successfully posted though through web socket and I can receive them in Node Red. Several hundred messages per second coming through.

When I connect the same web page to test.mosquitto.org or another public MQTT Websocket site, all is fine, so I think it has to do with either Mosquitto or Websocket configuration on my Raspi.

Any suggestions?
Hans

PepperNg
Posts: 1
Joined: Sun Jul 29, 2018 7:28 am

Re: Raspberry Pi 3 - Jessie - Mosquitto 1.5 - Websocket Paho Client Connect Problem

Sun Jul 29, 2018 7:37 am

I'm having the exact same problem. It has something to do with libwebsockets on Jessie. I did some searching trying to resolve the problem for my own but haven't had the time to try any of these, but:
On Stretch it is supposedly working fine, so you can try to upgrade to that, or either downgrade libwebsockets to 2.4.1 or downgrade mosquitto to a version prior to 1.5.
Unfortunately this issue has been known for quite some time, and still hasn't been fixed, so I'm guessing it won't be in the near future either. Requiring you to either upgrade your raspberry pi OS to Stretch or the downgrade workarounds.
Some more information can be found here:
https://github.com/eclipse/mosquitto/issues/837

User avatar
DougieLawson
Posts: 34167
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Raspberry Pi 3 - Jessie - Mosquitto 1.5 - Websocket Paho Client Connect Problem

Sun Jul 29, 2018 1:16 pm

The time to upgrade to Raspbian Stretch is NOW!
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

tanner87661
Posts: 2
Joined: Sun Jul 29, 2018 1:53 am

Re: Raspberry Pi 3 - Jessie - Mosquitto 1.5 - Websocket Paho Client Connect Problem

Sat Aug 18, 2018 3:00 am

I upgraded to stretch tonight, the process was taking some time but otherwise no problem. Mosquitto, Node-RED still running, all date still there. But the problem with websockets remains as well. Very frustrating.

User avatar
DougieLawson
Posts: 34167
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Raspberry Pi 3 - Jessie - Mosquitto 1.5 - Websocket Paho Client Connect Problem

Sat Aug 18, 2018 9:10 am

What's in your mosquitto config?

I've got

Code: Select all

#listener 1883
protocol mqtt

listener 9001
protocol websockets
I've got an example WS program at: https://github.com/DougieLawson/Wemos_Arduino_MQTT
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

Return to “Beginners”