setting a gio pin as input and export in domoticz

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

setting a gio pin as input and export in domoticz

Post by guantolento » Saturday 04 November 2017 16:43

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
Posts: 2397
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.10267
Location: The Netherlands
Contact:

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

Post by SweetPants » Saturday 04 November 2017 17:10

Did you use a pull-up resistor?
Ubuntu 16.04.5 LTS, Intel NUC, MySensors 2.3.0-alpha, Pro Mini 3.3/8M RFM69(HW), ESP8266 (SDK2.2.0), Sonoff, RFLink, RFXcom, MQTT, NodeRed, Domoticz Beta (from source)

guantolento
Posts: 182
Joined: Saturday 01 October 2016 14:48
Target OS: Raspberry Pi
Domoticz version: LastBeta
Location: Italy BG
Contact:

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

Post by guantolento » Saturday 04 November 2017 17:12

SweetPants wrote:
Saturday 04 November 2017 17: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
Posts: 2397
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.10267
Location: The Netherlands
Contact:

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

Post by SweetPants » Saturday 04 November 2017 17:21

guantolento wrote:
Saturday 04 November 2017 17:12
SweetPants wrote:
Saturday 04 November 2017 17: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
Ubuntu 16.04.5 LTS, Intel NUC, MySensors 2.3.0-alpha, Pro Mini 3.3/8M RFM69(HW), ESP8266 (SDK2.2.0), Sonoff, RFLink, RFXcom, MQTT, NodeRed, Domoticz Beta (from source)

guantolento
Posts: 182
Joined: Saturday 01 October 2016 14:48
Target OS: Raspberry Pi
Domoticz version: LastBeta
Location: Italy BG
Contact:

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

Post by guantolento » Saturday 04 November 2017 17:23

10k is the value of R1 ?
Attachments
Cattura.JPG
Cattura.JPG (16.64 KiB) Viewed 2295 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: 182
Joined: Saturday 01 October 2016 14:48
Target OS: Raspberry Pi
Domoticz version: LastBeta
Location: Italy BG
Contact:

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

Post by guantolento » Saturday 04 November 2017 17:34

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 2295 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
Posts: 2397
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.10267
Location: The Netherlands
Contact:

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

Post by SweetPants » Saturday 04 November 2017 19:12

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.
Ubuntu 16.04.5 LTS, Intel NUC, MySensors 2.3.0-alpha, Pro Mini 3.3/8M RFM69(HW), ESP8266 (SDK2.2.0), Sonoff, RFLink, RFXcom, MQTT, NodeRed, Domoticz Beta (from source)

guantolento
Posts: 182
Joined: Saturday 01 October 2016 14:48
Target OS: Raspberry Pi
Domoticz version: LastBeta
Location: Italy BG
Contact:

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

Post by guantolento » Tuesday 07 November 2017 17: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 ?
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
Posts: 2397
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.10267
Location: The Netherlands
Contact:

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

Post by SweetPants » Tuesday 07 November 2017 23:52

guantolento wrote:
Tuesday 07 November 2017 17: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.
Ubuntu 16.04.5 LTS, Intel NUC, MySensors 2.3.0-alpha, Pro Mini 3.3/8M RFM69(HW), ESP8266 (SDK2.2.0), Sonoff, RFLink, RFXcom, MQTT, NodeRed, Domoticz Beta (from source)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest