rpi-io 2.0.6 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -16
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
**rpi-io** is a lite [ESM](https://nodejs.org/api/esm.html#modules-ecmascript-modules) module for **Node.js** to control **Raspberry Pi** GPIO: access (in, out), input event detection and [PWM](https://en.wikipedia.org/wiki/Pulse-width_modulation) peripheral control.
|
|
6
6
|
|
|
7
|
+
**rpi-io** is built on a high performance hybrid architecture based on Node.js + C addon.
|
|
8
|
+
|
|
7
9
|
**rpi-io** is designed for recent versions of Raspberry and related OS and middlewares. It has been tested in the following environments:
|
|
8
10
|
|
|
9
11
|
- Raspberry Pi models: *RPi 5,* *RPi 4B* and *RPi Zero 2.*
|
|
@@ -12,24 +14,12 @@
|
|
|
12
14
|
- Input/Output - [libgpiod](https://libgpiod.readthedocs.io/en/stable/) v1.6.3 (*Bookworm*) and v2.2.1 (*Trixie*)
|
|
13
15
|
- PWM - [sysfs](https://en.wikipedia.org/wiki/Sysfs) interface.
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## What's new with version 2
|
|
18
|
-
|
|
19
|
-
| | version 1 | version 2 |
|
|
20
|
-
| ------------ | ------------ | ------------------------ |
|
|
21
|
-
| Architecture | Full Node.js | Hybrid Node.js + C addon |
|
|
22
|
-
| Performance | Low | High |
|
|
23
|
-
|
|
24
|
-
⚠️ Given the new architecture, the v2 API is not compatible with the v1 one.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
|
|
28
18
|
## Prerequisites
|
|
29
19
|
|
|
30
20
|
### libgpiod
|
|
31
21
|
|
|
32
|
-
By default *libgpiod* is available with the latest Raspberry Pi OS distributions. If you want to install **rpi-io** with older - not tested - distributions, be sure it is installed.
|
|
22
|
+
By default, *libgpiod* is available with the latest Raspberry Pi OS distributions. If you want to install **rpi-io** with older - not tested - distributions, be sure it is installed.
|
|
33
23
|
|
|
34
24
|
```bash
|
|
35
25
|
sudo apt-get update
|
|
@@ -82,9 +72,13 @@ npm install
|
|
|
82
72
|
|
|
83
73
|
If you meet errors during this step, stay in the same directory and check your environment.
|
|
84
74
|
|
|
75
|
+
|
|
85
76
|
```bash
|
|
86
77
|
npm run check
|
|
87
78
|
```
|
|
79
|
+
If the error is an alert about high-level vulnerabilities related to the *tar* module,
|
|
80
|
+
- be sure that you are installing **rpi-io** version 2.0.8 or more,
|
|
81
|
+
- follow the NPM recommendation to run `npm audit fix --force` to install the appropriate version of *node-gyp*.
|
|
88
82
|
|
|
89
83
|
If you need to recompile the module when errors are fixed, stay in the same directory and the run the following scripts.
|
|
90
84
|
|
|
@@ -250,7 +244,7 @@ const btn = new RIO(18, "input", {bias: "pull-up"})
|
|
|
250
244
|
|
|
251
245
|
#### Servo motor
|
|
252
246
|
|
|
253
|
-
REMINDER: PWM peripherals used in hardware mode need some specific [configuration](
|
|
247
|
+
REMINDER: PWM peripherals used in hardware mode need some specific [configuration](## Configuration for PWM-based peripherals).
|
|
254
248
|
|
|
255
249
|
##### Diagram for servo-motor *SG90*
|
|
256
250
|
```
|
|
@@ -488,7 +482,7 @@ myButton.monitoringStart(callback, "both", 30)
|
|
|
488
482
|
|
|
489
483
|
- **callback** *{Function}* Function triggered by input events where parameter is *edge* that can be either "rising" (input change from 0 to 1) or "falling" (input change from 1 to 0).
|
|
490
484
|
- **edge** *{String}* Filter of monitored events: "rising", "falling", "both" (default value).
|
|
491
|
-
- **bounce** *{Number}* Set
|
|
485
|
+
- **bounce** *{Number}* Set threshold in ms to filter consecutive events of same type. Default value is 0.
|
|
492
486
|
|
|
493
487
|
|
|
494
488
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rpi-io",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "Nodejs module to control Raspberry Pi GPIO",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"raspberry",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"node-addon-api": "^7.0.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"node-gyp": "^
|
|
72
|
+
"node-gyp": "^12.2.0"
|
|
73
73
|
},
|
|
74
74
|
"gypfile": true,
|
|
75
75
|
"binary": {
|