zap*_*hod 5 usb devices 11.10 printing
我有一个通过通用 USB 连接到并行适配器的激光切割机。激光切割机说 HPGL,碰巧,但由于这是激光切割机而不是绘图仪,我通常想自己生成 HPGL,因为我关心切割的顺序、速度和方向等。
在以前版本的 Ubuntu 中,我可以通过将 HPGL 文件直接复制到相应的 USB“lp”设备来打印到切割机。例如:
cp foo.plt /dev/usblp1
Run Code Online (Sandbox Code Playgroud)
好吧,我刚刚升级到 Ubuntu 11.10 oneiric,我在 /dev 中找不到任何“lp”设备了。哦!
在 Ubuntu 中将原始数据发送到并行端口的首选方式是什么?我已经尝试过系统设置 > 打印 > + 添加,希望我可以将我的设备与某种“原始打印机”驱动程序相关联,并使用类似的命令打印到它
lp -d LaserCutter foo.plt
Run Code Online (Sandbox Code Playgroud)
但是我的 USB 转并行适配器似乎没有出现在列表中。我看到的是我的 HP Color LaserJet、两个 USB 转串口适配器、“输入 URI”和“网络打印机”。
同时,在 /dev 中,我确实看到了用于 2 个 USB 到串行适配器的 /dev/ttyUSB0 和 /dev/ttyUSB1 设备。我没有看到任何与 HP 打印机(升级前是 /dev/usblp0)明显对应的东西,除了通用的 USB 东西。例如,不sudo find /dev | grep lp产生任何输出。不过,我似乎可以很好地打印到 HP 打印机。打印机设置 GUI 为其提供了一个以“hp:”开头的设备 URI,这对并行适配器没有多大帮助。
CUPS 管理员指南听起来好像我可能需要向它提供表单的设备 URI parallel:/dev/SOMETHING,但当然,如果我有一个,/dev/SOMETHING我可能会继续直接写入它。
这是dmesg我从 USB 端口断开并重新连接设备后的内容:
[ 924.722906] usb 1-1.1.4: USB disconnect, device number 7
[ 959.993002] usb 1-1.1.4: new full speed USB device number 8 using ehci_hcd
Run Code Online (Sandbox Code Playgroud)
这是它在 lsusb -v 中的显示方式:
Bus 001 Device 008: ID 1a86:7584 QinHeng Electronics CH340S
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x1a86 QinHeng Electronics
idProduct 0x7584 CH340S
bcdDevice 2.52
iManufacturer 0
iProduct 2 USB2.0-Print
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 96mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 7 Printer
bInterfaceSubClass 1 Printer
bInterfaceProtocol 2 Bidirectional
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 0
Device Status: 0x0000
(Bus Powered)
Run Code Online (Sandbox Code Playgroud)
您正在查找的设备文件/dev/usb/lpX由驱动程序提供usblp。但在 Ubuntu 11.10 中,该驱动程序似乎已被列入黑名单。查看/etc/modprobe.d/blacklist-cups-usblp.conf文件:
# cups talks to the raw USB devices, so we need to blacklist usblp to avoid
# grabbing them
blacklist usblp
Run Code Online (Sandbox Code Playgroud)
如果还是想直接向设备发送数据,可以暂时加载驱动程序modprobe usblp(黑名单只是阻止自动加载驱动程序)。完成后,您可以使用 卸载它modprobe -r usblp。
| 归档时间: |
|
| 查看次数: |
6085 次 |
| 最近记录: |