iobroker-community-adapters / ioBroker.rpi2

RPI-Monitor Adapter for ioBroker
MIT License
11 stars 12 forks source link

Configure internal Pull UP/Down Resistor #31

Open TBobsin opened 4 years ago

TBobsin commented 4 years ago

Hello, i found no comment about the internal resistors and how they are set with rpi.2

It shoult be possible to configure the Resistor to Pull up or down when i set an GPIO as Input

Please Dokument how the resistor ist set in the actual Version.

volkerverkamp commented 4 years ago

I have the same question/request - are there any news on this?

raintonr commented 3 years ago

I am preparing a pull request for #30 that will add this feature.

raintonr commented 3 years ago

This was merged with #48 and can be closed.

raintonr commented 1 year ago

Ah... in fact I am going to re-open this because although rpi_gpio_buttons has a usePullUp option this doesn't actually control pull up/down hardware configuration.

To correctly implement this would need a change in the underlying rpi-gpio package as per https://github.com/JamesBarwell/rpi-gpio.js/issues/71

DrThriller commented 1 year ago

Normally the GPIOs inputs are pulled to low, accept when I set them all to high in the settings, right? Or are the inputs normally undefined?

raintonr commented 1 year ago

Sadly all this setting does is logically NOT the input. It doesn't actually configure the hardware.

I have actually given up on this adapter as it's just as easy to write your own script and run inside Javascript adapter. Eg. install rpio module in Javascript adapter settings and do something like...

const rpio = require('rpio');

// Use GPIO numbers *NOT* pin numbers
rpio.init({ mapping: 'gpio' });

// Configure hardware GPIO internal pull up
rpio.open(23, rpio.INPUT, rpio.PULL_UP);

// Start polling
rpio.poll(23, () => { /* Called when GPIO23 changes */ });

FYI, pigpio also works well here.

Garfonso commented 3 weeks ago

Yes, this is still missing. Currently (since libgpiod is mandatory on newer raspian versions) this is blocked by an issue on the library we use: https://github.com/ExplorationSystems/opengpio/issues/1