diff --git a/src/client/static/app.js b/src/client/static/app.js index f3efbf4..b6df902 100644 --- a/src/client/static/app.js +++ b/src/client/static/app.js @@ -31,7 +31,10 @@ document.addEventListener('DOMContentLoaded', () => { }; // Event Listeners for Control Buttons - if (reconnectBtn) reconnectBtn.addEventListener('click', () => sendCommand('/reconnect')); + if (reconnectBtn) reconnectBtn.addEventListener('click', () => { + console.log('Reconnect button clicked'); + sendCommand('/reconnect'); + }); if (startStreamBtn) startStreamBtn.addEventListener('click', () => sendCommand('/stream/streamon')); if (takeoffBtn) takeoffBtn.addEventListener('click', () => sendCommand('/command/takeoff')); if (landBtn) landBtn.addEventListener('click', () => sendCommand('/command/land')); @@ -61,7 +64,7 @@ document.addEventListener('DOMContentLoaded', () => { }; // Periodically Update Drone Status - setInterval(updateDroneStatus, 1000); // Update every second + setInterval(updateDroneStatus, 2000); // Update every second // Initial Status Update updateDroneStatus(); diff --git a/src/server/services/connections.py b/src/server/services/connections.py index 2fc7647..759e389 100644 --- a/src/server/services/connections.py +++ b/src/server/services/connections.py @@ -26,12 +26,10 @@ def release_and_renew(timeout=20): } try: # Release the IP address on wlan1 - print("releasing") release_cmd = ["sudo", "dhclient", "-r", "wlan1"] release_process = subprocess.run(release_cmd, capture_output=True, text=True, timeout=timeout) # Renew the IP address on wlan1 - print("renewing") renew_cmd = ["sudo", "timeout", str(timeout), "dhclient", "-v", "wlan1"] renew_process = subprocess.run(renew_cmd, capture_output=True, text=True, timeout=timeout) # renew wlan0 so default gateway issue is fixed (issue: broken internet connection for ui and all)