npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-fred

v0.0.6

Published

Node set for linking FRED hosted Node-RED to devices

Downloads

13

Readme

node-red-contrib-fred

This module provides a set of nodes for making it easier to connect to a FRED instance from a device like a Raspberry Pi.

These nodes currently connect to FRED using web sockets. These nodes are based on the built in web sockets modules that come with Node-RED. As FRED evolves, the method of connecting to a FRED-hosted Node-RED may change. Using these nodes will make sure your device flows will continue to connect to FRED using the most well supported protocol.

You can find detail tutorial of this node from here.

Install

cd ~/.node-red
npm install node-red-contrib-fred

Open your Node-RED instance and you should have a FRED input and output node available in the input and output categories.

Connecting to FRED

On FRED, create an named endpoint for your Pi or PC to connect to. The endpoint name must start with a letter and consist of only alpha-numeric, dash and underscore characters (url friendly). For example, the following flow creates a private FRED input endpoint node called 'example' connected to a debug output node.

[{"id":"a7028d68.57b46","type":"fred-server","z":"dfb73258.cc266","endpoint":"example","private":true,"wholemsg":"false"},{"id":"629ac252.a200ac","type":"debug","z":"dfb73258.cc266","name":"","active":true,"console":"false","complete":"false","x":417.5,"y":274,"wires":[]},{"id":"76df0c2e.be7f14","type":"fred in","z":"dfb73258.cc266","name":"","server":"a7028d68.57b46","client":"","x":183,"y":274,"wires":[["629ac252.a200ac"]]}]

On your Pi or PC, create an endpoint with the same name that sends data to the FRED endpoint.

[{"id":"15d1c0df.836f1f","type":"fred-client","z":"a832565d.979308","endpoint":"example","private":true,"username":"mike","apikey":"api-key","wholemsg":"false"},{"id":"6b89d3c1.57de3c","type":"fred out","z":"a832565d.979308","name":"","server":"","client":"15d1c0df.836f1f","x":402,"y":280,"wires":[]},{"id":"780979d5.8621e8","type":"inject","z":"a832565d.979308","name":"","topic":"asdfasf","payload":"fasdfsaf","payloadType":"str","repeat":"","crontab":"","once":false,"x":185,"y":246,"wires":[["6b89d3c1.57de3c"]]}]

Note that if you create a public endpoint on FRED, the client only needs your user name to access the FRED endpoint in your instance. Replace the text 'api-key' in the flow above with your own API key before importing to your local Node-RED.

Installing on FRED

This information only applies to installing these nodes on the FRED host, and is here (mostly) for FRED licensees.

The package.json file contains a config property 'hostType' that can be 'client' (default) or 'server'.

To configure FRED nodes to run on a FRED server, execute this before installing:

npm config set node-red-contrib-fred:hostType server

Setting to client (default) will ensure only the fred-client nodes are available for connecting to FRED from a device like a PC or Pi. When set to server, only the fred-server nodes will be available.

During the postinstall phase, the rewriteHtml.js script runs to modify the fred.html code to indicate whether the client or server nodes should be made available in Node-RED.

Note that the FRED protocol and host is in the package.json file. Change it after installation to run against test servers or other FRED deployments.

Developers

cd ~\.node-red\node-modules
git clone https://github.com/SenseTecnic/node-red-contrib-fred.git
cd node-red-contrib-fred
npm install