diff --git a/core/class/AbeilleParser.class.php b/core/class/AbeilleParser.class.php index a12e9d0833..b484066910 100755 --- a/core/class/AbeilleParser.class.php +++ b/core/class/AbeilleParser.class.php @@ -2449,11 +2449,11 @@ function decode8002_MgmtLqiRsp($dest, $srcAddr, $pl) { $pl = substr($pl, 10); $m = ' Management LQI response'; - $m = $m.': SQN='.$sqn.', Status='.$status.', NTableEntries='.$nTableEntries.', StartIdx='.$startIdx.', NTableListCount='.$nTableListCount; + $m .= ': SQN='.$sqn.', Status='.$status.', NTableEntries='.$nTableEntries.', StartIdx='.$startIdx.', NTableListCount='.$nTableListCount; parserLog2('debug', $srcAddr, $m); $toLqiCollector = array( - 'type' => '804E', + 'type' => 'mgmtLqiRsp', 'srcAddr' => $srcAddr, 'status' => $status, 'tableEntries' => $nTableEntries, diff --git a/core/php/AbeilleLQI.php b/core/php/AbeilleLQI.php index 8d351a7f5d..7e99d165a0 100755 --- a/core/php/AbeilleLQI.php +++ b/core/php/AbeilleLQI.php @@ -6,7 +6,7 @@ * * Starting from zigate (coordinator), send LQI request to get neighbour table * - Send request thru AbeilleCmd (004E cmd) - * - Get response from AbeilleParser (804E cmd) + * - Get response from AbeilleParser (Mgmt_lqi_rsp cmd) * - Identify each neighbour * - If neighbor is router, added to list for interrogation */ @@ -73,7 +73,7 @@ function msgFromParserFlush() { while (msg_receive($queueParserToLQI, 0, $msgType, 2048, $msgJson, false, MSG_IPC_NOWAIT | MSG_NOERROR)); } - /* Treat request responses (804E) from parser. + /* Treat request responses (Mgmt_lqi_rsp) from parser. Returns: 0=OK, -1=fatal error, 1=timeout */ function msgFromParser($eqIdx) { // logMessage("", " msgFromParser(eqIndex=".$eqIdx.")"); @@ -90,13 +90,13 @@ function msgFromParser($eqIdx) { if (msg_receive($queueParserToLQI, 0, $msgType, $msgMax, $msgJson, false, MSG_IPC_NOWAIT, $errCode) == true) { /* Message received. Let's check it is the expected one */ $msg = json_decode($msgJson); - if ($msg->type != "804E") { + if ($msg->type != "mgmtLqiRsp") { logMessage("", " msgFromParser: Unsupported message type (".$msg->type.") => Ignored."); continue; } if (hexdec($msg->startIdx) != $eqToInterrogate[$eqIdx]['tableIndex']) { /* Note: this case is due to too many identical 004E messages sent to eq - leading to several identical 804E answers */ + leading to several identical mgmtLqiRsp answers */ logMessage("", " msgFromParser: Unexpected start index (".$msg->startIdx.") => Ignored."); continue; } @@ -104,7 +104,11 @@ function msgFromParser($eqIdx) { logMessage("", " msgFromParser: Unexpected source addr (".$msg->srcAddr.") => Ignored."); continue; } - if ($msg->status != "00"){ + if ($msg->status == "C1") { + logMessage("", " msgFromParser: No devices."); + break; + } + if ($msg->status != "00") { logMessage("", " msgFromParser: Wrong message status (".$msg->status.") => Ignored."); continue; } @@ -137,7 +141,7 @@ function msgFromParser($eqIdx) { /* Message format reminder $msg = array( - 'type' => '804E', + 'type' => 'mgmtLqiRsp', 'srcAddr' => $srcAddr, 'tableEntries' => $nTableEntries, 'tableListCount' => $nTableListCount, @@ -347,7 +351,7 @@ function interrogateEq($eqIdx) { list($netName, $addr) = explode('/', $logicId); logMessage("", "Interrogating '${name}' (Addr=${addr}, EqIdx=${eqIdx})"); global $done, $total; - updateLockFile("Analyse du réseau ".$netName.": ${done}/${total} => interrogation de '".$name."' (".$addr.")"); + updateLockFile("${netName} - ${done}/${total}: Interrogation de '".$name."' (".$addr.")"); while (true) { $eq = $eqToInterrogate[$eqIdx]; // Read eq status @@ -365,7 +369,7 @@ function interrogateEq($eqIdx) { return -1; } - $eq = $eqToInterrogate[$eqIdx]; // Read eq status + $eq = $eqToInterrogate[$eqIdx]; // Reread eq status if ($eq['tableIndex'] >= $eq['tableEntries']) break; // Exiting interrogation loop } @@ -536,6 +540,8 @@ function interrogateEq($eqIdx) { } else if ($ret == 0) { $eqToInterrogate[$eqIdx]['completed'] = true; $done++; + if ($eqToInterrogate[$eqIdx]['tableEntries'] == 0) + updateLockFile("= Aucun équipement en vie."); } } @@ -571,7 +577,7 @@ function interrogateEq($eqIdx) { default: $status = "error"; break; // Interrupted } // file_put_contents($lockFile, "done/".time()."/".$status); - updateLockFile("done/".time()."/".$status); + updateLockFile("= Collecte terminée: ".time()."/".$status); } logMessage("", "<<< AbeilleLQI exiting."); diff --git a/desktop/js/AbeilleNetwork.js b/desktop/js/AbeilleNetwork.js index 47dba6862d..985f0b13c0 100644 --- a/desktop/js/AbeilleNetwork.js +++ b/desktop/js/AbeilleNetwork.js @@ -218,28 +218,28 @@ function trackLQICollectStatus(_autoUpdate, zgId) { $("#div_networkZigbeeAlert").hide(); }, 10000); } else { - var data = res.content; - console.log("Status='" + data + "'"); + var content = res.content; + console.log("Status='" + content + "'"); var alertLevel = "success"; - if (data.toLowerCase().includes("oops")) { + if (content.toLowerCase().includes("oops")) { alertLevel = "danger"; _autoUpdate = 0; - } else if (data.toLowerCase().includes("done")) { - // Reminder: done///' + content = "Collecte terminée"; _autoUpdate = 0; // Stop status refresh } - if (data != prevTrackingMsg) { + if (content != prevTrackingMsg) { $("#div_networkZigbeeAlert").showAlert({ - message: data, + message: content, level: alertLevel, }); - prevTrackingMsg = data; + prevTrackingMsg = content; } /* Collect status display stops when "done" found */ - // _autoUpdate = data.toLowerCase().includes("done")?0:1; + // _autoUpdate = content.toLowerCase().includes("done")?0:1; if (_autoUpdate) { // Next status update in 1s setTimeout(function () { diff --git a/desktop/modal/AbeilleRefreshLQI.modal.php b/desktop/modal/AbeilleRefreshLQI.modal.php index 45f3825b95..f65d1c0e4f 100644 --- a/desktop/modal/AbeilleRefreshLQI.modal.php +++ b/desktop/modal/AbeilleRefreshLQI.modal.php @@ -57,26 +57,24 @@ function analysisProgress() { // _autoUpdate = 0; // setTimeout(function () { $('#div_networkZigbeeAlert').hide(); }, 10000); } else { - var data = res.content; - console.log("Status='"+data+"'"); - if (data.toLowerCase().includes("oops")) { - // networkInformationProgress = data; - // document.getElementById("refreshInformation").value = data; - textArea.innerHTML += data + "
"; + var content = res.content; + console.log("Status='"+content+"'"); + if (content.toLowerCase().includes("oops")) { + textArea.innerHTML += content + "
"; clearInterval(analysisStatus); - } else if (data.toLowerCase().includes("done")) { - // Reminder: done///' textArea.innerHTML += "Collecte terminée
"; + textArea.innerHTML += "
Si aucun équipement n'est listé
"; + textArea.innerHTML += "- soit votre réseau est vide
"; + textArea.innerHTML += "- soit ils sont tous en timeout depuis un moment.
"; clearInterval(analysisStatus); - } else - networkInformationProgress = data; - // document.getElementById("refreshInformation").value = data; - if (data != analysisText) { - textArea.innerHTML += data + "
"; - analysisText = data; + } else { + if (content != analysisText) { + textArea.innerHTML += content + "
"; + analysisText = content; } + } } } }); diff --git a/desktop/php/Abeille-TopButtons.php b/desktop/php/Abeille-TopButtons.php index 686d2f0404..dd6869f86d 100644 --- a/desktop/php/Abeille-TopButtons.php +++ b/desktop/php/Abeille-TopButtons.php @@ -11,7 +11,7 @@ $tools = array( 'health' => array( 'bouton'=>'bt_healthAbeille', 'icon'=>'fa-medkit', 'text'=>'{{Santé}}' ), 'netList' => array( 'bouton'=>'bt_network', 'icon'=>'fa-sitemap', 'text'=>'{{Réseau}}' ), - 'net' => array( 'bouton'=>'bt_networkMap', 'icon'=>'fa-map', 'text'=>'{{Placement réseau (BETA)}}' ), + 'net' => array( 'bouton'=>'bt_networkMap', 'icon'=>'fa-map', 'text'=>'{{Placement réseau}}' ), 'compat' => array( 'bouton'=>'bt_supportedEqList', 'icon'=>'fa-align-left', 'text'=>'{{Compatibilité}}' ), 'ota' => array( 'bouton'=>'bt_Ota', 'icon'=>'fa-paperclip', 'text'=>'{{Mises-à-jour OTA}}' ), 'support' => array( 'bouton'=>'bt_maintenancePage', 'icon'=>'fa-medkit', 'text'=>'{{Maintenance}}' ), diff --git a/docs/fr_FR/Changelog.md b/docs/fr_FR/Changelog.md index fa560c8fdb..6166873e82 100644 --- a/docs/fr_FR/Changelog.md +++ b/docs/fr_FR/Changelog.md @@ -2,6 +2,7 @@ - Correction: 'Commande 0102-01- inconnue' (2719). - Sonoff SNZB-01P: Mise-à-jour du modèle (2716). +- Correction: Collecte LQI: Code C1 n'est plus un timeout mais 'aucun eq en vie'. ## 240710-BETA-2