eclipse / mraa

Linux Library for low speed IO Communication in C with bindings for C++, Python, Node.js & Java. Supports generic io platforms, as well as Intel Edison, Intel Joule, Raspberry Pi and many more.
http://mraa.io
MIT License
1.37k stars 613 forks source link

Feature Request: 1-wire support #154

Closed jmealo closed 8 years ago

jmealo commented 9 years ago

Please add 1-wire support to mraa.

It looks like it should be supported in Yocto.

Does anyone have any progress on this?

Related links: [1] http://bigdinotech.com/tutorials/galileo-tutorials/using-1-wire-device-with-intel-galileo/ [2] https://groups.google.com/forum/#!topic/wandboard/fPf1fbEj9Io [3] https://communities.intel.com/thread/56822 [4] http://owfs.org/

arfoll commented 9 years ago

You'll have to be more specific, the problem with one wire is one it's reliance on exact timings which from userspace linux is 'hard'. The other issue is that it's heavily board dependant and alot of sensors handle it differently. Hacking it as your [1] shows is trivial from mraa.

It would be interesting to have a look at how to use it from the kernel and expose that from mraa, the 1wire driver seems to however use device tree which galileo/edison does not so this would require a bit of thinking to make it work on intel boards.

akulo commented 9 years ago

how about DS18B20 support?

wawrow commented 9 years ago

I've tried using ds18b20 with edison but it seems like it wasn't switching in/out on gpio fast enough for 1wire, could probably be done with two gpios, but i haven't got a chance to try it out.

akulo commented 9 years ago

the idea is to have it somehow exposed to node.js to consume without knowing all the implementation details

mulderp commented 8 years ago

A nice example of 1-wire protocol might be the DHT-22: http://www.adafruit.com/datasheets/DHT22.pdf - the DHT series is quite popular in Arduino examples (it's very cheap), e.g. see https://www.adafruit.com/products/386

mulderp commented 8 years ago

sorry, dht-xx is not one wire: http://forum.arduino.cc/index.php?topic=253899.0

alext-mkrs commented 8 years ago

Support for 1-wire via UART was merged with a379eb7bf66a7a31a3b95b9bf239dffaaec241a6 and I think it's as close as we can get to it, given the OS we have on board.

@arfoll, do you think we can close this one as done? I would think so.

arfoll commented 8 years ago

Indeed, completely forgot this bug :) Closed!