Joe-ab1do/mcp-pcf-aio install problem

Hi @Joe-AB1DO, thank you for mcp-pcf-aio 3.3.2.

I have a new install of Rpi Bookworm-64 bit on Rpi4B using the latest bash install script.

I added the node via the pallet manager and on NR start it all looks OK:

26 May 11:37:57 - [info] Node-RED version: v4.0.9
26 May 11:37:57 - [info] Node.js version: v20.19.2
26 May 11:37:57 - [info] Linux 6.12.25+rpt-rpi-v8 arm64 LE
...26 May 11:37:59 - [info] Starting flows
MCP23017 chip initialization OK. BusNumber=1 Address=0X20 id:2f4058f458e944de startAllHigh = false
26 May 11:37:59 - [info] Started flows

However when I create a flow using an input or output I get

Opening i2c Bus failed. Bus=1 Pin=0
  Error:Error: EIO, Input/output error

when I deploy.

Enabling logging, deploy then restart node-red gives:

26 May 12:04:35 - [info] Starting flows
  MCP23017 chip initialization OK. BusNumber=1 Address=0X20  id:2f4058f458e944de  startAllHigh = false
---
>>> Initializing  MCP23017 Output node >>  invert=false pinNum=0  ID=5cd8e5e722537fe1
    MCP23017 init-Pin started... i2cAddr = 0X20  pinNum=0  isInput=false  pullUp=false  startAllHigh=false  LastState=-2
26 May 12:04:35 - [error] [mcp pcf out:5cd8e5e722537fe1] Opening i2c Bus failed. Bus=1 Pin=0
  Error:Error: EIO, Input/output error
    ...status update >>  _onOffStatus: false   globalState= 2  Node_id=5cd8e5e722537fe1
    ...status update >>  _onOffStatus: -2   globalState= 2  Node_id=5cd8e5e722537fe1
26 May 12:04:35 - [info] Started flows

Any ideas ?

Best regards, oz

Hi @Joe-AB1DO , just an addressing problem I think.

I am using the CQRobot MCP23017 IO Expansion Board for the first time and although NR reports:

  MCP23017 chip initialization OK. BusNumber=1 Address=0X20  id:2f4058f458e944de  startAllHigh = false

address 0x20 this hardware defaults to 0x27 (all other boards I have used have been 0x20), anyway if the config node is set to the correct address of 0x27 then all is OK.

SOLVED by setting the correct address for the hardware and ignoring that reported during NR startup.

Best regards Oz

Hi @ozpos ,
not quite sure I understand exactly what is going on. I have not taken a look at the CQRobot MCP23017 IO Expansion Board. From what you have told me it seems like this board defaults to all address ports on the board being high? Setting the node's chip address port accordingly should solve your problem, as you stated.
:slightly_smiling_face:

Hi @Joe-AB1DO , thank you for your response.

i2cdetect -y 1 does in fact confirm 0x27:

i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- 27 -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

P.S. I am in the process of tracking down a noise source that causes corruption/reset of MCP23017 configuration settings (nothing to do with your driver at all).

I was using the kernel overlay driver but a chip init/reset meant an entire system reset, with your driver I can restart node-red to re-initialise 20317 registers.

With this in mind, have you ever considered adding a 'msg.reset' parameter that would re-initialise the chip ?

I think the noise source I have is caused by cheap opto-relays that do not isolate GND and VCC of mcu with that of your relays or 12v systems!

Thank you again for this node I will use it in place of the Bookworm kernel overlay driver for sure.

Best regards, Oz

Hi @ozpos ,

good to see the board is working as expected.

With this in mind, have you ever considered adding a 'msg.reset' parameter that would re-initialise the chip ?

No I have not, never had a need for it and there could be a possible risk of unintended consequences with multiple chips. Just haven't thought it through. Maybe when I have more time on my hands...

I am in the process of tracking down a noise source that causes corruption/reset of MCP23017 configuration settings (nothing to do with your driver at all).

Good luck with that. I know first hand how difficult tracking down noise sources can be!

Thanks for the compliment and all the best,
Joe