Skip to content

Conversation

@yeyeto2788
Copy link
Contributor

Should close adafruit/Adafruit_CircuitPython_DHT#32 and also help on using other boards that RPI with external pull resistors.

If something else is needed just let me know and I'll be more than happy to help.

@ladyada
Copy link
Member

ladyada commented Dec 12, 2020

hi why not just catch the exception in the DHT library and print out a warning there? we don't want to change the behavior of setting a pull_up - it should raise an exception if using libgpiod without pull up support?

@yeyeto2788
Copy link
Contributor Author

Hey @ladyada,

I tried to catch the exception on DHT library but the pin does not get initialized even being setup as pull-up in the DHT library.

The generic pin object does not have the option to pass an argument to tell it that it will be using physical resistor.

Even passing such argument will need to add some similar conditional check againts this argument.

@ladyada
Copy link
Member

ladyada commented Dec 12, 2020

@yeyeto2788
Copy link
Contributor Author

But then on lines https://github.com/adafruit/Adafruit_Blinka/blob/master/src/adafruit_blinka/microcontroller/generic_linux/libgpiod_pin.py#L52-L63 you'll get the raise exception and it will not be initialized if "external pull-up" is passed, shouldn't it?

I can also make it be pull=None and then it will just run fine. The only thing missing is that we are not keeping track if we use external or internal resistors.

Thank you very much for your quick reply BTW.

Want me to make the changes on the DHT library then?

@ladyada
Copy link
Member

ladyada commented Dec 12, 2020

where is the pin initialized with a pullup in DHT library, we only see it assigned on the line
https://github.com/adafruit/Adafruit_CircuitPython_DHT/blob/master/adafruit_dht.py#L163

@yeyeto2788
Copy link
Contributor Author

Hey @ladyada,

You were totally right 👍🏽 my apologies for creating a not needed PR. I have file the PR on DHT library (adafruit/Adafruit_CircuitPython_DHT#56)

Regards.

P.D: Want me to close this one?

@ladyada ladyada closed this Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DHT-Blinka fail when using libgpiod

2 participants