Menu

#11 Using simultaneous to read all thermometers at once

v1.0_(example)
open
nobody
None
1
2014-12-12
2013-10-27
Anonymous
No

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.

Discussion

  • Anonymous

    Anonymous - 2014-12-12

    It looks like you're writing an integer 1 (0x01). You should write the character '1' (0x31).

     
  • Anonymous

    Anonymous - 2014-12-12

    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