[Owfs-developers] Creating owlua...

2006-12-12 Thread Matthew Percival
G'Day,

I am looking to create a Lua interface to owlib --- effectively owlua.
I would need to do this as a simple C library that makes the appropriate
calls, however, I have not been able to find any documentation that
would help with this.  owcapi seems like it would be something similar
to what I would need to do, so would I be able to use this as a
basis/guide to make owlua, or would that be a bad idea (incomplete, out
of date, etc)?

If owcapi is fine, I assume the key functions owlua needs are init(),
get(), put() and finish().  I see owcapi also has OW_init_string(), but
I am unsure as to what its purpose is, or if I would need an equivilent
function for owlua.

If owcapi is insufficient, is there anywhere I could get find a guide
to what would be necessary, or perhaps a owlib API summary?

-- Matthew


-
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers


Re: [Owfs-developers] Proposed Enhancement: "read_ROM" node in simultaneous directories

2006-12-12 Thread Paul Alfille

Jan,

You currently return the name a of single device. And error if there are
none, or more than one.

What do you really intend? Do you want to know if there are
A. exactly 1 (and it's number) ?
B more than 0 ?
C more than 1 ?

Paul Alfille

On 12/12/06, Paul Alfille <[EMAIL PROTECTED]> wrote:


I'm impressed. You certainly figured out the code style.

Questions:
1. We "read_ROM" and get a positlve result if any devices exist on the
selected path?
2. Should we use a name like "not_empty" or "search" ?

Paul Alfille

On 12/12/06, Jan Kandziora <[EMAIL PROTECTED]> wrote:

> Hi all, hi Paul,
>
> I made a small enhancement to owfs to implement the "read ROM" function
> all
> onewire chips have. With this function, a single key on a (sub)-bus can
> be
> identified without (fairly expensive) scanning.
>
> The attached code works with ibutton keys on the buses of a DS2482-800
> and
> with ibutton keys on the sub-buses of the DS2409. I'm a little unsure if
> the
> error handling is correct, so I'll wait for your opinion until I make up
> a
> proper patch. Most mysterious to me is how to signalize an error.
> Returning
> -EINVAL leads to that:
>
> read_ROM (simultaneous) dat=ff. crc8=ff crc8c=14 ret=1
> read_ROM (simultaneous) dat=ff. crc8=ff crc8c=14 ret=1
> read_ROM (simultaneous) dat=ff. crc8=ff crc8c=14 ret=1
> *** glibc detected *** double free or corruption (fasttop): 0x08084b98
> ***
> Abgebrochen
>
> Kind regards
>
> Jan
> --
> The first law of demos:
> - never try to actually use the system for anything
>
>
>
> -
> 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
> Owfs-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
>
>
>

-
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers


Re: [Owfs-developers] Proposed Enhancement: "read_ROM" node in simultaneous directories

2006-12-12 Thread Paul Alfille

I'm impressed. You certainly figured out the code style.

Questions:
1. We "read_ROM" and get a positlve result if any devices exist on the
selected path?
2. Should we use a name like "not_empty" or "search" ?

Paul Alfille

On 12/12/06, Jan Kandziora <[EMAIL PROTECTED]> wrote:


Hi all, hi Paul,

I made a small enhancement to owfs to implement the "read ROM" function
all
onewire chips have. With this function, a single key on a (sub)-bus can be
identified without (fairly expensive) scanning.

The attached code works with ibutton keys on the buses of a DS2482-800 and
with ibutton keys on the sub-buses of the DS2409. I'm a little unsure if
the
error handling is correct, so I'll wait for your opinion until I make up a
proper patch. Most mysterious to me is how to signalize an error.
Returning
-EINVAL leads to that:

read_ROM (simultaneous) dat=ff. crc8=ff crc8c=14 ret=1
read_ROM (simultaneous) dat=ff. crc8=ff crc8c=14 ret=1
read_ROM (simultaneous) dat=ff. crc8=ff crc8c=14 ret=1
*** glibc detected *** double free or corruption (fasttop): 0x08084b98 ***
Abgebrochen

Kind regards

Jan
--
The first law of demos:
- never try to actually use the system for anything


-
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers




-
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers


Re: [Owfs-developers] Echo string to LCD gets funky trailing char

2006-12-12 Thread [EMAIL PROTECTED]




Thanks Jan, echo -n works perfectly.  I'm still trying to get up to
speed in linux capabilities since OWFS is my first actual adventure in
it.

-Scott

Jan Kandziora wrote:

  Am Mittwoch, 13. Dezember 2006 01:12 schrieb [EMAIL PROTECTED]:
  
  
Should I be doing this differently (instead of echoing it)


  
  How about using the "printf" shell builtin or, if you don't have bash at hand, 
how about using "echo -n"?

Kind regards

	Jan
  





-
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers


Re: [Owfs-developers] Echo string to LCD gets funky trailing char

2006-12-12 Thread Jan Kandziora
Am Mittwoch, 13. Dezember 2006 01:12 schrieb [EMAIL PROTECTED]:
> Should I be doing this differently (instead of echoing it)
>
How about using the "printf" shell builtin or, if you don't have bash at hand, 
how about using "echo -n"?

Kind regards

Jan
-- 
A closed mouth gathers no foot.

-
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers


[Owfs-developers] Echo string to LCD gets funky trailing char

2006-12-12 Thread [EMAIL PROTECTED]
I am writing a (test) shell script to dump the temps reported by several 
sensors to my LCD, but I think it's trying to display the CR/LF at the 
end. When I change the message to something via OWhttpd it works fine 
(no trailing char), but echoing something to the message file via OWFS 
it seems to add a char at the end that seems to be non-printable.

Should I be doing this differently (instead of echoing it) or can we add 
apply a filter to the text sent to the message & screen files so that 
non-printable chars are stripped & not displayed?

-Scott

Here's my script:

#!/bin/sh
cd /home/scott/ow/uncached
while :
do
temp1=10.225F0=`cat uncached/10.225FB6000800/temperature | sed 's/^[ 
\t]*//; s/[:cntrl:]//'`F
#This doesn't work to strip CR/LF either
# temp1=10.225F0=`cat uncached/10.225FB6000800/temperature | sed 's/^[ 
\t]*//; s/\n//'`F
echo $temp1
# echo "10.225F0=`cat uncached/10.225FB6000800/temperature|sed 's/^[ 
\t]*//'`F"
echo "$temp1" >> 29.6EA70100/LCD_H/message
# echo $temp1 >> 29.6EA70100/LCD_H/message
echo " "
sleep 2
echo "28.F7668=`cat uncached/28.F7668900/temperature|sed 's/^[ 
\t]*//'`F"
echo "28.F7668=`cat uncached/28.F7668900/temperature|sed 's/^[ 
\t]*//'`*F" \
 > 29.6EA70100/LCD_H/message
echo "---"
sleep 2
done


STD Output is:

10.225F0=71.0375F

28.F7668=70.7F
---
10.225F0=71.0375F

28.F7668=70.8125F
---
...
---
LCD outout example:
---

10.225F0=71.0375F█

(the last character is really alternating on/off horizontal bars)


-
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers


[Owfs-developers] Proposed Enhancement: "read_ROM" node in simultaneous directories

2006-12-12 Thread Jan Kandziora
Hi all, hi Paul,

I made a small enhancement to owfs to implement the "read ROM" function all 
onewire chips have. With this function, a single key on a (sub)-bus can be 
identified without (fairly expensive) scanning.

The attached code works with ibutton keys on the buses of a DS2482-800 and 
with ibutton keys on the sub-buses of the DS2409. I'm a little unsure if the 
error handling is correct, so I'll wait for your opinion until I make up a 
proper patch. Most mysterious to me is how to signalize an error. Returning 
-EINVAL leads to that:

read_ROM (simultaneous) dat=ff. crc8=ff crc8c=14 ret=1
read_ROM (simultaneous) dat=ff. crc8=ff crc8c=14 ret=1
read_ROM (simultaneous) dat=ff. crc8=ff crc8c=14 ret=1
*** glibc detected *** double free or corruption (fasttop): 0x08084b98 ***
Abgebrochen

Kind regards

Jan
-- 
The first law of demos:
 - never try to actually use the system for anything
/*
$Id: ow_simultaneous.c,v 1.30 2006/12/05 14:02:09 alfille Exp $
OWFS -- One-Wire filesystem
OWHTTPD -- One-Wire Web Server
Written 2003 Paul H Alfille
email: [EMAIL PROTECTED]
Released under the GPL
See the header file: ow.h for full attribution
1wire/iButton system from Dallas Semiconductor
*/

/* General Device File format:
This device file corresponds to a specific 1wire/iButton chip type
( or a closely related family of chips )

The connection to the larger program is through the "device" data structure,
  which must be declared in the acompanying header file.

The device structure holds the
  family code,
  name,
  device type (chip, interface or pseudo)
  number of properties,
  list of property structures, called "filetype".

Each filetype structure holds the
  name,
  estimated length (in bytes),
  aggregate structure pointer,
  data format,
  read function,
  write funtion,
  generic data pointer

The aggregate structure, is present for properties that several members
(e.g. pages of memory or entries in a temperature log. It holds:
  number of elements
  whether the members are lettered or numbered
  whether the elements are stored together and split, or separately and joined
*/

/* Simultaneous is a trigger to do a mass conversion on all the devices in the specified path */

#include 
#include "owfs_config.h"
#include "ow_simultaneous.h"

/* --- Prototypes --- */
/* Statistics reporting */
 yREAD_FUNCTION( FS_r_convert ) ;
yWRITE_FUNCTION( FS_w_convert ) ;
 aREAD_FUNCTION( FS_read_ROM ) ;

/*  Structures -- */
struct filetype simultaneous[] = {
{"temperature" ,  1, NULL  , ft_yesno, fc_volatile, {y:FS_r_convert}, {y:FS_w_convert}, {i: simul_temp}, } ,
{"voltage" ,  1, NULL  , ft_yesno, fc_volatile, {y:FS_r_convert}, {y:FS_w_convert}, {i: simul_volt}, } ,
{"read_ROM", 15, NULL  , ft_ascii, fc_volatile, {a:FS_read_ROM} , {v:NULL}, {v:NULL}, } ,
} ;
DeviceEntry( simultaneous, simultaneous ) ;

/* --- Functions  */
struct internal_prop ipSimul[] = {
{"temperature",fc_volatile},
{"voltage",fc_volatile},
};

/* returns 0 if valid conversion exists */
int Simul_Test( const enum simul_type type, UINT msec, const struct parsedname * pn ) {
struct parsedname pn2 ;
struct timeval tv,now ;
long int diff ;
int ret ;
memcpy( &pn2, pn , sizeof(struct parsedname)) ; // shallow copy
FS_LoadPath(pn2.sn,&pn2) ;
if ( (ret=Cache_Get_Internal_Strict(&tv, sizeof( struct timeval ), &ipSimul[type],&pn2)) ) {
LEVEL_DEBUG("No simultaneous conversion valid.\n") ;
return ret ;
}
LEVEL_DEBUG("Simultaneous conversion IS valid.\n") ;
gettimeofday(&now, NULL) ;
diff =  1000*(now.tv_sec-tv.tv_sec) + (now.tv_usec-tv.tv_usec)/1000 ;
if ( diff<(long int)msec ) UT_delay(msec-diff) ;
return 0 ;
}

static int FS_w_convert(const int * y , const struct parsedname * pn) {
struct parsedname pn2 ;
enum simul_type type = (enum simul_type) pn->ft->data.i ;
memcpy( &pn2, pn , sizeof(struct parsedname)) ; // shallow copy
FS_LoadPath(pn2.sn,&pn2) ;
pn2.dev = NULL ; /* only branch select done, not actual device */
/* Since writing to /simultaneous/temperature is done recursive to all
* adapters, we have to fake a successful write even if it's detected
* as a bad adapter. */
if ( y[0] ) {
if ( pn->in->Adapter != adapter_Bad ) {
int ret = 1 ; // set just to block compiler errors
switch ( type ) {
case simul_temp: {
const BYTE cmd_temp[] = { 0xCC, 0x44 } ;
struct transaction_log t[] = {
TRXN_START,
{cmd_temp, NULL, 2, trxn_match, } ,
TRXN_END ,
} ;
ret = BUS_transaction(t,&pn2) ;
//printf("CO

Re: [Owfs-developers] Caching problem?

2006-12-12 Thread Jan Kandziora
Am Dienstag, 12. Dezember 2006 19:26 schrieb Paul Alfille:
> Clearly a bug. Now fixed (in the CVS).
>
Have you checked in already? If yes, the bug is still there.

I noticed something interesting: It seems to be connected to the caching of 
the chip presence:

% OW::put 1F.0F1B0500/discharge 1

--- Needs more time than below, don't know why ---

% OW::get alarm
1F.0F1B0500/
% OW::get uncached
bus.7/,bus.6/,bus.5/,bus.4/,bus.3/,bus.2/,bus.1/,bus.0/,29.5E410100/,29.8F410100/,1F.071B0500/,1F.0F1B0500/,alarm/
% OW::put 1F.0F1B0500/discharge 1

--- Returns "immediately" ---

% OW::get alarm
%


Kind regards

Jan
-- 
A Law of Computer Programming:
Make it possible for programmers to write in English and you
will find the programmers cannot write in English.

-
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers


Re: [Owfs-developers] Caching problem?

2006-12-12 Thread Paul Alfille

Clearly a bug. Now fixed (in the CVS).

Paul Alfille

On 12/12/06, Jan Kandziora <[EMAIL PROTECTED]> wrote:


Hi all,

I think I discovered a problem with caching in the "alarm" directory.
-
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers


[Owfs-developers] Caching problem?

2006-12-12 Thread Jan Kandziora
Hi all,

I think I discovered a problem with caching in the "alarm" directory. See this
transcript:


janskiste:/home/jan # tclsh
% package require ow
0.1
% OW::init /dev/i2c-1
% OW::get
structure/,bus.7/,bus.6/,bus.5/,bus.4/,bus.3/,bus.2/,bus.1/,bus.0/,uncached/,settings/,system/,statistics/,29.5E410100/,29.8F410100/,1F.071B0500/,1F.0F1B0500/,alarm/
% OW::get alarm

--- Put an iButton on the main branch of the DS2409 1F.0F1B0500, alarm 
triggered ---

% OW::get alarm
1F.0F1B0500/
% OW::put 1F.0F1B0500/discharge 1
CACHE GET 3 buffer size=4 stored size=4
% OW::get alarm

--- Ok so far. But now again put the iButton on the main branch of the DS2409 
1F.0F1B0500, alarm triggered ---

% OW::get alarm
1F.0F1B0500/

--- Wait ~1m ---

% OW::get alarm
1F.0F1B0500/
% OW::put 1F.0F1B0500/discharge 1
% OW::get alarm
1F.0F1B0500/
%

--- Huh? Ok, lets check if owfs is caching the alarm or if the chip is still 
responding ---

% exit
janskiste:/home/jan # tclsh
% package require ow
0.1
% OW::init /dev/i2c-1
% OW::get alarm
%


Seems to be a problem with caching to me. How do I get rid of the cached 
alarm?

Kind regards

Jan
-- 
A Law of Computer Programming:
Make it possible for programmers to write in English and you
will find the programmers cannot write in English.

-
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers


Re: [Owfs-developers] Thanks

2006-12-12 Thread Peter Kropf
On 12/12/06, Matt <[EMAIL PROTECTED]> wrote:
> I just though I take the time to to say thanks to the developers and support
> contributors of OWFS.
>
> I work for a non-profit research institute and I've been able to implement
> some cost effective environmental monitoring.
> First our server room, and now this week we extend it into some
> laboratories.
> This all works with our existing Nagios setup, Debian + owserver + owread +
> Nagios.

Don't know if you're interested, but there's a new nagios plugin based
on the ownet Python module. It's located under
module/swig/python/ownet/examples/check_ow.py. The ownet module runs
on any platform supported by Python without having the whole owfs
system installed locally. It does this by implementing the owserver
protocol in Python. The big advantage that I see is to allow for
easier installations. Install the full owfs on the system with the
1-wire devices connected and run owserver there. Install the ownet
module on the system (Windows, FreeBSD, Linux, OS X, whatever) running
Nagios. The check_ow program running on the Nagios server talks
directly to the owserver program running on the owfs server to collect
data. Makes for a nice easy setup.

Of course I could just be imagining that it make for an easier installation ;-)

- Peter

-
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers


[Owfs-developers] Thanks

2006-12-12 Thread Matt
 
I just though I take the time to to say thanks to the developers and support
contributors of OWFS.
 
I work for a non-profit research institute and I've been able to implement
some cost effective environmental monitoring.
First our server room, and now this week we extend it into some
laboratories.
This all works with our existing Nagios setup, Debian + owserver + owread +
Nagios.
 
The willingness of people on this list to help others is truely appricated.
 
Thanks
 
Matt (www.ccia.org.au)
-
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers


Re: [Owfs-developers] temperature sensors - simultaneous and "pre-reading"

2006-12-12 Thread Jerry Scharf
Darryl wrote:
> Any clues how to use simultaneous with owpython?
>
> -darryl
>
> -
> 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
> Owfs-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>   
import ow

ow.init('127.0.0.1:1')

ow._put('/simultaneous/temperature','1')


-
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers