Yea, something in swig there i wasnt quiete able to figure out... then just started makeing the php class at work =)
For your debugging pleasure latest version of gentoo, PHP 5.1.4-pl4-gentoo: ow_wrap.c: In function `SWIG_Php4_SetModule': ow_wrap.c:761: error: `tsrm_ls' undeclared (first use in this function) ow_wrap.c:761: error: (Each undeclared identifier is reported only once ow_wrap.c:761: error: for each function it appears in.) ow_wrap.c: In function `get': ow_wrap.c:905: warning: generating trampoline in object (requires executable stack) make[3]: *** [ow_wrap.lo] Error 1 make[3]: Leaving directory `/usr/src/owfs/module/swig/php' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/src/owfs/module/swig' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/owfs/module' make: *** [all-recursive] Error 1 >From: [EMAIL PROTECTED] >Reply-To: [email protected] >To: [email protected] >Subject: Owfs-developers Digest, Vol 2, Issue 25 >Date: Thu, 27 Jul 2006 12:05:17 -0700 >MIME-Version: 1.0 >Received: from lists-outbound.sourceforge.net ([66.35.250.225]) by >bay0-mc2-f17.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2444); Thu, >27 Jul 2006 12:05:37 -0700 >Received: from sc8-sf-list2-new.sourceforge.net (unknown [10.3.1.94])by >sc8-sf-spam2.sourceforge.net (Postfix) with ESMTPid 75AF2FA17; Thu, 27 Jul >2006 12:05:37 -0700 (PDT) >X-Message-Info: LsUYwwHHNt3wuFewu7IefZFX9xe/+jObohWnkDmEo3Q= >X-BeenThere: [email protected] >X-Mailman-Version: 2.1.8 >Precedence: list >List-Id: <owfs-developers.lists.sourceforge.net> >List-Unsubscribe: ><https://lists.sourceforge.net/lists/listinfo/owfs-developers>, ><mailto:[EMAIL PROTECTED]> >List-Archive: ><http://sourceforge.net/mailarchive/forum.php?forum=owfs-developers> >List-Post: <mailto:[email protected]> >List-Help: ><mailto:[EMAIL PROTECTED]> >List-Subscribe: ><https://lists.sourceforge.net/lists/listinfo/owfs-developers>, ><mailto:[EMAIL PROTECTED]> >Errors-To: [EMAIL PROTECTED] >Return-Path: [EMAIL PROTECTED] >X-OriginalArrivalTime: 27 Jul 2006 19:05:37.0612 (UTC) >FILETIME=[A53AB8C0:01C6B1AF] > >Send Owfs-developers mailing list submissions to > [email protected] > >To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/owfs-developers >or, via email, send a message with subject or body 'help' to > [EMAIL PROTECTED] > >You can reach the person managing the list at > [EMAIL PROTECTED] > >When replying, please edit your Subject line so it is more specific >than "Re: Contents of Owfs-developers digest..." > > >Today's Topics: > > 1. PHP Code snippet (Davin Thompson) > 2. Barometric Pressure (TAI8570) support (Paul Alfille) > 3. Re: PHP Code snippet (Paul Alfille) > > >---------------------------------------------------------------------- > >Message: 1 >Date: Thu, 27 Jul 2006 14:14:35 -0400 >From: "Davin Thompson" <[EMAIL PROTECTED]> >Subject: [Owfs-developers] PHP Code snippet >To: [email protected] >Message-ID: <[EMAIL PROTECTED]> >Content-Type: text/plain; format=flowed > >I had a heck of a time getting owphp to compile under gentoo... However, a >simple class in php seems to serve just as well! Its still a bit crude, i >havent worked it into the rest of my application yet, and im not so sure >about the writing to devices yet... other than that it works, and i thought >i'd share it for anyone else having simmilar difficulties. > >oh.. and an important note: you need to start owfs witht he following: >/opt/owfs/bin/owfs -F -u /mnt/owfs/ --fuse-opt="\"$FUSEOPTS\"" > ><? >//Demo code loops through values >$ow = new OneWire; >foreach($ow->devices() as $device) { > echo $ow->write($device,"templow",50.1); > foreach ($ow->abilities($device) as $value) { > echo "<b>".$device. " - ". $value . " </b>- " . >$ow->read($devi$ > } >} > >// And the actuall class > >class OneWire { >var $owBaseDir="/mnt/owfs"; > function OneWire(){ > } > function devices() { > $dirlist = scandir($this->owBaseDir); > foreach ($dirlist as $entry) { > if (fnmatch("??.????????????",$entry)) { > $devices[]=$entry; > } > } > return $devices; > } > function temperature($device) { > $filename = $this->owBaseDir."/".$device."/temperature"; > if (file_exists($filename)) { > $file = fopen($filename, "r"); > $value = fread($file, 1024); > fclose($file); > return $value; > } > } > function abilities($device) { > $path = $this->owBaseDir."/".$device; > $dirlist = scandir($path); > foreach ($dirlist as $entry) { > switch ($entry) { > case "temperature": > case "type": > case "family": > case "ID": > case "temphigh": > case "templow": > case "address": > $ability[]=$entry; > break; > default: > //do nothing > } > } > return $ability; > } > function read($device, $value) { > $filename = $this->owBaseDir."/".$device."/".$value; > if (file_exists($filename)) { > $file = fopen($filename, "r"); > $value = fread($file, 1024); > fclose($file); > return $value; > } > } > function write($device, $value, $data) { > $filename = $this->owBaseDir."/".$device."/".$value; > if (file_exists($filename)) { > $file = fopen($filename, "wb"); > settype($data, "double"); > echo "<br>debug: ". $data . "<br>"; > if (fwrite($file, (double)$data) === FALSE) { > fclose($file); > return "WRITE ERROR"; > } > > fclose($file); > return "OK".$data."<br>"; > } > } > >} > >?> > > > > > >------------------------------ > >Message: 2 >Date: Thu, 27 Jul 2006 14:59:01 -0400 >From: "Paul Alfille" <[EMAIL PROTECTED]> >Subject: [Owfs-developers] Barometric Pressure (TAI8570) support >To: [email protected] >Message-ID: > <[EMAIL PROTECTED]> >Content-Type: text/plain; charset="iso-8859-1" > >Thanks to the permission and kind assistance of Aitor Arrieta of AAG >Electronica (aag.com.mx) and Dr. Simon Melhuish (http://oww.sf.net) we have >full support for the DS2406-based TAI8570. > >It's a bit of a funny device, it uses 2 DS2406s that synthesize 3-wire >communication with a MS5534 pressure sensor. > >The primary DS2406 stores it's sibling's address in EEPROM. The MS5534 >stores calibration data that is extracted and cached after the first >invokation. > >Properties are available under the 12.1234134134/TAI8570 subdirectory: >sibling(address), temperature(C), pressure(millibar). If the DS2406 isn't >the primary switch in the device, reading properties will be unsuccessful. > >Paul Alfille >-------------- next part -------------- >An HTML attachment was scrubbed... >URL: >http://sourceforge.net/mailarchive/forum.php?forum=owfs-developers/attachments/20060727/5397c4c9/attachment.html > >------------------------------ > >Message: 3 >Date: Thu, 27 Jul 2006 15:04:30 -0400 >From: "Paul Alfille" <[EMAIL PROTECTED]> >Subject: Re: [Owfs-developers] PHP Code snippet >To: [email protected] >Message-ID: > <[EMAIL PROTECTED]> >Content-Type: text/plain; charset="iso-8859-1" > >Thanks for the code snippet. Was the problem with SWIG and compilation? > >I'm no PHP expert, but I gather you are avoiding owphp entirely, building >your PHP class by reading from the FUSE filesystem. That will certainly >work, though permissions make take a bit of work. > >Paul Alfille > >On 7/27/06, Davin Thompson <[EMAIL PROTECTED]> wrote: > > > > I had a heck of a time getting owphp to compile under gentoo... However, >a > > simple class in php seems to serve just as well! Its still a bit crude, >i > > havent worked it into the rest of my application yet, and im not so sure > > about the writing to devices yet... other than that it works, and i > > thought > > i'd share it for anyone else having simmilar difficulties. > > > > oh.. and an important note: you need to start owfs witht he following: > > /opt/owfs/bin/owfs -F -u /mnt/owfs/ --fuse-opt="\"$FUSEOPTS\"" > > > > <? > > //Demo code loops through values > > $ow = new OneWire; > > foreach($ow->devices() as $device) { > > echo $ow->write($device,"templow",50.1); > > foreach ($ow->abilities($device) as $value) { > > echo "<b>".$device. " - ". $value . " </b>- " . > > $ow->read($devi$ > > } > > } > > > > // And the actuall class > > > > class OneWire { > > var $owBaseDir="/mnt/owfs"; > > function OneWire(){ > > } > > function devices() { > > $dirlist = scandir($this->owBaseDir); > > foreach ($dirlist as $entry) { > > if (fnmatch("??.????????????",$entry)) { > > $devices[]=$entry; > > } > > } > > return $devices; > > } > > function temperature($device) { > > $filename = $this->owBaseDir."/".$device."/temperature"; > > if (file_exists($filename)) { > > $file = fopen($filename, "r"); > > $value = fread($file, 1024); > > fclose($file); > > return $value; > > } > > } > > function abilities($device) { > > $path = $this->owBaseDir."/".$device; > > $dirlist = scandir($path); > > foreach ($dirlist as $entry) { > > switch ($entry) { > > case "temperature": > > case "type": > > case "family": > > case "ID": > > case "temphigh": > > case "templow": > > case "address": > > $ability[]=$entry; > > break; > > default: > > //do nothing > > } > > } > > return $ability; > > } > > function read($device, $value) { > > $filename = $this->owBaseDir."/".$device."/".$value; > > if (file_exists($filename)) { > > $file = fopen($filename, "r"); > > $value = fread($file, 1024); > > fclose($file); > > return $value; > > } > > } > > function write($device, $value, $data) { > > $filename = $this->owBaseDir."/".$device."/".$value; > > if (file_exists($filename)) { > > $file = fopen($filename, "wb"); > > settype($data, "double"); > > echo "<br>debug: ". $data . "<br>"; > > if (fwrite($file, (double)$data) === FALSE) { > > fclose($file); > > return "WRITE ERROR"; > > } > > > > fclose($file); > > return "OK".$data."<br>"; > > } > > } > > > > } > > > > ?> > > > > > > > > >------------------------------------------------------------------------- > > 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 > > >-------------- next part -------------- >An HTML attachment was scrubbed... >URL: >http://sourceforge.net/mailarchive/forum.php?forum=owfs-developers/attachments/20060727/1ed29f8f/attachment.html > >------------------------------ > >------------------------------------------------------------------------- >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 > > >End of Owfs-developers Digest, Vol 2, Issue 25 >********************************************** ------------------------------------------------------------------------- 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
