USB PoS Printer advise
Posted
#1
(In Topic #1197)
Enthusiast

I need some advise. I have a fully working module that talks to my Epson TM-88IV thermal printer on comport and it works perfectly
And now I want to try and use a USB version of it
So I have found on my system /dev/usb/lp1 and I can echo to it with no problems
The problem I seem to have is when I try to open the port in my status module I get a error message saying "Stream is closed"
Do I handle usb connected devices differently then serial? Some advice would be welcomed.
I can easily add a option for usb to the current module as long as I know what I need to update (I assume one the dev is open it should still communicate the same within the code)
If anyone needs to see the actual module I can upload that
Andy
Error message on screen
Posted
Guru

Posted
Guru

Posted
Enthusiast

cogier said
From what I can see, there is a Linux Printer driver for your printer. Why not install that and just send a page to the printer or as I do with a Zebra Printer, create a PDF file and send that to the printer?
If I used the driver I loose all control
Over the printer and I will not get any status about the cash drawer etc from the printer.
Posted
Enthusiast

BruceSteers said
how exactly do you try to open it?
I was trying to open it just like a Serial Printer
Code (gambas)
- With Global.PrinterPort
- .PortName = Global.PortName
- .Speed = Global.BandRate
- Case "Hardware"
- .FlowControl = Global.PrinterPort.Hardware
- Case "Software"
- .FlowControl = Global.PrinterPort.Software
- Case "None"
- .FlowControl = Global.PrinterPort.None
- .DataBits = Global.DataBits
- .StopBits = Global.StopBits
- Case "None"
- .Parity = Global.PrinterPort.None
- Case "Odd"
- .Parity = Global.PrinterPort.Odd
- Case "Even"
- .Parity = Global.PrinterPort.Even
- Case "Open"
- Case "Close"
- Global.AddToScreenList("Error connecting to printer")
- Global.AddToScreenList("Connected to printer")
- EpsonPrinterInitialize
I know it is not a Serial device so I would need to do some update to my code to work with the USB Printer
Posted
Guru

If I used the driver I loose all control
Over the printer and I will not get any status about the cash drawer etc from the printer.
I found this command online tail -f /var/log/syslog. If you run the command in Terminal, then change the cash draw status, you may be able to see it as it happens. (Press [Ctrl]+C to exit). Every time I changed a USB, or turned a printer on, data poured in.
Posted
Enthusiast

cogier said
If I used the driver I loose all control
Over the printer and I will not get any status about the cash drawer etc from the printer.
I found this command online tail -f /var/log/syslog. If you run the command in Terminal, then change the cash draw status, you may be able to see it as it happens. (Press [Ctrl]+C to exit). Every time I changed a USB, or turned a printer on, data poured in.
Hi
I have install my development IDE (gamabs3) onto the PoS Terminal that has the USB printer attached (/dev/usb/lp0) I have chmod 777 the port so anyone can access it and when I run the printer module now insde the IDE I get the following error message "Unable to get configuration: Inappropriate ioctl for device"
I was setting it to /dev/usb/lp0 and speed of 115200
am I thinking along the right lines for the USB Printer or do I need to re think this?
Posted
Enthusiast

Code (gambas)
But I am still getting a Error connecting to USB Printer and then the same error message steam is closed (#53) could some one have a look and see if I am on the right lines (should the device not show up as a /dev/ttyUSB and not /dev/usb/lp1 (im on debian))
Chatgpt came up with this one
Of course I have had to update it to work
1 guest and 0 members have just viewed this.




