diff --git a/html/saraR4.html b/html/saraR4.html
index 4bf5ec3..affd0a4 100755
--- a/html/saraR4.html
+++ b/html/saraR4.html
@@ -387,9 +387,54 @@ document.addEventListener('DOMContentLoaded', function () {
}
});
-
});
+window.onload = function() {
+ getModem_busy_status();
+ setInterval(getModem_busy_status, 1000);
+
+ //NEW way to get config (SQLite)
+ $.ajax({
+ url: 'launcher.php?type=get_config_sqlite',
+ dataType:'json',
+ //dataType: 'json', // Specify that you expect a JSON response
+ method: 'GET', // Use GET or POST depending on your needs
+ success: function(response) {
+ console.log("Getting SQLite config table:");
+ console.log(response);
+ //device name_side bar
+ const elements = document.querySelectorAll('.sideBar_sensorName');
+ elements.forEach((element) => {
+ element.innerText = response.deviceName;
+ });
+ },
+ error: function(xhr, status, error) {
+ console.error('AJAX request failed:', status, error);
+ }
+ });//end AJAX
+
+
+ //get local RTC
+ $.ajax({
+ url: 'launcher.php?type=RTC_time',
+ dataType: 'text', // Specify that you expect a JSON response
+ method: 'GET', // Use GET or POST depending on your needs
+ success: function(response) {
+ console.log("Local RTC: " + response);
+ const RTC_Element = document.getElementById("RTC_time");
+ RTC_Element.textContent = response;
+
+ },
+ error: function(xhr, status, error) {
+ console.error('AJAX request failed:', status, error);
+ }
+ });
+
+
+
+ }
+
+
function getData_saraR4(port, command, timeout){
console.log("Data from SaraR4");
console.log("Port: " + port );
@@ -811,69 +856,6 @@ function update_modem_configMode(param, checked){
-window.onload = function() {
- getModem_busy_status();
- setInterval(getModem_busy_status, 1000);
-
-
- fetch('../config.json') // Replace 'deviceID.txt' with 'config.json'
- .then(response => response.json()) // Parse response as JSON
- .then(data => {
- //get device ID
- const deviceID = data.deviceID.trim().toUpperCase();
- //document.getElementById('pageTitle_plus_ID').innerText = 'token: ' + deviceID;
- //get device Name
- const deviceName = data.deviceName;
-
- //get modem version
- const modem_version = data.modem_version;
- const modem_version_html = document.getElementById("modem_version");
- modem_version_html.textContent = modem_version;
-
-
-
- const elements = document.querySelectorAll('.sideBar_sensorName');
- elements.forEach((element) => {
- element.innerText = deviceName;
- });
-
-
- //get SARA_R4 connection status
- /*
- const SARA_statusElement = document.getElementById("modem-status");
- console.log("SARA R4 is: " + data.SARA_R4_network_status);
-
- if (data.SARA_R4_network_status === "connected") {
- SARA_statusElement.textContent = "Connected";
- SARA_statusElement.className = "badge text-bg-success";
- } else if (data.SARA_R4_network_status === "disconnected") {
- SARA_statusElement.textContent = "Disconnected";
- SARA_statusElement.className = "badge text-bg-danger";
- } else {
- SARA_statusElement.textContent = "Unknown";
- SARA_statusElement.className = "badge text-bg-secondary";
- }
- */
- //get local RTC
- $.ajax({
- url: 'launcher.php?type=RTC_time',
- dataType: 'text', // Specify that you expect a JSON response
- method: 'GET', // Use GET or POST depending on your needs
- success: function(response) {
- console.log("Local RTC: " + response);
- const RTC_Element = document.getElementById("RTC_time");
- RTC_Element.textContent = response;
-
- },
- error: function(xhr, status, error) {
- console.error('AJAX request failed:', status, error);
- }
- });
-
-
- })
- .catch(error => console.error('Error loading config.json:', error));
- }