Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Star TSP143IIILAN #8

Open
svang-app opened this issue Apr 13, 2021 · 21 comments
Open

Support for Star TSP143IIILAN #8

svang-app opened this issue Apr 13, 2021 · 21 comments

Comments

@svang-app
Copy link

svang-app commented Apr 13, 2021

Hi @receiptline,

Things worked pretty well with Star-MC printers and the receiptline works perfect.

I tried to test on Star TSP100IIILAN or TSP143IIILAN and it did not work and it may be due to no support for ESC commands for Star 100/143 printers.

Is it possible that you could please add support for Star TSP100IIILAN? Like Epson TM-220, the Start TSP100 is also widely used by restaurants.

Could there be a work-around so that I could still use receiptline and send the print to Star-100/143? I looked at other libraries but I am very reluctant to use other library as we have already invested on reciptline for the printing.

It will be very helpful to us as we have developed everything using receiptline for local and web printing.

I really appreciate your help on this the way you helped on Epson Impact Printers.

@receiptline
Copy link
Owner

Hello!
Thank you for using receiptline.

I am studying about Star TSP100 series.
It looks like there are two different paths to printing.

  1. Line Mode (Emulation)
    ReceiptLine
    --> Star Line Mode Command Emulator
    --> Star Virtual TCP/IP Port Emulator (or Star Virtual Serial Port Emulator)
    --> TSP100IIILAN

  2. Graphic Mode
    ReceiptLine
    --> SVG
    --> PNG
    --> Star Graphic Mode Command
    --> TSP100IIILAN

Which would be better?

I will start implementation with the Star Line Mode Command for now.
It is similar to the StarPRNT Command.

@svang-app
Copy link
Author

I sincerely appreciate your reply. I knew that you will come back with some solution.

Yes - Please implement both Line mode and then graphic mode. The line mode is the highest priority and the graphic can come later. In the graphic - we will need PNG. The TSP100IIILAN is the one that is mostly used in kitchens now. The USB is used near the tablet/POS.

In terms of priority:

  • Line Mode (Emulation) -- through TSP100IIILAN
  • Graphic Mode -- using PNG through TSP100IIILAN

@receiptline
Copy link
Owner

Thank you for waiting.
Version 1.4.0 is now available, please try it with TSP100 series.

  • Line Mode (Emulation)
  • Graphic Mode
// TSP100 series
const printer = {
    "host": "127.0.0.1",
    "port": 9100,
    "cpl": 48,
    "spacing": true,
    "command": "starlinesbcs"
};

@svang-app
Copy link
Author

svang-app commented Apr 18, 2021

Excellent - Thank YOU very much. It worked very well after I tested it. We will start using it.

Thank YOU so much for your very prompt enhancements.

Update: I tested with MC-30 where it worked well but when I am testing on Star 100 from the designer.js, it shows the print was successful with status 200 but nothing printed on the printer. Is there a way, I can get some debug info to check it.

@svang-app
Copy link
Author

svang-app commented Apr 19, 2021

@receiptline - Any idea how I can debug and send you info as why it is failing to print.

Just an update - I tried the test example from this link https://github.com/Klemen1337/node-thermal-printer and that worked OK on Star MC-30 but it did not work on the Star-100 printer. The only library that works for Star-100 printer is react-native https://github.com/infoxicator/react-native-star-prnt. But we want to move away from it and use receiptline.

@receiptline
Copy link
Owner

Thank you for waiting.
Version 1.5.0 is now available, please try it with TSP100IIILAN.

  • Line Mode (Emulation)
  • Graphic Mode
// TSP100IIILAN
const printer = {
    "command": "stargraphic"
};

@vikramsvang
Copy link

Ok - thank you. I will try it today.

@svang-app
Copy link
Author

Hi @receiptline - I tested the new build using stargraphic but when I print it on TSP100IIILAN, it just do a paper cut and it did not print anything. Am I missing something? As you must have already tested it working on TSP100IIILAN. Is there anything that I am missing? I sincerely appreciate your assistance.

@receiptline
Copy link
Owner

Hello!
TSP100 series is a special printer that does not have device fonts, so please print with images.
To print an image containing text, it is better to print in monochrome.

const printer = {
    command: "stargraphic",
    gradient: false,
    threshold: 128 // please adjust it
}

Thanks.

@svang-app
Copy link
Author

Hi @receiptline - Ok - I got your point. I tried to send just a graphic image using designer.js. The paper advanced with a paper cut but nothing got printed (means - that it was blank). I tried different threshold values such as 0, 64, and 128 with the same result. I tried the same printer on MC-30 and there it is also blank page print. (Note: If I use starsbcs - it prints fine.)

Can you please check? I can provide you any other info that you might need. Thank you for your assistance.

@receiptline
Copy link
Owner

Hello. Unfortunately, I don't have a TSP143IIILAN at hand right now. So I tested it on MCP31.

printers.json in ReceiptLine Designer

    "tsp100lan": {
        "host": "192.168.1.253",
        "port": 9100,
        "gradient": false,
        "gamma": 1.0,
        "threshold": 160,
        "command": "stargraphic"
    }

MCP31 does not support Star Graphic Mode, but it printed a mirror image and cut the paper.

mcp31

@svang-app
Copy link
Author

Hi @receiptline - I tested just a simple graphic and it printed ok on the TSP100 printer. I should have paid attention to your message that the device fonts are not there in the TSP100.

I tried this and it printed well.

{image:iVBORw0KGgoAAAANSUhEUgAAAIAAAAAwAQMAAADjOuD9AAAABlBMVEUAAAD///+l2Z/dAAAAZklEQVQoz2P4jwYYRrrABwYGOwYG5gMMDBUMDPxAgQcMDDJAgQYGhgJcAv//yMj//9/8//+HerAZRAsAzUASAJoGMhRF4AC6ANCIAhQz8AkAXQoUOIDidBQBkG8hAj8gAqPJAa8AAGjulhOsX97yAAAAAElFTkSuQmCC}

The request that I have for you is this - if this is doable in making changes in your designer.js so that I can send the graphics output to the printer for testing purposes.

For example:

When the printer is the stargraphic, can you please generate SVG using your library and then convert it to the PNG and then send that PNG to the printer. In that fashion - it will solve the problem. The print may not exact but this is much better than not having a print.

Example: When printer is stargraphic, first generate the SVG and then convert to the PNG and then generate the command again - which can then be sent to the printer.

const { convert } = require("convert-svg-to-png");
const printer = {
        cpl: cpl,
        encoding: 'cp437',
        upsideDown: false,
        gamma: 1.8,
        spacing: true,
        command: 'svg'
    };
    var buffer = receiptline.transform(ticket, printer);
    var binary;
    // convert svg to png
    convert(buffer, { "background": "0xffffff" }).then((png) => {
      // Write code to generate the command again so that it can be sent to stargraphic printer through the designer.
    }

Thank YOU.

@receiptline
Copy link
Owner

That's right.
I will add a print option to printers.json to choose SVG image or device font.
I appreciate it so much.

@Tadija1986
Copy link

Tadija1986 commented Nov 25, 2022

Hello @receiptline,

I am also using TSP143IIILAN for printing receipt. I succesfully implemented printing for SP700 but this printer can not print in STAR LINE mode, only in GRAPHIC mode. So I have a question for you, when you click on Send in ReceiptLine Designer are you sending raster data to image buffer or not?

Thank you,
Nikola

@carlosa54
Copy link

Hi @Tadija1986, saw that you were able to print to an SP700 printer, do you get any issues with font size? For some reason I'm able to print the receipts on an SP700 but the font size is not working (It always use a small font even if I set it to 5x using ^^^^^).

If it's working for you can you share an example?

@Tadija1986
Copy link

Tadija1986 commented Nov 29, 2022

Hi @carlosa54, for SP700 I am using STAR LINE mode, so you can not use font: 5px, there are only three fonts available: 7x9 font, 5x9 font (2P-1) and 5x9 font (3P-1), you can check this in STAR LINE Command Specifications.

@receiptline
Copy link
Owner

Hello!
Thank you for using ReceiptLine.

We checked SP700 specs and found that the command is the STAR MODE on dot impact printers.

This command is similar to STAR LINE mode.
If you use STAR LINE mode, text size, images and barcodes/2D codes would not work.

We can implement a command set for the STAR MODE on dot impact printers as an experimental feature.

Best regards.

@carlosa54
Copy link

Thanks @receiptline that explains the text size not working for the SP700. Happy to test the experimental feature once it’s implemented

@lkb2k
Copy link

lkb2k commented Mar 9, 2023

Also looking for support printing to TSP143. The TSP143 only supports printing a raster image, so some method to generate a PNG instead of an SVG would be super helpful.

@receiptline
Copy link
Owner

Hi!

For TSP143, please try the following

  1. Create a virtual serial port with the TSP100 printer driver
  2. Relay the serial port with the Serial-LAN Converter (servers.json)
  3. Set the printer configuration (printers.json)
"tsp143": {
    "host": "127.0.0.1",
    "port": 9100,
    "asImage": true,
    "command": "emustarlinesbcs"
}

Best regards.

@lkb2k
Copy link

lkb2k commented Mar 23, 2023

Hi,

I'm actually trying to print to a TSP143USB from a react-native iOS app. I don't mind rendering the receipt on a server, but I'm struggling to find an output format that I can read via http and then feed to the Star Micronics react-native library. Do you have a recommendation on how best to accomplish that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants