Page 1 of 1

MCP23017

Posted: 11 Jan 2021, 23:42
by uxhamby
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.

Re: MCP23017

Posted: 11 Jan 2021, 23:55
by TD-er
I can't see your images.

Re: MCP23017

Posted: 12 Jan 2021, 17:09
by uxhamby
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.

Re: MCP23017

Posted: 12 Jan 2021, 18:03
by TD-er
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"

Re: MCP23017

Posted: 12 Jan 2021, 20:58
by iron
What Address is the MCP discovered on under Tools / I2C scan ?

Re: MCP23017

Posted: 12 Jan 2021, 21:55
by uxhamby
I2C Addresses in use Supported devices
0x20

Re: MCP23017

Posted: 13 Jan 2021, 08:39
by Micha_he
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.

Re: MCP23017

Posted: 13 Jan 2021, 20:05
by uxhamby
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.

Re: MCP23017

Posted: 13 Jan 2021, 20:42
by Micha_he
Look at the MCP23017-plugin documentation, which you can find, when you click at the '?', at the top oft the device config.

Re: MCP23017

Posted: 13 Jan 2021, 22:24
by uxhamby
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.

Re: MCP23017

Posted: 14 Jan 2021, 10:32
by Micha_he
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.