I try to setup my raspberry pi 3 as a virtual printer. My scenario is the following:
Legacy System (running Windows 7) -> COM port -> cross-wired rs232 cable -> rpi rs232 extension board for GPIO -> /dev/ttyAMA0 port on latest Raspbian
I try to read the incoming printing jobs at the rpi end. I cannot get this working. When using pyserial, I can exchange data between my windows system and my rpi using the following code:
Raspberry (receiving end):
import serial with serial.Serial(port='/dev/ttyAMA0', baudrate=9600, bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=0, rtscts=0) as ser: x = ser.readline() print x
Windows (sending end):
PS> [System.IO.Ports.SerialPort]::getportnames() COM1,9600,None,8,one PS> $port= new-Object System.IO.Ports.SerialPort COM1,9600,None,8,one PS> $port.open() PS> $port.WriteLine("Hello world") PS> $port.Close()
Result: "Hello world" is printed on the rpi's console.
Issue: However, the same COM port does not work as a "Generic / Text only" printer. No data is delivered to the rpi.
Question: What is missing on the receiving end to act as a standard printer (such as those using the ESC/POS printer control language)? It seems like Windows does not treat the rpi as a printer. What am I missing here?