GPIO export and default status at boot Topic is solved

Post Reply
gohan
Posts: 40
Joined: Tuesday 14 February 2017 0:42
Target OS: Windows
Domoticz version:
Contact:

GPIO export and default status at boot

Post by gohan » Thursday 23 February 2017 0:08

Hi
I'm running v.3.6707 on RPI3 (it is also acting as a MySensors mqtt gateway ans mqtt broker) and I wanted to connect an 8 relays board (one of those that you find on Amazon) to the GPIO and control it directly through Domoticz, so I followed the wiki and added the "gpio export PIN out" in the domoticz.sh as specified, but now those port by default turn on the relay at boot and before shutdown. Is it normal? I would like them to stay off all the time and only turn on when asked to, since i'd like to avoid to have gate that opens and lights to turn on in case of a reboot.
Also I noticed that when adding a light switch connected to one of the GPIO it has reversed logic (domoticz shows lights as on while the relay is off and vice versa): did I set up something wrong?

PS in addition I found this in the log but I didn't setup anything on GPIO22 since it is used for NRF24L01 radio for the mysensors gateway
2017-02-19 23:02:27.449 GPIO: Queuing interrupt for GPIO 22.
2017-02-19 23:02:27.449 GPIO: 1 interrupts in queue.
2017-02-19 23:02:27.449 GPIO: Too many interrupts for GPIO 22. Ignoring..
2017-02-19 23:02:27.449 GPIO: Acknowledging interrupt for GPIO 22.
2017-02-19 23:02:27.449 GPIO: Processing interrupt for GPIO 22...
2017-02-19 23:02:27.458 MySensorsMQTT: Topic: domoticz/in/MyMQTT/2/1/1/0/1, Message: 45.0
2017-02-19 23:02:27.459 (MySensor MQTT) Temp + Humidity (MEGA_TempHum)
2017-02-19 23:02:27.499 GPIO: Done processing interrupt for GPIO 22 (HIGH).
2017-02-19 23:02:27.499 (GPIO) Lighting 1 (Unknown)

And this in the error log
2017-02-22 22:18:00.674 Error: GPIO hardware (7) thread seems to have ended unexpectedly
2017-02-22 22:18:30.680 Error: GPIO hardware (7) thread seems to have ended unexpectedly
2017-02-22 22:19:00.686 Error: GPIO hardware (7) thread seems to have ended unexpectedly
2017-02-22 22:35:30.541 Error: GPIO hardware (7) thread seems to have ended unexpectedly
2017-02-22 22:44:30.784 Error: GPIO hardware (7) thread seems to have ended unexpectedly
2017-02-22 22:57:00.475 Error: GPIO hardware (7) thread seems to have ended unexpectedly
2017-02-22 22:59:30.504 Error: GPIO hardware (7) thread seems to have ended unexpectedly
2017-02-22 23:00:00.663 Error: GPIO hardware (7) thread seems to have ended unexpectedly
2017-02-22 23:00:30.669 Error: GPIO hardware (7) thread seems to have ended unexpectedly

User avatar
emme
Posts: 798
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: GPIO export and default status at boot

Post by emme » Monday 27 February 2017 13:54

a friend of mine (ciao @guantolento :lol: :lol: ) had exactely the same issue and found a fix:

sudo sh -c 'echo pin > /sys/class/gpio/export'
sudo sh -c 'echo high > /sys/class/gpio/gpiopin/direction'
sudo sh -c 'echo 1 >/sys/class/gpio/gpiopin/active_low'

BCM pinout numbering ;)
That's one small step for a programmer, one giant leap for me!
- - - - -
Raspberry Pi3 + AeonStick G5 + RFXCOMM433 + iRTrans Server + NodeJS
There's no stress in the mess!!

gohan
Posts: 40
Joined: Tuesday 14 February 2017 0:42
Target OS: Windows
Domoticz version:
Contact:

Re: GPIO export and default status at boot

Post by gohan » Saturday 20 May 2017 11:52

Using these commands I don't get the relays switching on during reboot but I can't get the reverse behavior with the last command
sudo sh -c 'echo 1 >/sys/class/gpio/gpiopin/active_low'
even if I actually see that the active_low file in the folder containing the number 1

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest