update
This commit is contained in:
@@ -61,6 +61,12 @@ if ($type == "sys_RTC_module_time") {
|
||||
echo $output;
|
||||
}
|
||||
|
||||
if ($type == "sara_ping") {
|
||||
$command = 'sudo /usr/bin/python3 /var/www/nebuleair_pro_4g/SARA/sara_ping.py';
|
||||
$output = shell_exec($command);
|
||||
echo $output;
|
||||
}
|
||||
|
||||
if ($type == "git_pull") {
|
||||
$command = 'sudo git pull';
|
||||
$output = shell_exec($command);
|
||||
|
||||
@@ -225,6 +225,24 @@
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<h3>Test HTTP server comm.</h3>
|
||||
<div class="row mb-3">
|
||||
<!-- SET URL -->
|
||||
|
||||
<div class="col-sm-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<p class="card-text">Test communication with the server.</p>
|
||||
<button class="btn btn-primary" onclick="ping_test()">Test</button>
|
||||
<div id="loading_ping" class="spinner-border spinner-border-sm" style="display: none;" role="status"></div>
|
||||
<div id="response_ping"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<h3>Send message (test)</h3>
|
||||
<div class="row mb-3">
|
||||
<!-- SET URL -->
|
||||
@@ -543,6 +561,27 @@ function setURL_saraR4(port, url){
|
||||
});
|
||||
}
|
||||
|
||||
function ping_test(port, url){
|
||||
console.log("Test ping to data.nebuleair.fr:");
|
||||
$("#loading_ping").show();
|
||||
$.ajax({
|
||||
url: 'launcher.php?type=sara_ping',
|
||||
dataType: 'text',
|
||||
//dataType: 'json', // Specify that you expect a JSON response
|
||||
method: 'GET', // Use GET or POST depending on your needs
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
$("#loading_ping").hide();
|
||||
// Replace newline characters with <br> tags
|
||||
const formattedResponse = response.replace(/\n/g, "<br>");
|
||||
$("#response_ping").html(formattedResponse);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('AJAX request failed:', status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function writeMessage_saraR4(port, message, type){
|
||||
console.log(type +" message to SARA R4 memory (port "+port+" and message "+message+"):");
|
||||
$("#loading_"+port+"_message_write").show();
|
||||
|
||||
Reference in New Issue
Block a user