Fighting with access to MCP23017 I/O Ports

Moderator: leecollings

Post Reply
smq
Posts: 10
Joined: Monday 11 August 2014 23:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Fighting with access to MCP23017 I/O Ports

Post by smq »

Hi,

I'm trying to setup input/outputs port using mcp23017 expander connected to i2c port in my Raspberry Pi (http://www.raspberrypi-spy.co.uk/2013/0 ... pi-part-1/).
Firstly I'd like to explain what I have done now. I've been installed WiringPi and i'm able to export GPIO pins on RPI and of course I can configure switches which are directly on RPI board.
But... there is also an option to expand gpio ports using mcp23017 expander (http://wiringpi.com/the-gpio-utility/i2 ... xtensions/), and also I'm able to control inputs/outputs pins using command line. And the main goal here is to configure switches/lights buttons inside the domoticz to control mcp23017 in/out pins. It allows to expand inputs/outputs up to 128 inputs/outputs (It's possible to connect up to 8 devices to i2c bus and each device can support 16 lines).
Have anybody done domoticz configuration to manage mcp23017 in/outs?

I would be grateful for any help!!
Thank you in advance.
smq
Posts: 10
Joined: Monday 11 August 2014 23:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Fighting with access to MCP23017 I/O Ports

Post by smq »

Is it even possible? Maybe I'd like to go throw the way which is currently impossible to be covered by domoticz software?

The goal I want to achieve to have at least 32 (preferable 48 digital outputs), and at least 16 inputs. Every circuits are done by wires inside the walls.

Any sugestions? ;)
smq
Posts: 10
Joined: Monday 11 August 2014 23:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Fighting with access to MCP23017 I/O Ports

Post by smq »

Ok, It seems I solved this problem using Dummy Virtual Devices and updating them by JSON and lua scripts and execute commands using script:/ function.
In a while I could present the way and solution if anybody is interested.

For sure the huge goal of this solution is possibility to connect up to 8 mcp23017 devices (each equipped 16 i/o ports) so in fact we can manage up to 128 i/o devices using just 2 communication wires (i2c bus) and it is low cost and stable solution.

Thank you.
nickos
Posts: 5
Joined: Sunday 06 April 2014 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Fighting with access to MCP23017 I/O Ports

Post by nickos »

hi
if you have a tutorial to explain how you did it :P
thank you
Rpi + RFXcom USB + Domoticz
smq
Posts: 10
Joined: Monday 11 August 2014 23:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Fighting with access to MCP23017 I/O Ports

Post by smq »

Hi,

I'm do not, but when I find a while I will describe the way.
macieiks
Posts: 36
Joined: Tuesday 07 July 2015 12:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Fighting with access to MCP23017 I/O Ports

Post by macieiks »

Any update ? :D I have 2x MCPs ready to be installed.

Cheers
RPI2 + RFLink + PiFace D2 + Aeon Z-Wave Gen5 + Foscams FI9821P&R2 + MySensors + UPS APC Back-UPS 950VA
RPI2 + RFXtrx433e + Foscams FI9821P + MySensors + UPS APC Back-UPS 950VA
RPIB+ + TP-Link MR3420 + Huawei E173 GarageDomoticz :)
RonEN
Posts: 11
Joined: Tuesday 07 June 2016 10:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Location: Netherlands
Contact:

Re: Fighting with access to MCP23017 I/O Ports

Post by RonEN »

Hi SMQ,

Although it is some time ago since you wrote your message, i am very interesseted in your solution to control the MCP23017.
I hope you can help me with your "tutorial" :)

Regards,

Ronald.
oipmok
Posts: 3
Joined: Sunday 03 July 2016 12:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Fighting with access to MCP23017 I/O Ports

Post by oipmok »

new ideas ?
I fight with this a few days :((
oipmok
Posts: 3
Joined: Sunday 03 July 2016 12:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Fighting with access to MCP23017 I/O Ports

Post by oipmok »

Instead mcp23017 I want to use mcp23s17 which is used in PiFace, however, is limited to 4 in domoticz, and the raspberry pi can address their 8 and an additional 8 to spi1, which gives 128 + 128 = 256 inputs / outputs. if someone tried to modify PiFace.cpp domoticz to detect them more than 4 Piface?
steffend82
Posts: 1
Joined: Thursday 24 November 2016 12:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Fighting with access to MCP23017 I/O Ports

Post by steffend82 »

Hi,

does anybody have any tutorial or samples how to manage outputs of one or more MCP23017 with domoticz?

Thanks!
pkilar
Posts: 1
Joined: Tuesday 14 March 2017 10:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Fighting with access to MCP23017 I/O Ports

Post by pkilar »

User avatar
ILoveIOT
Posts: 59
Joined: Sunday 25 March 2018 17:47
Target OS: Linux
Domoticz version: 2020.2
Location: NL
Contact:

Re: Fighting with access to MCP23017 I/O Ports

Post by ILoveIOT »

try this https://www.domoticz.com/forum/viewtopi ... 32&t=27447

For output i use inside Domoiticz

On;

script:///usr/local/bin/gpio -x mcp23017:100:0x24 mode 110 out ; /usr/local/bin/gpio -x mcp23017:100:0x24 write 110 0

Off;

script:///usr/local/bin/gpio -x mcp23017:100:0x24 mode 110 out ; /usr/local/bin/gpio -x mcp23017:100:0x24 write 110 1
1x OPI PC 5.8.16 Debian 10, MiniDNLA,SMD230,EpEver,MPD,800GB,Wiegand,7 temps,DHT,32/64 I/O,2022.1
2x OPI PC 4.19.25 Debian 9, MPD,7 temps,16/32 I/O,BMP,4.10717
1x IntelNUC 5.10 Debian 10, 2TB,DalyBMS,2023.1
3x ESPEasy NodeMCU V3, 16/16 I/O
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests