Problem getting GPIO to work
Posted: Thursday 11 July 2019 16:15
I have just made a new installation of Domoticz on Raspbian Stretch, but for some reason or another I cannot make GPIO to work.
I have done the standard installation, after doing sudo apt udate and upgrade.
I have edited the /etc/init.d/domoticz.sh and defined the ports needed for my setup
Then I have made script for dzVents
14 GPIO 30E0E03 6 VarmeBad Lighting 2 AC On
18 GPIO 30E0E03 12 BadAv Lighting 2 AC Off
This works like a dream on another system, and seems to work on this system, the events will be trapped and the switches change status, but when I check the pins on my RPi, the status is never changed, so I must have done something wrong. Problem is I cannot check the other system, since it is on a location 200 km from where I am now.
The problem must be inside domoticz, since it works like a dream usin Gpio from Node Red.
I have done the standard installation, after doing sudo apt udate and upgrade.
I have edited the /etc/init.d/domoticz.sh and defined the ports needed for my setup
Code: Select all
gpio export 4 out
gpio export 14 out
gpio export 17 out
sudo sh -c "echo '1' >> /sys/class/gpio/gpio4/active_low"
sudo sh -c "echo '1' >> /sys/class/gpio/gpio14/active_low"
sudo sh -c "echo '1' >> /sys/class/gpio/gpio17/active_low"
Code: Select all
return {
on = { timer = { 'every minute' } },
execute = function(domoticz)
local Sensor = domoticz.devices(5) -- Temperature
local SETPOINT = domoticz.devices(2) -- SetPoint
SETPOINT.updateSetPoint(SETPOINT.setPoint) -- This will refresh the setPoint with current value
if (Sensor.temperature <= (SETPOINT.setPoint - 0.2)) then -- turn on heat
domoticz.devices(14).switchOn().checkFirst()
domoticz.devices(18).switchOff().checkFirst()
elseif (Sensor.temperature >= (SETPOINT.setPoint + 0.2)) then -- turn off heat
domoticz.devices(14).switchOff()
domoticz.devices(18).switchOn().checkFirst()
else
-- within hysteresis range
end
end
}
18 GPIO 30E0E03 12 BadAv Lighting 2 AC Off
This works like a dream on another system, and seems to work on this system, the events will be trapped and the switches change status, but when I check the pins on my RPi, the status is never changed, so I must have done something wrong. Problem is I cannot check the other system, since it is on a location 200 km from where I am now.
The problem must be inside domoticz, since it works like a dream usin Gpio from Node Red.