Page 1 of 1
Fighting with access to MCP23017 I/O Ports
Posted: Tuesday 19 August 2014 19:50
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.
Re: Fighting with access to MCP23017 I/O Ports
Posted: Wednesday 20 August 2014 20:02
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?

Re: Fighting with access to MCP23017 I/O Ports
Posted: Wednesday 03 September 2014 9:45
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.
Re: Fighting with access to MCP23017 I/O Ports
Posted: Sunday 30 November 2014 13:13
by nickos
hi
if you have a tutorial to explain how you did it
thank you
Re: Fighting with access to MCP23017 I/O Ports
Posted: Wednesday 22 April 2015 21:40
by smq
Hi,
I'm do not, but when I find a while I will describe the way.
Re: Fighting with access to MCP23017 I/O Ports
Posted: Wednesday 08 July 2015 10:02
by macieiks
Any update ?

I have 2x MCPs ready to be installed.
Cheers
Re: Fighting with access to MCP23017 I/O Ports
Posted: Monday 20 June 2016 11:29
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.
Re: Fighting with access to MCP23017 I/O Ports
Posted: Sunday 03 July 2016 12:27
by oipmok
new ideas ?
I fight with this a few days

(
Re: Fighting with access to MCP23017 I/O Ports
Posted: Sunday 10 July 2016 21:04
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?
Re: Fighting with access to MCP23017 I/O Ports
Posted: Thursday 24 November 2016 12:23
by steffend82
Hi,
does anybody have any tutorial or samples how to manage outputs of one or more MCP23017 with domoticz?
Thanks!
Re: Fighting with access to MCP23017 I/O Ports
Posted: Tuesday 14 March 2017 10:23
by pkilar
Re: Fighting with access to MCP23017 I/O Ports
Posted: Thursday 18 April 2019 10:21
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

0x24 mode 110 out ; /usr/local/bin/gpio -x mcp23017

0x24 write 110 0
Off;
script:///usr/local/bin/gpio -x mcp23017

0x24 mode 110 out ; /usr/local/bin/gpio -x mcp23017

0x24 write 110 1