On 12/10/2010 03:45 PM, Chris G wrote:
> I have my owfs server running with USB master device:-
>
> /opt/owfs/bin/owfs -u -m /mnt/1-wire/
>
> This works fine and creates appropriate directories in /mnt/1-wire/
> where I can see the data from my temperature sensors.
>
> How then do I use owdir, owread, etc. to actually read the data? They
> seem to need a port number among other things and I don't see how I can
> know the port number that owfs is using.
Oh, by the way, if you only want to read the data then you may not need
to mess with owserver -- just open the appropriate temperature file and
read from it. From shell scripts it is a simple as using cat:
$ cat /owfs/28.6618A2020000/temperature; echo
16.5625
If using some other scripting language, you can do something like (this
example is for Perl):
if (!open SENSOR, "/owfs/28.6618A2020000/temperature") {
print STDERR "Can't open temperature file: $!\n";
exit 1;
}
my $temperature = <SENSOR>;
close SENSOR;
$temperature =~ s/ *//; # " 82.7375" -> "82.7375"
# Do something with $temperature
Cheers,
Eloy Paris.-
------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers