我正在使用SerialIP库并试图为我的 Arduino 建立一个 SLIP 连接。现在,当我尝试 ping 时,RX LED 亮起,证明它确实收到了数据包,但 TX 引脚从未亮起,数据包也没有返回。
我正在使用示例服务器程序。它确实设法到达了主循环(已经用一些数字写入进行了测试),所以我唯一能看到代码有问题的是 IP 地址定义:
// Set the IP address we'll be using. Make sure this doesn't conflict with
// any IP addresses or subnets on your LAN or you won't be able to connect to
// either the Arduino or your LAN...
IP_ADDR myIP = {192,168,5,2};
IP_ADDR subnet = {255,255,255,0};
我正在通过 Ubuntu 执行此操作,当我运行时route
,我得到了这一行:
Destination Gateway Genmask Flags Metric Ref Use Iface
... ... ... ... ... ... ...
192.168.5.2 * 255.255.255.255 UH 0 0 0 sl0
我想也许我必须将子网更改为 {255,255,255,255},但它仍然有相同的结果:没有 TX 的点亮 RX。
现在我不知道为什么这不起作用。为什么是解决方案?