Ping aller-retour Miotiq: byte 9 = command, script ping + écoute réponse
- SensorPayload: byte 9 passe de protocol_version (0x01) à command (0x00 par défaut) - Nouveau set_command() method (0x00=data normal, 0x01=ping test) - Nouveau script SARA/sara_ping_miotiq.py: envoie payload 100 bytes avec command=1, puis écoute la réponse descendante Miotiq pendant 15s via AT+USORD - Endpoint launcher.php sara_ping_miotiq - Bouton "Ping Miotiq" dans la section tests Miotiq (page modem) - Mise à jour error_flags.md avec la nouvelle map complète du payload Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -334,8 +334,10 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<p class="card-text"><strong>3. Test aller-retour</strong></p>
|
||||
<p class="text-muted small mb-2">Envoie un payload spécial puis vérifie la réception via l'API descendante Miotiq. (à venir)</p>
|
||||
<button class="btn btn-secondary" disabled>Bientôt disponible</button>
|
||||
<p class="text-muted small mb-2">Envoie un payload ping (command=1) via UDP puis écoute la réponse descendante Miotiq (~15s).</p>
|
||||
<button class="btn btn-primary" onclick="pingMiotiq()">Ping Miotiq</button>
|
||||
<div id="loading_ping_miotiq" class="spinner-border spinner-border-sm" style="display: none;" role="status"></div>
|
||||
<div id="response_ping_miotiq"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1728,6 +1730,32 @@ function testUdpSocket() {
|
||||
});
|
||||
}
|
||||
|
||||
function pingMiotiq() {
|
||||
console.log("Ping Miotiq round-trip test:");
|
||||
$("#response_ping_miotiq").empty();
|
||||
$("#loading_ping_miotiq").show();
|
||||
$.ajax({
|
||||
url: 'launcher.php?type=sara_ping_miotiq',
|
||||
dataType: 'text',
|
||||
method: 'GET',
|
||||
timeout: 60000,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
$("#loading_ping_miotiq").hide();
|
||||
$("#response_ping_miotiq").html(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('AJAX request failed:', status, error);
|
||||
$("#loading_ping_miotiq").hide();
|
||||
$("#response_ping_miotiq").html(`
|
||||
<div class="alert alert-danger py-2 mt-2">
|
||||
<strong>Erreur de communication</strong><br>
|
||||
<small>${error}</small>
|
||||
</div>`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Self test functions are now in assets/js/selftest.js
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user