Problem getting GPIO to work

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
ulfh2018
Posts: 65
Joined: Sunday 11 November 2018 9:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Oslo
Contact:

Problem getting GPIO to work

Post by ulfh2018 »

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

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"
Then I have made script for dzVents

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
}
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.
Shanep
Posts: 3
Joined: Monday 21 January 2019 16:52
Target OS: Windows
Domoticz version:
Contact:

Re: Problem getting GPIO to work

Post by Shanep »

ulfh2018 wrote: Thursday 11 July 2019 16:15 I have just made a new installation of Domoticz on Raspbian gimp freejobalert notepad++ Stretch, but for some reason or another I cannot make GPIO to work.
The problem must be inside domotizc, since it works like a dream usin Gpio from Node Red
.
Facing similar issues here too. Some help is massively appreciated.

Thanks in advance,
Regards,
Shane
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest