autocommit
This commit is contained in:
@@ -31,7 +31,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Event Listeners for Control Buttons
|
// 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 (startStreamBtn) startStreamBtn.addEventListener('click', () => sendCommand('/stream/streamon'));
|
||||||
if (takeoffBtn) takeoffBtn.addEventListener('click', () => sendCommand('/command/takeoff'));
|
if (takeoffBtn) takeoffBtn.addEventListener('click', () => sendCommand('/command/takeoff'));
|
||||||
if (landBtn) landBtn.addEventListener('click', () => sendCommand('/command/land'));
|
if (landBtn) landBtn.addEventListener('click', () => sendCommand('/command/land'));
|
||||||
@@ -61,7 +64,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Periodically Update Drone Status
|
// Periodically Update Drone Status
|
||||||
setInterval(updateDroneStatus, 1000); // Update every second
|
setInterval(updateDroneStatus, 2000); // Update every second
|
||||||
|
|
||||||
// Initial Status Update
|
// Initial Status Update
|
||||||
updateDroneStatus();
|
updateDroneStatus();
|
||||||
|
|||||||
@@ -26,12 +26,10 @@ def release_and_renew(timeout=20):
|
|||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
# Release the IP address on wlan1
|
# Release the IP address on wlan1
|
||||||
print("releasing")
|
|
||||||
release_cmd = ["sudo", "dhclient", "-r", "wlan1"]
|
release_cmd = ["sudo", "dhclient", "-r", "wlan1"]
|
||||||
release_process = subprocess.run(release_cmd, capture_output=True, text=True, timeout=timeout)
|
release_process = subprocess.run(release_cmd, capture_output=True, text=True, timeout=timeout)
|
||||||
|
|
||||||
# Renew the IP address on wlan1
|
# Renew the IP address on wlan1
|
||||||
print("renewing")
|
|
||||||
renew_cmd = ["sudo", "timeout", str(timeout), "dhclient", "-v", "wlan1"]
|
renew_cmd = ["sudo", "timeout", str(timeout), "dhclient", "-v", "wlan1"]
|
||||||
renew_process = subprocess.run(renew_cmd, capture_output=True, text=True, timeout=timeout)
|
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)
|
# renew wlan0 so default gateway issue is fixed (issue: broken internet connection for ui and all)
|
||||||
|
|||||||
Reference in New Issue
Block a user