Smart Home Automation Forum
how to add MCP23017 by i2c on Raspberry pi CM4 to extend GPIOs - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=1)
+--- Forum: KinCony Server-Mini / Server-16 Raspberry Pi4 relay module (https://www.kincony.com/forum/forumdisplay.php?fid=53)
+--- Thread: how to add MCP23017 by i2c on Raspberry pi CM4 to extend GPIOs (/showthread.php?tid=3562)



how to add MCP23017 by i2c on Raspberry pi CM4 to extend GPIOs - admin - 11-26-2023

1. connect MCP23017 i2c module with KinCony Server-Mini's i2c extend terminal. so that you can extend 16 GPIOs for switch or binary sensor in home assistant.
   
   

2. enable i2c for home assistant.

Add files to enable I2C
In the root of the hassos-boot partition, add a new folder called CONFIG.
In the CONFIG folder, add another new folder called modules.
Inside the modules folder add a text file called rpi-i2c.conf with the following content:
i2c-dev

In the root of the hassos-boot partition, edit the file called config.txt add two lines to it:
dtparam=i2c_vc=on
dtparam=i2c_arm=on

3. MCP23008/MCP23017 implementation for Home Assistant (HA)
https://github.com/jpcornil-git/HA-mcp23017