WT32 ET01 issue with MCP23017
Moderators: grovkillen, Stuntteam, TD-er
WT32 ET01 issue with MCP23017
Hello,
I'm using ESP easy for different projects for a while together with IOBroker. I've started a new project were I need at least 10 GPIO's and an ethernet connection, therefore I have flashed ESP Easy to an WT32 ETH01 board and everything works as usual. However I'm not able to get the MCP23017 running correctly.
MCP connections:
PIN 12 SCL -> ESP IO14
PIN 13 SDA -> ESP IO15
PIN 15 -> ESP GND
PIN 16 -> ESP GND
PIN 17 -> ESP GND
PIN 18 -> ESP 3,3V
PIN 28 GPA7 -> Relais Board Input
I have followed the instructions on
https://espeasy.readthedocs.io/en/lates ... /P009.html
I2C Address set to 0x20
For Port I have tried several Ports, ie. PA0, PA7
I have enabled the device
I2C Scan in the Tools section shows an connected device with the 0x20 address
However trying to switch the states of the MCP GPIOs doesn't work.
I have played around with MCPGPIO,7,0 // ,7,1 // ,8,0 // ,6,0....
sometimes I got 'failed' messages, sometimes it shows a change of state, sometimes it sets the status to -1.
I also tried to use different GPIOs on the MCP, I've tried another MCP23017, I have changed the relais board to an simple LED but I cannot get this running.
Somewhere is a mistake which I'm not able to find, I hope someone can assist.
THANK YOU!
BR
Phillip
I'm using ESP easy for different projects for a while together with IOBroker. I've started a new project were I need at least 10 GPIO's and an ethernet connection, therefore I have flashed ESP Easy to an WT32 ETH01 board and everything works as usual. However I'm not able to get the MCP23017 running correctly.
MCP connections:
PIN 12 SCL -> ESP IO14
PIN 13 SDA -> ESP IO15
PIN 15 -> ESP GND
PIN 16 -> ESP GND
PIN 17 -> ESP GND
PIN 18 -> ESP 3,3V
PIN 28 GPA7 -> Relais Board Input
I have followed the instructions on
https://espeasy.readthedocs.io/en/lates ... /P009.html
I2C Address set to 0x20
For Port I have tried several Ports, ie. PA0, PA7
I have enabled the device
I2C Scan in the Tools section shows an connected device with the 0x20 address
However trying to switch the states of the MCP GPIOs doesn't work.
I have played around with MCPGPIO,7,0 // ,7,1 // ,8,0 // ,6,0....
sometimes I got 'failed' messages, sometimes it shows a change of state, sometimes it sets the status to -1.
I also tried to use different GPIOs on the MCP, I've tried another MCP23017, I have changed the relais board to an simple LED but I cannot get this running.
Somewhere is a mistake which I'm not able to find, I hope someone can assist.
THANK YOU!
BR
Phillip
Last edited by phillip89 on 22 Jul 2023, 14:27, edited 1 time in total.
Re: WT32 ET01 issue with MCP23017
The plugin you are pointing at is intended for getting input from a MCP GPIO pin, not for enabling output. In fact, by enabling that plugin, the pin is configured to be used as an input pin.
You will have to send a command, like you mention already, to set a pin on or off. By using the command MCPGPIOToggle,<pin> you can easily flip the state from on to off, or off to on. That's the easiest way of checking if it works as expected.
NB: The pin connections are somewhat confusing, not sure why you connect so many GND pins to the ESP, there won't be flowing big currents here
And the pin numbers on the MCP23017 side may differ from board to board, best is to only mention the signal labels like SDA, SCL etc.
You will have to send a command, like you mention already, to set a pin on or off. By using the command MCPGPIOToggle,<pin> you can easily flip the state from on to off, or off to on. That's the easiest way of checking if it works as expected.
NB: The pin connections are somewhat confusing, not sure why you connect so many GND pins to the ESP, there won't be flowing big currents here

And the pin numbers on the MCP23017 side may differ from board to board, best is to only mention the signal labels like SDA, SCL etc.
/Ton (PayPal.me)
Re: WT32 ET01 issue with MCP23017
See: https://espeasy.readthedocs.io/en/lates ... e-on-esp32
As stated there, both pins you picked for I2C will output some bogus signals at boot.
Not sure which one you set as SDA and SCL as you copy/pasted the same SCL
Since I2C is a bit odd in that the clock can be just about anything from near DC signal to the max. frequency for the connected devices, you may end up in a completely unknown state right after boot..
As stated there, both pins you picked for I2C will output some bogus signals at boot.
Not sure which one you set as SDA and SCL as you copy/pasted the same SCL

Since I2C is a bit odd in that the clock can be just about anything from near DC signal to the max. frequency for the connected devices, you may end up in a completely unknown state right after boot..
Re: WT32 ET01 issue with MCP23017
Ups, I've corrected it, thxNot sure which one you set as SDA and SCL as you copy/pasted the same SCL

Alright, so I better should use other Pins?! Then I will check which ones are available and not in use due to Ethernet.As stated there, both pins you picked for I2C will output some bogus signals at boot.
Thanks for the links to the pinout
Well as I understood, the way you connect the Pins 15-17 will set the I2C address on the MCP, for 0x20 all three pins have to be on GND. Or am I wrong?NB: The pin connections are somewhat confusing, not sure why you connect so many GND pins to the ESP, there won't be flowing big currents here
Okay I will try to use that command instead and see what will happen.You will have to send a command, like you mention already, to set a pin on or off. By using the command MCPGPIOToggle,<pin> you can easily flip the state from on to off, or off to on. That's the easiest way of checking if it works as expected.
Thank you both in advance!!!
Re: WT32 ET01 issue with MCP23017
AFAIK, 0x20 is the default address for this chip, even when nothing is connected (internal pull-down).
besides MCPGPIOtoggle, you can also use the MCPGPIOrange,<start>,<end>,<state> command like mcpgpiorange,0,255,1 to switch on all pins and see if the device responds at all

/Ton (PayPal.me)
Re: WT32 ET01 issue with MCP23017
You don't have a lot of pins left over on the WT32-ETH01.
And keep in mind that GPIO 34-39 are input-only.
I suggest to at least have the SCL connected to a pin that doesn't show PWM signals at boot up.
For the SDA this is less of a problem.
Also some pins have (and need) a pull-down resistor, which makes them unusable for I2C.
GPIO-12 is also made available on that board, but keep in mind to NEVER! have that pin pulled-up or -down as the state of that pin during boot determines the voltage applied to the flash chip.
So either you end up with a module not booting, or burning up the flash chip when having the wrong state present on your board.
You could measure the default state, to see if that specific board you're having is either configured with a pull-up or -down resistor, so you might be able to use it if it is intended to have a pull-up resistor.
Just make sure no connected device will ever pull it down during boot.
And keep in mind that GPIO 34-39 are input-only.
I suggest to at least have the SCL connected to a pin that doesn't show PWM signals at boot up.
For the SDA this is less of a problem.
Also some pins have (and need) a pull-down resistor, which makes them unusable for I2C.
GPIO-12 is also made available on that board, but keep in mind to NEVER! have that pin pulled-up or -down as the state of that pin during boot determines the voltage applied to the flash chip.
So either you end up with a module not booting, or burning up the flash chip when having the wrong state present on your board.
You could measure the default state, to see if that specific board you're having is either configured with a pull-up or -down resistor, so you might be able to use it if it is intended to have a pull-up resistor.
Just make sure no connected device will ever pull it down during boot.
Re: WT32 ET01 issue with MCP23017
Thank you both for the tips.
I've tried to follow them, changing the Pins first as you suggested, however ESPeasy tells me now, that no I2C device can be found.
Even going back to my initial GPIO pins doesn't help, I'm not getting the MCP23017 connected anymore
Any thoughts?
I've tried to follow them, changing the Pins first as you suggested, however ESPeasy tells me now, that no I2C device can be found.
Even going back to my initial GPIO pins doesn't help, I'm not getting the MCP23017 connected anymore

Any thoughts?
Re: WT32 ET01 issue with MCP23017
Which pins are you now using for I2C?
Do these have a pull-up resistor present?
Something like 4k7 or 10k between 3V3 - SDA and 3V3 - SCL.
Do these have a pull-up resistor present?
Something like 4k7 or 10k between 3V3 - SDA and 3V3 - SCL.
Re: WT32 ET01 issue with MCP23017
Now I'm using
SCL -> ESP IO14
SDA -> ESP IO15
again as it worked in the beginning.
I haven't attached any resistor to it.
SCL -> ESP IO14
SDA -> ESP IO15
again as it worked in the beginning.
I haven't attached any resistor to it.
Re: WT32 ET01 issue with MCP23017
And not mixed up SDA and SCL while soldering?
You could simply test this by swapping those in the settings in ESPEasy.
You could simply test this by swapping those in the settings in ESPEasy.
Re: WT32 ET01 issue with MCP23017
I haven't soldered anything yet, as I'm using a breadboard at the moment to test things first.
I double checked the connection with the ESP easy settings and it matches.
I double checked the connection with the ESP easy settings and it matches.
Re: WT32 ET01 issue with MCP23017
Hmm sounds like some I2C device on your bus is then blocking stuff.
First thing would be to completely power cycle everything on that board and maybe also remove and re-insert all (4) wires related to this MCP chip:
3V3
SDA
SCL
GND
Just to be sure the wires are all plugged in well and no bogus setting is left in a chip due to some capacitor keeping its charge.
Do you have any other I2C device to check whether the MCP chip may have received some damaging (static) discharge?
First thing would be to completely power cycle everything on that board and maybe also remove and re-insert all (4) wires related to this MCP chip:
3V3
SDA
SCL
GND
Just to be sure the wires are all plugged in well and no bogus setting is left in a chip due to some capacitor keeping its charge.
Do you have any other I2C device to check whether the MCP chip may have received some damaging (static) discharge?
Re: WT32 ET01 issue with MCP23017
I have switched everything off, wired everything from scratch and checked with mulimeter if all connections are working correctly.
I got the same result.
The only I2C devices I have are these MCP23017, as I bought a pack of 5, I tried a different one, still the same result...
Really strange this behaviour as ESP easy recognized the MCP yesterday...
I got the same result.
The only I2C devices I have are these MCP23017, as I bought a pack of 5, I tried a different one, still the same result...
Really strange this behaviour as ESP easy recognized the MCP yesterday...
Who is online
Users browsing this forum: No registered users and 7 guests