Sign inSign up

beetaone/i2c-input

By beetaone

•Updated about 2 years ago

Image
0

170

beetaone/i2c-input repository overview

⁠I2C input

namei2c input
versionv2.0.1
docker imagebeetaone/i2c-input⁠
tagsPython, Flask, Docker, beetaone
authorsGhassen barbouchi

⁠Table of Content


⁠Description

This module mounts a I2C slave device and reads its data periodically.

⁠Features
  1. Open the connected i2c interface.
  2. Read an i2c slave data using the slave address for each period.
  3. Forward the data to the next module.

⁠Environment Variables

⁠Module Specific

The following module configurations can be provided in a data service designer section on beetaone platform:

NameEnvironment VariablesTypeDescription
I2C device pathI2C_INTERFACE_PATHstringLocal path to I2C device
I2C interface numberI2C_INTERFACE_NUMBERintegerThe number of the I2C interface. Example : the number of this interface "/dev/i2c-1" is 1
Data TypeDATA_TYPEstringThe data type of incoming data: 'byte' or 'word'
Slave AddressSLAVE_ADDRintegerExample : 10 (in hex '0xa')
OffsetOFFSETintegerThe address (offset) inside the EEPROM
Polling PeriodPERIODintegerThe period between every two successives data receptions

Other features required for establishing the inter-container communication between modules in a data service are set by beetaone agent.

⁠Set by the beetaone Agent on the edge-node
Environment VariablestypeDescription
MODULE_NAMEstringName of the module
MODULE_TYPEstringType of the module (Input, Processing, Output)
EGRESS_URLSstringHTTP ReST endpoint for the next module

⁠Dependencies

requests==2.27.1
smbus2

⁠Output

Output of this module is:

  • JSON body single object, example:

byte example :

{"i2cData": 119}

word example :

{"i2cData": 65481}

Tag summary

Content type

Image

Digest

sha256:3d346c71f…

Size

48.8 MB

Last updated

about 2 years ago

docker pull beetaone/i2c-input:v2.0.1