autocommit

This commit is contained in:
ALIHAN DIKEL
2024-10-29 23:11:57 +03:00
parent 7ebd306bcb
commit bbbdb0e59c
2 changed files with 5 additions and 4 deletions

View File

@@ -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();

View File

@@ -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)