我正在尝试通过 TCP/IP 通信与机械臂进行通信。它在 Windows 上运行良好,但当我在 Linux Matlab 上尝试时,我无法连接到机械臂。Matlab 一次又一次尝试连接
Connecting to 169.254.131.130:10300
Connecting to 169.254.131.130:10300
Connecting to 169.254.131.130:10300
Connecting to 169.254.131.130:10300
当我 ping 的时候
PING 169.254.131.130 (169.254.131.130) 56(84) bytes of data.
From 192.168.2.4 icmp_seq=1 Destination Host Unreachable
From 192.168.2.4 icmp_seq=2 Destination Host Unreachable
From 192.168.2.4 icmp_seq=3 Destination Host Unreachable
From 192.168.2.4 icmp_seq=4 Destination Host Unreachable
From 192.168.2.4 icmp_seq=5 Destination Host Unreachable
From 192.168.2.4 icmp_seq=6 Destination Host Unreachable
From 192.168.2.4 icmp_seq=7 Destination Host Unreachable
From 192.168.2.4 icmp_seq=8 Destination Host Unreachable
From 192.168.2.4 icmp_seq=9 Destination Host Unreachable
From 192.168.2.4 icmp_seq=10 Destination Host Unreachable
From 192.168.2.4 icmp_seq=11 Destination Host Unreachable
From 192.168.2.4 icmp_seq=12 Destination Host Unreachable
^C
--- 169.254.131.130 ping statistics ---
13 packets transmitted, 0 received, +12 errors, 100% packet loss, time 12055ms
pipe 3
问题可能出在 Linux IP 设置上。你有什么建议?
答案1
因为 169.254.xx 本身不是有效的 IP 范围。意味着 Windows 尝试通过 DHCP 获取 IP 失败,只能从该范围中随机选择一个。在与 192.168.2.4 相同的子网中分配正确的 IP,这样就没问题了
答案2
我找到了问题所在。你只需要将有线网络编辑为与其他计算机共享,从自动连接我的设备开始。