adafruit / Adafruit_CircuitPython_BitbangIO

A library for adding bitbang I2C and SPI to CircuitPython without the built-in bitbangio module
MIT License
4 stars 10 forks source link

Add OneWire Support #8

Closed themeadery closed 4 years ago

themeadery commented 4 years ago

Will Blinka ever support OneWire like the main fork of Circuit Python? I have a DS18B20 temp sensor and many hours have gone into trying to get it to work. I'm down to writing lots of code (bitbang?) from scratch at this point. It would be nice if busio or bitbingio modules had the OneWire code in them.

ladyada commented 4 years ago

not likely soon - there's kernel support for ds18b's for linux - we recommend that! are you using like an ft232h?

themeadery commented 4 years ago

Yes, FT232H + Windows (unfortunately). I guess I could try a Linux VM.

ladyada commented 4 years ago

unlikely it will ever work - without a native 1wire peripheral you will be bit banging at 1khz, which is incredibly slow... you could try this UART-1Wire convsion method and library, then you're just using pyserial which works with the FT232H when its in uart mode https://github.com/mcsakoff/pydigitemp/tree/master/digitemp

themeadery commented 4 years ago

Well, I also have an I2C temp/hum sensor (Si7021) and wanted to control relays on the GPIO ports at the same time. A saltwater reef aquarium controller all in. So dropping down into UART mode was not an option. I had luck finally getting I2C to work with GPIO at the same time, if the DS18B20 worked I would have my waterproof tank temperature sensor and everything needed! Now I might be looking at a non-OneWire waterproof temp sensor or a Raspberry Pi. I was trying to avoid the Raspberry Pi as my computer with 16 USB ports is sitting one foot away from the aquarium!

ladyada commented 4 years ago

kk we transfered it to bitbangio which is where this would live if we did implement it!

evaherrada commented 4 years ago

hi @phorensic Were you ever able to figure out how to get this working?

themeadery commented 4 years ago

The short answer is after many hours of hacking, no. I think I will try a thermistor based solution. Then I'm just reading voltages and doing math.