1
votes
  • Epson model TM-T88V-i.
  • Connected to LAN.
  • Ping response OK.
  • Printing status sheet OK.
  • I have access to printer configuration page.

    http://192.168.x.x/PrinterConfigurationPage/

  • In configuration page - section devices raise error in test print button for the printer "local_printer", error: "EX_TIMEOUT A time-out ocurred".

reference (ePOS-Print API/XML):
https://download.epson-biz.com/modules/community/index.php?content_subject=ePOS-Print%20API/XML

simple test web site:

print.html

<script type="text/javascript" src="js/epos-print-3.0.0.js"></script>

code

function printTest() {
    // open print dialog
    $('#print').dialog('open');

    //
    // build print data
    //

    // create print data builder object
    var builder = new epson.ePOSBuilder();

    builder.addText('Test Print\n');
    builder.addFeedLine(1);

    // append paper cutting
    builder.addCut();

    //
    // send print data
    //

    // create print object
    var url = 'http://192.168.x.x/cgi-bin/epos/service.cgi?devid=local_printer&timeout=6000';
    var epos = new epson.ePOSPrint(url);

    // register callback function
    epos.onreceive = function (res) {
        // close print dialog
        $('#print').dialog('close');
        // print failure
        if (!res.success) {
            // show error message
            $('#receive').dialog('open');
        }
    }

    // register callback function
    epos.onerror = function (err) {
        // close print dialog
        $('#print').dialog('close');
        // show error message
        $('#error').dialog('open');
    }

    // send
    epos.send(builder.toString());

}

Request to service.cgi :

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
        <epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
            <text>Test Print!!&#10;</text>
            <feed line="1"/>
            <cut/>
        </epos-print>
    </s:Body>
</s:Envelope>

Response: epson api manual (status: 0x00000001 = No response from the TM printer)

<?xml version="1.0" encoding="UTF-8" ?> 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <response success="false" code="EX_TIMEOUT" status="1" xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print" /> 
    </soapenv:Body>
</soapenv:Envelope>

when i change the service url a other device

var url = 'http://192.168.x.x/cgi-bin/epos/service.cgi?devid=other_printer&timeout=6000';

Request correct

Sucess="False" code="DeviceNotFound" status="0"

Windows Application example the same response:

Public Class Form1

    ' URL of ePOS-Print supported TM printer
    Private address As String = "http://192.168.x.x/cgi-bin/epos/service.cgi?devid=local_printer&timeout=10000"

    ' XML namespace
    Private soap As XNamespace = "http://schemas.xmlsoap.org/soap/envelope/"
    Private epos As XNamespace = "http://www.epson-pos.com/schemas/2011/03/epos-print"

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        ' Create print document
        Dim req As XElement = _
            <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
                <s:Body>
                    <epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
                        <text lang="en" smooth="true">Intelligent Printer&#10;</text>
                        <cut/>
                    </epos-print>
                </s:Body>
            </s:Envelope>

        ' Send print document
        Dim client As WebClient = New WebClient()
        client.Headers.Set("Content-Type", "text/xml; charset=utf-8")
        AddHandler client.UploadStringCompleted, AddressOf UploadStringCompletedEventHandler
        client.UploadStringAsync(New Uri(address, UriKind.Absolute), req.ToString())

    End Sub

    ' Receive response document
    Private Sub UploadStringCompletedEventHandler(sender As Object, e As UploadStringCompletedEventArgs)

        If (e.Error IsNot Nothing) Then
            MessageBox.Show(e.Error.Message)
        Else
            'Parse response document
            Dim res As XElement = XElement.Parse(e.Result)
            Dim c = From el In res.Descendants(epos + "response") Select el.Attribute("success")
            MessageBox.Show(c.First().Value)
        End If

    End Sub

End Class
1

1 Answers

0
votes

Two possibilities:

Your printer has a device id that is different from local_printer - check the configuration page.

Or the ePOSPrint() function does not allow sending the url directly. What I have on my first test page (I'm working on building an app for the same printer right now) looks different than on yours:

var epos = new epson.ePOSPrint();
epos.address = 'http://192.168.0.1/cgi-bin/epos/services.cgi?devid=local_printer&timeout=6000';

Note the empty () and how the url is delivered after initialization.


After checking, it looks like some other test code I have does submit the url as parameter to the function like you have it, so my only guess is that the device id local_printer is incorrect.