Module specifically for Raspberry Pi. Always read/write to/from i2c bus via UCI packets and socket. Extends uci-base
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
David Kebler 0c7bfd11f5 0.3.1 refactor ack processing, fix ackInterval option issue 3 years ago
examples 0.3.1 refactor ack processing, fix ackInterval option issue 3 years ago
src 0.3.1 refactor ack processing, fix ackInterval option issue 3 years ago
.eslintrc.js FIRST commit of socket/packet based i2cbus with separate class bus-packet 5 years ago
.gitignore 0.1.22 refactor bus functions so they are generated from a common function. 3 years ago
.npmignore 0.1.22 refactor bus functions so they are generated from a common function. 3 years ago
nodemon.json 0.3.1 refactor ack processing, fix ackInterval option issue 3 years ago
package.json 0.3.1 refactor ack processing, fix ackInterval option issue 3 years ago
readme.md removed old non-packet reversion and rename packet version to bus.js 5 years ago

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)
})