more G-Labs products

Author Topic: Mosquitto on RPi  (Read 508 times)

December 29, 2016, 06:05:20 PM
Read 508 times

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
This isn't exactly a HG issue, but I'm sure others here could run into this if not using the built-in MQTT broker.  Mosquitto is one of the more popular brokers but the standard repository only has version 0.15 available.  I was having issues connecting an ESP8266 so I upgraded the repository and was able to get a current version of Mosquitto (1.4.10) but now nothing connects to it from another machine.  I can use the local pub/sub and it will work but that's it.

I have an Arduino UNO running PubSubClient that was working on 0.15 and now will not connect.  I installed MyMQTT for my Android phone and it will connect to test brokers but not the RPi.  I tried the ESP8266 with test brokers successfully but failed to connect to the RPi.

I'm sure there's some difference between 0.15 and 1.4.10 that is the issue and most likely just a setting that can be changed.  However, I can't figure it out for the life of me!  If anyone has 1.4.10 (or anything over 0.15 really) running on an RPi, PLEASE chime in!

December 30, 2016, 12:38:18 PM
Reply #1

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271
I had issues with the inbuilt mqtt broker that it didnt work on the older PI (suspect mono version) - don't know if that the issue your seeing? But my esp8266's connect fine once i figured that out :)

Mosquitto needs to be configured to allow access from remote machines iirc.

I've used moquette before as an app to test too before assuming your code doesnt work :)

December 30, 2016, 05:47:01 PM
Reply #2

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I posted the question on the esp8266 forum and figured things out. In the end, it was something in the config file that Mosquitto wasn't happy about. I deleted the config file and everything seems to be working with default settings. Funny because I followed a guide that recommended those config tweaks and they broke things.