WillemVH commited on
Commit
a60b2db
·
verified ·
1 Parent(s): 2e4ee75

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -19,17 +19,17 @@ servo_state = {
19
  state_lock = threading.Lock()
20
 
21
  def send_servo_command(servo_num, angle):
22
- """Send command to specific servo"""
23
  try:
24
  with state_lock:
25
  esp_ip = servo_state['esp_ip']
26
 
27
- if not esp_ip:
28
- return f"Error: No ESP32 IP configured"
29
-
30
  url = f"http://{esp_ip}/{servo_num}?angle={angle}"
31
- response = requests.get(url, timeout=1)
 
 
32
  return f"Servo {servo_num} → {angle}°"
 
33
  except Exception as e:
34
  return f"Error: {e}"
35
 
 
19
  state_lock = threading.Lock()
20
 
21
  def send_servo_command(servo_num, angle):
 
22
  try:
23
  with state_lock:
24
  esp_ip = servo_state['esp_ip']
25
 
26
+ # Use your ngrok URL directly
 
 
27
  url = f"http://{esp_ip}/{servo_num}?angle={angle}"
28
+ print(f"Calling: {url}")
29
+
30
+ response = requests.get(url, timeout=5)
31
  return f"Servo {servo_num} → {angle}°"
32
+
33
  except Exception as e:
34
  return f"Error: {e}"
35