```
sudo systemctl daemon-reload
```
-Now that Remote GPIO is enabled, get the daemon going:
+Now that Remote GPIO is enabled, get the daemon going (even if installed with apt-get):
```
sudo systemctl enable pigpiod
sudo systemctl start pigpiod
In openHAB, set `host` to the address of the pi and the `port` to the port of pigpio (default: 8888).
+Note: If you are running Pigpio on same host as openHAB, then set host to **::1**.
+
## Channels
### Pigpio Remote
Set the number of the pin in `gpioId`.
If you want to invert the value, set `invert` to true.
To prevent incorrect change events, you can adjust the `debouncingTime`.
+Using `pullupdown` you can enable pull up or pull down resistor (0 = Off, 1 = Pull Down, 2 = Pull Up).
### GPIO digital output channel
Thing gpio:pigpio-remote:sample-pi-2 "Sample-Pi 2" [host="192.168.2.37", port=8888] {
Channels:
Type pigpio-digital-input : sample-input-3 [ gpioId=16, debouncingTime=20]
- Type pigpio-digital-input : sample-input-4 [ gpioId=17, invert=true, debouncingTime=5]
+ Type pigpio-digital-input : sample-input-4 [ gpioId=17, invert=true, debouncingTime=5, pullupdown=2]
Type pigpio-digital-output : sample-output-2 [ gpioId=4, invert=true]
}
```
if (gpioId == null) {
throw new NoGpioIdException();
}
- gpio = new GPIO(jPigpio, gpioId, 1);
+ gpio = new GPIO(jPigpio, gpioId, JPigpio.PI_INPUT);
jPigpio.gpioSetAlertFunc(gpio.getPin(), (gpio, level, tick) -> {
lastChanged = new Date();
Date thisChange = new Date();
scheduler.schedule(() -> afterDebounce(thisChange), configuration.debouncingTime, TimeUnit.MILLISECONDS);
});
+ Integer pullupdown = configuration.pullupdown;
+ jPigpio.gpioSetPullUpDown(gpio.getPin(), pullupdown);
}
private void afterDebounce(Date thisChange) {
<default>10</default>
<advanced>true</advanced>
</parameter>
+ <parameter name="pullupdown" type="integer" min="0" max="2">
+ <label>Pull Up/Down Resistor</label>
+ <description>Configure Pull Up/Down Resistor of GPIO pin</description>
+ <options>
+ <option value="0">Off</option>
+ <option value="1">Pull Down</option>
+ <option value="2">Pull Up</option>
+ </options>
+ <limitToOptions>true</limitToOptions>
+ <default>0</default>
+ </parameter>
</config-description>
</channel-type>