Pregunta

Hello all tech saviors out there.

I am capturing serial data successfully using Minicom to a text file. The serial data comes from an automatic programmable controller serial port sent to an HP printer.

Unfortunately, Minicom ignores the PCL characters such as esc (ascii 27).

Example:

sent from serial port "(s16H00:01:41"

received in Minicom "16H00:01:41"

I am sure I am not getting the correct command line when opening Minicom.

Any suggestions?

Thanks for all the help so many have provided.

¿Fue útil?

Solución

Hello anyone that looks into this.

I found a different avenue that did exactly what I needed along with forwarding the serial data to a printer. In this case I used PYTHON.

There is a modified version of pyserial's serial_tcp_redirect.py available online. This version allows the user to set up a remote host that can accept the serial data via Ethernet.In this case a printer using port 9100 raw telnet.

I was able to add the file.write option to append the serial data to a file with all PCL characters.

I added these lines:

        logfile = open("/home/testwrite.txt","a")
        logfile.write("%s"%data)    
        print "%r" %data  #original part of program 
        logfile.close()
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top