MQTT No Longer Works

I'd say there are only two choices for buying now: the latest (ie Pi 5) and the Pi Zero Two.

Of course the Pi 5 is much more powerful. It's much more expensive too.

Node-red runs well on the Zero Two, but I only use the Lite OS so no desktop, and access Node-red via the browser on my PC.

It's just so endearing that this little computer is running Node-red.
Should have turned the coin over so there was no doubt it's 20p not 50p!

1 Like

ok i will have a look thanks, node red has stopped working now so has to be done

Thanks
Stuart

You might want to investigate tools to keep both the OS and your npm installs auto-updated. Whilst this will occasionally cause their own issues such as the ones I mentioned with a few previous releases of Mosquitto, it will overall save you a lot of grief.

For example, I use the unattended-upgrades Debian package to keep my home automation server updated. This is, I believe, Debian's recommended approach. The Pi OS's are based on Debian.

1 Like

Hi,
Thanks i will have a look if i get up and running again, i have ordered a pi 5 from farnell, just having a nightmare with the pc now updating, if i have mosquitto running on the pc and i open mqtt FX i should be able to connect and subscribe to any of the topics that are coming in but it is not seeing anything so i think something may be blocking mqtt

thanks
stuart

Hi,
I have just seen on a wireshark page that you need to alter the mosquitto conf file to allow anonymous packets, i have never had to do this but maybe after something was updated it broke

thanks
Stuart

That is a change since mosquitto 2.0 to make systems more secure. The default is only to allow localhost connections. You should add

listener 1883
allow_anonymous true

You also might like to add this so that you get meaningful timestamps in the mosquitto log, should you ever need to look there.

# human readable timestamps in log
log_timestamp true
log_timestamp_format %Y-%m-%d %H:%M:%S
1 Like

Hi,
Thanks for the info, I have just reinstalled mosquitto on the pc but now the service starts and stops straight away, its one thing after another
Thanks
Stuart

Look in /var/log/mosquitto.log
Probably you have a typo in the config file.

1 Like

Hi,

Thanks i will check it now
Stuart

Hi,
I am at home now so I have installed mosquitto on my pc at home and node red, first I changed and saved the mosquitto conf file and restarted, the broker service starts and connects on node red startup, I then setup a test mqtt input and sent a Test topic from my mobile phone on the same network and all works fine, so I will try the same with the other pc on monday
Thanks again
Stuart

Certainly I am prejudiced but the logic of owning a Pi while installing Mosquitto or Node-red on a PC totally defeats me.

Unless I missed something I don't think you have clearly explained your setup for sensors, mqtt or Node-red.

1 Like

Hi,
I work for a registered childrens charity retreat centre and the pi runs a sensor system that I built about 12 years ago, 7 buildings 22 Calorifiers, Calorifier Returns, Cold water storage tanks, an external wifi system coming into a ten way switch and a wireless router with the worlds slowest broadband connection @ 1gig or under, then the old pi, the sensors are esp8266 based which convert temperatures from DS18b20's to MQTT messages (which have worked flawlessly for 12 years), the whole system was built for next to nothing, every month i use scrot to take a screen shot of all the gauges on the dashboard for records and email it to myself, the PC was given to me so is used in my workshop for various jobs, troubleshooting being one of them

I must say the system has just amazed me at how reliable it all has been the only parts being replaced have been on the wifi network ie cheap routers and external access points

Thanks All
Stuart

5 Likes

Good to hear your system has been so reliable. I have similar experiences with DS18B20's, ESP8266 and a Rpi 3 running the MQTT broker. Probably not for as long as you though, about 8 years I think. I think when you get everything set up again with your Pi 5 and the latest softwares your system will become reliable again. I suggest you take a look at IOTstack, a system that enables you to install, mosquitto, InfluxDb and Grafana. InfluxDb and Grafana are great for storing and displaying data. IOTstack is a dockerized system that makes it easy to update the various softwares running in its containers.

1 Like

Just a caution about using Docker. Sometimes it causes more problems than it solves. You only have to look at how many of the questions here involve docker in some way.

1 Like

Hi Colin, thanks for cautionary note. I specifcally mentioned the IOTstack version of Docker containers as it is very well and actively supported by the IOTstack developer and has a very good 'Discord' group. I know very little about Docker or Linux but I do have two systems running IOTstack and then NR, InfluxDb, Grafana and Mosquitto under it with a very few problems. It is, however, just another option.

1 Like

To add to @TotallyInformation there is a package called webmin that keeps the system updated automatically and gives some dashboard info that runs on pi's

1 Like

Hi Bob,
I am getting there now, I have the dashboard going, just trying to sort the emails out again, your suggestions sound good though I will have a look tonight when I get in

Thanks
Stuart

Hi Gerry,
Thanks for the info, I will have a look at this too

Stuart