[351] SysFS Linux GPIO
Posted: Thursday 25 June 2015 11:28
Creating thread as requested in tracker: http://www.domoticz.com/forum/tracker.php?p=2&t=351
GPIO States can be read and changed via filesystem layer: /sys/class/gpio/gpioXX/value without requiring specific additional GPIO libraries for hardware already supported by any modern Linux Kernel. When supported by the hardware Interrupts can be used with these devices to trigger changes without polling.. I dont know if there is any good way to tell if a GPIO will work wit interrupts so it will likely need to be a configurable option (polling vs interupt)
IMHO the current GPIO support needs to abandon the WiringPI Libraries which are applicable to only PI devices and go straight for GPIO access without additional libraries.. Setting up SysFS should be done externally from domoticz and it should use what ever is available.
the gpio paths should be able to be mapped to header labels, this could be as simple as an alias name within the UI.. such as gpio27 = P8_12
SysFS also supports PWM Outputs via run, duty_ns and period_ns files, in domoticz these could be the equivalent of GPIO "Dimmers"
I believe this to be critical functionality that is missing from Domoticz, with proper support anything that can run linux with GPIO's could be utilized as a Domoticz server/node, limited to only what the kernel supports.. for example i2c or spi IO expanders
GPIO States can be read and changed via filesystem layer: /sys/class/gpio/gpioXX/value without requiring specific additional GPIO libraries for hardware already supported by any modern Linux Kernel. When supported by the hardware Interrupts can be used with these devices to trigger changes without polling.. I dont know if there is any good way to tell if a GPIO will work wit interrupts so it will likely need to be a configurable option (polling vs interupt)
IMHO the current GPIO support needs to abandon the WiringPI Libraries which are applicable to only PI devices and go straight for GPIO access without additional libraries.. Setting up SysFS should be done externally from domoticz and it should use what ever is available.
the gpio paths should be able to be mapped to header labels, this could be as simple as an alias name within the UI.. such as gpio27 = P8_12
SysFS also supports PWM Outputs via run, duty_ns and period_ns files, in domoticz these could be the equivalent of GPIO "Dimmers"
I believe this to be critical functionality that is missing from Domoticz, with proper support anything that can run linux with GPIO's could be utilized as a Domoticz server/node, limited to only what the kernel supports.. for example i2c or spi IO expanders