MCP23017

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
uxhamby
Normal user
Posts: 64
Joined: 29 Dec 2016, 18:13
Location: Toronto Canada

MCP23017

#1 Post by uxhamby » 11 Jan 2021, 23:42

I have upgraded an ESP8266 from R120 to Mega 20111 today.

This device has an MCP23017 connected to it as shown below and apparently worked under R120

Image

I had the I2C set up as follows under R120:

Image

I have similarly configured Mega 20111 as follows:

Image

Image

Now however, when I enable the mcpgpio device, my log fills up fast with

Code: Select all

6621858: MCP  : Port=0 is offline (EVENT= -1)
6621860: EVENT: mcpgpio#Switch=-1
6621958: MCP  : Port=0 is offline (EVENT= -1)
6621960: EVENT: mcpgpio#Switch=-1
6622058: MCP  : Port=0 is offline (EVENT= -1)
6622060: EVENT: mcpgpio#Switch=-1
6622158: MCP  : Port=0 is offline (EVENT= -1)
6622160: EVENT: mcpgpio#Switch=-1
6622258: MCP  : Port=0 is offline (EVENT= -1)
... and I don't get what I expect from the MCP23017.


I fail to see where I have gone wrong as yet. Thoughts / advice would be appreciated.

Thanks,

Brian H.

TD-er
Core team member
Posts: 3870
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MCP23017

#2 Post by TD-er » 11 Jan 2021, 23:55

I can't see your images.

User avatar
uxhamby
Normal user
Posts: 64
Joined: 29 Dec 2016, 18:13
Location: Toronto Canada

Re: MCP23017

#3 Post by uxhamby » 12 Jan 2021, 17:09

TDer,
I can't see your images.
Sorry, cant explain that. I am convinced that they are publicly available.

ProxyBrowser

Can you d/l the images directly from their web addresses?

Image #1: http://home.powergate.ca/~bjh/esp4/Task.png

Image #2: http://home.powergate.ca/~bjh/esp4/Hardware.png

Image #3: http://home.powergate.ca/~bjh/esp4/MegaTask.png

Image #4: http://home.powergate.ca/~bjh/esp4/MegaHardware.png

LMK,

Cheers,

Brian H.

TD-er
Core team member
Posts: 3870
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MCP23017

#4 Post by TD-er » 12 Jan 2021, 18:03

Yep.
But please remind me later this evening to reply, as I now have to go and the forum doesn't have a "mark as unread"

User avatar
iron
Normal user
Posts: 130
Joined: 24 Sep 2016, 08:37
Location: Veria, Greece
Contact:

Re: MCP23017

#5 Post by iron » 12 Jan 2021, 20:58

What Address is the MCP discovered on under Tools / I2C scan ?
-D

User avatar
uxhamby
Normal user
Posts: 64
Joined: 29 Dec 2016, 18:13
Location: Toronto Canada

Re: MCP23017

#6 Post by uxhamby » 12 Jan 2021, 21:55

I2C Addresses in use Supported devices
0x20

Micha_he
Normal user
Posts: 227
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: MCP23017

#7 Post by Micha_he » 13 Jan 2021, 08:39

I've setup a MCP23017 yesterday. Firmware 4M1M is from ~ november/december last year. I'll look in the log today evening, but all ports (1-6) works perfectly.

In your log and in your config I see 'Port 0' !? Port numbers are from 1 to xxx, or ? Maybe this was different in R120 !?

Edit: The log from my ESP looks good. No errors from MCP-devices.

User avatar
uxhamby
Normal user
Posts: 64
Joined: 29 Dec 2016, 18:13
Location: Toronto Canada

Re: MCP23017

#8 Post by uxhamby » 13 Jan 2021, 20:05

Hmmmm.
In your log and in your config I see 'Port 0' !? Port numbers are from 1 to xxx, or ?
I wish I understood the ESPEASY documentation system better but this Oct '17 doc seems to bear out what you say.

I'll try changing from 0 to 1 and see what happens.

Thanks,

Brian H.
Last edited by uxhamby on 13 Jan 2021, 23:03, edited 1 time in total.

Micha_he
Normal user
Posts: 227
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: MCP23017

#9 Post by Micha_he » 13 Jan 2021, 20:42

Look at the MCP23017-plugin documentation, which you can find, when you click at the '?', at the top oft the device config.

User avatar
uxhamby
Normal user
Posts: 64
Joined: 29 Dec 2016, 18:13
Location: Toronto Canada

Re: MCP23017

#10 Post by uxhamby » 13 Jan 2021, 22:24

Look at the MCP23017-plugin documentation, which you can find, when you click at the '?', at the top oft the device config.
Yes, that takes me to the Oct '17 doc that I unsuccessfully tried to reference above.

I find it lacking. Its probably me but I'm just not getting it

It tells me how to set up an input switch device, how do I set up an output ? How do I specify pin by pin input or output mode.

Originally I had interpreted a port as being 16 bits wide but now I am suspecting that port is one bit wide.

Ok, I can set my inputs pin by pin but do I just write to output pins w/o a device configured? That seems to work but the results aren't permanent, as the physical outputs set by MCPGPIO,x,1 only stay set for a few seconds and then go unset again. If I look at the pin state buffer, I see the pins not set up with an input device are listed as "undefined".

Apologies, but a certain amount of frustration is setting in. Perhaps its time to walk the dog instead.

Thanks,

Brian H.

Micha_he
Normal user
Posts: 227
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: MCP23017

#11 Post by Micha_he » 14 Jan 2021, 10:32

Here I can't help you. I've changed the expander from PCF8574 to MCP23017 at monday and I use only 6 output-ports.
If I set they to a specified state, I've not saw any wrong state after some minutes. Longer tests I've not performed yet.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 48 guests