I am please to announce that r1045 contains PiFace support
Upto 4 pifaces can be used (maximum possible)
Functions:
Inputs:
Changes (when applicable) are reported to Domoticz at 100 msec rate
Configuration options: (thru configuration file)
Level,
rising edge (button press)
falling edge (button release)
Inverted level
Output:
The following options for output state reporting are possible, HOWEVER Domoticz does not seem to like anything else than Level, have to figure out why...
Configuration options:
Level,
rising edge (button press)
falling edge (button release)
Inverted level
Counters:
Can be enabled on ALL inputs and outputs.
For the inputs hardware edge detection is used, for the outputs software edge detection is used @ the input report rate. (both are rising edge)
The hardware registers are sampled every 20 msec (at least that is the intention...

Tests @ 5Hz showed an error rate of approx 0.5- 0.7% (tested with 40000 and 185000 counts, with 50/50 and 30/70 duty cycles, tested with 3 parallel connected inputs)
Tests @ 10Hz showed an error rate of approx 3.3 - 3.7 % (avg 3.4 %) (tested with 40000 and 87000 counts, with 50/50 duty cycles)
Initial test @ 20Hz showed an error rate near 10%
The encountered errors are due to kernel / userland switches and the linux multitasking mechanism, and are the best achievable.
The PiFace driver works as follows:
- Enable spi-bcm2708 module in /etc/modprobe.d/raspi-blacklist.conf (put a # before blacklist)
- Reboot
- Put a piface.conf configuration file in the domoticz program folder, needed if the default config (see later on) needs to be changed.
- Select PiFace from hardware dialog
- Goto devices screen and add devices..
PiFace devices and numbering:
Enabled I/O ports will be reported as a lighting 1 (impuls) device.
The ID field will show if a pin is a input (I) or output (O).
The Unit field will show the PiFace board, and pin number. The decade number ID's the PiFace board, the unit number the pin number.
So Unit 25 = PiFace Board address 2, and pinnumber 5 (pincount starts at 0)
Enabled Counters will be reported as a RFXMeter.
The ID field will show the PiFace address, Pintype, and Pinnumber.
The hundreds tell if a pin = input or output (input = 1xx, output 0xx)
The decades = address of the PiFace board
The unit number = pinnumber
The default configuration (without a piface.conf):
Input 0-3 (the buttons) enabled, with rising edge toggle (button press), counters disabled
Input 4-7 disabled, counters enabled with 10 seconds update time
Outputs 0-7 enabled, with level, counters enabled with 10 seconds update time
All can be changed with the piface.conf (a basic version for address 0 is included in r1045).
Enjoy...
Any remarks, questions etc., please place them in this topic.
Best Regards,
Robin