Feature request****Pulse GPIO command for MCP23017

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
budman1758
Normal user
Posts: 301
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Feature request****Pulse GPIO command for MCP23017

#1 Post by budman1758 » 21 Apr 2017, 05:41

This ESPEasy stuff is the greatest invention since the T-shirt with a pocket!! Kudos to the developers!!

I was using the pulse command on a GPIO pin to toggle a mosfet "relay" with great results. The fet needs a quick click to ground to turn either on or off.

Tried the same thing with an MCP23017 IO expander but It does not seem to support that. Is it possible to extend that functionality to the MCP23017? There only seems to be "on" or "off" unless I am missing something. (Quite possible in my case) :lol: The trigger has to go back to either high or floating in order to for the mosfet to react to the next low trigger.

Any chance of that happening? Otherwise might have to implement a timer or dual commands or something. Hate to get more complicated than necessary.
"The glass is twice as big as it needs to be".

maluko
Normal user
Posts: 112
Joined: 02 Sep 2015, 00:49

Re: Feature request****Pulse GPIO command for MCP23017

#2 Post by maluko » 21 Apr 2017, 10:35

Did you try this?

MCPPulse Plugin Pulse control on MCP23017 output pins See:MCP23017
MCPLongPulse Plugin Long pulse control on MCP23017 output pins See:MCP23017

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Feature request****Pulse GPIO command for MCP23017

#3 Post by Shardan » 21 Apr 2017, 16:32

maluko wrote: 21 Apr 2017, 10:35 Did you try this?

MCPPulse Plugin Pulse control on MCP23017 output pins See:MCP23017
MCPLongPulse Plugin Long pulse control on MCP23017 output pins See:MCP23017
Does that work?
It's not documented in the wike, not for the MCP23017 neither for PCF8574.

Would be nice.
Regards
Shardan

User avatar
budman1758
Normal user
Posts: 301
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Re: Feature request****Pulse GPIO command for MCP23017

#4 Post by budman1758 » 21 Apr 2017, 16:56

Can't find it so impossible to tell if it works or not. :roll:
Can you elaborate?

OK. Found the command. However it does not seem to be able to work the way I need. I am trying to toggle the gpio with a short INPUT low (like a push button) but the command output shows this....
{
"log": "GPIO 8 Pulsed for 500 mS",
"plugin": 9,
"pin": 8,
"mode": "output",
"state": 0
}
It looks like its setting the pin as output. I am using the pin as an input. In the settings for the MCP23017 there are not as many options for setting the pin function as there are for native gpio.
Is there any way around this limitation?
"The glass is twice as big as it needs to be".

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Feature request****Pulse GPIO command for MCP23017

#5 Post by Shardan » 21 Apr 2017, 20:31

Hello,

well, i'm not a software guy so i can't say if there is a possibility to change ESPEasy's plugin.

What should be possible is using a small FET or transistor as an inverter:
.
Circuit.jpg
Circuit.jpg (147.62 KiB) Viewed 9240 times
.

VCC is the voltage from the relay's FET.
R3 (Transistor) / R4 (FET) including the VCC connection may be ommited if the FET on your relay has a pullup resistor internally.

Regards
Shardan
Regards
Shardan

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Feature request****Pulse GPIO command for MCP23017

#6 Post by toffel969 » 21 Apr 2017, 22:07

Shardan wrote: 21 Apr 2017, 16:32
maluko wrote: 21 Apr 2017, 10:35 Did you try this?

MCPPulse Plugin Pulse control on MCP23017 output pins See:MCP23017
MCPLongPulse Plugin Long pulse control on MCP23017 output pins See:MCP23017
Does that work?
It's not documented in the wike, not for the MCP23017 neither for PCF8574.

Would be nice.
I definitly works with the PCF8574 (pcfpulse) I tried yesterday with success. isnt it documented under output pin ?

Regards
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Feature request****Pulse GPIO command for MCP23017

#7 Post by Shardan » 21 Apr 2017, 22:21

It's documented under Outout pin, but not under PCF8574 or MCP23017.

As these need their own plugin I assumed it is not supported with these IO-expanders.

Anyways, thanks for testing - i might need that soon when my ordered PCB's arrive.

Regards
Shardan
Regards
Shardan

User avatar
budman1758
Normal user
Posts: 301
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Re: Feature request****Pulse GPIO command for MCP23017

#8 Post by budman1758 » 21 Apr 2017, 22:59

Hi again. Let me explain my setup a bit better. I live in an RV full time. All lighting is 12volt.
I am trying to control ceiling lites with ESP's. Most of them have a switch on them and that's the only way to control them. Problem: Wife is quite short and can't reach them. ESP to the rescue. :mrgreen:

ESP-01 module in the light fixture. This controls a flip-flop latching mosfet. Short tap to ground triggers on or off. If you stay active low it will not respond to another "tap" to trigger again. (Hence the need for the pulse command). When mosfet is turned on 12v goes to light and thru an LE33 voltage regulator which then goes to GPIO on ESP module as input to indicate lite on. There is also the manual switch in the fixture to turn light on via the mosfet.

ESP-01 module with the MCP23017 is (will be) wall mounted as a control panel of up to 8 momentary push buttons and indicator LED's next to each button. Here is how I am trying to make this madness function......

Button push on control sends message to lite unit to pulse mosfet trigger. This is done using rules. Sense button-sentohttp-pulsegpio. Light unit responds by turning on lite and senses this on other gpio and using rules sendtohttp-controlunit-switch corresponding LED on. Reason for the back and forth is because I want the lite to actually be on before the indicator LED is. Also, this works if you turn the light on manually. :mrgreen:

I have all of this working on my bench now. The problem is to also make it work from automation software or browser.........

Now, after typing all that it just hit me that I am trying to control this remotely backwards. Trying to emulate the push button is not the way. I just need to tell the light to turn on. The gpio on the lite module responds correctly to the pulse command. Don't need it on the MCP23017. :roll: :roll:

I'm not sure if this is the most efficient way to go about this but it seems to work. I have been trying to find a easy solution to this because when it comes to software code I am completely useless. Just coming up with the simple rules to make it work pretty much used up all my coding skills. I'm a hardware/mechanic/bash it together kind of guy. Stumbling upon ESPEasy was exactly what I have been looking for. Kudos to the Devs for this!!!
"The glass is twice as big as it needs to be".

maluko
Normal user
Posts: 112
Joined: 02 Sep 2015, 00:49

Re: Feature request****Pulse GPIO command for MCP23017

#9 Post by maluko » 22 Apr 2017, 10:02

this command inst on output seccion but in reference command.

see here
https://www.letscontrolit.com/wiki/inde ... _Reference

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Feature request****Pulse GPIO command for MCP23017

#10 Post by toffel969 » 22 Apr 2017, 15:28

maluko wrote: 22 Apr 2017, 10:02 this command inst on output seccion but in reference command.

see here
https://www.letscontrolit.com/wiki/inde ... _Reference
I updated the PCF's wiki. Take a look
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Feature request****Pulse GPIO command for MCP23017

#11 Post by Shardan » 22 Apr 2017, 17:28

Hello

toffel969, kudos - you made my life easier :)

+1
Regards
Shardan

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Feature request****Pulse GPIO command for MCP23017

#12 Post by toffel969 » 22 Apr 2017, 19:07

Shardan wrote: 22 Apr 2017, 17:28 Hello

toffel969, kudos - you made my life easier :)

+1
The part about the gpio current ;-)...? took me a moment to realize, but is clearly stated in the data sheet. Always a pleasure
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests