-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_pairing.sh
More file actions
executable file
·92 lines (84 loc) · 2.88 KB
/
debug_pairing.sh
File metadata and controls
executable file
·92 lines (84 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
# Debug script to check Open Claw gateway connectivity and pairing
# Optionally pass the gateway host/IP as the first argument.
GATEWAY_HOST="${1:-100.64.1.2}"
echo "=== Open Claw Gateway Debugging ==="
echo "Gateway: $GATEWAY_HOST"
echo ""
# Check if gateway is reachable
echo "1. Checking gateway connectivity..."
if ping -c 1 -W 1 "$GATEWAY_HOST" > /dev/null 2>&1; then
echo " ✓ Gateway is reachable via ping"
else
echo " ✗ Gateway is NOT reachable via ping"
echo " Check your Tailscale connection"
exit 1
fi
# Check common ports
echo ""
echo "2. Checking common ports..."
for port in 80 443 8080 8443 3000 5000 8000; do
if nc -z -w 1 "$GATEWAY_HOST" "$port" 2>/dev/null; then
echo " ✓ Port $port is open"
else
echo " ✗ Port $port is closed"
fi
done
# Try to find WebSocket endpoint
echo ""
echo "3. Testing WebSocket endpoints..."
for scheme in "ws" "wss"; do
for port in "" ":80" ":443" ":8080" ":8443" ":3000" ":5000"; do
if [ -z "$port" ]; then
if [ "$scheme" = "wss" ]; then
test_port=443
else
test_port=80
fi
else
test_port=$(echo $port | tr -d ':')
fi
if nc -z -w 1 "$GATEWAY_HOST" "$test_port" 2>/dev/null; then
endpoint="${scheme}://${GATEWAY_HOST}${port}/ws"
echo " Testing: $endpoint"
# Try to connect (this is a basic check)
fi
done
done
# Check pairing endpoint
echo ""
echo "4. Testing pairing endpoint..."
for scheme in "http" "https"; do
for port in "" ":80" ":443" ":8080" ":8443"; do
if [ -z "$port" ]; then
if [ "$scheme" = "https" ]; then
test_port=443
else
test_port=80
fi
else
test_port=$(echo $port | tr -d ':')
fi
if nc -z -w 1 "$GATEWAY_HOST" "$test_port" 2>/dev/null; then
url="${scheme}://${GATEWAY_HOST}${port}/pair"
echo " Testing: $url"
if [ "$scheme" = "https" ]; then
response=$(curl -k -s -o /dev/null -w "%{http_code}" --max-time 2 "$url" 2>/dev/null)
else
response=$(curl -s -o /dev/null -w "%{http_code}" --max-time 2 "$url" 2>/dev/null)
fi
if [ "$response" != "000" ] && [ "$response" != "" ]; then
echo " → HTTP $response"
fi
fi
done
done
echo ""
echo "=== Debugging Tips ==="
echo "1. Check Open Claw logs on your gateway host for pairing attempts"
echo "2. Verify the WebSocket endpoint path (might not be /ws)"
echo "3. Check if Open Claw requires authentication before pairing"
echo "4. Verify the pairing token format matches what Open Claw expects"
echo ""
echo "To check iOSLobster app logs, run:"
echo " log stream --predicate 'process == \"iOSLobster\"' --level debug"