Creating dummy ASCII driver for thermal printer (Star TSP600)

Luis Da Costa aliasbody at gmail.com
Mon Jan 28 18:51:40 PST 2013


> Luis Da Costa wrote:
>
> >> > Luis Da Costa wrote:
> >> >
> >> > >> Luis Da Costa wrote:
> >> > >>
> >> > >> >> Luis Da Costa wrote:
> >> > >> >>
> >> > >> >> > Hello everyone,
> >> > >> >> >
> >> > >> >> > I am new here, so if this is not the right place to post this
> >> > >> >> > please tell me.
> >> > >> >> >
> >> > >> >> > I bought a thermal Star TSP600 for my POS installation.
> >> > >> >> > Normally this device has a official website (licensed under
> >> > >> >> > GPLv2 if I'm not wrong, which is pretty cool and useful), but
> >> > >> >> > it only works (under Gnu/Linux and Mac, not on Windows) with
> >> > >> >> > the USB and Ethernet version... and as you may already imagine
> >> > >> >> > my version is a Serial one.
> >> > >> >> >
> >> > >> >> > Long story short. After a long time understanding how all of
> >> > >> >> > this should work, I've found a way to print. Simply by doing
> >> > >> >> > this :
> >> > >> >> >
> >> > >> >> > echo "Hello World" >> /dev/ttyUSB0
> >> > >> >> >
> >> > >> >> > It works nice (with no accents as expected) but this isn't a
> >> > >> >> > solution for a POS installation since I need the software
> >> > >> >> > (proprietary) to work with this printer (by using Cups as you
> >> > >> >> > may already understood).
> >> > >> >> >
> >> > >> >> > Under Fedora 18 I've managed to make it print something under
> >> > >> >> > cups using one of those generic drivers : - PostScript
> >> > >> >> > - Raw Queue
> >> > >> >> > - Others from other printers randomly chosen.
> >> > >> >> >
> >> > >> >> > After installing them with one of the generic drivers, I've
> >> > >> >> > tested with gedit and it would print, sometimes slowly,
> >> > >> >> > sometimes faster, but in all the cases I couldn't even
> >> > >> >> > understand what was printed (the best I got was one of the
> >> > >> >> > drivers that printed in big fonts all the settings used for
> >> > >> >> > printing like the font used, the size used etc..).
> >> > >> >> >
> >> > >> >> > So my question is (as I know programming, and need to have this
> >> > >> >> > printer working until the end of this month, and I am trying to
> >> > >> >> > not use Windows, since it works in there perfectly), is it
> >> > >> >> > possible to create a dummy driver for this kind of situations ?
> >> > >> >> > Or is it possible to edit the original ppd from this printer in
> >> > >> >> > order to add the serial support ?
> >> > >> >> >
> >> > >> >> > If yes, could anyone help me do this ? (Or just help me find a
> >> > >> >> > better solution that would work under cups in order for the POS
> >> > >> >> > software to recognize the printer and use it).
> >> > >> >> >
> >> > >> >> > Thanks in Advance for all the help. And sorry for my horrible
> >> > >> >> > English.
> >> > >> >> >
> >> > >> >> > Best Regards,
> >> > >> >> > Luis Da Costa
> >> > >> >>
> >> > >> >> Look at
> >> > >> >> http://www.starasia.com/productshow.asp?id=82
> >> > >> >> for Linux drivers.
> >> > >> >>
> >> > >> >> Helge
> >> > >> >>
> >> > >> >
> >> > >> >
> >> > >> > Hi Helge,
> >> > >> >
> >> > >> > Thanks for the help. But as I already said, those drivers are only
> >> > >> > for the Ethernet and USB version and I've got a Parallel/Serial
> >> > >> > version which is not compactible. I've already tried those drivers
> >> > >> > and they give me problems with the rasterstar filter, and when
> >> > >> > they don't, they simply don't print...
> >> > >> >
> >> > >> > I have better results with the Raw Queue drivers that with those
> >> > >> > ones
> >> > >> > :S
> >> > >> >
> >> > >> > Thanks in Advance,
> >> > >> > Luis Da Costa
> >> > >>
> >> > >> The driver(s) are independent of the backend used. For your serial
> >> > >> version you need to use the serial backend of CUPS. But it seems
> >> > >> your serial connection needs to be capable of transferring 8-bit
> >> > >> binary data.
> >> > >>
> >> > >> Helge
> >> > >>
> >> > >
> >> > > Hi there again,
> >> > >
> >> > > I've tried to install those drivers in a Fedora 14 i686 box with
> >> > > sucess, then I added the printer, and selected the same options as
> >> > > the printer output in the debug mode :
> >> > >
> >> > > - Baud Rate : 9,600bps
> >> > > - Data Bits : 8 Bits
> >> > > - Parity : None (Odd)
> >> > > - Handshake : DTR
> >> > >
> >> > > But nothing to do, I only receive "????????????" and some weird
> >> > > characters.
> >> > >
> >> > > The only difference is that sometimes with some options the text just
> >> > > prints upside down.
> >> > >
> >> > > What should I do then ? And how can I know if my serial connection is
> >> > > capable of transferring 8-bit binary data ? I have it connected to a
> >> > > serial-to-usb cable, can this be the problem ?
> >> > >
> >> > > Sorry for all this questions, and thank you for all you help.
> >> > >
> >> > > Best Regards,
> >> > > Luis Da Costa
> >> >
> >> > Am I right in assuming that your Fedora box's USB port is connected to
> >> > your printer's serial port by the usb-to-serial cable? That may indeed
> >> > be the cause of your issues.
> >> > To further dig into your problems, please do:
> >> > - execute
> >> >   cupsctl --debug-logging
> >> > - print a (not too big) test job to your printer
> >> > - execute
> >> >   cupsctl --no-debug-logging
> >> > - post (an URL to) the portion of your /var/log/cups/error_log that
> >> > contains
> >> >   all the messages related to the test job.
> >> >
> >> > Helge
> >> >
> >>
> >>
> >> Hi again,
> >>
> >> Before anything thanks again for taking your time to answer me.
> >>
> >> I haven't done the Gnu/Linux test yet, but I've been testing it on
> >> Windows with the same configuration.
> >>
> >> So I have  USB-to-SERIAL adapter connected to a SERIAL-to-PARALLEL (that
> >> comes with the machine) cable, connected to the printer. Connecting it
> >> directly to the board on a PC with a Serial port does exactly the same
> >> thing (but with less cables).
> >>
> >> Now on Windows I had to search a lot and for it to install the printer
> >> (as a legacy one, but that's not the point). And I've found that on
> >> Windows I have the exact same results as on Gnu/Linux... But only until I
> >> changed the drivers.
> >>
> >> On Gnu/Linux we only have 1 driver, the Raster Driver that works only
> >> with Ethernet and USB, but on Windows we have 2 drivers, the Line Driver
> >> and the Raster Driver. Since Windows Vista Star Micronics (at least for
> >> this device) stopped shipping 2 drivers (well they stopped shipping
> >> drivers at all since we have to go to the Windows Update thing to search
> >> them when installing the printer). After some testing I was able to
> >> correctly print, but only using the driver on Line Mode (on Raster Mode I
> >> wouldn't understand a thing of what was printed).
> >>
> >> I also changed the DIP Switches from the Parallel interface (because we
> >> can change it, but the USB one cost 50$ almost the same as the printer)
> >> in order for it to have a Baud Rate at 19,200bps instead of 9,600bps. The
> >> speed was up but it would take like 30 seconds to print for a normal size
> >> paper (which is a lot since I have a lot of costumers at the same time in
> >> my Bar).
> >>
> >> So for now this is what I know that could help making things work under
> >> Gnu/Linux: 1 - On parallel mode I can only use the Line Mode which is
> >> slow. But speed can be increased in 2 ways :
> >>  - Changing the font in order to use the stock font from the printer
> >>  (don't know how) - Increase the Baud Rate (already did and it saved me
> >>  only 5 seconds something like that).
> >> 2 - Change the interface but it is expensive.. It's a solution but not
> >> for now (and even after that I would need to have a rasterstar working
> >> under Gnu/Linux 64bits since the only version available is for 32 bits).
> >>
> >> I will test your commands and I will report it back to you.
> >>
> >> Thanks in Advance,
> >> Luis Da Costa
> >
> >
> > This is the output of the error_log on a Ubuntu 12.10 machine with the
> > TSP613 driver (the one of my printer) but with the Filter line removed
> > (where the raster scripted is used).
> >
> > http://pastebin.com/TPEU2aDA
> >
> > I had a pretty good result even if it's still non understandable text
> > (because I have less "???" and more actual text).
> >
> > I will report it back to you as fast as possible the same test on my
> > Fedora machine (I don't have access to it right know) but without that
> > line removed (since the script can be installed compared to Ubuntu).
>
> Well, according to your log file, you tried to print PostScript on that
> printer, which is treated by the printer as (nearly) ordinary text. As this
> "text" lacks any ESC commands, the state of the printer, regarding selected
> fonts etc., is at random, therefore the varying amount of "?"s printed.
>
> If you do not want to print using the raster filter chain, you need a
> special filter that converts plain text into the printer's line mode stream,
> which is text interspearsed with the appropriate ESC commands.
>
> I'd suggest to use the raster filter chain (so reestablish the cupsFilter
> statement for the rastertostar fikter in the PPD.
>
> Helge
>

Hi again,

Then what should I do ? Try to edit the Raster filter source code acording to the ESC commands on the Line Mode Programming manual for this printer ? Or is it an easier and faster way to solve this (even partially) since the result os worse with the cupsFilter line that without it ?

The best result I had until now was when I used a driver from another printer (don't remember which). It didn't print the right text (it just printed code) but it was the only one that allowed me to actually see any understandable text. Other than that the best is to print plain text with printf or even echo.

PS: Once again thank your for the time spending trying to solve this problem.

Best Regards,
Luis Da Costa




More information about the cups mailing list