Door sensor connect to GPIO

Moderator: leecollings

Post Reply
runy
Posts: 11
Joined: Monday 28 January 2019 15:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Door sensor connect to GPIO

Post by runy »

Hi mates,

I would like to connect a sensor door like this (https://es.aliexpress.com/item/32255861 ... 63c0iBdn8C) to my raspberry's GPIO.

Using SYSFS option I set the port with the following steps:

Code: Select all

sudo echo 18 > /sys/class/gpio/export
sudo echo in > /sys/class/gpio/gpio18/direction
sudo echo 1 > /sys/class/gpio/gpio18/active_low
but when I try to check the status with

Code: Select all

cat /sys/class/gpio/gpio18/value
the value is always 0

What am i forgetting?
runy
Posts: 11
Joined: Monday 28 January 2019 15:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Door sensor connect to GPIO (SOLVED)

Post by runy »

I have changed the GPIO for the GPIO4 a now it's working well.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest