PizzaProgram / MCP23017-PCF8574-AIO

This is a Node-Red node to communicate with MCP23017 or PCF8574(A) chips on a I2C bus. Both Input + Output.
https://www.npmjs.com/package/@pizzaprogram/mcp-pcf-aio
MIT License
2 stars 1 forks source link
chip-16 chip-8 i2c i2c-bus i2c-device input-output-logic mcp23017 node-red-contrib pcf8574 relay-board

!!! A NEW, more advanced repo, (based on this one) is: here:

This is a Node-Red node for the MCP23017 & PCF8574 chips

Code Language:

About

It uses the config node "mcp_pcf_chip" for all reading and writing on i2c bus
More about I2C...

Requires 'i2c-bus' module. link...
( It gets automatically installed, except if you want to use it directly from function nodes. )

Inputs

WARNING: input interrupts part of this component is experimental.

Config

Known problems:

  1. After disconnected of cable or USB-I2C adapter the readouts can not properly restore unless restarting the whole flow.
  2. Multiple Main-chip-setup-nodes can be set to same Address, causing conflicts. (No pre-error or pre-warning happens.)
  3. -- fixed 2022-03-26
  4. It changes the On-Off state visually of the Node while it's not that node changed when using direct-msg-control
  5. Sending "All0" or "All1" to an MCP node turns on only 0-7 pins, if Bit of Nodes are only set to 0-7. Solution: Set Bit of the node at setup to 8-15 to turn ALL!

To Do

  1. Don't even allow already selected bits to be selected again (not just error reporting about)
  2. When a node is deleted or disabled - remove from ids (array in chip) --- half done at 2022-03-19 version
  3. Block RW operations happening at the same time... (rework everything to Async / await and atomic flags)
  4. Analize further how interrupts are dealt with in C code and write it in s/mcp23017)
  5. Don't allow to create multiple main chips with the same address (MCP + PCF can be on the same address accidentally)

Credit

Thanks to Mike Wilson for the original v0.1 node: MCP23017chip

Change Log 2022-09-09 (Y-M-D) Version: 2.4.0.20220909

by László Szakmári (www.pizzaprogram.hu)

Change Log 2022-09-08 (Y-M-D) Version: 2.3.9.20220908

by László Szakmári (www.pizzaprogram.hu)

Change Log 2022-09-07 (Y-M-D) Version: 2.3.8.20220907

by László Szakmári (www.pizzaprogram.hu)

Change Log 2022-06-07 (Y-M-D) Version: 2.3.7.20220607

by László Szakmári (www.pizzaprogram.hu)

Change Log 2022-06-06 (Y-M-D) Version: 2.3.6.20220606

by László Szakmári (www.pizzaprogram.hu)

Change Log 2022-03-26 (Y-M-D) Version: 2.3.5.20220326

by László Szakmári (www.pizzaprogram.hu)

Change Log 2022-03-25 (Y-M-D) Version: 2.3.3.20220325

by László Szakmári (www.pizzaprogram.hu)

Change Log 2022-03-22 (Y-M-D) Version: 2.3.2.20220322

by László Szakmári (www.pizzaprogram.hu)

Change Log 2022-03-21 (Y-M-D) Version: 2.3.1.20220321

by László Szakmári (www.pizzaprogram.hu)

Change Log 2022-03-19 (Y-M-D) Version: 2.3.0.20220319

by László Szakmári (www.pizzaprogram.hu)

Change Log 2022-03-03 (Y-M-D) Version: 2.3.0.20220303

by László Szakmári (www.pizzaprogram.hu)

Change Log 2021-01-11 (Y-M-D)

by László Szakmári (www.pizzaprogram.hu)

Change Log 2021-09-12 (Y-M-D)

Change Log 2021-11-11 (Y-M-D)