Am 07.12.2013 23:22, schrieb Top-Dog:
> OK... but how do I read and write to an EEPROM page file if I can't access
> the file structure of the 'sensor'? 
> 
You still don't understand. Owlib just offers a "file" *representation*
of the devices of the bus. The owfs tool presents this file
representation as a file system. None of this is real. When you write
into a "file" the owfs tool offers, you actually write into the owfs
fuse driver, which translates this to a
OW_put("/my_chip_id/eeprom",&data,length) of owlib.


The language bindings all do the same, winding down to OW_put()
ultimately. This function of owlib takes a virtual "path" to the node
and the data to put. Similar, OW_get("/my_chip_id/eeprom",&buffer)
returns the data from the node.


In the python API, everything is object oriented so it's a little
different to use. Basically, you create a sensor object, then access the
implicit object variables created with the object.

s = ow.Sensor( '/1F.5D0B01000000' )
s.PIO_1 = '1'   <--- Notice the _, ad . already has another
                     meaning in python.

This translates to OW_put("/1F.5D0B01000000/PIO.1","1",1). Same for all
other nodes. See the section __setattr__ of the python API description.


But you can be objectless and lame and just use the owfs_put and
owfs_get functions of the python API.

For debugging, note all the ow.init options are passed to owlib, so can
enable debugging output there, too.


> I'll probably need more owfs 'packages' because I want to put the file
> structure online (so use owhttpd, and owserver) and then use owpython to
> handle the read/writing and IDing the connected 1-wire devices.
> 
You can use all clients at the same time, but then have to use owserver
to connect to the actual hardware. All other clients may only connect to
the owserver. If you do it different, concurrent access won't work properly.


Kind regards

        Jan

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to