Module specifically for Raspberry Pi. Always read/write to/from i2c bus via UCI packets and socket. Extends uci-base
 
Go to file
David Kebler 96472b71f8 0.1.22 refactor bus functions so they are generated from a common function.
use the uci/base processing and namespaces
add a queue for bus function calls
rework all the examples
fix a default ID
2019-09-17 08:50:07 -07:00
examples 0.1.22 refactor bus functions so they are generated from a common function. 2019-09-13 19:23:12 -07:00
src 0.1.22 refactor bus functions so they are generated from a common function. 2019-09-17 08:50:07 -07:00
.eslintrc.js FIRST commit of socket/packet based i2cbus with separate class bus-packet 2018-01-31 18:42:11 -08:00
.gitignore 0.1.22 refactor bus functions so they are generated from a common function. 2019-09-11 18:35:13 -07:00
.npmignore 0.1.22 refactor bus functions so they are generated from a common function. 2019-09-11 18:35:13 -07:00
.travis.yml add device class back to this package - remove promise q from bus module. 2017-05-26 08:16:30 -07:00
nodemon.json 0.1.22 refactor bus functions so they are generated from a common function. 2019-09-11 18:35:13 -07:00
package.json 0.1.22 refactor bus functions so they are generated from a common function. 2019-09-17 08:50:07 -07:00
readme.md removed old non-packet reversion and rename packet version to bus.js 2018-05-27 11:46:49 -07:00

readme.md

uCOMmandIt (UCI) - I2C Bus Class

Raspberry Pi ONLY!

Build Status Inline docs Dependencies devDependencies codecov

This is an Raspberry Pi only I2C bus socket packet listener and I2C bus master processor. See /examples/bus.js for how to implement an instance. The rest of the examples are client examples that will talk to a running i2c-bus instance

Here is a simple script to get an instance going (on an RPI only)

/*
*  Raspberry Pi (only) I2C-Bus listener
* named pipe socket 'i2c-bus' is always created by default /tmp directory unless
* env variable SOCKETS_DIR='' is used to create a 'i2c-bus.sock' in a particular directory
* e.g. command >SOCKETS_DIR=/opt/sockets node -r esm i2cbus
* add TCP listener with tcp:true.  Will listen on port 1776 by default
*/

import Bus from  '@uci/i2c-bus'
;
(async () => {

  let i2cbus  = new Bus({id:'i2c-bus',tcp:true})

  await i2cbus.init()

})().catch(err => {
  console.error('FATAL: UNABLE TO START SYSTEM!\n',err)
})