Help! GPio, 8 relays...
Moderator: leecollings
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Help! GPio, 8 relays...
I have one small problem i guess.
RaspBerry 2B + 8 Channel Relays Module
Everything is working, all 8 relays are doing its job, but its working in the wrong direction.
Ofcourse i've made the gpio settings in the scripts (gpio export 17 out, etc) and i've made 2 relays in Domoticz, for testing.
When the raspi is starting up, all relays going to ON with a lot of noise and in Domoticz they are OFF while the leds are on.
When i click to OFF they are going to ON, and viceversa..
And, how to setup the relays to stay OFF while booting, now they going all to ON while the state in domoticz is OFF?
Thank you.
RaspBerry 2B + 8 Channel Relays Module
Everything is working, all 8 relays are doing its job, but its working in the wrong direction.
Ofcourse i've made the gpio settings in the scripts (gpio export 17 out, etc) and i've made 2 relays in Domoticz, for testing.
When the raspi is starting up, all relays going to ON with a lot of noise and in Domoticz they are OFF while the leds are on.
When i click to OFF they are going to ON, and viceversa..
And, how to setup the relays to stay OFF while booting, now they going all to ON while the state in domoticz is OFF?
Thank you.
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
-
- Posts: 115
- Joined: Sunday 11 January 2015 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Help! GPio, 8 relays...
That is the way the relay board works. The relay board is 'active low' (relay active when signal is grounded, while the pi is active high (3,3v = On, 0v = Off).
There is a way to fix that, but you have to desolder the resistors and diodes on the relay board and solder some new resistors and bridges. Do you have a picture of the relay board?
There is a way to fix that, but you have to desolder the resistors and diodes on the relay board and solder some new resistors and bridges. Do you have a picture of the relay board?
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: Help! GPio, 8 relays...
Well, i'm a technician so i know how a relais works, but... It's working "spiegelbeeld"?
the state of the relais is ON while in domoticz the state is OFF.
Also, all relais are going to ON while booting up the raspi. I don't think thats the way it has to be.
Ofcourse:
the state of the relais is ON while in domoticz the state is OFF.
Also, all relais are going to ON while booting up the raspi. I don't think thats the way it has to be.
Ofcourse:
-
- Posts: 115
- Joined: Sunday 11 January 2015 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Help! GPio, 8 relays...
This board isn't designed to be used with the pi. It needs ground to switch the relay on. The pi is grounded when off and 3,3v when on. That is why it acts reversed.
Here is what I did:
I removed the led and the lower resistor. I soldered in a bridge and a 100 Ohm resistor as in the first picture. You have to do this for all 8 relays! I put the jumper between ground and vcc (second picture). 5v from the pi is connected to jd-vcc. The vcc pin on the left pinrow is unused (I cut it away).
Here is what I did:
I removed the led and the lower resistor. I soldered in a bridge and a 100 Ohm resistor as in the first picture. You have to do this for all 8 relays! I put the jumper between ground and vcc (second picture). 5v from the pi is connected to jd-vcc. The vcc pin on the left pinrow is unused (I cut it away).
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: Help! GPio, 8 relays...
Oh gosh.. Its what they said on the website, thats it fully worked with the arduino AND raspberry..
Perhaps, it IS working, only in the wrong direction. It seems like a software (reversed) issue/protocol.
Now i can use this relaisboard, if i use the nc/no relais in reversed state, but thats not the way it should be ofcourse.
Grrrrr, why they sell it if it isnt designed to work with a raspi?
Perhaps, it IS working, only in the wrong direction. It seems like a software (reversed) issue/protocol.
Now i can use this relaisboard, if i use the nc/no relais in reversed state, but thats not the way it should be ofcourse.
Grrrrr, why they sell it if it isnt designed to work with a raspi?
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Help! GPio, 8 relays...
You could also look at a Ethernet relay board like this user has: http://domoticz.com/forum/viewtopic.php?f=17&t=5984
A bit more expensive than the board you have now, but the Ethernet one has the benefit that it doesn't need to be connected directly to the Pi. Thus, it can be placed anywhere as long as it can be connected to the Pi through network.
A bit more expensive than the board you have now, but the Ethernet one has the benefit that it doesn't need to be connected directly to the Pi. Thus, it can be placed anywhere as long as it can be connected to the Pi through network.
I am not active on this forum anymore.
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: Help! GPio, 8 relays...
Looks cool ThinkPad, thanks..ThinkPad wrote:You could also look at a Ethernet relay board like this user has: http://domoticz.com/forum/viewtopic.php?f=17&t=5984
A bit more expensive than the board you have now, but the Ethernet one has the benefit that it doesn't need to be connected directly to the Pi. Thus, it can be placed anywhere as long as it can be connected to the Pi through network.
The reason i need a fully functional 'oob' board, is because i want to (make and) test a fully operational sun-controller (for heatpipes) and/or also do some heating stuff..
Maybe its done before, maybe it doesnt, but i guess it is not impossible?
Want to use some code in domoticz (temperatures and stuff) and open/close some relays related to temperatures to turn on pumps, a valve and stuff?
Let me clearify some stuff>
I have, 1 collector pump
1 heating system (atag Q)
1 3 way valve, to send return water trough boiler (when boilertemp is > then system return temp) or otherwise trough the atag heating (gas)
1 electronic heat (3.2kwh) to warm up a 1000 liter boiler (at night) - We also have 43 pv panels to make power at day to use at night (for the electric heater as example)
Last edited by BarryT on Wednesday 08 April 2015 13:46, edited 2 times in total.
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: Help! GPio, 8 relays...
Although more expensive it's worth taking a look at Devantech Relay Boards. I use the Eth008 8 channel Relay Board. It's reliable and easy to make work with domoticz using simple HTTP commands. The Eth020 has "Hardware" already defined within Domoticz.
I use it to:-
Turn my heating thermostat from Occupied to Non-Occupied.
Operate a modified RF Remote to control my ceiling fan - On / Off / reverse.
Operate a Velux Interface for my roof windows.
I use it to:-
Turn my heating thermostat from Occupied to Non-Occupied.
Operate a modified RF Remote to control my ceiling fan - On / Off / reverse.
Operate a Velux Interface for my roof windows.
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: Help! GPio, 8 relays...
Awesome Stan! But there is one problem.StanHD wrote:Although more expensive it's worth taking a look at Devantech Relay Boards. I use the Eth008 8 channel Relay Board. It's reliable and easy to make work with domoticz using simple HTTP commands. The Eth020 has "Hardware" already defined within Domoticz.
I use it to:-
Turn my heating thermostat from Occupied to Non-Occupied.
Operate a modified RF Remote to control my ceiling fan - On / Off / reverse.
Operate a Velux Interface for my roof windows.
It needs to be wireless, or placed by/on the raspi otherwise i cant use it.
The raspberry is completely wireless include a zwave v2 stick (for metering electra/gas/water), and placed into the main heating room where also my boiler stands.
The only thing that i have is the powercable ofcourse.
There is also no planning of making a ethernet cable trough the house, or install a second wifi switch due some reasons.
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: Help! GPio, 8 relays...
https://www.youtube.com/watch?v=9T10hyfSri8
Here you can see what i mean..
If it doesnt work then i have to send these boards back to the seller, and tell him its not working for raspberry!
Here you can see what i mean..
If it doesnt work then i have to send these boards back to the seller, and tell him its not working for raspberry!
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
-
- Posts: 115
- Joined: Sunday 11 January 2015 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Help! GPio, 8 relays...
Barry, can't you do the modification as I did? Works like a charm.
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: Help! GPio, 8 relays...
Hi Ray,RayAmsterdam wrote:Barry, can't you do the modification as I did? Works like a charm.
it is a option to do but i wish i had more time to do it..
i dont want to do some modification because i want to buy a lot more of some stuff so i really need board that works oob with raspberry.
i just dont have the time to solder on the circuits, i just want to 'plug and play' so its up and running in some minutes
this is just a start, many things more to come!
*edit if it works like the way it should be ofcourse.. haha
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Help! GPio, 8 relays...
For this kind of setup i wouldn't let it control entirely by Domoticz. Too much risks when Domoticz freezes (which isn't a very uncommon condition unfortunately).
This is more a task for a PLC or so... or if you dare to take the risk and want to build it cheap: Arduino
Domoticz is too clumsy for a setup you want to rely on. For this you need some setup which is much more low-level and doesn't run a fullblown OS like a Pi. And which can also run the same code over and over again, 24/7
This is more a task for a PLC or so... or if you dare to take the risk and want to build it cheap: Arduino
Domoticz is too clumsy for a setup you want to rely on. For this you need some setup which is much more low-level and doesn't run a fullblown OS like a Pi. And which can also run the same code over and over again, 24/7
I am not active on this forum anymore.
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: Help! GPio, 8 relays...
ahwww..ThinkPad wrote:For this kind of setup i wouldn't let it control entirely by Domoticz. Too much risks when Domoticz freezes (which isn't a very uncommon condition unfortunately).
This is more a task for a PLC or so... or if you dare to take the risk and want to build it cheap: Arduino
Domoticz is too clumsy for a setup you want to rely on. For this you need some setup which is much more low-level and doesn't run a fullblown OS like a Pi. And which can also run the same code over and over again, 24/7
i already have 3 pi's running with (on 2 of them) the latest beta of domoticz, and they running for several days/weeks now without problems so far...
1 for logging temperatures (heating/water) with DS18B20 sensors, 1 for metering stuff like electra/gas through the zwave, and 1 (this one) for building/testing stuff.
the only problem so far was when rebooting my system (router/modem/etc) it has no re-connection to the wifi, but that has been solved by the "ifupdown.original" code..
so arduino is better for a stable system, then rpi running domoticz, to make an ethernet accessible controller, for logging and stuff?
beat me, then i'm lost! ha
i thought it was a great idea to do it through the rpi/domoticz hardware / interface because i can do some other tricks (like lights and stuff) to..
didnt work with arduino so far
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: Help! GPio, 8 relays...
Btw, the boards i used are raspberry pi 2 model b, and they look very stable so far. really nice, smooth and fast board anyway!
but a question is on my mind: What can go wrong, and why can a rpi/domoticz hang, what is the reason?
I have no other hardware attached, only the zwave and a usb wifi stick.
since it is the linux core, there are not many things that could go wrong?
i have a very good sd card, and ofcourse an 2A power supply, if that make any sence..
but a question is on my mind: What can go wrong, and why can a rpi/domoticz hang, what is the reason?
I have no other hardware attached, only the zwave and a usb wifi stick.
since it is the linux core, there are not many things that could go wrong?
i have a very good sd card, and ofcourse an 2A power supply, if that make any sence..
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: Help! GPio, 8 relays...
It's solved!!
This did the trick, and everything is working like it should be, include the relais state stay OFF on powerup boot... >
In /etc/init.d/domoticz.sh
sudo sh -c 'echo # > /sys/class/gpio/export'
sudo sh -c 'echo high > /sys/class/gpio/gpio#/direction'
sudo sh -c 'echo 1 > /sys/class/gpio/gpio#/active_low'
Where # is gpio pin.
*Edit The only thing needed to do was to enter the codes all up in the startupscript, domoticz.sh
I was entering it into the latest line, so when domoticz started up it didnt see the gpio ports.
Now it does, and everything works!
Happy!
This did the trick, and everything is working like it should be, include the relais state stay OFF on powerup boot... >
In /etc/init.d/domoticz.sh
sudo sh -c 'echo # > /sys/class/gpio/export'
sudo sh -c 'echo high > /sys/class/gpio/gpio#/direction'
sudo sh -c 'echo 1 > /sys/class/gpio/gpio#/active_low'
Where # is gpio pin.
*Edit The only thing needed to do was to enter the codes all up in the startupscript, domoticz.sh
I was entering it into the latest line, so when domoticz started up it didnt see the gpio ports.
Now it does, and everything works!
Happy!
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
-
- Posts: 1
- Joined: Tuesday 26 May 2015 3:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Location: Albacete (Spain)
- Contact:
Re: Help! GPio, 8 relays...
Please where exactly in startup script of domitcz.sh i should be putting this code-edited for my gpio pins?
I tried several places.
Could you paste an example? It would be awsome.
Its very important relays dont turn on on reboot as its controlling my garage door..
I tried your solution and:
sudo sh -c 'echo 22 > /sys/class/gpio/export'
sudo sh -c 'echo out (Instead of HIGH)> /sys/class/gpio/gpio22/direction'
sudo sh -c 'echo 1 > /sys/class/gpio/gpio22/active_low'
And also:
sudo sh -c 'echo 22 > /sys/class/gpio/export'
sudo sh -c 'echo out > /sys/class/gpio/gpio22/direction'
sudo sh -c 'echo 1 > /sys/class/gpio/gpio22/value'(Instead of active_low)
Any help would be much appreciated
I tried several places.
Could you paste an example? It would be awsome.
Its very important relays dont turn on on reboot as its controlling my garage door..
I tried your solution and:
sudo sh -c 'echo 22 > /sys/class/gpio/export'
sudo sh -c 'echo out (Instead of HIGH)> /sys/class/gpio/gpio22/direction'
sudo sh -c 'echo 1 > /sys/class/gpio/gpio22/active_low'
And also:
sudo sh -c 'echo 22 > /sys/class/gpio/export'
sudo sh -c 'echo out > /sys/class/gpio/gpio22/direction'
sudo sh -c 'echo 1 > /sys/class/gpio/gpio22/value'(Instead of active_low)
Any help would be much appreciated
-
- Posts: 36
- Joined: Tuesday 07 July 2015 12:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Help! GPio, 8 relays...
BarryT, Any update with that? I run these relays too and I would like to invert values. Could you give us an example how to manage to do that?
RPI2 + RFLink + PiFace D2 + Aeon Z-Wave Gen5 + Foscams FI9821P&R2 + MySensors + UPS APC Back-UPS 950VA
RPI2 + RFXtrx433e + Foscams FI9821P + MySensors + UPS APC Back-UPS 950VA
RPIB+ + TP-Link MR3420 + Huawei E173 GarageDomoticz :)
RPI2 + RFXtrx433e + Foscams FI9821P + MySensors + UPS APC Back-UPS 950VA
RPIB+ + TP-Link MR3420 + Huawei E173 GarageDomoticz :)
-
- Posts: 2
- Joined: Saturday 30 August 2014 16:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Belgium
- Contact:
Re: Help! GPio, 8 relays...
Or just buy this active high board as i did (replaced 3 active low boards, if anyone needs one let me know )
http://www.ebay.com/itm/191294891032
Replace the active low with this one and you don't need to modify, Cut or solder anything
http://www.ebay.com/itm/191294891032
Replace the active low with this one and you don't need to modify, Cut or solder anything
-
- Posts: 34
- Joined: Saturday 31 October 2015 14:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Help! GPio, 8 relays...
Hi guys,
I just found this.. https://docs.google.com/file/d/0B5-HND9 ... VyODA/edit on http://www.sainsmart.com/8-channel-dc-5 ... logic.html
Maybe it should be useful for you...
I just found this.. https://docs.google.com/file/d/0B5-HND9 ... VyODA/edit on http://www.sainsmart.com/8-channel-dc-5 ... logic.html
Maybe it should be useful for you...
Who is online
Users browsing this forum: No registered users and 0 guests