Here's the code I use:

At init time I call:
        #    Set the caching mode of the owfs filesystem
        Owfs.set_caching("0","300","300","300","300","300")


In a lib:
#    Set the appropriate chahing modes of the owfs
def Owfs.set_caching(volatile,stable,serial,presence,directory,server)
    $debuglevel > 1 and puts "Setting owfs caching mode"
    volatile_file = File.new("/mnt/1wire/settings/timeout/volatile","w")
    volatile_file.write(volatile)
    volatile_file.close()
    stable_file = File.new("/mnt/1wire/settings/timeout/stable","w")
    stable_file.write(stable)
    stable_file.close()
    serial_file = File.new("/mnt/1wire/settings/timeout/serial","w")
    serial_file.write(serial)
    serial_file.close()
    presence_file = File.new("/mnt/1wire/settings/timeout/presence","w")
    presence_file.write(presence)
    presence_file.close()
    directory_file = File.new("/mnt/1wire/settings/timeout/directory","w")
    directory_file.write(directory)
    directory_file.close()
    server_file = File.new("/mnt/1wire/settings/timeout/server","w")
    server_file.write(server)
    server_file.close()
end

Domokos Molnár

On 09/24/2010 09:29 PM, Paul Alfille wrote:
When you say "zero caching" -- how do you accomplish that? (It would help with debugging).

Paul Alfille

On Fri, Sep 10, 2010 at 5:02 AM, Molnar Domokos <[email protected]> wrote:
Hi,

I have just read the thread owfs-mounted directory fails first time after inactivity period and may have something related to it.

I have been running owfs lights out to control my HVAC at home for about 3 years, I have switches and temp sensors on it, and it works in "real time" so I had to resolve the stability issue with programming around.

My HVAC controller reads the temperature of the furnace in a loop as it needs to act fast on temperature changes by switching on/off the gas burner and water pumps and magnetic valves. As a result I have a fair bit of experience with the stability of owfs.

It is not very stable so I my controller does the following:
Level1: The code catches the read/write exception of owfs provided files and retries max. 10 times, if does not succeed then
Level2: Kills owfs with -9, umounts /mnt/1wire and restarts owfs
If Level2 error happens it logs the event.

Level1 error happens about every other day, while Level2 happens less frequently but it really is random.

Here is the log for Level2 events from 1st of August this year. As you can see sometimes it goes on for 10, even 20 days w/o Level2 errors, then it just happens. Nothing changes in the usage pattern of the network or the controller, all sensors are continuously read, and all PIOs are written.

The exceptions are mostly "No such file or directory" but sometimes "Software caused connection abort" happens too.

It runs on a CentOs 5.4., with owfs 2.7p39, with zero caching as I need the new values every time.


------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________ Owfs-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/owfs-developers



------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to