# 连接问题排查指南

<figure><img src="https://content.gitbook.com/content/fP3cCWKYuK5Zvo63eKgb/blobs/1Ae3120DUELPJce7rT28/image.png" alt=""><figcaption></figcaption></figure>

部分 SimFly Pad 用户在首次使用时会遇到网络连接问题，表现为无法连接到 SimFly Linker。通常可以按以下步骤排查：

* **测试基础网络连通性**（测试网络 ping）
* **测试 SimFly Linker 服务**

下面是详细的排查步骤。

## 测试基础网络连通性 <a href="#testing-basic-network-connectivity" id="testing-basic-network-connectivity"></a>

网络连通是最基本的前提。你的 SimFly Pad 设备必须能访问运行 SimFly Linker 的电脑，SimFly Pad 才能正常工作。

{% hint style="info" %}
当 SimFly Linker 运行时，它会自动向局域网内的设备进行广播，使 SimFly Pad 能够发现它。
{% endhint %}

### 方法一：使用 SimFly Pad 的 Connection Diagnose 功能 <a href="#testing-method-one-use-the-connection-diagnose-feature-on-simfly-pad" id="testing-method-one-use-the-connection-diagnose-feature-on-simfly-pad"></a>

> SimFly Pad 提供 Connection Settings 页面，可帮助你检测并定位部分问题。

1. 在 SimFly Pad 打开 Connection Settings 页面并点击 “Diagnose” 按钮。如果你使用的是 “AUTO SimFly Linker IP” 模式，SimFly Pad 会尝试自动获取运行 SimFly Linker 的电脑 IP 地址；如果失败，请在页面顶部手动输入 IP 地址后再次点击 Diagnose。
2. 在诊断项的 Ping 测试中，如果结果成功，说明 SimFly Pad 可以连接到你的电脑；如果失败，则表示 SimFly Pad 与电脑之间存在基础网络通信问题。请参考 PING Failure Guide 继续排查。

### 方法二 <a href="#method-twoefbc9a" id="method-twoefbc9a"></a>

* 你也可以使用第三方工具测试移动设备与指定 IP 地址之间的连通性。例如在 App Store 下载 ‘iNetTools’，使用其中的 Ping 测试功能来验证移动设备与电脑是否连通。

### 可能的解决方案 <a href="#potential-solutionsefbc9a" id="potential-solutionsefbc9a"></a>

* 尝试临时关闭 Windows 防火墙。
* [尝试将 Windows 网络配置文件切换为 “Private”。](https://support.microsoft.com/en-us/windows/make-a-wi-fi-network-public-or-private-in-windows-0460117d-8d3e-a7ac-f003-7a0da607448d)
* 确保移动设备与电脑连接到同一网络。
* 确认路由器未启用 WIFI isolation / device isolation 等隔离选项。
* 尝试在 SimFly Linker 的 Connection Diagnose 页面使用 ADMIN 按钮添加 “Allow Local Network Rule”。具体步骤：
  * 以管理员身份运行 SimFly Linker。
  * 点击 "Start" 按钮。
  * 点击 SimFly Linker 首页的 "Connection diagnose" 链接。
  * 点击 "Admin Actions"，选择 "Add SimFly Linker rule" 或 "Add Local Network Rule"。
* （iOS）确认已为 SimFly Pad 开启 “Local Network” 权限。

## **测试 SimFly Linker 服务** <a href="#test-simfly-linker-service" id="test-simfly-linker-service"></a>

{% hint style="warning" %}
你应先完成 “**测试基础网络连通性**”，再继续以下步骤。
{% endhint %}

如果你在 SimFly Pad 的 Connection Settings Diagnose 中 Ping 测试成功，但在 “test sending request” 步骤失败，很可能是 Windows 防火墙阻止了连接。

### **方法一：**

* 在 SimFly Linker 点击 “Start” 后，在 SimFly Pad 设备上打开浏览器（如 Safari 或 Chrome），访问 <http://xxx.xxx.xxx.xxx:39000/test>（将 xxx.xxx.xxx.xxx 替换为 SimFly Linker 的 IP 地址）。如果你看到如下页面，通常说明配置正确，SimFly Pad 应能正常工作。

<figure><img src="https://content.gitbook.com/content/fP3cCWKYuK5Zvo63eKgb/blobs/l8K1grZZ7zMcUVpzLkGQ/connection1.png" alt=""><figcaption><p>如果你在浏览器中看到这个页面，说明连接正常。</p></figcaption></figure>

你也可以在电脑浏览器中打开上述地址进行测试。如果电脑可以访问，但移动设备无法访问，则说明 SimFly Linker 服务运行正常，但 Windows 防火墙或其他设置在阻止移动设备访问。

### **方法二：**

* 在 SimFly Linker 点击 “Start” 后，你可以在 SimFly Pad 设备上进入 Connection Settings 页面并点击 Diagnose。如果显示一切正常（如下图所示），则说明防火墙设置通常没有问题。

<figure><img src="https://content.gitbook.com/content/fP3cCWKYuK5Zvo63eKgb/blobs/yH8j4pXffpVXSllw3QuZ/connection2.png" alt=""><figcaption></figcaption></figure>

### **Potential Solutions**

* 打开 SimFly Linker 的 Connection Diagnose 页面，点击 Start，然后查看诊断结果以定位潜在问题。
* 找到问题后，可在同一页面使用 ADMIN Action 按钮一键添加 “SimFly Linker Rule” 以设置防火墙规则。
* 检查是否运行了 VPN 软件，并尝试关闭（例如 ExpressVPN 可能会隔离你的设备）。
* 确认 SimFly Pad 已获得 Local Network 权限（可在系统设置中查看该权限）。

如果以上方法仍无法解决问题，欢迎联系我们。

{% hint style="info" %}
如果你能在联系我们时同时附上 SimFly Pad 和 SimFly Linker 的 Connection Diagnose 结果，会更有助于我们定位问题。 😊
{% endhint %}

## iOS Hotspot Network <a href="#ios-hotspot-network" id="ios-hotspot-network"></a>

如果你使用移动热点让电脑与 SimFly Pad 连接，请在 iOS 系统的 WLAN 设置中 <mark style="color:red;">**关闭**</mark> Private WLAN Address 选项。

## 通过 VPN 连接

如果出于某些原因，你希望连接 **不在同一局域网** 的 SimFly Pad 与 SimFly Linker，那么你需要搭建 VPN（例如 Tailscale），并将电脑与 SimFly Pad 都加入该 VPN。加入后，在 SimFly Pad 的 Connection Settings 页面手动填写电脑主机的 VPN IP 地址。

{% hint style="warning" %}
使用 VPN 在大多数情况下会增加网络延迟，具体取决于你的网络环境以及 VPN 的质量。
{% endhint %}
