如何为 PRUSA 打印机的 Ubuntu Pi 映像编译 cdc-acm.ko 内核模块
我有一台Prusa打印机,它不允许在Raspberry Pi CM4上与Ubuntu 21.10服务器进行USB /串行通信。
我正在尝试将串行端口传递给Docker图像。
我尝试通过 /dev /ttyAcm0和 /dev /ttyacm1,但它不起作用,因为它们不是正确的设备。
经过一些研究,事实证明,Prusa需要cdc-acm.ko
内核模块进行通信。默认情况下,Ubuntu Server Raspberry Pi不包含该模块,现有的串行端口不是正确的端口。
I have a PRUSA printer that would not allow USB / serial communication with Ubuntu 21.10 Server on a raspberry pi CM4.
I am trying to pass the serial port to a Docker image.
I have tried passing /dev/ttyACM0 and /dev/ttyACM1, but it isn't working, because they are not the correct devices.
After some research, it turns out that the PRUSA requires the cdc-acm.ko
kernel module for communication. This module is not included with Ubuntu Server Raspberry Pi by default and the existing serial ports were not the correct ports.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每次有较小的内核更新时,您都必须重复此过程。由于源基于父树,因此如果需要,您可以使用 git pull 从源进行更新。然而,就我的目的而言,这个模块实际上不会更新太多,所以当 apt 安装新内核时,我可以重新运行 make 和 make install 组件。
在您的主文件夹中安装内核源代码
准备构建/安装
这可以防止在使用 insmod 或 modprobe 加载模块时出现“no symbol version for module_layout”消息。
备份现有文件(如果存在)(如果您已经构建了另一个版本)
更改到包含 cdc-acm 模块源文件的目录。
的目录中构建模块
在安装模块
。确保模块加载
检查 dmesg 以查看串行端口是否已添加为设备。
通过 ID 验证串行设备,以便您可以传递到 Docker 容器等。
额外说明一下,以下是如何将此串行端口传递到 Docker 进行 OctoPrint。
You will have to repeat this procedure every time there is a minor kernel update. Because the source is based on the parent tree, you can update with a git pull from the source if you want to. For my purposes, however, this module really won't be updated much, so I can just re-run the make and make install components when a new kernel is installed by apt.
Install Kernel Source in your home folder
Prepare for build / install
This to prevent the message "no symbol version for module_layout" when loading the module with insmod or modprobe.
backup existing file if it exists (if you already built another version)
change to the directory with the cdc-acm module source files.
build the modules in the directory
install the modules.
make sure the module loads
check dmesg to see if the serial port is added as a device.
Verify Serial Device by ID, so you can pass to Docker container etc.
For extra credit, here is how you pass this serial port to Docker for OctoPrint.