martin-doyle / node-red-contrib-aedes

MQTT broker for Node-RED based on Aedes
MIT License
61 stars 11 forks source link

Pallete Manager - could not install #24

Open scargill opened 4 years ago

scargill commented 4 years ago

Hi

On my Node-Red installation, nothing happened when I tried to install Aedes node.. I did get it to work with npm of course but just wondering if there is an issue - my NR installation is bang up to date. I'm also (idly) wondering, given a working Mosquitto installation if there is any advantage of moving to Aedes - that is for simple use - would it presenr a lighter load on a Raspberry Pi while being just as fast? Or is such a comparison not that easy? If there's an advantage I'll write about it at https://tech.scargill.net. Any pointers appreciate.

Regards

Pete

martin-doyle commented 4 years ago

Hi Pete,

I just tested the installation again on a Raspberry 3 and a Solidrun without any problem. What does it mean "nothing happened"? What does the Node-Red log say when you try to install the Node (View Log during install)? On my Raspberry Aedes complains about Node Version 8 but it still works.

Martin

martin-doyle commented 4 years ago

This is what my log prints:

2020-04-21T20:20:40.549Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-aedes@0.3.5
2020-04-21T20:21:01.772Z [out] + node-red-contrib-aedes@0.3.5
2020-04-21T20:21:01.772Z [out] added 71 packages from 46 contributors in 18.644s
2020-04-21T20:21:02.094Z rc=0
scargill commented 4 years ago

I'm going to put it down to my stupidity. I just uninstalled Aedes - then used NR pallette manager to install again - set the port to 8082 - and added a couple of test nodes - it works. Sorry about that.

martin-doyle commented 4 years ago

No problem. I know that installing Mosca was a nightmare. So I am glad that Aedes is different.

To your other questions: If you have another MQTT broker like Mosquitto running you probably don't need ths node. But for some people node-red-contrib-aedes is just very easy to use. This was the main motivation for creating this node. You don't need to install and maintain another program. Some people are not even allowed to install other programs. I did not compare Node-Red plus Mosquitto vs Node-Red including node-red-contrib-aedes on a Raspberry. But I will check it.

scargill commented 4 years ago

Easy setup is important - and well done - I get countless folk on my blog who have issues with setups of various tools - and fair enough, most just want to use, for example MQTT. I want to drive a car but have no real interest in how the injectors work :-) I'd like to make more mention of Aedes on the blog - if you do get around to running a comparison with Mosquitto I'd love to hear. I know that most of my controllers for lights etc go through MQTT - timing etc.. and would love to know, when I get very slight delays if they are more likely to be Node-Red or Mosquitto slowing things down and if the latter, is there an advantage to moving to Aedes. Mosquitto has a load of reporting features and QOS none of which I use. It is reliable however and has never failed in 2 or 3 years (unlike the Pi which had it's SD taken out my lightning. Thankfully I had a fairly recent RPI-CLONE in a USB socket on the Pi - which survived. Did I see anything in there about Last Will and Testament?

martin-doyle commented 4 years ago

If you need a fast and low resource demanding MQTT broker on a Raspberry, Mosquitto is definately the way to go.

In terms of memory there is not much difference because most of the memory is used for the NodeJS VM anyway (running Node-Red). But when it comes to throughput and response time Mosquitto is faster than Aedes. I used https://github.com/krylovsk/mqtt-benchmark for testing.

I don't know your setup but I would assume that the slight delays come from Node-Red. I created a flow where the messages go 5 times via Mosquitto (on a Raspberry3) and the total delay from publish to subscribe was 13ms on average (2.5ms per message). For node-red-contrib-aedes I got 25ms (5ms per message). This is valid for QOS 0 only. QOS 2 is significantly slower (Mosquitto 400ms / Aedes 500ms).

For me it is clear, if you need a fast MQTT broker and you are allowed and able to install Mosquitto go with it. If you need an inside Node-Red solution or if you come from node-red-contrib-mqtt-broker (Mosca) give node-red-contrib-aedes a try.

I did not use Last Will and Testament so far since I did not have a use case. But it is implemented in node-red-contrib-aedes as well as QOS, Retained messages (which I use if status messages are interesting), password security and TLS.