{"id":14978056,"url":"https://github.com/fivdi/linux-io","last_synced_at":"2025-09-21T23:31:31.255Z","repository":{"id":66204731,"uuid":"80958951","full_name":"fivdi/linux-io","owner":"fivdi","description":"Extensible Linux IO Plugin for Johnny-Five","archived":false,"fork":false,"pushed_at":"2021-09-26T07:54:22.000Z","size":77,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-18T20:38:07.759Z","etag":null,"topics":["beaglebone","beaglebone-black","io-plugin","iot","javascript","johnny-five","linux","nodejs","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fivdi.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-05T00:44:59.000Z","updated_at":"2023-06-24T01:10:53.000Z","dependencies_parsed_at":"2023-02-20T21:46:06.407Z","dependency_job_id":null,"html_url":"https://github.com/fivdi/linux-io","commit_stats":{"total_commits":127,"total_committers":1,"mean_commits":127.0,"dds":0.0,"last_synced_commit":"f2fb90c963cb8b1dde9b50eaa4187e7251352ec9"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivdi%2Flinux-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivdi%2Flinux-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivdi%2Flinux-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivdi%2Flinux-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fivdi","download_url":"https://codeload.github.com/fivdi/linux-io/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233806501,"owners_count":18733205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beaglebone","beaglebone-black","io-plugin","iot","javascript","johnny-five","linux","nodejs","raspberry-pi"],"created_at":"2024-09-24T13:56:47.788Z","updated_at":"2025-09-21T23:31:25.822Z","avatar_url":"https://github.com/fivdi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://app.travis-ci.com/fivdi/linux-io.svg?branch=master)](https://app.travis-ci.com/github/fivdi/linux-io)\n\n# Linux-IO\n\nLinux-IO is an extensible Linux\n[IO Plugin](https://github.com/rwaldron/io-plugins) for\n[Johnny-Five](https://github.com/rwaldron/johnny-five). It extends\n[board-io](https://github.com/achingbrain/board-io) to provide Linux\nimplementations for the following features that IO Plugins can support:\n\n * Digital IO\n   * Implementation based on the [GPIO sysfs interface](https://www.kernel.org/doc/Documentation/gpio/sysfs.txt) using [onoff](https://github.com/fivdi/onoff)\n * I2C\n   * Implementation based on the [/dev interface](https://www.kernel.org/doc/Documentation/i2c/dev-interface) using [i2c-bus](https://github.com/fivdi/i2c-bus)\n * Built-in LEDs\n   * Implementation based on the [LED sysfs interface](https://www.kernel.org/doc/Documentation/leds/leds-class.txt) using [led.js](https://github.com/fivdi/linux-io/blob/master/lib/led.js)\n\nThe initial motivation for implementing Linux-IO was to provide Linux\nimplementations of the I2C methods that Johnny-Five IO Plugins are required to\nimplement. Over the course of the last two years I was involved in adding I2C\nfunctionality to a number of IO Plugins. In reality, more or less the same\ncode was added to each IO Plugin. The goal of Linux-IO is to make such code\nreusable across Linux IO Plugins.\n\nLinux-IO supports Node.js versions 10, 12, 14, 15 and 16.\n\n## Installation\n\n```\nnpm install linux-io\n```\n\n## Johnny-Five Features Supported\n\nThe Johnny-Five features supported by a platform are summarized in tables on\nthe [Platform Support](http://johnny-five.io/platform-support/) page. The\nfeatures supported by Linux-IO shown in the following table:\n\nFeature | Support\n:--- | :---\nAnalog Read | no\nDigital Read | yes\nDigital Write | yes\nPWM | no\nServo | no\nI2C | yes\nOne Wire | no\nStepper | no\nSerial/UART | no\nDAC | no\nPing | no\n\n## Usage\n\nHere's a minimalistic IO Plugin for the Raspberry Pi called\n[TinyRaspberryPiIO](https://github.com/fivdi/linux-io/blob/master/example/raspberry-pi/tiny-raspberry-pi-io.js)\nthat allows digital IO on GPIO4 and GPIO17 and I2C serial bus access on I2C\nbus 1. The built-in LED can also be used.\n\n```js\nvar LinuxIO = require('linux-io'),\n  util = require('util');\n\nfunction TinyRaspberryPiIO() {\n  if (!(this instanceof TinyRaspberryPiIO)) {\n    return new TinyRaspberryPiIO();\n  }\n\n  LinuxIO.call(this, {\n    pins: [{\n      ids: ['P1-7', 'GPIO4'],\n      gpioNo: 4,\n      modes: [0, 1]\n    }, {\n      ids: ['P1-11', 'GPIO17'],\n      gpioNo: 17,\n      modes: [0, 1]\n    }, {\n      ids: ['LED0'],\n      ledPath: '/sys/class/leds/led0',\n      modes: [1]\n    }],\n    defaultI2cBus: 1,\n    defaultLed: 'LED0'\n  });\n\n  setImmediate(function () {\n    this.emit('connect');\n    this.emit('ready');\n  }.bind(this));\n}\nutil.inherits(TinyRaspberryPiIO, LinuxIO);\n\nmodule.exports = TinyRaspberryPiIO;\n```\n\nIf a button is connected to GPIO4 and an LED is connected to GPIO17, the\nfollowing\n[program](https://github.com/fivdi/linux-io/blob/master/example/raspberry-pi/led-button.js)\nwill turn the LED on when the button is pressed and turn\nthe LED off when the button is released.\n\n```js\nvar five = require('johnny-five');\nvar TinyRaspberryPiIO = require('./tiny-raspberry-pi-io');\n\nvar board = new five.Board({\n  io: new TinyRaspberryPiIO()\n});\n\nboard.on('ready', function() {\n  var led = new five.Led('GPIO17');\n  var button = new five.Button('GPIO4');\n\n  button.on('down', function() {\n    led.on();\n  });\n\n  button.on('up', function() {\n    led.off();\n  });\n});\n```\n\nIf an ADXL345 accelerometer is connected to I2C bus 1, the following\n[program](https://github.com/fivdi/linux-io/blob/master/example/raspberry-pi/i2c-accelerometer.js)\nwill print information provided by accelerometer.\n\n```js\nvar five = require('johnny-five');\nvar TinyRaspberryPiIO = require('./tiny-raspberry-pi-io');\n\nvar board = new five.Board({\n  io: new TinyRaspberryPiIO()\n});\n\nboard.on('ready', function() {\n  var accelerometer = new five.Accelerometer({\n    controller: \"ADXL345\"\n  });\n\n  accelerometer.on(\"change\", function() {\n    console.log(\"accelerometer\");\n    console.log(\"  x            : \", this.x);\n    console.log(\"  y            : \", this.y);\n    console.log(\"  z            : \", this.z);\n    console.log(\"  pitch        : \", this.pitch);\n    console.log(\"  roll         : \", this.roll);\n    console.log(\"  acceleration : \", this.acceleration);\n    console.log(\"  inclination  : \", this.inclination);\n    console.log(\"  orientation  : \", this.orientation);\n    console.log(\"--------------------------------------\");\n  });\n});\n```\n\n## Examples\n\nAdditional examples for the Raspberry Pi, BeagleBone Black and C.H.I.P can be\nfound in the\n[example directory](https://github.com/fivdi/linux-io/tree/master/example).\n\n## IO Plugins Based On Linux-IO\n\n- BeagleBone Black\n  - [BeagleBone-IO](https://github.com/julianduque/beaglebone-io)\n- Raspberry Pi\n  - [Pi-IO](https://github.com/fivdi/pi-io)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivdi%2Flinux-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffivdi%2Flinux-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivdi%2Flinux-io/lists"}