On Friday 24 February 2006 02:47 pm, Krzysztof Drewicz wrote: > Hello There! > > I'm building very customized and embended solution using > owhttpd/owserver and DS1820 + DS2450 family. > Basically i have: lots of fridges in supermarket-like store ( > temperatures in Celcius scale varies from -30 to -6 degrees). > > I don't want do use owfs on my small box (i would like to use 16MB of SF > card) but i would like to talk dicectlly to owserwer process. Is your "small box" network connected? If your "strip" owfs and fuse and owhttpd they are quite small. They run on 4MB Linksys routers even with the routing functions present (as well as rrd, and data storage).
If you are network connected, owfs doesn't need to run on the box, just owserver. > > Could someone point me where owserver/client protocol is defined. http://owfs.sf.net/wiki/index.php/NetworkProtocol (Sorry, the tables were lost in a recent edit -- restored) The actual code is: Server module/owserver/src/c/owserver.c Client module/owlib/src/c/ow_server.c Note, the protocol is rather simple, but really was written for communication between owserver and owlib, it's probably easiest if you can link owlib. Basically, it's tcp communication, a new connection for every query. One message TO owserver. One or more responses: 1. null "ping" message if more than 1.5 seconds needed -- ignore and wait again 2. Single answer for a read, write, presence, or size query. 3. one message per directory element, and an empty message to signal the end. > > And second question i need to expand every DS1820 with: > a) up-to-ten phone numbers ( gsm like +48xxxyyyzzz) > b) min-max parameters > > and for DS2450 the same but for every A/D converter. > > I've managed to store it on filesystem and hardcoded my read/write > functions in : > struct filetype DS18B20 [] = { ... > {"Phone_1", 12, ft_asci.... a:FS_read_ascii_from_filesystem, > a:FS_write_ascii_into_filesystem} > } > Very interesting -- something I've always contemplated. Basically, you want to store unique application-specific data for each device. One approach is to hard code it into the program. This has the problem is that the "filetype" structure is per device type, not individual device. It looks to me like you are actually writing to a real filesystem and creating a "filetype" to write to it. Wouldn't it be easier to just change the path? i.e: /1wire/10.123456789ABC/temperature # temperature /data/10.123456789ABC/phone1 # phone number fuse is mounted as 1wire data is on your data card. Of course this only works for the local "owfs" program -- not owhttpd etc. There is another way to store data per device, look at "Cache_Add_Store" and "Cache_Get_Store" in ow_cache.c, which uses the in-memory database. (This is done with filetype with a parameter of ft_persistent. You'd still have to add the file types, and the data would evaporate with a reboot. Another point: use "arrays". phone.1 phone.2 ... OWFS handles these efficiently, and it's easier to alter in the future. > it works, but it's the right way or am i do it wrong ? > > Best regards, > ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Owfs-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/owfs-developers
