GithubHelp home page GithubHelp logo

node-red-embedded's Introduction

node-red-embedded

Node red nodes used by the signalk-node-red plugin which embeds node-red into signalk-node-server.

Please note that these nodes only work when node-red is embedded in signalk-node-server.

See the examples folder for flows from the following examples..

Examples

Send an adjusted depth value

Alt text

Switch relays based on complex conditions (example turns on/off the anchor light and ACR automatically)

Alt text

Send an alarm when wind speed is high

Alt text

Send an alarm when the starter battery voltage is low for more and 60 seconds. (this keeps the alarm from going off while starting the engine)

Alt text

Send an alarm when the AC input voltage is low and the boat is in its slip

Alt text

Send a tweet when leaving or arriving at the slip

Alt text

GPIO and put handler

Sends the state of a digital gpio pin into Signal K and allows at PUT request to the server to set the state of a pin. Alt text

Available Nodes

signalk-on-delta

Input that sends messages for every delta the server receives. Optionally flatten the deltas (see signalk-flatten-delta below)

signalk-subscribe

Input that sends messages for every delta from the configured path. Optionally flatten the deltas (see signalk-flatten-delta below)

signalk-flatten-delta

Function that flatten deltas from signalk-on-delta.

The output payload will be the value and the topic will be the path, The payload will also include context, $source, and source.

{
  "topic": "navigation.speedOverGround",
  "payload": 2.45,
  "source": {"label":"actisense","type":"NMEA2000","pgn":129026,"src":"3"},
  "context": "vessels.self",
  "$source": "actisense.3"
}

signalk-input-handler

Input that allows a flow to modify or filter deltas before they get to the server. Once the data is modified, it should be connected to the signalk-input-handler-next node.

signalk-input-handler-next

Output that should be used to send a delta on after processing using the signalk-input-handler node.

signalk-geofence-switch

Function that checks if a vessel is inside of the specified geofence

signalk-delay

Function that will delay sending the input until the value has been the same for the given timout

For example, you could use this to send a low starter battery voltage alarm only if it stays low for 5 seconds.

signalk-send-pathvalue

Output that sends a delta through the server. Input should be path and value

{
  "path":"navigation.speedOverGround",
  "value":20.45
}

signalk-notification

Input that sends a message when a notification is received. Configuration allows messages for a specific notification or any notification. The notification state can also be specified. Payload will be the notification path and value.

{
  "path: "notifications.anchorAlarm",
  "value" : {
    "state" : "emergency",
    "method" : [
      "visual",
      "sound"
    ],
    "timestamp" : "2018-06-15T15:01:55.007Z",
    "message" : "Anchor Alarm - Emergency"
  }
}

signalk-geofence

Input that checks if a vessel is inside of the specified geofence

signalk-put-handler

Input that sends messages when a PUT is sent to the server for the given path

signalk-send-delta

Output that sends a delta to the server. Input should be a fully formed SignalK delta

signalk-send-put

Output that send a SignalK put request via app.putSelfPath. Input should be the value to put.

signalk-send-notification

Output that sends a SignalK notification

If the input payload is an object, then it will use the keys path, state, method, and message. Example below. Otherwise it will use the configured values.

To specify all the info, send:

{payload: {
  "path":"notifications.testNotification",
  "state":"alarm",
  "method":["visual","sound"],
  "message":"this is a notification message"
}}

Or to specify some of the info, send:

{payload: {
  "state":"normal",
}}

signalk-send-nmea2000

Output that sends out NMEA 2000 messages. Input payload can be canboat json format or a raw Actisense formatted string

signalk-send-nmea0183

Output that sends out NMEA 0183 messages. Input payload can be an 0183 formatted string.

node-red-embedded's People

Contributors

hoeken avatar matsa avatar sbender9 avatar tkurki avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

richfind hoeken

node-red-embedded's Issues

Signalk-send-pathvalue

Hi
I think I've populated the node correctly (topic,path) but only get: "TypeError: Cannot read property 'handleMessage; of defined"

Would really appreciate some guidance. Have attached a simplified flow, near to what I'm trying achieve.

Failed flows.docx

Node-RED web interface stops responding during use.

It occurred many times on my install the NR web interface suddenly stops responding.
Do you have any tips how to debug this?

I don't see any error in Signal K process logs or in the "Server Log" in the SignalK web interface.
When it happens the SignalK web interface keeps working, when I restart SignalK I can use the NR web interface again.

Hardware: Raspberry Pi 4 8 GB
OS:

Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

Kernel:

Linux signalk 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

NodeJS: Tried v18.19.0 and v20.10.0
Signal K Server: version 2.4.1
Embedded Node-Red: v3.0.2

Node red crashes when adding nodes ( signalk-input-handler )

Running on Victron Cerbo-S ( Venus OS Large ) . When I enable the module, add a node and deploys, my server crashes and I see this in the logs :

@400000006567c60404957834
@400000006567c60404957c1c Welcome to Node-RED
@400000006567c604049583ec ===================
@400000006567c604049587d4
@400000006567c6040569e704 29 Nov 23:15:06 - [info] Node-RED version: v3.0.2
@400000006567c60405c93574 29 Nov 23:15:06 - [info] Node.js version: v18.16.0
@400000006567c60405ef013c 29 Nov 23:15:06 - [info] Linux 5.10.109-venus-12 arm LE
@400000006567c60c13fca93c 29 Nov 23:15:14 - [info] Loading palette nodes
@400000006567c614198bc5a4 29 Nov 23:15:22 - [info] Settings file : /usr/lib/node_modules/node-red/venus-settings.js
@400000006567c6141a1bc8d4 29 Nov 23:15:22 - [info] Context store : 'default' [module=memory]
@400000006567c6141bc28f4c 29 Nov 23:15:22 - [info] User directory : /data/home/nodered/.node-red
@400000006567c6141be4193c 29 Nov 23:15:22 - [warn] Projects disabled : editorTheme.projects.enabled=false
@400000006567c6141c9884bc 29 Nov 23:15:22 - [info] Flows file : /data/home/nodered/.node-red/flows.json
@400000006567c6151c534dfc 29 Nov 23:15:23 - [info] Server now running at http://127.0.0.1:1880/
@400000006567c615284a3774 29 Nov 23:15:23 - [warn]
@400000006567c615284a56b4
@400000006567c615284a5a9c ---------------------------------------------------------------------
@400000006567c615284a6a3c Your flow credentials file is encrypted using a system-generated key.
@400000006567c615284a75f4
@400000006567c615284a79dc If the system-generated key is lost for any reason, your credentials
@400000006567c615284a8594 file will not be recoverable, you will have to delete it and re-enter
@400000006567c615284a914c your credentials.
@400000006567c615284d0e04
@400000006567c615284d15d4 You should set your own key using the 'credentialSecret' option in
@400000006567c615284d218c your settings file. Node-RED will then re-encrypt your credentials
@400000006567c615284d2d44 file using your chosen key the next time you deploy a change.
@400000006567c615284d38fc ---------------------------------------------------------------------
@400000006567c615284d44b4
@400000006567c6152dd690d4 29 Nov 23:15:23 - [info] Starting flows
@400000006567c6161bda16bc 29 Nov 23:15:24 - [error] [signalk-input-handler:dc2f5c0d8733db7f] TypeError: Cannot read properties of undefined (reading 'registerDeltaInputHandler')
@400000006567c6161c98d6c4 29 Nov 23:15:24 - [info] Started flows
@400000006567c61626d1d3fc 29 Nov 23:15:24 - [info] [mqtt-broker:Stoffer MTQQ] Connected to broker: xxxxxxxxxxxxx
@400000006567c61b1cd13c44 29 Nov 23:15:29 - [red] Uncaught Exception:
@400000006567c61b1d006294 29 Nov 23:15:29 - [error] TypeError: Cannot read properties of undefined (reading 'subscribe')
@400000006567c61b1d0089a4 at Timeout._onTimeout (/data/home/nodered/.node-red/node_modules/@signalk/node-red-embedded/signalk-subscribe.js:124:16)
@400000006567c61b1d00a114 at listOnTimeout (node:internal/timers:569:17)
@400000006567c61b1d00accc at process.processTimers (node:internal/timers:512:7)
@400000006567c61b1faa2da4 *** starting node-red-venus ***

signalk-send-nmea2000

I am having trouble getting this to work. I put together a JSON string in a function block and wired it to signalk-send-nmea2000 in node red. The actisense nmea reader on the network picked up the pgn 127489 but there is no data. Node red says it is sending and the reader is constantly updating but the data is all FF in hex.

in the function block:
const pgn = { "pgn": 127489,
"engineInstance": 0,
"oilPressure": 0,
"oilTemperature": oilTemperature,
"temperature": temperature,
"alternatorPotential": 12,
"fuelRate": 0,
"totalEngineHours": 1234,
"coolantPressure": 0,
"fuelPressure": 0,
"reserved": 0,
"discreteStatus1": 0,
"discreteStatus2": 0,
"percentEngineLoad": 0,
"percentEngineTorque": 0
}
msg.payload = pgn;
return msg;

In the debug block:
1/6/2019, 5:07:43 PMnode: 9cc66d62.0e579
msg.payload : Object
object
pgn: 127489
engineInstance: 0
oilPressure: 0
oilTemperature: "70.81"
temperature: "71.60"
alternatorPotential: 12
fuelRate: 0
totalEngineHours: 1234
coolantPressure: 0
fuelPressure: 0
reserved: 0
discreteStatus1: 0
discreteStatus2: 0
percentEngineLoad: 0
percentEngineTorque: 0

What am I doing wrong?

signalK-geofence-switch

Is it possible to dynamically change the lat/lon of the geofence center through an input msg?

no topic for incomming message

Hi all,
first of all: amazing project!! Thanks for all the work done.
I am new here and i deal with signalk and the node-red plugin since some weeks. I think i didn't understand how to create a topic witch is sent to signalk. I build a trigger and send temperature update via signalk-send-pathvalue. I made a screenshot also. I hope someone can help to fix the problem. Thanks a lot!!

Converting SignalK battery data to NMEA200

HI, I'm having trouble converting SK to N2K in Node-red. I have a "subscriber node" connected to a "function node" which takes the single voltage as a string and creates json:
const pgn = {
"pgn": 127508,
"Battery Instance": 0,
"Instance":0,
"Voltage": Number(msg.payload ),
"Current": 0,
"Temperature":0
}
msg.payload = pgn;
return msg;

Here is the debug Output:
{pgn: 127508, Battery Instance: 0, Instance: 0, Voltage: 26.3, Current: 0, Temperature: 0}

from this function its going to a "signalk-send-nmea2000" node

If I check in "SignalK Server Log" under "signalk-server:events:nmeaJsonOut" I see the data:
"Oct 18 12:04:46 2023-10-18T19:04:46.052Z signalk-server:events:nmea2000JsonOut [ { pgn: 127508, 'Battery Instance': 0, Instance: 0, Voltage: 26.55, Current: 0, Temperature: 0 } ]"

But I don't see any reference of it under "signalk-to-nema2000" or under the WebApps @Mxtommy/Kip

Any help?
Thanks

Remove dashboard authentication

HEllo,
I'm using SignalK/Nodered embedded with openplotter.
I have built some dashboards to use on board and everything works fine except :

I dont want authentication on my dashboards. I found the nodered settings file on /home/pi/.signalk/node_modules/node-red/settings.js but authentication is disabled.

ANy idea where I can remove the authentication for the dashboards ?

Many thanks,
Bart

Missing GPIO

Hi
I installed node-red through the App store, but for some reaon i don't have a node to check for GPIO changes. Did i miss something or is this no longer available. It runs on a RPI4

'Disable of "put" doesn't work

While debugging a flow I noticed that the "Get" node keeps on functioning when disabled (in lower-left in config of node)
Capture

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.