2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-07 19:04:20 +00:00

10_ZWave.pm/00_ZWDongle.pm: Try to fix CAN problems (Forum #50090)

git-svn-id: https://svn.fhem.de/fhem/trunk@11007 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-03-06 12:35:21 +00:00
parent 97f7f181a8
commit bc693e1355
3 changed files with 21 additions and 8 deletions

View File

@ -210,11 +210,13 @@ ZWCUL_cmd($$@)
delete $hash->{addNode}; delete $hash->{addNode};
if($cmdName eq "addNodeId") { if($cmdName eq "addNodeId") {
$hash->{addNode} = sprintf("%02x", $a[0]); $hash->{addNode} = sprintf("%02x", $a[0]);
} else { } else {
$hash->{addNode} = ZWCUL_getNextNodeId($hash) if($a[0]); $hash->{addNode} = ZWCUL_getNextNodeId($hash) if($a[0]);
$hash->{addSecure} = 1 if($a[0] == 2); $hash->{addSecure} = 1 if($a[0] == 2);
} }
Log3 $hash, 3, "ZWCUL going to assigning new node id $hash->{addNode}"; Log3 $hash, 3, "ZWCUL going to assigning new node id $hash->{addNode}"
if($a[0]);
ZWCUL_tmp9600($hash, $a[0] ? "zm9" : 0); # expect random homeId ZWCUL_tmp9600($hash, $a[0] ? "zm9" : 0); # expect random homeId
return; return;
} }
@ -470,7 +472,14 @@ ZWCUL_Parse($$$$$)
return; return;
} }
$rmsg = sprintf("0004%s%s%02x%s", $S, $S, length($P)/2, $P); if($P =~ m/^0101(......)(..)..(.*)/) {
my ($nodeInfo, $type6, $classes) = ($1, $2, $3);
$rmsg = sprintf("004a0003%s####%s##%s", $S, $2, $3);
} else {
$rmsg = sprintf("0004%s%s%02x%s", $S, $S, length($P)/2, $P);
}
} else { # ACK } else { # ACK
if($hash->{removeNode} && $hash->{removeNode} eq $S) { ############# if($hash->{removeNode} && $hash->{removeNode} eq $S) { #############

View File

@ -634,6 +634,9 @@ ZWDongle_Parse($$$)
$hash->{"${name}_TIME"} = TimeNow(); $hash->{"${name}_TIME"} = TimeNow();
$hash->{RAWMSG} = $rmsg; $hash->{RAWMSG} = $rmsg;
$hash->{SendTime} = 0 # Retry sending after a "real" msg from the dongle
if($hash->{WaitForAck} && $rmsg !~ m/^(0113|0013)/);
my %addvals = (RAWMSG => $rmsg); my %addvals = (RAWMSG => $rmsg);
Dispatch($hash, $rmsg, \%addvals); Dispatch($hash, $rmsg, \%addvals);

View File

@ -2073,7 +2073,8 @@ ZWave_mcCreateAll($$)
my ($hash, $data) = @_; my ($hash, $data) = @_;
if(!$data) { # called by the user if(!$data) { # called by the user
$zwave_parseHook{"$hash->{nodeIdHex}:046008...."} = \&ZWave_mcCreateAll; $zwave_parseHook{"$hash->{nodeIdHex}:046008...."} = \&ZWave_mcCreateAll;
return("", "07"); ZWave_Get($hash, $hash->{NAME}, "mcEndpoints");
return("", "EMPTY");
} }
$data =~ m/^046008(..)(..)/; $data =~ m/^046008(..)(..)/;
my $nGrp = hex($2); my $nGrp = hex($2);
@ -3691,7 +3692,7 @@ ZWave_Parse($$@)
my $evt; my $evt;
my $rawMsg = "CMD:$cmd ID:$id ARG:$arg"; # No fmt change, Forum #49165 my $rawMsg = "CMD:$cmd ID:$id ARG:$arg"; # No fmt change, Forum #49165
Log3 $ioName, 4, $rawMsg; Log3 $ioName, 4, $rawMsg ." CB:$callbackid";
if($cmd eq 'ZW_ADD_NODE_TO_NETWORK' || if($cmd eq 'ZW_ADD_NODE_TO_NETWORK' ||
$cmd eq 'ZW_REMOVE_NODE_FROM_NETWORK') { $cmd eq 'ZW_REMOVE_NODE_FROM_NETWORK') {
@ -3723,10 +3724,10 @@ ZWave_Parse($$@)
my $hash = $modules{ZWave}{defptr}{"$homeId $id"}; my $hash = $modules{ZWave}{defptr}{"$homeId $id"};
if($hash) { if($hash) {
if(ZWave_isWakeUp($hash)) { #if(ZWave_isWakeUp($hash)) { # Used to Debug Forum #50090 / CAN problems
ZWave_wakeupTimer($hash, 1); # ZWave_wakeupTimer($hash, 1);
ZWave_processSendStack($hash, "next"); # ZWave_processSendStack($hash, "next");
} #}
if(!$ret) { if(!$ret) {
readingsSingleUpdate($hash, "CMD", $cmd, 1); # forum:20884 readingsSingleUpdate($hash, "CMD", $cmd, 1); # forum:20884