Fuse & owfs question

lylegiese

New Member
I am new to 1 wire, but not computers and sensors and Linux. I purchased some stuff from Hobby-board and am starting to setup and plan my sensor network.

I setup fuse and owfs to interface the sensor network and I have the serial port interface and the 6 channel hub to power the sensors.

It appears to be working, but my question revolves more around access via owfs. What happens if two seperate processes want to get a reading from the same sensor at about the same time. I bring this up as there appears to be a delay when you open temperature until you get the answer. So it appears that OWFS actually goes out and polls the sensor and returns the current reading. That takes a long time(in cpu cycles). And what happens when a second process asks the same question?

I am working with Perl and open a filehandle to read the sensor. So I can certainly see where a second read could take place before the first one is complete. So what happens to the second request?

Thanks,
Lyle
 
I've been wanting to learn more about owfs, so I figured this was as good an excuse as any.

I found this PDF that repeatedly makes the assertion that it works. That said, it doesn't really say how.

What it does do, as does the overview on the OWFS sourceforge site, is indicate that owfs is no longer the best way to get at the 1-wire data from perl. Best I can tell, The perl ow bindings directly link to owserver, bypassing the slow owfs. Ultimately, it will deal with concurrency, and ... if properly configured ... will cache for you.

I look forward to hearing how the project goes! (Any 1-wire work I do will be with perl, so very similar environment).

-jbn
 
Hello.

As the author, I can probably answer your question on OWFS.

1. How do multiple programs access the 1-wire bus concurrently?
We have one program own the bus (the serial or USB connection) and arbitrate multiple queries.

Clearly, the 1-wire bus doesn't allow multiple communication streams, but most of the queries (temperature, etc) are self-contained, so bus is only locked as needed.

The original program "owfs" is the 1-wire filesystem server (using FUSE). It allows multiple programs to read and write to the virtual filesystem just like any other filesystem.

Another program, "owhttpd", is the web server that owns the 1-wire bus and allows multiple browsers to query, just like any web server.

Finally, "owserver" is a distillation of the server process. It owns the 1-wire bus and allows multiple clients to talk to it using a special network protocol. Clients can be perl (OWNET.pm) shell scripts, or even owfs and owhttpd.

2. Speed. Temperature readings take about 1 second. It's a limitation of the 1-wire technology. owfs (or owhttpd or owserver) cache the reading for about 15 seconds to make subsequent reads faster, but that can be modified or avoided.

If I were to design an all-perl system (which I've done). I'd use owserver and the OWNET module from CPAN.

Paul Alfille
 
Back
Top