Tomato firmware in default only recognize one printer. If more printers are detected, it assign the first detected printer to lp0. When a printer is plugged into the Tomato router and turned on, the printer port is assigned.
To add a second p910nd instance, you need to manually run it with p910nd -f /dev/usb/lp1 1, and add -b for bidirectional if needed. When sharing one printer using p910nd in Tomato firmware, the first printer will be assigned to default port 9100. If you plug in more than one printers, the usb printer kernel module assigns /dev/usb/lp devices in the order printers are turned on/off. When a printer is turned on and recognized on the usb bus, it receives the first free device name in /dev/usb/lp.
If you are using more than one printers and turn them on and off all the time, you have to change device assignments for p910nd dynamically. The following configuration uses the Hotplug script to pair printers to designed ports. This allows multiple printers to be recognized, assigned ports based on the product ID, same ports assigned will resume when printers are connected/turned on. Works on both usb printer and parallel printer using serial to USB adapter.
1. Turn on “Core USB Support”, “USB 2.0 Support”, “USB 1.1 Support (Optional)”, “USB Printer Support”, and “USB Storage Support” under “USB Support”.
2. Unplug all printers. Copy and paste the following code into the “Hotplug script” box.
The following code is a demo of sharing three printers.
1 | #!/bin/sh |
Tomato Printers
3. plug each printer one by one into the router, check “/var/log/hotplug”, copy and paste printers’ PRODUCT, VID, and PID information into the hotplug code above.
4. Turn off “USB Printer Support”, this will disable the default printer support and port assignation.
5. Copy and paste the following code into “init” under “Administration” “Scripts”
This will load the printer support when the router start.
1 | modprobe usblp |
6. This is it. Reboot and test
Note: Hotplug script box needs “USB Storage Support” be turned on at least. If you don’t want USB Storage Support, you can turn it off by using the code into “init” under “Administration” “Scripts”.
1 | modprobe -r usb_storage |
Comments