Hello,
with high interest i read the EXTERNAL SENSOR support. This would be an
great option to extend my KNX smarthome System with other than orignal
1-wire sensors.
So i wrote the following config:
external
SENSOR: Outside, 28, "Outsidesensor", "sensortext"
SCRIPT: temperature10, 28, t, 1, v, /tmp/value, /tmp/value, "proptext"
and started owserver.
I'm able to get the expected value from my script /tmp/value with the
following command:
owget /bus.0/Outside/temperature10
that works fine ;-). And:
owdir /bus.0/Outside
gives me the entries:
/bus.0/Outside/family
/bus.0/Outside/temperature10
/bus.0/Outside/type
But reading the automatic created properties from owserver like "family"
or "type" i got:
owget /bus.0/Outside/family
ServerRead: Data error on /bus.0/Outside/family
even at higher level
owget /Outside/family
the whole owserver crashes with SEGMENTATION FAULT.
I looked at the code and for my understand there is something missing in
the function "OW_trees_for_read" in "ow_read_external.c"
[...]
if ( property_n != NULL ) {
switch ( property_n->et ) {
case et_none:
return 0 ;
case et_internal:
return -ENOTSUP ;
case et_script:
return OW_read_external_script( sense_n, property_n,
owq ) ;
default:
return -ENOTSUP ;
}
}
[...]
In case of reading properties that are described with SCRIPT in the
config (=> et_script), there is a function "OW_read_external_script"
that executes the external program, whereas for automatic/internal
properties ("family", "type" that has type "et_internal") only
return-code "-ENOTSUP" is reported back to the higher level functions.
For my understanding there should be wrote the documented value
"external" for the property "type" and for property "family" the value
from the config (in my example "28") wrote back to the Data-Struct
"one_wire_query". Is that right?
Beside the Concept about the external sensor support described at your page
http://owfs.org/index.php?page=external-sensor-design
it would be very fine to overwrite the fixed value "external" for the
property "type", with any other value. That's because some
Smarthome-Visus like smarthome.py only support known 1-wire sensors like
DS18B20. With the external sensor feature, there would be an graceful
way to simulate well known sensors.
Thanks for your answer and your help. If you need more Debugging infos,
please let me know.
Patrick
------ owserver debug -----
/opt/owfs/bin/owserver --foreground --debug --error_level 9 -c /tmp/ow.cfg
0x1ae6010 alloc owserver.c:[51] STRDUP s=/opt/owfs/bin/owserver
DEBUG MODE
libow version:
2.9p5
DEBUG: ow_opt.c:(290) Configuration file (/tmp/ow.cfg:1) Program=,
Option=external, Value=
DEBUG: ow_opt.c:(335) Configuration file (/tmp/ow.cfg:1) Option
external recognized as external. Value=
DEBUG: ow_opt.c:(439) SENSOR entry found < Outside, 28,
"Outsidesensor", "jojojo"
>
0x1ae62f0 alloc ow_parse_external.c:[71] STRDUP s= Outside, 28,
"Outsidesensor", "jojojo"
0x1ae6330 alloc ow_parse_external.c:[142] STRDUP s=Outside
0x1ae62f0 free ow_parse_external.c:[143] FREE
0x1ae6350 alloc ow_parse_external.c:[71] STRDUP s= 28, "Outsidesensor",
"jojojo"
0x1ae6380 alloc ow_parse_external.c:[142] STRDUP s=28
0x1ae6350 free ow_parse_external.c:[143] FREE
0x1ae6350 alloc ow_parse_external.c:[71] STRDUP s= "Outsidesensor", "jojojo"
0x1ae63a0 alloc ow_parse_external.c:[71] STRDUP s=Outsidesensor", "jojojo"
0x1ae63a0 free ow_parse_external.c:[118] FREE
0x1ae63d0 alloc ow_parse_external.c:[142] STRDUP s="Outsidesensor"
0x1ae6350 free ow_parse_external.c:[143] FREE
0x1ae63f0 alloc ow_parse_external.c:[170] STRDUP s=Outsidesensor"
0x1ae63d0 free ow_parse_external.c:[175] FREE
0x1ae63d0 alloc ow_parse_external.c:[71] STRDUP s= "jojojo"
0x1ae6410 alloc ow_parse_external.c:[71] STRDUP s=jojojo"
0x1ae6410 free ow_parse_external.c:[118] FREE
0x1ae6410 alloc ow_parse_external.c:[142] STRDUP s="jojojo"
0x1ae63d0 free ow_parse_external.c:[143] FREE
0x1ae63d0 alloc ow_parse_external.c:[170] STRDUP s=jojojo"
0x1ae6410 free ow_parse_external.c:[175] FREE
0x1ae6430 alloc ow_parse_external.c:[497] MALLOC size=59
0x1ae6480 alloc ow_connect.c:[135] MALLOC size=192
0x1ae6550 alloc ow_connect.c:[90] MALLOC size=560
0x1ae6410 alloc ow_arg.c:[48] STRDUP s=external
0x1ae6790 alloc ow_arg.c:[49] STRDUP s=external
DEBUG: ow_parse_external.c:(625) New family entry: 28
0x1ae67b0 alloc ow_parse_external.c:[468] MALLOC size=66
DEBUG: ow_parse_external.c:(607) New sensor entry:
Outside,28,Outsidesensor,jojojo"
0x1ae6800 alloc ow_parse_external.c:[531] MALLOC size=167
DEBUG: ow_parse_external.c:(642) New property entry:
family,28,just_print_data,,28,
0x1ae68e0 alloc ow_parse_external.c:[531] MALLOC size=171
DEBUG: ow_parse_external.c:(642) New property entry:
type,28,just_print_data,,external,
0x1ae6330 free ow_parse_external.c:[454] FREE
0x1ae6380 free ow_parse_external.c:[455] FREE
0x1ae63f0 free ow_parse_external.c:[456] FREE
0x1ae63d0 free ow_parse_external.c:[457] FREE
DEBUG: ow_opt.c:(290) Configuration file (/tmp/ow.cfg:2) Program=,
Option=, Value=
DEBUG: ow_opt.c:(445) SCRIPT entry found < temperature10, 28, t, 1,
v, /tmp/testv, /tmp/testv, "jjj"
>
0x1ae69d0 alloc ow_parse_external.c:[71] STRDUP s= temperature10, 28, t,
1, v, /tmp/testv, /tmp/testv, "jjj"
0x1ae63d0 alloc ow_parse_external.c:[142] STRDUP s=temperature10
0x1ae69d0 free ow_parse_external.c:[143] FREE
0x1ae62f0 alloc ow_parse_external.c:[71] STRDUP s= 28, t, 1, v,
/tmp/testv, /tmp/testv, "jjj"
0x1ae63f0 alloc ow_parse_external.c:[142] STRDUP s=28
0x1ae62f0 free ow_parse_external.c:[143] FREE
0x1ae62f0 alloc ow_parse_external.c:[71] STRDUP s= t, 1, v, /tmp/testv,
/tmp/testv, "jjj"
0x1ae6380 alloc ow_parse_external.c:[142] STRDUP s=t
0x1ae62f0 free ow_parse_external.c:[143] FREE
0x1ae6a20 alloc ow_parse_external.c:[71] STRDUP s= 1, v, /tmp/testv,
/tmp/testv, "jjj"
0x1ae6330 alloc ow_parse_external.c:[142] STRDUP s=1
0x1ae6a20 free ow_parse_external.c:[143] FREE
0x1ae6a20 alloc ow_parse_external.c:[71] STRDUP s= v, /tmp/testv,
/tmp/testv, "jjj"
0x1ae6a50 alloc ow_parse_external.c:[142] STRDUP s=v
0x1ae6a20 free ow_parse_external.c:[143] FREE
0x1ae6a20 alloc ow_parse_external.c:[71] STRDUP s= /tmp/testv,
/tmp/testv, "jjj"
0x1ae6a70 alloc ow_parse_external.c:[142] STRDUP s=/tmp/testv
0x1ae6a20 free ow_parse_external.c:[143] FREE
0x1ae6a90 alloc ow_parse_external.c:[71] STRDUP s= /tmp/testv, "jjj"
0x1ae6ab0 alloc ow_parse_external.c:[142] STRDUP s=/tmp/testv
0x1ae6a90 free ow_parse_external.c:[143] FREE
0x1ae6a90 alloc ow_parse_external.c:[71] STRDUP s= "jjj"
0x1ae6ad0 alloc ow_parse_external.c:[71] STRDUP s=jjj"
0x1ae6ad0 free ow_parse_external.c:[118] FREE
0x1ae6ad0 alloc ow_parse_external.c:[142] STRDUP s="jjj"
0x1ae6a90 free ow_parse_external.c:[143] FREE
0x1ae6a90 alloc ow_parse_external.c:[170] STRDUP s=jjj"
0x1ae6ad0 free ow_parse_external.c:[175] FREE
0x1ae6ad0 alloc ow_parse_external.c:[71] STRDUP s=
0x1ae6af0 alloc ow_parse_external.c:[142] STRDUP s=
0x1ae6ad0 free ow_parse_external.c:[143] FREE
0x1ae69d0 alloc ow_parse_external.c:[497] MALLOC size=59
DEBUG: ow_parse_external.c:(621) Duplicate family entry: 28
0x1ae69d0 free ow_parse_external.c:[622] FREE
0x1ae6b10 alloc ow_parse_external.c:[531] MALLOC size=182
DEBUG: ow_parse_external.c:(642) New property entry:
temperature10,28,/tmp/testv,/tmp/testv,jjj"
,
0x1ae6ad0 alloc ow_parse_external.c:[654] STRDUP s=temperature10
0x1ae6ad0 free ow_parse_external.c:[664] FREE
0x1ae63d0 free ow_parse_external.c:[401] FREE
0x1ae63f0 free ow_parse_external.c:[402] FREE
0x1ae6a70 free ow_parse_external.c:[403] FREE
0x1ae6ab0 free ow_parse_external.c:[404] FREE
0x1ae6a90 free ow_parse_external.c:[405] FREE
0x1ae6af0 free ow_parse_external.c:[406] FREE
DEBUG: ow_opt.c:(290) Configuration file (/tmp/ow.cfg:3) Program=,
Option=, Value=
0x1ae6030 alloc ow_connect_out.c:[29] MALLOC size=104
DEBUG: ow_daemon.c:(166) main thread id = 140258545637120
0x1ae7770 alloc ow_tree.c:[311] CALLOC size=64 nmemb=3
CALL: ow_parsename.c:(102) path=[]
DEBUG: owlib.c:(81) Globals temp limits 0C 100C (for simulated adapters)
0x1ae6a00 alloc ow_net_server.c:[50] STRDUP s=0.0.0.0
0x1ae6310 alloc ow_net_server.c:[51] STRDUP s=4304
CONNECT: ow_zero.c:(145) Zeroconf not enabled
0x1ae79a0 alloc ow_net_server.c:[267] MALLOC size=16
DEBUG: ow_tcp_read.c:(64) attempt 24 bytes Time: 10.000000 seconds
DEBUG: ow_tcp_read.c:(114) read: 24 - 0 = 24
DEBUG: from_client.c:(66) FromClient payload=16 size=65536 type=2
sg=0x10A offset=0
DEBUG: from_client.c:(74) FromClient (no servermessage) payload=16
size=65536 type=2 controlflags=0x10A offset=0
0x7f90780008c0 alloc from_client.c:[87] MALLOC size=18
DEBUG: ow_tcp_read.c:(64) attempt 16 bytes Time: 10.000000 seconds
DEBUG: ow_tcp_read.c:(114) read: 16 - 0 = 16
DEBUG: handler.c:(153) START handler /Outside/family
CALL: data.c:(104) DataHandler: parse path=/Outside/family
DEBUG: ow_parseobject.c:(164) /Outside/family
CALL: ow_parsename.c:(102) path=[/Outside/family]
CALL: data.c:(145) Read message
DEBUG: read.c:(55) ReadHandler start
DEBUG: read.c:(61) ReadHandler: From Client sm->payload=16
sm->size=65536 sm->offset=0
0x7f90700008c0 alloc ow_parseobject.c:[258] MALLOC size=3
DEBUG: read.c:(79) ReadHandler: call FS_read_postparse on /Outside/family
DEBUG: ow_read.c:(79) /Outside/family
DEBUG: ow_read.c:(199) /Outside/family
DEBUG: ow_read.c:(233) About to read </Outside/family> extension=0
size=2 offset=0
DEBUG: ow_read.c:(328) file_length=2 offset=0 size=2
0x7f90700008e0 alloc ow_read_external.c:[39] STRDUP s=Outside/family
0x7f90700008e0 free ow_read_external.c:[51] FREE
DEBUG: ow_read.c:(613) Read /Outside/family Extension 0 Gives result -95
DEBUG: ow_read.c:(248) return=-95
DEBUG: ow_read.c:(258) After read is performed (bytes or error -95)
OWQ OneWireQuery structure of /Outside/family
OneWireQuery size=2 offset=0, extension=0
Byte buffer OneWireQuery buffer, length=2
--000: 00 00
<..>
Cleanup = 0006 OneWireQuery I=2 U=2 F=9.88131E-324 Y=2 D=Thu Jan
1 01:00:02 1970
--- OneWireQuery done
DEBUG: ow_read.c:(221) /Outside/family returns -95
DEBUG: ow_select.c:(71) Selecting a path (and device)
path=/Outside/family SN=00 00 00 00 00 00 00 00 last path=00 00 00 00 00
00 00 00
DEBUG: ow_select.c:(82) Clearing root branch
Speicherzugriffsfehler
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers