I have written a small Java application to read 10 DS18B20 (powered) at any chosen resolution using OWFS.
I cannot get the "simultaneous" function to work. The code is :
FileOutputStream ThermoFile_OutputStream = new FileOutputStream("/mnt/1wire/simultaneous/temperature");
DataOutputStream ThermoFile_OutputData = new DataOutputStream(ThermoFile_OutputStream);
int x = 1;
ThermoFile_OutputStream.write(x);
On the .write(x) I get error message "Simu write Error message was : Invalid argument"
What am I doing wrong ?
In addition, how does the API know at which resolution todo the reads... Does the API wait for the next cached read and use the chosen resolution (eg when reading 28.xxx/temperature9 for 9 bit) or does it just default out to max 12 bit resolution.
Any help would be greatly appreciated.
It looks like you're writing an integer 1 (0x01). You should write the character '1' (0x31).
You have to write an ascii string '1' (0x31), not raw binary data (0x01).
Writing to /simultaneous/temperature triggers a conversion at the same setting at which the latest single conversion on the particular chip has been done at. The power-on default for DS18B20 is 12 bits.
Last edit: Jan Kandziora 2014-12-12