OctoPrint连接打印机时提示“Unhandled communication error”

按照https://github.com/foosel/OctoPrint/wiki/Setup-on-a-Raspberry-Pi-running-Raspbian的提示配置好OctoPrint,并按照标准的树莓派GPIO定义用串口连接打印机控制板和树莓派之后,访问Web管理界面,点connect,显示

Unhandled communication error

The was an unhandled error while talking to the printer. Due to that OctoPrint disconnected. Error: Failed to autodetect serial port, please set it manually.
捕获
原因是树莓派GPIO上的串口默认是用来SSH的(也有可能是我之前为了用SSH改了配置),所以需要再改回来。
 sudo nano /boot/cmdline.txt

原文件应该类似这样

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

将斜体部分删除,有可能斜体部分不完全一样,没关系,只要最后是如下内容就行

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

然后编辑/etc/inittab

sudo nano /etc/inittab

我的树莓派上这个文件是空的,所以没做什么改动,有的可能需要注释掉最后一行

#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

 

然后重启,启动OctoPrint,进入web管理页面,点右上角的“Settings”,进入设置,我们要手动加入默认的串口

 

a

 

,Connection框里就有默认串口的选项了

 

2016-05-10 (2)

 

选择正确的串口号和波特率,就可以连接打印机开始打印啦

 

 

 

参考:

http://blog.csdn.net/yangqicong11/article/details/26571787

http://blog.csdn.net/xukai871105/article/details/22713925

 

 

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注