Giter Club home page Giter Club logo

node-red-contrib-aedes's Introduction

node-red-contrib-aedes

MQTT Broker for Node-RED based on Aedes.

You can use the MQTT protocol in Node-RED without an external MQTT broker like Mosquitto.

Node.js CI js-semistandard-style Codacy Badge

Open Source Love NPM version

Background

This node was created because the original MQTT broker node-red-contrib-mqtt-broker uses mosca which is no longer maintained.

Installation

You can install the node directly within the editor by using the Palette Manager.

To install the node from the command-line, you can use the following command from within your user data directory (by default, $HOME/.node-red):

npm install node-red-contrib-aedes

Flows

Just put this node on Node-RED and hit the deploy button. The MQTT Broker will run on your Node-RED instance. flows

Features

  • Standard TCP Support
  • WebSocket Support via port or path
  • SSL / TLS
  • Message Persistence (In-memory, LevelDB or MongoDB)

For more information see Aedes.

Server without public IP or behind firewall

If your server is behind a firewall or you cannot open any ports other than the standard http/https ports, the MQTT broker node can be accessible by public clients through a WebSocket path.

When your Node-RED server address is https://yourserver/, you can set the WebSocket to bind to, e.g., "/ws/mqtt" path, to have wss://yourserver/ws/mqtt WebSocket at port 443.

You can also bind the WebSocket to the root "/" path and having wss://yourserver/ WebSocket listening at port 443 (or ws://yourserver/ at port 80).

License

Licensed under MIT.

node-red-contrib-aedes's People

Contributors

martin-doyle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

node-red-contrib-aedes's Issues

Aedes over mTLS

Hi,

I am trying to use aesed on nodered with an mTLS connection.
The only port that can be used is the https port so connection will be over websockets.

image

so I expect that I can connect to the broker on:
wss://my.domain.com/ws/mqtt

I created a nodejs client to connect like this:

import mqtt from "mqtt";
import fs from "fs";

const protocol = "wss";
const host = "my.domain.com/ws/mqtt";
const port = "443";
const clientId = `mqtt_${Math.random().toString(16).slice(3)}`;

const connectUrl = `${protocol}://${host}:${port}`;

// certs for mtls
var caFile3 = fs.readFileSync("./certs/ISRoot.crt");
var certFile = fs.readFileSync("./certs/client_cert.pem");
var keyFile = fs.readFileSync("./certs/client_key.pem");

const client = mqtt.connect(connectUrl, {
  clientId,
  clean: true,
  ca: [caFile3],
  cert: certFile,
  rejectUnauthorized: true,
  key: keyFile,
  connectTimeout: 4000,
  reconnectPeriod: 1000,
});

client.on("connect", () => {
  console.log("Connected");
});

client.on("error", (err) => {
  console.log("Connection error: ", err);
  client.end();
});

client.on("reconnect", (error) => {
  console.log("Reconnecting...");
});

The result in the console is always: Reconnecting ...

When we deploy a simple nodejs program with aedes broker in stead of the nodered application, the connection over mTLS is working.

code of the simple nodejs broker:

import Aedes from "aedes";
import { createServer } from "http";
import ws from "websocket-stream";

const httpServer = createServer();
const port = process.env.PORT || 8888;
const aedes = new Aedes();

// emitted when a client connects to the broker
aedes.on("client", function (client) {
  console.log(
    `[CLIENT_CONNECTED] Client ${
      client ? client.id : client
    } connected to broker ${aedes.id}`
  );
});

// emitted when a client disconnects from the broker
aedes.on("clientDisconnect", function (client) {
  console.log(
    `[CLIENT_DISCONNECTED] Client ${
      client ? client.id : client
    } disconnected from the broker ${aedes.id}`
  );
});

// emitted when a client subscribes to a message topic
aedes.on("subscribe", function (subscriptions, client) {
  console.log(
    `[TOPIC_SUBSCRIBED] Client ${
      client ? client.id : client
    } subscribed to topics: ${subscriptions
      .map((s) => s.topic)
      .join(",")} on broker ${aedes.id}`
  );
});

// emitted when a client unsubscribes from a message topic
aedes.on("unsubscribe", function (subscriptions, client) {
  console.log(
    `[TOPIC_UNSUBSCRIBED] Client ${
      client ? client.id : client
    } unsubscribed to topics: ${subscriptions.join(",")} from broker ${
      aedes.id
    }`
  );
});

// emitted when a client publishes a message packet on the topic
aedes.on("publish", async function (packet, client) {
  if (client) {
    console.log(
      `[MESSAGE_PUBLISHED] Client ${
        client ? client.id : "BROKER_" + aedes.id
      } has published message on ${packet.topic} to broker ${aedes.id}`
    );
  }
});

ws.createServer({ server: httpServer }, aedes.handle);

httpServer.listen(port, function () {
  console.log("websocket server listening on port ", port);
});

What are we missing in the nodered configuration to run the mqtt broker over websockets and mTLS?

kr,
Joachim

Broker publish something repeatedly on its own

MQTT Aedes Broker publish topic "$SYS/af98066f-eb5b-4ec7-8ece-e2cf67bd154c/heartbeat" on its own
I don't have that topic, even after I give security username and password, it still publish that topic every minutes

MaxListenersExceededWarning

Not sure if it's an issue of node-red-contrib-aedes, or Aedes itself. I recently switched from node-red-contrib-mqtt-broker on my Raspberry Pi (thanks). I get a (node:2156) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 statusUpdate listeners added. Use emitter.setMaxListeners() to increase limit. I don't get this error when I uninstall node-red-contrib-aedes. I did some googling, found this https://nodejs.org/api/events.html#events_eventemitter_defaultmaxlisteners but I'm out of my league here.
Everything does seem to function as it should, but error should not occur :).

Made with Aedes

Hi, I'm a maintainer of aedes mqtt broker, we are creating a section on aedes Made with Aedes where we will add some interesting projects that are using Aedes. Are you interested on this? Can we add this project to the list?

Can't get TLS to work

Hi firstly many thanks for your good work.

When I try and use with TLS I get
debug window:: Error: error:0909006C:PEM routines:get_name:no start line" (twice)
console :: 25 Mar 20:35:06 - [info] [mqtt-broker:Aedes] Connection failed to broker: mqtts://localhost:8883

Think there might be an bug in aedes.html
line 103 var currentCert = $('#node-nput-cert').val();
think it should be '#node-input-cert'

When I run aedes TLS example with same cert/key files all works.
I'm testing using MQTT Explorer & NR running on a different device.
The RPI is NR v1.0.3

Thanks
Lawrence

Raspberry Pi not showing Aedes node

When searched on Node-Red Palette, no aedes or "node-red-contrib-aedes" shows up. I tried downloading it via the command prompt of my Raspberry Pi Zero:

pi@raspberrypi:~ $ npm install node-red-contrib-aedes
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

+ [email protected]
updated 1 package and audited 129 packages in 40.469s

6 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Anything obvious that should be done?

npm init package.json and npm init /home/pi/package.json result in errors.

0.3.6 Cannot read property 'emit' of undefined, using node-red 1.1.3 Docker

node-red 1.1.3 Docker image
node-red-contrib-aedes 0.3.6
Fresh flows.json, no other nodes, and default Flow 1 tab.
Also, no other nodes are installed aside from those that ship with node-red 1.1.3.

node-red crashes, with the following error log:
Error gist

Tried with and without mongodb connection string.

I haven't found anything with the same error using aedes-persistence-mongodb as a search.

Problem Maximum call stack size exceeded

Hello.
I am using node-red to implement a MQTT broquer (node-red-contrib-aedes) and node-red its working in a Docker, Everything is working correctly but, I detect the following error

1 Jun 15:05:59 - [error] RangeError: Maximum call stack size exceeded
    at AedesBrokerNode.Node.send (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:369:31)
    at Aedes.<anonymous> (/data/node_modules/node-red-contrib-aedes/aedes.js:319:14)
    at Aedes.emit (node:events:513:28)
    at PublishState.callPublished (/data/node_modules/aedes/aedes.js:255:15)
    at makeCallTwo (/data/node_modules/fastseries/series.js:150:3)
    at MQEmitter.release (/data/node_modules/fastseries/series.js:138:7)
    at MQEmitter.parallel [as _parallel] (/data/node_modules/fastparallel/parallel.js:25:12)
    at MQEmitter._do (/data/node_modules/mqemitter/mqemitter.js:133:8)
    at released (/data/node_modules/mqemitter/mqemitter.js:48:12)
    at MQEmitter.parallel [as _parallel] (/data/node_modules/fastparallel/parallel.js:26:7)

I don't get more information only that node-network restarts repeatedly 1 time every hour (more or less).

Please can anyone help me with this error?

Node-red update 1.3.5, new error when loading aedes

Hi there!

I have a problem after updating node-red to 1.3.5.

I get a missing node type error regarding "aedes broker":

"Flows stopped due to missing node types."

the commandline shows this error

Waiting for missing types to be registered:
5 Jul 09:31:42 - [info] - aedes broker

node-red-contrib-aedes:aedes broker : Error: Could not locate the bindings file. Tried:
→ /home/pi/.node-red/node_modules/snappy/build/binding.node
→ /home/pi/.node-red/node_modules/snappy/build/Debug/binding.node
→ /home/pi/.node-red/node_modules/snappy/build/Release/binding.node
→ /home/pi/.node-red/node_modules/snappy/out/Debug/binding.node
→ /home/pi/.node-red/node_modules/snappy/Debug/binding.node
→ /home/pi/.node-red/node_modules/snappy/out/Release/binding.node
→ /home/pi/.node-red/node_modules/snappy/Release/binding.node
→ /home/pi/.node-red/node_modules/snappy/build/default/binding.node
→ /home/pi/.node-red/node_modules/snappy/compiled/12.18.0/linux/arm/binding.node

Could you tell me what am I doing wrong?

Thank you

Crashes with ESP-8266 connected to it at nodered

After update my ESP-8266 it crashes:

Apr 18 11:41:06 raspberrypi Node-RED[18988]: 18 Apr 11:41:06 - [red] Uncaught Exception:
Apr 18 11:41:06 raspberrypi Node-RED[18988]: 18 Apr 11:41:06 - [error] TypeError: Cannot read property 'toString' of undefined
Apr 18 11:41:06 raspberrypi Node-RED[18988]: at Aedes.authenticate (/home/pi/.node-red/node_modules/node-red-contrib-aedes/aedes.js:172:68)
Apr 18 11:41:06 raspberrypi Node-RED[18988]: at ClientPacketStatus.authenticate (/home/pi/.node-red/node_modules/aedes/lib/handlers/connect.js:101:17)
Apr 18 11:41:06 raspberrypi Node-RED[18988]: at makeCallTwo (/home/pi/.node-red/node_modules/fastseries/series.js:150:3)
Apr 18 11:41:06 raspberrypi Node-RED[18988]: at release (/home/pi/.node-red/node_modules/fastseries/series.js:138:7)
Apr 18 11:41:06 raspberrypi Node-RED[18988]: at resultList (/home/pi/.node-red/node_modules/fastseries/series.js:125:3)
Apr 18 11:41:06 raspberrypi Node-RED[18988]: at Aedes.series [as _series] (/home/pi/.node-red/node_modules/fastseries/series.js:45:7)
Apr 18 11:41:06 raspberrypi Node-RED[18988]: at Immediate.init (/home/pi/.node-red/node_modules/aedes/lib/handlers/connect.js:83:17)
Apr 18 11:41:06 raspberrypi Node-RED[18988]: at processImmediate (internal/timers.js:466:21)
Apr 18 11:41:06 raspberrypi systemd[1]: nodered.service: Main process exited, code=exited, status=1/FAILURE

Dont know why ...

Node-Red Installer/Example problem

I had this library running on my Node-Red server, I was using the example provided here:
https://github.com/martin-doyle/node-red-contrib-aedes/blob/master/examples/aedes_simple.json
then after trying to change the default port back to 1883 - after a deploy, it said the Aedes Broker node not found.

I rebooted my system and eventually tried to reinstall the library and now I am getting the error below in the install log. Based on the scorecard, this should run on Nodejs v12.0.0 or greater. Did something change today? WTH?:

2023-11-28T16:42:27.497Z Install : node-red-contrib-aedes 0.11.1

2023-11-28T11:42:25.203Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2023-11-28T11:43:03.634Z [err] npm
2023-11-28T11:43:03.638Z [err]
2023-11-28T11:43:03.640Z [err] ERR!
2023-11-28T11:43:03.641Z [err]
2023-11-28T11:43:03.646Z [err] code ENOTSUP
2023-11-28T11:43:03.734Z [err] npm
2023-11-28T11:43:03.735Z [err]
2023-11-28T11:43:03.737Z [err] ERR!
2023-11-28T11:43:03.738Z [err]
2023-11-28T11:43:03.740Z [err] notsup
2023-11-28T11:43:03.743Z [err] Unsupported engine for [email protected]: wanted: {"node":">=14"} (current: {"node":"12.21.0","npm":"6.14.11"})
2023-11-28T11:43:03.746Z [err] npm ERR!
2023-11-28T11:43:03.749Z [err] notsup Not compatible with your version of node/npm: [email protected]
2023-11-28T11:43:03.753Z [err] npm ERR!
2023-11-28T11:43:03.756Z [err] notsup Not compatible with your version of node/npm: [email protected]
2023-11-28T11:43:03.756Z [err] npm
2023-11-28T11:43:03.761Z [err] ERR! notsup Required: {"node":">=14"}
2023-11-28T11:43:03.761Z [err] npm ERR! notsup Actual: {"npm":"6.14.11","node":"12.21.0"}
2023-11-28T11:43:03.796Z [err]

Pallete Manager - could not install

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

Unsupported engine

Orange Pi +2E, Armbian 23.5.2 (Ubuntu 22.04.2 LTS)

root@orangepiplus2e:~# npm install node-red-contrib-aedes
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=14' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=14' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=14' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=14' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=14.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=14.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>= 14' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }

up to date, audited 98 packages in 13s

11 packages are looking for funding
  run `npm fund` for details

1 low severity vulnerability

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

But using NVM i installed
rrr

But this does not help, the system still sees the old versions (and I didn’t even install them).
What should be done in this case?

p.s. And which version of Ubuntu to install so that the repository contains the latest up-to-date versions of Node.js ?

Working with Docker

Good Evening, @martin-doyle
Hope everyone is safe from Corona!

Trying to get 'node-red-contrib-aedes' to work via Docker swarm...

So far I have it working internally within a node-red docker container,
as in [MQTT] communication from one flow to another.

I have had to move away from mosquitto MQTT as they have little to no support for clustering machines together as one larger [HA] MQTT broker, and it seems Aedes is more up to this task...

I am trying to connect (externally) via MQTT.fx which is installed on another host machine and i cant get a connection at all. It keeps saying connection refused.

I'm not sure where to start troubleshooting this as i have a connection internally but cant access it from outside of the docker container. I appreciate if not everyone is using docker to deploy this sort of thing but any guidance would be grateful.

More Details about Setup;

Docker Swarm [Cluster] consisting of 8x Raspberry pi 4 (4GB) nodes each with their own SSD managed by a GlusterFS network share

I have a digitalOcean DNS with 'A' Records pointing to my External IP Address
e.g - mqtt.example.com

Traefik Proxy - Serving TLS Certs via lets-encrypt and sitting as the Edge router / load-balancer for Docker Services

Ports 80, 443 & 8883 open on Router to above IP Address
They are also listed as entryPoints in Docker file config (via Docker Stack Deploy and compose.yml).
Therefore ;
tcp://mqtt.example.com:8883 -> Traefik -> Nodered -> Aedes
tcp://mqtt.example.com:8883 -> Traefik -> Aedes --would be better - but dont know if this is possible due to Aedes being installed via Nodered inside of the container [i.e - sandboxed])

Nodered is set as a 'router' in Traefik coming through port 443 (also port 80 auto-redirects to 443)
so http://node.example.com:80/443 -> Nodered service (port 1880)

Aedes Set up inside each Nodered instance on port 8883
But Aedes can't be accessed through either;
tcp://mqtt.example.com:8883 or,
tcp://node.example.com:8883


What i am unsure about -

Would I have to go through node.example.com in order to reach Aedes, or can i go direct either through for example; mqtt.example.com:8883

Also, does Aedes have 'SNI' support..?
I think traefik needs this support to be able to receive TCP traffic through its frontend routers.

Any pointers are gladly appreciated as ive been trying to get this config to work for some time now and feel like im getting nowhere.

If nobody can help would it be possible for someone to let me know how to debug aedes connections through Nodered, as i used to be able to do it through docker using
$ docker service logs x_mqtt
When i was using mosquitto as my mqtt docker service.

ERR_DLOPEN_FAILED when installing on 2.1.4

While installing the node on version 2.1.4, the following console error appear

[node-red-contrib-aedes/aedes-mqtt-broker] Error: Module did not self-register: '~/.node-red/node_modules/snappy/build/Release/binding.node'.

When going to manage pallette to check the status of the node, it has a warning sign next to it , with the following message
ERR_DLOPEN_FAILED

Any thoughts ?
Thank you and thanks for sharing the node

Add status to node

Show the node status (listening to port, error) including the number of clients.

Error stopping node: Close timed out - Again

This is an issue once again with Node-red 2.x

Here is a post on the NR forms discussing the issue.

[(https://discourse.nodered.org/t/error-stopping-node-close-timed-out-mqtt-nodes/52830/5)]

Uncomment "publish" event to allow impliment bridge easily.

I understand that you commened broker.on('publish', function(){ ... }); to avoid multiple log message. However this is particularly useful to create a bridge for MQTT 3.1.1. Hence I recomend to uncoment this section.

As an alternative approach you can add an aditional ouput to the Aedes Broker node dedicated to the "publish". I mean two output to a single node. This will make the the node more flexible.

Error stopping node: Close timed out

Steps to reproduce the error
Import the flow in: https://cookbook.nodered.org/mqtt/connect-to-broker, configure Aedes node (localhost:1883) and deploy

What happens
Every time the flow is deployed, the MQTT in node gets stuck for a while, then output: "Error stopping node: Close timed out"

Expected behaviour
The MQTT in node would immediately close without errors and the flow would be deployed without error and time wasting, as it happens if you use an external MQTT broker (e.g., Mosquitto)

Environment
Node-RED version: 1.3.2
Node.js version: 14.6.1

Connect Aedes mqtt from device to IBM (Node-Red)

Hello, @martin-doyle I have installed node-red in IBM cloud using the catalog node-red app. There I installed this module as well. Now how can I connect my device to node-red so I can send data to node-red via mqtt.

I am presently using mqtt box and could not connect to node-red mqtt broker. I used the app URL as mqtt broker URL. is that right? Please let me know if you would like to know more info.

Connect to MQTT broker (aedes running on AWS) from public client

Hi,
I am not sure if this is an issue or if it is not working due to some settings on my side.

I have installed node-red on AWS EC2 - Windows Instance and enable IIS Manager and installed websockets,enabling websockets through Server Manager was necessary to have node-red started fully on EC2.(before enable websockets, node-red was getting disconnected after login)

Now, the task is to run MQTT broker on the AWS EC2 instance and connect to it using public clients.

I have installed aedes broker and configure following:
MQTT port: 1884
WS port : 8080
Have entered - user and password in security,my flow is attached

Now can when i try to connect by any client like google lens or hiveMQ client I am getting error.

Can anybody tell what mistake I am doing ?

As I am able to subscribe to Aedes MQTT broker on localhost, how can I connect Aedes MQTT broker through public clients.

Thanks and Regards,

Aedes-Node not showing up in palette after installation

Hello everyone,

i tried installing the node with the palette manager and npm, but had no success yet. After the installation the node doesn't show up in the palette but gets listed as installed.

Installing the node with the npm command gives me the following response:

npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
+ [email protected]
added 73 packages from 100 contributors and audited 75 packages in 90.744s
found 0 vulnerabilities

Does this issue prevent the node from working entirely? I'm working with older versions of node and node-red, is the aedes-node not compatible?

My versions are:
node version is 8.16.1
node-red version is 1.2.9

Any help would be appreciated!

TypeError: Cannot assign to read only property 'writeQueueSize' of object '#<TCP>'

Hi!

I'm trying to connect from an ESP32 and send MQTT messages to Node-Red using node-red-contrib-aedes. As soon as the ESP32 tries to connect, either with authentication or none, the Node-Red service crashes with the following error message:

8 Dec 19:43:08 - TypeError: Cannot assign to read only property 'writeQueueSize' of object '#<TCP>'
at _clone (/usr/lib/node_modules/node-red/node_modules/clone/clone.js:162:16)
at _clone (/usr/lib/node_modules/node-red/node_modules/clone/clone.js:162:18)
at clone (/usr/lib/node_modules/node-red/node_modules/clone/clone.js:202:10)
at Object.cloneMessage (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/util.js:91:17)
at AedesBrokerNode.Node.send (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:410:61)
at Aedes. (/home/pi/.node-red/node_modules/node-red-contrib-aedes/aedes.js:138:12)
at Aedes.emit (events.js:198:13)

Additional Information:
8 Dec 19:48:23 - [info] Node-RED version: v1.0.6
8 Dec 19:48:23 - [info] Node.js version: v10.21.0
8 Dec 19:48:23 - [info] Linux 5.4.79-v7+ arm LE

Node-Red runs on a Raspberry Pi 3 B

Many Greetings!
Remo

payload topic undefined

my humble oppinnion is that subscription is deleted before the node.send finishes

 broker.on('subscribe', function (subscription, client) {
      console.log(subscription) >>>>>> [{ topic: 'db/client-ek2jasyss8r/repo/7c8c7f0e-1b4d-4822-9f95-52a6a079a3e6',qos: 1 }]
      const msg = {
        topic: 'subscribe',
        payload: {
          topic: subscription.topic,
          qos: subscription.qos,
          client
        }
      };
      node.send([msg, null]);
    });

image

aedes adduser

Hi, can you help me to use
aedes adduser
whit parameter like
aedes adduser myuser mypass --credentials ./credentials.json
--authorize-publish 'hello/' --authorize-subscribe 'hello/'
to create dynamic users to restrict each user from the other?
thanks Paolo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.