Comments (16)
Unit test code merged. This W1 impl is now available in the latest 1.1-SNAPSHOT build. Thanks!
from pi4j-v1.
I implemented an example in JAVA using the modprobe driver and reading from the file. Just like the article. At least I could read temperature values in a Raspberry pi :-)
I hope it helps.
from pi4j-v1.
I would suggest an static function for listing all available wired devices as an Array or List.
Adem
from pi4j-v1.
Schups code looks fine, but it is a few months old. Until now there has been no reaction on his merge request... Is there a chance, that it will get merged soon or got this issue postponed for a specific reason?
from pi4j-v1.
I've only got active now (someone was of impression that he's following this project while he wasn't). I'll go through the code over weekend and do the necessary. Sorry for the delay...
from pi4j-v1.
BTW, it will get merged into the 'develop' branch which means that it will be available in the 1.1-SNAPSHOT builds.
from pi4j-v1.
Seems to take some more weekends? ;-)
Could we help in some way? Is there something that needs to be improved (apart from some javadoc comments) before it could be merged?
from pi4j-v1.
All help appreciated. Do you know how to lay laminate? Or at least remove existing tiles from kitchen floor? I think I got confused by Robert's message thinking he has already done it. Will start looking into it tonight. Sorry about it.
from pi4j-v1.
I think I could learn it on-the-fly. But free support for such tasks is limited to Berlin! ;-)
from pi4j-v1.
OK. I've skimmed through Schups's code and I am not 100% sure what to do. Code itself is fine and I'll pull b76d065 and f16c54c - it will, at least buy us some time. Only thing is that it, probably, will be just WIP or initial (working) starting point for One Wire interface.
My only problem is that it doesn't (at this moment) capture 'idea' of 1-wire interface and in this format I cannot see it being implemented with simple bit banging through GPIO. TmpDS18B20 class, for instance, must be tied to a file (direct, one of, implementations of 1-wire protocol through kernel driver). I would be more interested seeing something closer to the low level driver which, then can be implemented through /sys file system (as here) or bit banging or ... whatever is there. Implementation for test it third one I can envisage here. Still good place to start all with! Thanks Schups :)
BTW 9f59171 doesn't go under 1-wire protocol. Maybe it should be pulled after reviewed by Robert...
from pi4j-v1.
I agree - native implemenation of the 1-wire protocol would be nice.
Unfortunately I don't know the interals of the 1-wire protocol.
I've sumitted the merge request to get some feedback on the implementation and if the general approach would be good enough for now.
It is WIP :-)
The code is not really documented and well tested. Since the DS18B20 sensor is the only 1-wire device I have ever used there may be some specifics that wouldn't work well with other devices.
9f59171 - I merged the development branch back in to make sure it isn't breaking anything.
I would suggest to not merge the feature branch until has stabilized a bit more :-)
Cheers,
Peter
from pi4j-v1.
I've made implementation of one wire protocol some 20 years ago for 8031 (8051) µControllers and there are some resources on the internet (oh, what a understatement), so I don't mind looking more into it when time allows... And I hope it is going to be soon as I would like to use RPi + 2x1820 (or newer equivalent) soon as replacement for my hot water/heating controller.
Anyway - you've tested your code with real device and it works - that's really good start! :)
Will merge it as soon as return from the business trip.
from pi4j-v1.
Of course a bit-banging implementation might be nice but kernel support on the other side might be more efficient?!
The DHT11 or DHT22 sensors for example (which would be my next feature requests) uses a single dataline but with another manchester-like protocol. I saw multiple implementations for it without kernel support. The python implementations have a lot of read fails due to the timing. C implementations perform much better but still can have read fails. W1 might have the same issue?! Therefore a kernel support would be a better working solution, wouldn't it?!
from pi4j-v1.
There's nothing wrong relying on kernel support and I see implementation of one wire protocol that users that particular kernel module as a primary implementation. But API (java interfaces) shouldn't really be kernel module specific (i.e. talking about exposed files) but to expose higher (lower?!) level functions one wire protocol itself defines. They will nicely translate to kernel module implementation, but at the same time allow other implementations and ability to move to other platforms(), too.
DHT11/22 protocol API should be specification agnostic, too. Maybe we can start with C implementation (and JNI bridge to it) and see if anyone comes up with a kernel module, too. That would allow us to move from one implementation (which might not be ideal) to better one later without breaking compatibility of systems using it.
() Server API defined pi4j works perfectly on Lejos and Haiku - not as a fully fledged pi4j port but more like cut down hacked version... Still code that works on pi4j (and uses Server API) works perfectly without any changes on those platforms because API is implementation agnostic...
from pi4j-v1.
Done. Again, apologies for not have done it sooner. Your code is now in develop branch. See pull request comments for failing tests..
from pi4j-v1.
Hi @savageautomate,
I'd just like to point out that WiringPi includes the driver for the MaxDetect series 1-wire sensors:
https://github.com/WiringPi/WiringPi/blob/master/devLib/maxdetect.c
It might be nice including it in Pi4J too :)
I'll let you decide if it is worth having it as an enhancement...
Cheers,
Giampiero
from pi4j-v1.
Related Issues (20)
- Where is the PCA9685 code? HOT 3
- Published artifacts have class file version incompatible with JDK 8
- Parity bit is not sent with 1.4 on serial0 rpi4 HOT 1
- Computer Module 4 IO board Pinout issue
- PCA9685 servo question: setAlwaysOff sometimes makes the servo jump to zero position HOT 3
- Could be posible to manage Baud of 5800 on Serial0
- NoClassDefFoundError com/pi4j/io/gpio/gpiofactory HOT 5
- Not able to use spi in emteria.os
- Serial Port won't open HOT 5
- Can I use this library for other boards? HOT 2
- dependency on javax.xml.bind makes it impossible to jlink on JDK 11 HOT 3
- Question - change pinMode of GpioPinDigitalMultipurpose HOT 1
- [Question] serial control signals physical pins HOT 2
- J8 pin Different HOT 1
- PCIe x1 connector HOT 3
- Sorry, not something I can answer as the Pi4J project doesn't provide PCIE access.
- Serial buffer waits 100ms before letting me "read()" the bytes
- problem with openhab on pi4: not handling mcp23017 HOT 1
- vcgencmd is in /usr/bin on some systems - can you check this if /opt/vc.... isn't there
- Cannot run program "/opt/vc/bin/vcgencmd"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pi4j-v1.