setting a gio pin as input and export in domoticz

Moderator: leecollings

Post Reply
guantolento
Posts: 129
Joined: Saturday 01 October 2016 14:48
Target OS: Raspberry Pi / ODroid
Domoticz version: LastBeta
Location: Italy BG
Contact:

setting a gio pin as input and export in domoticz

Post by guantolento »

hi to all,
iam testing to use a pin on the gpio to use as an input in domoticz.
i connect a button (normally open) betwenn the physical pin 34 (ov) and the physycal pin 32 (name GPIO.26 and BCM 12).
in this mode when the button is unpressed, on the pin 32 i have nothing, when the buttun is pressed i must have 0v.
if i use the command gpio readall from shell i look always the value of the pin is V 0.

to export in domoticz i use a sysf gpio hardware. in the file to startup domoticz i add this line:

echo 12 > /sys/class/gpio/export

and i can add a virtual device connect to the sysf gpio on bcm 12. i set the type as contact as i find in the wiki.

i think in the export miss something, but i don't understand because from gpio readall the value is always 0.

someone can help me ?
Master (pi3) - MB sensors + Dummy + Sysfs gpio + 1 NodOn MSP-3 + 1 Aeotec DSB28 Energy Meter + 3 Danfoss RS Room + 7 Danfoss Z Thermostat + 1 Swiid Inter + 9 FGS222
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
SweetPants

Re: setting a gio pin as input and export in domoticz

Post by SweetPants »

Did you use a pull-up resistor?
guantolento
Posts: 129
Joined: Saturday 01 October 2016 14:48
Target OS: Raspberry Pi / ODroid
Domoticz version: LastBeta
Location: Italy BG
Contact:

Re: setting a gio pin as input and export in domoticz

Post by guantolento »

SweetPants wrote: Saturday 04 November 2017 16:10 Did you use a pull-up resistor?
actually i don't use nothing. tell me how restitor i must use .
Master (pi3) - MB sensors + Dummy + Sysfs gpio + 1 NodOn MSP-3 + 1 Aeotec DSB28 Energy Meter + 3 Danfoss RS Room + 7 Danfoss Z Thermostat + 1 Swiid Inter + 9 FGS222
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
SweetPants

Re: setting a gio pin as input and export in domoticz

Post by SweetPants »

guantolento wrote: Saturday 04 November 2017 16:12
SweetPants wrote: Saturday 04 November 2017 16:10 Did you use a pull-up resistor?
actually i don't use nothing. tell me how restitor i must use .
10K to Vcc would do, Vcc being 3.3v
guantolento
Posts: 129
Joined: Saturday 01 October 2016 14:48
Target OS: Raspberry Pi / ODroid
Domoticz version: LastBeta
Location: Italy BG
Contact:

Re: setting a gio pin as input and export in domoticz

Post by guantolento »

10k is the value of R1 ?
Attachments
Cattura.JPG
Cattura.JPG (16.64 KiB) Viewed 5056 times
Master (pi3) - MB sensors + Dummy + Sysfs gpio + 1 NodOn MSP-3 + 1 Aeotec DSB28 Energy Meter + 3 Danfoss RS Room + 7 Danfoss Z Thermostat + 1 Swiid Inter + 9 FGS222
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
guantolento
Posts: 129
Joined: Saturday 01 October 2016 14:48
Target OS: Raspberry Pi / ODroid
Domoticz version: LastBeta
Location: Italy BG
Contact:

Re: setting a gio pin as input and export in domoticz

Post by guantolento »

i find this 2 type of connection of the gpio. how i need to use ? pullup or pulldown ?
Attachments
resistor.JPG
resistor.JPG (62.81 KiB) Viewed 5056 times
Master (pi3) - MB sensors + Dummy + Sysfs gpio + 1 NodOn MSP-3 + 1 Aeotec DSB28 Energy Meter + 3 Danfoss RS Room + 7 Danfoss Z Thermostat + 1 Swiid Inter + 9 FGS222
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
SweetPants

Re: setting a gio pin as input and export in domoticz

Post by SweetPants »

Depends if you want the Gpio to go low (pullup) or high (puldown). Pulldown is not really a pulldown to 0V. I would choose pullup, you van always invert the action in software.
guantolento
Posts: 129
Joined: Saturday 01 October 2016 14:48
Target OS: Raspberry Pi / ODroid
Domoticz version: LastBeta
Location: Italy BG
Contact:

Re: setting a gio pin as input and export in domoticz

Post by guantolento »

but only to make a test. can i give 3.3v directly to the gpio pin? connect directly the button (NO) between the gpio and 3.3v ?
Master (pi3) - MB sensors + Dummy + Sysfs gpio + 1 NodOn MSP-3 + 1 Aeotec DSB28 Energy Meter + 3 Danfoss RS Room + 7 Danfoss Z Thermostat + 1 Swiid Inter + 9 FGS222
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
SweetPants

Re: setting a gio pin as input and export in domoticz

Post by SweetPants »

guantolento wrote: Tuesday 07 November 2017 16:50 but only to make a test. can i give 3.3v directly to the gpio pin? connect directly the button (NO) between the gpio and 3.3v ?
I don't think so, when the switch is open you have a floating input.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest