1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00
node-red-nodes/hardware/intel
Ivan Mikhaylov 983dafff13
mraa gpio din features (#929)
* mraa-gpio-din: add iot2050 board

This patch adds iot2050 board in possible list of boards.

Signed-off-by: zengchao <chao.zeng@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Ivan Mikhaylov <ivan.mikhaylov@siemens.com>

* mraa-gpio-din: add cleanup on close

Required as nodejs will only lazily delete the node objects, and we may
race with the next user requesting the resources. ISR thread release.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Ivan Mikhaylov <ivan.mikhaylov@siemens.com>

* mraa-gpio-din: extend GPIO lines

Signed-off-by: zengchao <chao.zeng@siemens.com>
Signed-off-by: Ivan Mikhaylov <ivan.mikhaylov@siemens.com>

* mraa-gpio-din: add configurable GPIO mode for DIN

GPIO mode wasn't set correctly, it was set from Pinmuxes modes instead
of GPIO. Add way to control GPIO modes on DINs from Node-RED with
possible values from mraa : Strong, Hiz, Pull-down, Pull-up.

Signed-off-by: Ivan Mikhaylov <ivan.mikhaylov@siemens.com>

* mraa-gpio-din: add support for initial message from digital input

This allows to send out an initial message with the current digital pin
state on startup, simplifying initializations of certain flows.

Based on siemens/meta-iot2000@5fc2bbe patch 0003.

Signed-off-by: Ivan Mikhaylov <ivan.mikhaylov@siemens.com>
2022-07-12 10:10:49 +01:00
..
LICENSE Update licenses and packages for all nodes 2016-11-06 20:26:19 +00:00
mraa-gpio-ain.html Update licenses and packages for all nodes 2016-11-06 20:26:19 +00:00
mraa-gpio-ain.js Update licenses and packages for all nodes 2016-11-06 20:26:19 +00:00
mraa-gpio-din.html mraa gpio din features (#929) 2022-07-12 10:10:49 +01:00
mraa-gpio-din.js mraa gpio din features (#929) 2022-07-12 10:10:49 +01:00
mraa-gpio-dout.html Update licenses and packages for all nodes 2016-11-06 20:26:19 +00:00
mraa-gpio-dout.js Re-lint a load of nodes 2017-01-29 17:45:44 +00:00
mraa-gpio-pwm.html Update licenses and packages for all nodes 2016-11-06 20:26:19 +00:00
mraa-gpio-pwm.js Update licenses and packages for all nodes 2016-11-06 20:26:19 +00:00
package.json Update package.jsons for mono-repo (#851) 2021-11-02 15:22:30 +00:00
README.md fix typo in intel readme 2018-05-07 09:40:42 +01:00

node-red-node-intel-gpio

A Node-RED node to talk to an Intel Galileo or Edison running mraa.

Install

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

    npm i node-red-node-intel-gpio

Usage

The Galileo or Edison must already be running Linux, and have Node-RED installed.

See the Intel Downloads for hardware / downloads for your particular board.

Ensure the latest version of mraa libraries are installed: (version 1.5 as of Sept 2015)

    echo "src mraa-upm http://iotdk.intel.com/repos/1.5/intelgalactic" > /etc/opkg/mraa-upm.conf
    opkg update
    opkg upgrade

NOTE : This node assumes that the mraa npm is already installed globally - as it is on the Galileo and Edison boards.

If you do need to install Node-RED, you can do this as follows from the home directory of the root user

    npm install -g --unsafe-perm node-red
    mkdir .node-red
    cd .node-red
    npm install node-red-node-intel-gpio

Analogue Input Node

Monitors the selected pin for changes. It outputs on a change of value. As analogue inputs are continuously changing you can set the sample rate in ms from 20 to 65535.

Digital Input Node

Monitors the selected pin for changes. It only outputs on a change of value.

Digital Output Node

Sets the selected digital pin output high or low depending on the value of msg.payload - expects a number or string 0 or 1.

Pulse Width Modulation (PWM) Node

The msg.payload should contain a floating point number value between 0 (off) and 1 (fully on), or a string representation thereof.

You can set the overall period (mS) in the edit dialogue.

For servo control set the period to 20mS and vary the input between 0.05 and 0.10,

    0.05 = 5% of 20mS = 1mS
    0.75 = 7.5% of 20mS = 1.5mS - typical servo centre point
    0.10 = 10% of 20mS = 2mS

Example

Simple flow to blink Pin 13

...tbd