如何使用静态 IP 通过以太网配置 OctoPrint/OctoPi
为了配置 OctoPrint/OctoPi 使用具有静态 IP 的树莓派以太网接口,首先打开 SD 卡上的 rootfs 分区。之后,在你喜欢的文本编辑器中打开 etc/network/interfaces(你可能需要以 root 身份打开它,例如 sudo nano etc/network/interfaces - 确保你不要编辑本地计算机的 /etc/network/interfaces 而是 SD 卡上的那个)。
现在将以下文本复制到 etc/network/interfaces 的末尾:
octopi_static_ip.conf
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.234
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.0.255
dns-nameservers 8.8.8.8 8.8.4.4你可能需要调整 IP 地址以匹配你的路由器。
保存文件并将 SD 卡插入你的树莓派。你应该能够 ping 通 - 在我们的示例中,ping 192.168.1.234。
在 OctoPrint 0.16.0 上测试
原始来源: OctoPrint 论坛
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow