I had posted some rudimentary changes in ownet for python a week or  
so ago. After fighting why iButtonLink MS-TH humidity readings were  
causing "value errors," I poked a bit more at the ownet python code.

It appears, from my quick and dirty run, that owserver is sending  
back data in a format that python ownet is failing on. Specifically  
the payload_len is -1. Also, the correct data seems to follow in  
another data packet. My approach in this quick fix was to just ignore  
the -1 payload len packet (message) and interpret the next one as the  
proper data. I'm unsure if this will work in all cases or just this  
one. Comments are welcome, I'm still pouring over the C source trying  
to glean the complete protocol spec.

The second is the previous change to ownet's init method regarding  
proper interpretation of the port as an integer and a rewritten init 
() method that uses the parameters or the initialized values.

The third diff is for the swig/perl makefile to work on OSX. Seems  
configure is not treating it properly. Have not looked more than to  
make a manual change, removing the unsupported "-shared" options.

Here are my diff's from the most recent CVS

diff -r owfs-cvs/module/ownet/python/ownet/connection.py owfs/module/ 
ownet/python/ownet/connection.py
138c138
<             if payload_len:
---
 >             if payload_len >= 0:
141a142,143
 >             elif payload_len < 0:
 >               pass


diff -r owfs-cvs/module/ownet/python/ownet/__init__.py owfs/module/ 
ownet/python/ownet/__init__.py
108c108
<     _port        = pair[1]
---
 >     _port        = int(pair[1])
136a137,138
 >         If server or port are specified they will override the  
initialized
 >         values from ownet.init()
143,149d144
<         elif not server or not port:
<             global _server
<             global _port
<             if not _server or not _port:
<                 raise exNotInitialized
<             else:
<                 self._connection = Connection(server, port)
151c146,157
<             self._connection = Connection(server, port)
---
 >               global _server
 >               global _port
 >               if not server:
 >                       server = _server
 >
 >               if not port:
 >                       port = _port
 >
 >               if not server or not port:
 >                       raise exNotInitialized
 >
 >               self._connection = Connection(server, port)


diff -r owfs-cvs/module/swig/perl5/Makefile.PL.in owfs/module/swig/ 
perl5/Makefile.PL.in
15c15
<     'LDDLFLAGS' =>      q[-shared -Wl,-L../../owlib/src/c/.libs - 
Wl,[EMAIL PROTECTED]@/lib],
---
 >     'LDDLFLAGS' =>      q[-bundle -flat_namespace -undefined  
suppress -Wl,-L../../owlib/src/c/.libs -Wl],


Stephen

----------------------------------------------------------------
Stephen Houser                      http://usm.maine.edu/~houser
Division of Information and Technology      [EMAIL PROTECTED]
University of Southern Maine                       (207)780-4588
P.O. Box 9300 / 96 Falmouth St.                             N1SH
Portland, Maine  04103 -- U.S.A. (Earth)                      O-




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to