@edgeflowjs/device-rpi
v0.2.2
Published
Raspberry Pi device adapter for EdgeFlow. Implements GPIO, Serial, Network, System, and Identity ports for real hardware.
Readme
@edgeflowjs/device-rpi
Raspberry Pi device adapter for EdgeFlow. Implements GPIO, Serial, Network, System, and Identity ports for real hardware.
Install
pnpm add @edgeflowjs/device-rpiOn Raspberry Pi, install optional peer dependencies for GPIO and Serial:
pnpm add onoff serialportUsage
import { createRpiDevice, detectPi } from "@edgeflowjs/device-rpi";
if (detectPi()) {
const device = await createRpiDevice();
// Use device.gpio, device.serial, etc.
}Ports
- GPIO — via
onoff(optional) - Serial — via
serialport(optional) - Network — Node.js
os.networkInterfaces() - System —
reboot,shutdownviachild_process - Identity —
/etc/machine-id,/proc/device-tree/model
Permissions
On Raspberry Pi, add your user to the gpio group for GPIO access:
sudo usermod -aG gpio $USER