[ Raspberry Pi or Android ] --> WiFi Router --> USB printer

Click For Summary

Discussion Overview

The discussion revolves around setting up a USB printer connected to a broadband router for use with a Raspberry Pi Model-4 and an Android phone. Participants explore the necessary configurations and troubleshooting steps involved in achieving successful printing from these devices.

Discussion Character

  • Technical explanation
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant inquires about the possibility of configuring a Raspberry Pi Model-4 and an Android phone to print to a USB printer connected to a broadband router, referencing existing port settings that work with a Windows laptop.
  • Another participant mentions the use of the CUPS service on the Raspberry Pi, noting that it supports a range of Samsung printers but encounters issues when attempting to print a test page, leading to an error message.
  • A different participant describes an attempt to send data from a print file to the USB printer using Wolfram, but experiences an error indicating potential issues with the data format or communication method required by modern printers.
  • One participant shares their experience with using a specific driver for the Samsung ML-1666 printer on Windows, contrasting it with their unsuccessful attempts to use a similar driver on the Raspberry Pi, and ultimately finds success after installing the "printer-driver-splix" package.

Areas of Agreement / Disagreement

Participants express varying levels of success and challenges in configuring their printing setups, with no consensus on the best approach for all devices. Some participants agree on the utility of the CUPS service and the "splix" driver, while others remain uncertain about the correct data transmission methods for modern printers.

Contextual Notes

Participants mention specific printer models and configurations, but there are unresolved questions regarding the optimal port settings and communication protocols for different devices. The discussion reflects a mix of trial and error, with some assumptions about compatibility and functionality that may not be universally applicable.

Swamp Thing
Insights Author
Messages
1,047
Reaction score
786
A couple of years ago, I connected a USB printer to the USB socket on my broadband router. After a lot of trial and error (of which I remember no details) I was able to print from my windows laptop. Here are the port settings that currently work from the laptop:

printerPort.png
1) Based on the above information, can I set up my Raspberry Pi Model-4 to print to the same setup? How?

2) Ditto for my Android phone.

3) Or, is there a different port config (e.g. LPR instead of Raw) that will work better with the Pi or the Android? And still work for Windows, of course.
 
Last edited:
Computer science news on Phys.org
A bit of progress...
You have to use the CUPS service to set up printers on the Raspberry Pi. It has a web based interface at localhost:631. When I went through the "add printer" wizard, I found that it supports a range of Samsung printers, including mine (ML-1660).

But when I print a test page, nothing happens. Sometimes, after a long time, the printer spits out a page with an error message.

I decided to insert a debug waypoint by setting it up to dump the Samsung compatible printer data to a file on disk, and now the test page goes to a file of about 125 kB.

Now I would like to pipe this file to 192.168.1.1:9100 as the next stage of debugging. How can I do that?
 
I tried to use Wolfram to send data from the print file (created as described above) to the usb printer hosted on the WiFi router:
Code:
ip = "192.168.1.1:9100"
port = "TCP"
socket = SocketConnect[ip, port]
data = BinaryReadList["/home/pi/Desktop/printerFile/printerFile.out"]
BinaryWrite[socket, data]
SocketClose[socket]

Nothing happens. Sometimes, after a long time, an error page is printed: "INTERNAL ERROR = Including corrupted data".

I now suspect that you can't just dump binary data to the printer, as one could in the 1980s and 90s. In more modern printers (esp. USB ones?) you probably need duplex bidirectional communications before and while data is being transferred?
 
In Windows, I have been using a "Samsung ML-1660 Series Class Driver", and it works. See pic in my first post. (My actual printer is ML-1666, which I have been assuming is of the "1660 series class".

After much digging and trial & error, I found that this logic doesn't cut it on the Raspberry Pi. I was initially trying to use a ML-1660 driver, which wasn't working.

Someone on the web recommends doing this:

Code:
sudo apt-get install printer-driver-splix

... after which I could then see the actual model that I have (ML-1666) in the CUPS list of printers.

Once I selected this, everything began to work flawlessly. :smile:👍

Apparently "splix" is a driver package that supports certain Samsung printers that use "Samsung Printer Language" or SPL.
 
Last edited:
  • Like
Likes   Reactions: Wrichik Basu

Similar threads

  • · Replies 2 ·
Replies
2
Views
667
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 4 ·
Replies
4
Views
8K
  • · Replies 1 ·
Replies
1
Views
681
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 24 ·
Replies
24
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 6 ·
Replies
6
Views
5K