---------- Forwarded message ----------
Hi Paul,
thanks for these hints. I have to add, that is is sufficient to have a line
'external' in the configuration file, which removes the need for an
additional argument (easier with preconfigured start scripts).
I figured out some errors in handling external sensors:
1. parsing the parameters does not trim new-line and tab characters,
resulting in the last parameter ending with a new-line and probably a
quote, when quoted (the starting quote is being removed) - find my patch
attached.
WORKAROUND for existing binary installations: just add another comma at the
end of your sensor and script definitions.
2. owserver crashes when configuring an external sensor with a well-formed
1-Wire ID (i.e. "17.FEEDDEADBEAF") while the same ID with non-hex
characters is working ("17.FILLDEADBEEF"). Seems as if the external sensors
are only handled by aliasing?
WORKAROUND: Do not use valid IDs for external sensors!
3. owserver crashes when reading the type/family properties of external
sensors.
WORKAROUND: Do not read these, do not open path to external sensors with
owhttpd.
But apart from that, I have multiple crashes for unknown reasons. I always
get an "memory access error" :-(
I will continue testing on another system, since owfs (without external
sensors) is running stable for some days there.
Until then I don't have a clue where to look for those crashes on reading
family and type properties on external sensors...
Sven
2014-11-27 12:45 GMT+01:00 Paul Alfille <paul.alfi...@gmail.com>:
> Svan,
>
> I'm busy with guests today, but a quick perusal of the code suggests:
>
> 1. add --external to the command line arguments of owserver
> 2. Add the SENSOR: and PROPERTY lines to the configuration file
>
> See if it works at all.
>
> Paul
>
> On Thu, Nov 27, 2014 at 5:21 AM, Sven Giermann <sven.gierm...@gmail.com>
> wrote:
>
>> Paul, thanks for the quick reply!
>>
>>
>> 2014-11-27 1:08 GMT+01:00 Paul Alfille <paul.alfi...@gmail.com>:
>>
>>> owexternal is actually already built into owserver. It isn't well tested
>>> since I had no actual use case, so your help will be very appreciated.
>>>
>>> This is the documentation:
>>> http://owfs.org/index.php?page=external-sensor-design
>>>
>>
>> I read this, but it's exactly what I don't understand... I don't have any
>> 'owexternal' binary, maybe I have to compile it from source with
>> "--enable-owexternal"?
>> But even after this - where do I put those configuration options
>> mentioned in the "example syntax"?
>> Are those 2 separate text files, one for sensors, one for families?
>> Or do I simply include those lines in owfs.conf, maybe without the need
>> of an additional owexternal binary?
>>
>> And what is the fourth sensor field (/dev/ttyUSB0), the actual parameter
>> to the read/write scripts?
>>
>> To give a general use case, I could simply write a bash script to display
>> the current memory usage, disk free space and so on.
>> If one has a LED or beeper in its system, there would also be a use case
>> for write operations...
>>
>>
>>
>>
>> On Wed, Nov 26, 2014 at 3:25 PM, Sven Giermann <sven.gierm...@gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I just thought about writing my own "owserver" to support a simple
>>>> relay card with a serial connection. I already have a binary to read and
>>>> set relay states but need a way to access it from other software.
>>>> Now the idea was to clone owserver by providing the same interface to
>>>> allow use of every owfs capable client. While starting to read the code I
>>>> stunbled across "owexternal" and found some threads in this list.
>>>>
>>>> But nothing I could really understand to try it on my own.
>>>> So I wanted to ask: what is the current development status of
>>>> "owexternal"?
>>>>
>>>> Even if it's still unstable/untested I would be interested in
>>>> contributing to it - but I need a starting point. What needs to be
>>>> configured and where?
>>>> What does the (Perl?) script need to support?
>>>>
>>>> Any ideas where to start?
>>>>
>>>> Thx, Sven.
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>>>> with Interactivity, Sharing, Native Excel Exports, App Integration &
>>>> more
>>>> Get technology previously reserved for billion-dollar corporations, FREE
>>>>
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>>>> _______________________________________________
>>>> Owfs-developers mailing list
>>>> Owfs-developers@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>>>>
>>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>>> Get technology previously reserved for billion-dollar corporations, FREE
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Owfs-developers mailing list
>>> Owfs-developers@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, FREE
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Owfs-developers mailing list
>> Owfs-developers@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>>
>>
>
--- owfs-2.9p8/module/owlib/src/c/ow_parse_external.c Mo 1. Sep 00:33:23 2014
+++ owfs-2.9p8/module/owlib/src/c/ow_parse_external.c Fr 28. Nov 18:14:16 2014
@@ -40,7 +40,7 @@
void * family_tree = NULL ;
void * sensor_tree = NULL ;
-// ForAddSensor and AddProperty
+// For AddSensor and AddProperty
// uses the various tools to get a string into s_name (name is given)
// start_pointer (a char *) is used and updated.
#define GetQuotedString( name ) do { \
@@ -53,6 +53,10 @@
s_##name = unquote_parse( trim_parse( s_##name ) ) ; \
} while (0) ;
+// For trim_parse
+#define IsNonSpaceChar( c ) \
+ ( c != ' ' && c != '\n' && c != '\r' && c != '\t' )
+
// Look through text_string, ignore backslash and match quoting varibles
// allocates a new string with the token
static char * string_parse( char * text_string, char delim, char ** last_char )
@@ -134,7 +138,7 @@
char * end_position ;
char * return_string ;
for ( start_position = raw_string ; start_position[0] ; ++
start_position ) {
- if ( start_position[0] != ' ' ) {
+ if ( IsNonSpaceChar( start_position[0] ) ) {
break ;
}
}
@@ -144,7 +148,7 @@
for ( end_position = return_string + strlen( return_string ) ;
end_position >= return_string ; -- end_position ) {
if ( end_position[0] == '\0' ) {
continue ;
- } else if ( end_position[0] != ' ' ) {
+ } else if ( IsNonSpaceChar( end_position[0] ) ) {
break ;
} else {
end_position[0] = '\0' ;
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers