how use "ProMiniExtender" for "Switch input" ?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
reza
Normal user
Posts: 88
Joined: 13 Jun 2017, 21:14

how use "ProMiniExtender" for "Switch input" ?

#1 Post by reza » 24 Mar 2024, 00:55

hi guys
for more I/O, I want use pinouts of ardunio pro mini for switch input. but i think this is impossible because ProMiniExtender is just for sensor input in devices espeasy.
can i help me to how use ProMiniExtender for Switch input
thank you

User avatar
Ath
Normal user
Posts: 3521
Joined: 10 Jun 2018, 12:06
Location: NL

Re: how use "ProMiniExtender" for "Switch input" ?

#2 Post by Ath » 26 Mar 2024, 22:46

We have some documentation in the old Wiki that's not yet migrated to ReadTheDocs, but quite elaborately describes how the ProMiniExtender can be used: https://www.letscontrolit.com/wiki/inde ... niExtender but it can also be used as an input device where it will return a state value of all input pins (pins use input mode until used as an output pin ;)).
Edit: changed 'bitmap value' to 'state value', only 1 port is read.

It seems easier to use a MCP23017 (P009/P061), PCF8574 (P019/P061) (both with core-support like monitoring pins for input changes), PCF8575 (P061), PCA9685 (P022), and depending on the type of input, also several 74HC165 (P129) can be daisy chained up to 16x8 pins, to add input ports to an ESP, but for a single or just a few switch inputs, the regular GPIO pins of an ESP should also suffice.

How many switch inputs would you want to use?
/Ton (PayPal.me)

reza
Normal user
Posts: 88
Joined: 13 Jun 2017, 21:14

Re: how use "ProMiniExtender" for "Switch input" ?

#3 Post by reza » 28 Mar 2024, 11:14

Ath wrote: 26 Mar 2024, 22:46 We have some documentation in the old Wiki that's not yet migrated to ReadTheDocs, but quite elaborately describes how the ProMiniExtender can be used: https://www.letscontrolit.com/wiki/inde ... niExtender but it can also be used as an input device where it will return a state value of all input pins (pins use input mode until used as an output pin ;)).
Edit: changed 'bitmap value' to 'state value', only 1 port is read.

It seems easier to use a MCP23017 (P009/P061), PCF8574 (P019/P061) (both with core-support like monitoring pins for input changes), PCF8575 (P061), PCA9685 (P022), and depending on the type of input, also several 74HC165 (P129) can be daisy chained up to 16x8 pins, to add input ports to an ESP, but for a single or just a few switch inputs, the regular GPIO pins of an ESP should also suffice.

How many switch inputs would you want to use?
thank you for help.
I have read about Promini in wiki before. i have not any problem with promini for output. but for input switch , pro mini extender plugin can not use pin out for switch .pin out just used for digital sensors. when pinouts goto 0 or 1 , esp can not get this value quickly and wait for next value . but every some seconds , return value of pin outs (0 or 1). this is to use digital sensors , not input switchs.

i want 4 relays with 4 switch . or 8 relays and 8 switch.arduino pro mini is ok for this issue.

i know about "MCP23017" and "PCF8574" and "74HC165" but unavailable for me . i have promini and i want use promini for switch . there is a plugin for change ProMiniExtender plugin?
i am not a programmer so i want help and i want a plugin for change promini extender to a plugin with output and switch input.
thanks

User avatar
Ath
Normal user
Posts: 3521
Joined: 10 Jun 2018, 12:06
Location: NL

Re: how use "ProMiniExtender" for "Switch input" ?

#4 Post by Ath » 28 Mar 2024, 12:13

Changing the plugin to detect an input change would require for ESPEasy to poll the state of the configured pin when set for input, but currently that's not available, other than the regular interval, and the smallest Interval rate available is once per second, which is probably too slow.

I'll put this on my TODO list, but can't give an ETA, as there are already quite some items on that list... :?
/Ton (PayPal.me)

reza
Normal user
Posts: 88
Joined: 13 Jun 2017, 21:14

Re: how use "ProMiniExtender" for "Switch input" ?

#5 Post by reza » 28 Mar 2024, 15:49

Ath wrote: 28 Mar 2024, 12:13 Changing the plugin to detect an input change would require for ESPEasy to poll the state of the configured pin when set for input, but currently that's not available, other than the regular interval, and the smallest Interval rate available is once per second, which is probably too slow.

I'll put this on my TODO list, but can't give an ETA, as there are already quite some items on that list... :?
now if i want use 74hc165 (1 or 2 or more) with a wemos D1 mini (also i am use arduino mini for output with I2C and use GPIO4 and GPIO5 for I2C)
i have just 3 pins on D1 mini . for example GPIO12 for DATA , GPIO13 for clock and GPIO14 for Enable . so "load(PL)" connect to which pin of d1 mini ? can i use GPIO16 for load(PL)?

User avatar
Ath
Normal user
Posts: 3521
Joined: 10 Jun 2018, 12:06
Location: NL

Re: how use "ProMiniExtender" for "Switch input" ?

#6 Post by Ath » 28 Mar 2024, 22:38

That 74HC165 has the same limitation as the ProMiniExtender, it has to be polled to get a state, and the fasted polling frequency is once per second.

I've been looking at the code of P011 (Pro Mini Extender) and it seems not too hard to add another selection in the options for "Input (switch)", that will continuously (digitally) read the configured pin, and generate an event when the level changes.

I'll include it in another PR, as there is some quite extensive work done on this plugin already, to reduce code-size, merging that later would be rather difficult.
Also, I don't own such board, so you'll have to test it for me :lol:
/Ton (PayPal.me)

reza
Normal user
Posts: 88
Joined: 13 Jun 2017, 21:14

Re: how use "ProMiniExtender" for "Switch input" ?

#7 Post by reza » 29 Mar 2024, 20:20

Ath wrote: 28 Mar 2024, 22:38 That 74HC165 has the same limitation as the ProMiniExtender, it has to be polled to get a state, and the fasted polling frequency is once per second.

I've been looking at the code of P011 (Pro Mini Extender) and it seems not too hard to add another selection in the options for "Input (switch)", that will continuously (digitally) read the configured pin, and generate an event when the level changes.

I'll include it in another PR, as there is some quite extensive work done on this plugin already, to reduce code-size, merging that later would be rather difficult.
Also, I don't own such board, so you'll have to test it for me :lol:
i am weak in programming
I have an ardunio pro mini :lol: so you give me your codes until i test it . i will report the result :)

User avatar
Ath
Normal user
Posts: 3521
Joined: 10 Jun 2018, 12:06
Location: NL

Re: how use "ProMiniExtender" for "Switch input" ?

#8 Post by Ath » 29 Mar 2024, 22:15

I've added the changes in PR #4777. You can download this for testing from this GH Actions build (you'll need a a GH Account to be able to download from there, but that account is free :))
/Ton (PayPal.me)

Post Reply

Who is online

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