Git Product home page Git Product logo

node2node's Introduction

node-red-contrib-n2n

A Node-RED node that provides automatic links between different topics on Node-RED instances within UDP multicast range.

Only use this for short messages like data readings.

Install

Run the following command in your Node-RED user directory - typically ~/.node-red

npm install node-red-contrib-n2n

Uses multicast to send packets - if you have multiple network adapters you may need to set a static multicast route - for example

Linux - sudo route add -net 225.0.18.83 netmask 255.255.255.255 dev eth0
Mac   - sudo route add -net 225.0.18.83/32 -interface en0

where eth0/en0 is the network interface you wish to use.

Usage

Only use this for short messages like data readings.

Discover other Node-RED devices on the network and open channels from them.

You can specify what topics are of interest. The node will "request" these from remote instances. The remote node will only send data if the message has a msg.topic that matches.

Topics of interest are specified by a regex string.

  • ^[0-9]{3}$ - matches a 3 digit number
  • ^cat.* - matches topics starting with cat. cats, cathedral, catastrophe

Also outputs msg.host - the hostname of the sending node, and msg.hostip - the ip of the sending node.

The network interface for the multicast can be fixed if required. If not it will try to bind to all available interfaces - which will probably work fine for input - but may not necessarily route out correctly - see above for how to set a static multicast route.

Note: the MTU may well restrict the message to around 1500 characters. Only use this for short messages like data readings.

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.