GPIO port
Moderator: leecollings
-
- Posts: 13
- Joined: Monday 17 April 2017 14:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.11670
- Location: Appingedam
- Contact:
GPIO port
Is it possible to use a GPIO port on a Raspberry Pi as in INPUT?
For example I like to create a doorbell.
If I manually create a switch with function 'doorbell' I can only select the pins as Outputs.
For example I like to create a doorbell.
If I manually create a switch with function 'doorbell' I can only select the pins as Outputs.
-
- Posts: 22
- Joined: Sunday 19 February 2017 12:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: GPIO port
yes, install "Generic sysfs gpio" hardware. Before enabeling it do the sysfs settings using a startup shell script. When google you will find how to do it. If you need pullups use raspi-gpio to enable these.
-
- Posts: 22
- Joined: Sunday 19 February 2017 12:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: GPIO port
Note: Generic sysfs gpio is only availble in the latest beta releases. There is no need for wiringpi.
-
- Posts: 22
- Joined: Sunday 19 February 2017 12:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: GPIO port
You can also do it using Raspberry's GPIO tough. See domoticz wiki on how to set it up. It works, I have used inputs using both Raspberrys GPIO and Sysfs-gpio. On the longer term Sysfs-gpio will likely replace Rasberrys GPIO.
-
- Posts: 13
- Joined: Monday 17 April 2017 14:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.11670
- Location: Appingedam
- Contact:
Re: GPIO port
I looked at the installation of 'sysfs' but that's pretty difficult and also I installed the latest Beta version of Domoticz.
Tonight I can take a look at the Wiki how to setup the GPIO port.
Tonight I can take a look at the Wiki how to setup the GPIO port.
-
- Posts: 22
- Joined: Sunday 19 February 2017 12:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: GPIO port
Below the content of my /etc/init.d/domoticz_sysfs.sh script.I call it from my /etc/init/domticz.sh script. I run domoticz as a daemon. After reboot all sysfs ports should be setup, ready to go. Note that in the example below I have setup 23 inputs (with pullups) and 1 output (gpio12). To setup the pullups I use the raspi-gpio tool. You can install it as follows: "sudo apt-get install raspi-gpio". Once this is done enable the "Generic sysfs gpio" hardware (Setup/Hardware/"Generic sysfs gpio"). Once done, goto the devices tab, you should see all devices that you have exported available for use. By clicking the green arrows you can add and rename the devices you want to use. Now you will see the devices you configured in the "Switches" tab. Please let us know your results.
#! /bin/sh
#-----------------------------------------------------------------------------
# Init sysfs GPIO ports
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# unexport
#
echo 4 > /sys/class/gpio/unexport
echo 5 > /sys/class/gpio/unexport
echo 6 > /sys/class/gpio/unexport
echo 7 > /sys/class/gpio/unexport
echo 8 > /sys/class/gpio/unexport
echo 9 > /sys/class/gpio/unexport
echo 10 > /sys/class/gpio/unexport
echo 11 > /sys/class/gpio/unexport
echo 12 > /sys/class/gpio/unexport
echo 13 > /sys/class/gpio/unexport
echo 14 > /sys/class/gpio/unexport
echo 15 > /sys/class/gpio/unexport
echo 16 > /sys/class/gpio/unexport
echo 17 > /sys/class/gpio/unexport
echo 18 > /sys/class/gpio/unexport
echo 19 > /sys/class/gpio/unexport
echo 20 > /sys/class/gpio/unexport
echo 21 > /sys/class/gpio/unexport
echo 22 > /sys/class/gpio/unexport
echo 23 > /sys/class/gpio/unexport
echo 24 > /sys/class/gpio/unexport
echo 25 > /sys/class/gpio/unexport
echo 26 > /sys/class/gpio/unexport
echo 27 > /sys/class/gpio/unexport
#-----------------------------------------------------------------------------
# export
#
echo 4 > /sys/class/gpio/export
echo 5 > /sys/class/gpio/export
echo 6 > /sys/class/gpio/export
echo 7 > /sys/class/gpio/export
echo 8 > /sys/class/gpio/export
echo 9 > /sys/class/gpio/export
echo 10 > /sys/class/gpio/export
echo 11 > /sys/class/gpio/export
echo 12 > /sys/class/gpio/export
echo 13 > /sys/class/gpio/export
echo 14 > /sys/class/gpio/export
echo 15 > /sys/class/gpio/export
echo 16 > /sys/class/gpio/export
echo 17 > /sys/class/gpio/export
echo 18 > /sys/class/gpio/export
echo 19 > /sys/class/gpio/export
echo 20 > /sys/class/gpio/export
echo 21 > /sys/class/gpio/export
echo 22 > /sys/class/gpio/export
echo 23 > /sys/class/gpio/export
echo 24 > /sys/class/gpio/export
echo 25 > /sys/class/gpio/export
echo 26 > /sys/class/gpio/export
echo 27 > /sys/class/gpio/export
#-----------------------------------------------------------------------------
# Set direction = in
#
echo in > /sys/class/gpio/gpio4/direction
echo in > /sys/class/gpio/gpio5/direction
echo in > /sys/class/gpio/gpio6/direction
echo in > /sys/class/gpio/gpio7/direction
echo in > /sys/class/gpio/gpio8/direction
echo in > /sys/class/gpio/gpio9/direction
echo in > /sys/class/gpio/gpio10/direction
echo in > /sys/class/gpio/gpio11/direction
echo out > /sys/class/gpio/gpio12/direction
echo in > /sys/class/gpio/gpio13/direction
echo in > /sys/class/gpio/gpio14/direction
echo in > /sys/class/gpio/gpio15/direction
echo in > /sys/class/gpio/gpio16/direction
echo in > /sys/class/gpio/gpio17/direction
echo in > /sys/class/gpio/gpio18/direction
echo in > /sys/class/gpio/gpio19/direction
echo in > /sys/class/gpio/gpio20/direction
echo in > /sys/class/gpio/gpio21/direction
echo in > /sys/class/gpio/gpio22/direction
echo in > /sys/class/gpio/gpio23/direction
echo in > /sys/class/gpio/gpio24/direction
echo in > /sys/class/gpio/gpio25/direction
echo in > /sys/class/gpio/gpio26/direction
echo in > /sys/class/gpio/gpio27/direction
#-----------------------------------------------------------------------------
# Set active_low = 0 (false)
#
echo 0 > /sys/class/gpio/gpio4/active_low
echo 0 > /sys/class/gpio/gpio5/active_low
echo 0 > /sys/class/gpio/gpio6/active_low
echo 0 > /sys/class/gpio/gpio7/active_low
echo 0 > /sys/class/gpio/gpio8/active_low
echo 0 > /sys/class/gpio/gpio9/active_low
echo 0 > /sys/class/gpio/gpio10/active_low
echo 0 > /sys/class/gpio/gpio11/active_low
echo 0 > /sys/class/gpio/gpio12/active_low
echo 0 > /sys/class/gpio/gpio13/active_low
echo 0 > /sys/class/gpio/gpio14/active_low
echo 0 > /sys/class/gpio/gpio15/active_low
echo 0 > /sys/class/gpio/gpio16/active_low
echo 0 > /sys/class/gpio/gpio17/active_low
echo 0 > /sys/class/gpio/gpio18/active_low
echo 0 > /sys/class/gpio/gpio19/active_low
echo 0 > /sys/class/gpio/gpio20/active_low
echo 0 > /sys/class/gpio/gpio21/active_low
echo 0 > /sys/class/gpio/gpio22/active_low
echo 0 > /sys/class/gpio/gpio23/active_low
echo 0 > /sys/class/gpio/gpio24/active_low
echo 0 > /sys/class/gpio/gpio25/active_low
echo 0 > /sys/class/gpio/gpio26/active_low
echo 0 > /sys/class/gpio/gpio27/active_low
#-----------------------------------------------------------------------------
# Set edges = none
#
echo none > /sys/class/gpio/gpio4/edge
echo none > /sys/class/gpio/gpio5/edge
echo none > /sys/class/gpio/gpio6/edge
echo none > /sys/class/gpio/gpio7/edge
echo none > /sys/class/gpio/gpio8/edge
echo none > /sys/class/gpio/gpio9/edge
echo none > /sys/class/gpio/gpio10/edge
echo none > /sys/class/gpio/gpio11/edge
echo none > /sys/class/gpio/gpio12/edge
echo none > /sys/class/gpio/gpio13/edge
echo none > /sys/class/gpio/gpio14/edge
echo none > /sys/class/gpio/gpio15/edge
echo none > /sys/class/gpio/gpio16/edge
echo none > /sys/class/gpio/gpio17/edge
echo none > /sys/class/gpio/gpio18/edge
echo none > /sys/class/gpio/gpio19/edge
echo none > /sys/class/gpio/gpio20/edge
echo none > /sys/class/gpio/gpio21/edge
echo none > /sys/class/gpio/gpio22/edge
echo none > /sys/class/gpio/gpio23/edge
echo none > /sys/class/gpio/gpio24/edge
echo none > /sys/class/gpio/gpio25/edge
echo none > /sys/class/gpio/gpio26/edge
echo none > /sys/class/gpio/gpio27/edge
#-----------------------------------------------------------------------------
# Set pullups
#
raspi-gpio set 4 pu
raspi-gpio set 5 pu
raspi-gpio set 6 pu
raspi-gpio set 7 pu
raspi-gpio set 8 pu
raspi-gpio set 9 pu
raspi-gpio set 10 pu
raspi-gpio set 11 pu
raspi-gpio set 12 dl
raspi-gpio set 13 pu
raspi-gpio set 14 pu
raspi-gpio set 15 pu
raspi-gpio set 16 pu
raspi-gpio set 17 pu
raspi-gpio set 18 pu
raspi-gpio set 19 pu
raspi-gpio set 20 pu
raspi-gpio set 21 pu
raspi-gpio set 22 pu
raspi-gpio set 23 pu
raspi-gpio set 24 pu
raspi-gpio set 25 pu
raspi-gpio set 26 pu
raspi-gpio set 27 pu
#-----------------------------------------------------------------------------
exit 0
#! /bin/sh
#-----------------------------------------------------------------------------
# Init sysfs GPIO ports
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# unexport
#
echo 4 > /sys/class/gpio/unexport
echo 5 > /sys/class/gpio/unexport
echo 6 > /sys/class/gpio/unexport
echo 7 > /sys/class/gpio/unexport
echo 8 > /sys/class/gpio/unexport
echo 9 > /sys/class/gpio/unexport
echo 10 > /sys/class/gpio/unexport
echo 11 > /sys/class/gpio/unexport
echo 12 > /sys/class/gpio/unexport
echo 13 > /sys/class/gpio/unexport
echo 14 > /sys/class/gpio/unexport
echo 15 > /sys/class/gpio/unexport
echo 16 > /sys/class/gpio/unexport
echo 17 > /sys/class/gpio/unexport
echo 18 > /sys/class/gpio/unexport
echo 19 > /sys/class/gpio/unexport
echo 20 > /sys/class/gpio/unexport
echo 21 > /sys/class/gpio/unexport
echo 22 > /sys/class/gpio/unexport
echo 23 > /sys/class/gpio/unexport
echo 24 > /sys/class/gpio/unexport
echo 25 > /sys/class/gpio/unexport
echo 26 > /sys/class/gpio/unexport
echo 27 > /sys/class/gpio/unexport
#-----------------------------------------------------------------------------
# export
#
echo 4 > /sys/class/gpio/export
echo 5 > /sys/class/gpio/export
echo 6 > /sys/class/gpio/export
echo 7 > /sys/class/gpio/export
echo 8 > /sys/class/gpio/export
echo 9 > /sys/class/gpio/export
echo 10 > /sys/class/gpio/export
echo 11 > /sys/class/gpio/export
echo 12 > /sys/class/gpio/export
echo 13 > /sys/class/gpio/export
echo 14 > /sys/class/gpio/export
echo 15 > /sys/class/gpio/export
echo 16 > /sys/class/gpio/export
echo 17 > /sys/class/gpio/export
echo 18 > /sys/class/gpio/export
echo 19 > /sys/class/gpio/export
echo 20 > /sys/class/gpio/export
echo 21 > /sys/class/gpio/export
echo 22 > /sys/class/gpio/export
echo 23 > /sys/class/gpio/export
echo 24 > /sys/class/gpio/export
echo 25 > /sys/class/gpio/export
echo 26 > /sys/class/gpio/export
echo 27 > /sys/class/gpio/export
#-----------------------------------------------------------------------------
# Set direction = in
#
echo in > /sys/class/gpio/gpio4/direction
echo in > /sys/class/gpio/gpio5/direction
echo in > /sys/class/gpio/gpio6/direction
echo in > /sys/class/gpio/gpio7/direction
echo in > /sys/class/gpio/gpio8/direction
echo in > /sys/class/gpio/gpio9/direction
echo in > /sys/class/gpio/gpio10/direction
echo in > /sys/class/gpio/gpio11/direction
echo out > /sys/class/gpio/gpio12/direction
echo in > /sys/class/gpio/gpio13/direction
echo in > /sys/class/gpio/gpio14/direction
echo in > /sys/class/gpio/gpio15/direction
echo in > /sys/class/gpio/gpio16/direction
echo in > /sys/class/gpio/gpio17/direction
echo in > /sys/class/gpio/gpio18/direction
echo in > /sys/class/gpio/gpio19/direction
echo in > /sys/class/gpio/gpio20/direction
echo in > /sys/class/gpio/gpio21/direction
echo in > /sys/class/gpio/gpio22/direction
echo in > /sys/class/gpio/gpio23/direction
echo in > /sys/class/gpio/gpio24/direction
echo in > /sys/class/gpio/gpio25/direction
echo in > /sys/class/gpio/gpio26/direction
echo in > /sys/class/gpio/gpio27/direction
#-----------------------------------------------------------------------------
# Set active_low = 0 (false)
#
echo 0 > /sys/class/gpio/gpio4/active_low
echo 0 > /sys/class/gpio/gpio5/active_low
echo 0 > /sys/class/gpio/gpio6/active_low
echo 0 > /sys/class/gpio/gpio7/active_low
echo 0 > /sys/class/gpio/gpio8/active_low
echo 0 > /sys/class/gpio/gpio9/active_low
echo 0 > /sys/class/gpio/gpio10/active_low
echo 0 > /sys/class/gpio/gpio11/active_low
echo 0 > /sys/class/gpio/gpio12/active_low
echo 0 > /sys/class/gpio/gpio13/active_low
echo 0 > /sys/class/gpio/gpio14/active_low
echo 0 > /sys/class/gpio/gpio15/active_low
echo 0 > /sys/class/gpio/gpio16/active_low
echo 0 > /sys/class/gpio/gpio17/active_low
echo 0 > /sys/class/gpio/gpio18/active_low
echo 0 > /sys/class/gpio/gpio19/active_low
echo 0 > /sys/class/gpio/gpio20/active_low
echo 0 > /sys/class/gpio/gpio21/active_low
echo 0 > /sys/class/gpio/gpio22/active_low
echo 0 > /sys/class/gpio/gpio23/active_low
echo 0 > /sys/class/gpio/gpio24/active_low
echo 0 > /sys/class/gpio/gpio25/active_low
echo 0 > /sys/class/gpio/gpio26/active_low
echo 0 > /sys/class/gpio/gpio27/active_low
#-----------------------------------------------------------------------------
# Set edges = none
#
echo none > /sys/class/gpio/gpio4/edge
echo none > /sys/class/gpio/gpio5/edge
echo none > /sys/class/gpio/gpio6/edge
echo none > /sys/class/gpio/gpio7/edge
echo none > /sys/class/gpio/gpio8/edge
echo none > /sys/class/gpio/gpio9/edge
echo none > /sys/class/gpio/gpio10/edge
echo none > /sys/class/gpio/gpio11/edge
echo none > /sys/class/gpio/gpio12/edge
echo none > /sys/class/gpio/gpio13/edge
echo none > /sys/class/gpio/gpio14/edge
echo none > /sys/class/gpio/gpio15/edge
echo none > /sys/class/gpio/gpio16/edge
echo none > /sys/class/gpio/gpio17/edge
echo none > /sys/class/gpio/gpio18/edge
echo none > /sys/class/gpio/gpio19/edge
echo none > /sys/class/gpio/gpio20/edge
echo none > /sys/class/gpio/gpio21/edge
echo none > /sys/class/gpio/gpio22/edge
echo none > /sys/class/gpio/gpio23/edge
echo none > /sys/class/gpio/gpio24/edge
echo none > /sys/class/gpio/gpio25/edge
echo none > /sys/class/gpio/gpio26/edge
echo none > /sys/class/gpio/gpio27/edge
#-----------------------------------------------------------------------------
# Set pullups
#
raspi-gpio set 4 pu
raspi-gpio set 5 pu
raspi-gpio set 6 pu
raspi-gpio set 7 pu
raspi-gpio set 8 pu
raspi-gpio set 9 pu
raspi-gpio set 10 pu
raspi-gpio set 11 pu
raspi-gpio set 12 dl
raspi-gpio set 13 pu
raspi-gpio set 14 pu
raspi-gpio set 15 pu
raspi-gpio set 16 pu
raspi-gpio set 17 pu
raspi-gpio set 18 pu
raspi-gpio set 19 pu
raspi-gpio set 20 pu
raspi-gpio set 21 pu
raspi-gpio set 22 pu
raspi-gpio set 23 pu
raspi-gpio set 24 pu
raspi-gpio set 25 pu
raspi-gpio set 26 pu
raspi-gpio set 27 pu
#-----------------------------------------------------------------------------
exit 0
-
- Posts: 139
- Joined: Tuesday 06 September 2016 20:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version: L stab
- Location: Belgium
- Contact:
Re: GPIO port
you can maybe check this https://github.com/bengtner/GPIOinput
Domoicz on RPI3 (wifi) directly connected 3x ds18b20 for CV temp, Evohome (9 zone), 1 remote 220V switch based on ESP-12. RFXtrx433E, 16x AMST-606, 5 Somfy RTS motors
Domoticz on RPI3(wifi) as slave for terraruim control
More to come
Domoticz on RPI3(wifi) as slave for terraruim control
More to come
-
- Posts: 22
- Joined: Sunday 19 February 2017 12:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: GPIO port
Lebo2d9 should also be able to use the new "Generic sysfs gpio" hardware type to control the relays connected to output ports the raspberry. The advantage is that wiringpi is no longer needed making the susbsystem more simple. I am looking forward to see reports back of people who use "Generic sysfs gpio" to find out if it is a good replacement for the existing "Raspberry's gpio" hardware type.
-
- Posts: 13
- Joined: Monday 17 April 2017 14:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.11670
- Location: Appingedam
- Contact:
Re: GPIO port
'Henrivb' I used your script, thanks for that. I installed raspi-gpio too, but I have one problem. I can not install the latest Beta version. When I update to the latest Beta version I can not login anymore on the webpage. It gives me the error: Browser Cache refresh failed. Manifest fetch failed (6).
So when I go back to the Stable, it works again.
And to install the 'Generic Sysfs GPIO' I need the latest version.
Do you know what is causing this problem?
So when I go back to the Stable, it works again.
And to install the 'Generic Sysfs GPIO' I need the latest version.
Do you know what is causing this problem?
-
- Posts: 22
- Joined: Sunday 19 February 2017 12:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: GPIO port
I am also running the latest beta (V3.7373) but did not see that problem. Did you delete you browser cache and reload? If the problem persists we need someone else to step in and help you out. You should be really close in getting it to work now.
-
- Posts: 22
- Joined: Sunday 19 February 2017 12:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: GPIO port
If deleting the browser cache does not help you may rename your existing database (domoticz.db to _domotocz.db ) and restart domoticz so that you start with a new db. Then add the "Generic sysfs gpio" hardware. This should work if all is well. It works for me using chrome IE and edge browsers on windows.
-
- Posts: 13
- Joined: Monday 17 April 2017 14:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.11670
- Location: Appingedam
- Contact:
Re: GPIO port
I deleted the folder 'domoticz' just installed Domoticz again, and restored my database. But I get the same error.
I just posted a new topic about my problem, and see if someone knows what to do.
After I installed the Beta version again, the same problem. So if nobody knows a solution after today, I create a backup of the database, and install a new image of Debian. And after that I restore the DB again.
The strange thing is, that the Beta was working last week, so there is something strange happening.
But I hoped it was something simple
I just posted a new topic about my problem, and see if someone knows what to do.
After I installed the Beta version again, the same problem. So if nobody knows a solution after today, I create a backup of the database, and install a new image of Debian. And after that I restore the DB again.
The strange thing is, that the Beta was working last week, so there is something strange happening.
But I hoped it was something simple
-
- Posts: 22
- Joined: Sunday 19 February 2017 12:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: GPIO port
Did you try: 1. install latest beta (don't restore your database but keep new empty one for a start) 2. add "Generic sysfs gpio" ? 3. test your GPIO inputs ?
-
- Posts: 13
- Joined: Monday 17 April 2017 14:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.11670
- Location: Appingedam
- Contact:
Re: GPIO port
I will first try to start a new Raspbian Image, and install Domoticz on a fresh SD-card. If something goes wrong I can go back fast.
After that I can try to restore the database and see if it's OK.
If not, I know that it is the Database that is causing the problem.
And if it works, I know it's the Domoticz installation itself.
I will test before evening starts and will let you know!
After that I can try to restore the database and see if it's OK.
If not, I know that it is the Database that is causing the problem.
And if it works, I know it's the Domoticz installation itself.
I will test before evening starts and will let you know!
-
- Posts: 13
- Joined: Monday 17 April 2017 14:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.11670
- Location: Appingedam
- Contact:
Re: GPIO port
I started with a new installation of Debian and after that I installed Domotics and all the things you advised above!
All is working now!
The problem is my database, the old one was corrupt I think...
So I configured Pin 4 as Doorbell, and 18 as an Output that is connected with Pushover.
Thanks for all your help!
All is working now!
The problem is my database, the old one was corrupt I think...
So I configured Pin 4 as Doorbell, and 18 as an Output that is connected with Pushover.
Thanks for all your help!
-
- Posts: 22
- Joined: Sunday 19 February 2017 12:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: GPIO port
Great !
-
- Posts: 331
- Joined: Sunday 22 February 2015 12:19
- Target OS: Linux
- Domoticz version: 2020.x
- Location: Netherlands
- Contact:
Re: GPIO port
Hi, I started to use the generic sysfs.gpi hardware instead of the "old" "Raspberry's GPIO port" hardware in Domoticz. I got this working without using the sysfs.sh script, even after reboot. Now thought to use your example initiation script, but don't understand the sequence.henrivb wrote:Below the content of my /etc/init.d/domoticz_sysfs.sh script.I call it from my /etc/init/domticz.sh script. I run domoticz as a daemon. After reboot all sysfs ports should be setup, ready to go. Note that in the example below I have setup 23 inputs (with pullups) and 1 output (gpio12). To setup the pullups I use the raspi-gpio tool. You can install it as follows: "sudo apt-get install raspi-gpio". Once this is done enable the "Generic sysfs gpio" hardware (Setup/Hardware/"Generic sysfs gpio"). Once done, goto the devices tab, you should see all devices that you have exported available for use. By clicking the green arrows you can add and rename the devices you want to use. Now you will see the devices you configured in the "Switches" tab. Please let us know your results.
...
From Google I understand, that you should:
Export
Change the ports
Unexport.
However in your script you do just do
Unexport
Export
Change the ports?
Is that Ok?
-
- Posts: 331
- Joined: Sunday 22 February 2015 12:19
- Target OS: Linux
- Domoticz version: 2020.x
- Location: Netherlands
- Contact:
Re: GPIO port
I'm having a strange thing, the "edge" command seems not to be persistant after an "unexport":
e.g.
Ok, so all things seems Ok, but then if I check:
What am I doing wrong here?
e.g.
Code: Select all
pi@RPI ~ $ echo 25 > /sys/class/gpio/export
pi@RPI ~ $ echo both > /sys/class/gpio/gpio25/edge
pi@RPI ~ $ cat /sys/class/gpio/gpio25/edge
both
pi@RPI ~ $ echo 25 > /sys/class/gpio/unexport
Code: Select all
pi@RPI ~ $ echo 25 > /sys/class/gpio/export
pi@RPI ~ $ cat /sys/class/gpio/gpio25/edge
none
-
- Posts: 22
- Joined: Sunday 19 February 2017 12:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: GPIO port
Why are you doing the "unexport" ? by doing that you will loose the previous settings of the gpio port.
-
- Posts: 331
- Joined: Sunday 22 February 2015 12:19
- Target OS: Linux
- Domoticz version: 2020.x
- Location: Netherlands
- Contact:
Re: GPIO port
So it seems I thought that was necessary to give control back to the system?henrivb wrote:Why are you doing the "unexport" ? by doing that you will loose the previous settings of the gpio port.
Why does your script start with an "unexport"?
Who is online
Users browsing this forum: No registered users and 1 guest