How to: Use a custom script to add USB Printer support to a DAL device

A user can use the socat command to interact with a USB printer connected to the USB port of a Digi device.

Below you can find an example of the socat command, which starts a service on port TCP 9100 and pass a print task to the USB device.

Configuration>System>Scheduled tasks>Custom scripts>

socat -u TCP-LISTEN:9100,fork,reuseaddr OPEN:/dev/usb/lp0

 

 

Since communication will be achieved by the IP address of the router a custom firewall rule must be added:

Configuration>Firewall>Custom rules

           iptables -I INPUT -p tcp --dport 9100 -j ACCEPT

  • Open the Printers & scanners page on your Microsoft Windows PC. Click the Add a printer or scanner button and wait until the note "The printer that I want isn't listed" appears; click it.
  • In the following window choose TCP/IP address option and click Next.
  • Select Device type: TCP/IP Device, enter the router's LAN IP address and port name.
  • In the next window, select Device Type: Standard, find and select your printer's manufacturer from the dropdown
  • Select your printer from the list.
  • Next, the PC will look printer drivers. If the drivers for your printer have been installed prior, you can choose the option to replace them or use the currently installed drivers.
  • In the next two windows you will be asked you to enter a custom name for the printer and set up sharing rights. 

 

Last updated: Jun 18, 2024

Recently Viewed

No recently viewed articles

Did you find this article helpful?