0

I have been trying for a while now and cannot seem to connect to my Epson TM-T88V printer from my app built with Swift. I have tried what I learned here https://github.com/Shoptree/epsonPrintSDK/issues/3 and was able to make a connection, but it is a dated SDK and I need more printers to be compatible. I have also looked at the Epson pdf guide written in Obj-C and the Java version.

I have tried many variations of the following. (Note: I have no problem bridging the headers and getting access to the library.

var printer = Epos2Printer(printerSeries: 0, lang: 1)

    printer.connect("TCP:192.168.X.X", timeout: 10000)
    printer.beginTransaction()
    printer.addText("Hello World")
    printer.addCut(1)

Thanks in advance!

1 Answer 1

3

I am not sure if you still have this problem, but according to your code I can suggest couple of fixes:

  1. Put correct printer series.
  2. Add couple of feed lines. Some Epson printers don't print if there is no enough lines to print (6-8 lines enough).
  3. Call beginTransaction after adding text and cut.
  4. Call sendData and endTransaction at the end.

Here is updated code:

var printer = Epos2Printer(printerSeries: EPOS2_TM_T88.rawValue, lang: EPOS2_MODEL_ANK.rawValue)
printer.connect("TCP:192.168.X.X", timeout: 10000)
printer.addFeedLine(5)
printer.addText("Hello World")
printer.addFeedLine(5)
printer.addCut(EPOS2_CUT_FEED.rawValue)

printer.beginTransaction()
printer.sendData(Int(EPOS2_PARAM_DEFAULT))
printer.endTransaction()
Sign up to request clarification or add additional context in comments.

1 Comment

can we have to connect printer via bluetooth before put correct printer series (your step-1 in code) ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.