7 Replies to “escpos-php 1.5 released”

  1. Hi Mike,

    We have integrated below code in Laravel5 and working fine with Ubuntu 16 in our local machine but same code is not working on our staging server (qc.xyz.com). CentOS is on staging server.

    Sample code:

    use Mike42\Escpos\PrintConnectors\FilePrintConnector;
    use Mike42\Escpos\Printer;
    $connector = new FilePrintConnector(“/dev/usb/lp0”);
    $printer = new Printer($connector);
    $printer -> text(“Hello World!\n”);
    $printer -> cut();
    $printer -> close();

    Please help me for Lunux and Windows OS.

    Regards,
    Avinash

  2. @Aviansh – Unless your staging server is connected to the printer via USB, you might need to devise a networked printing setup.

    There is an FAQ in the repository which has some tips for Internet-based printing, but otherwise you need a long USB cable, a LAN printer, or a print server such as CUPS on the computer that has the actual printer connected to it.

  3. I’m trying to print from my computer which connected the printer directly (LPT1)
    But when I’m trying to print from the web page I get this error : “Warning: file_put_contents(LPT1): failed to open stream: Permission denied in C:\xampp\htdocs\POS\src\Mike42\Escpos\PrintConnectors\WindowsPrintConnector.php on line 384 Couldn’t print to this printer: Failed to write file to printer at LPT1 ”
    i try to use this code
    require __DIR__ . ‘../autoload.php’;
    use Mike42\Escpos\Printer;
    use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;

    try {
    $connector = new WindowsPrintConnector(“LPT1”);

    $printer = new Printer($connector);
    $printer -> text(“Hello World!\n”);
    $printer -> cut();

    $printer -> close();
    } catch (Exception $e) {
    echo “Couldn’t print to this printer: ” . $e -> getMessage() . “\n”;
    }

  4. Hi
    do you have step by step installing and using escpos-php ?
    i want to use your code but dont know how to do that.
    thanks

  5. Hi Mike,
    Your epos php library is great and we successfully printing ticket on epson tmt88v machine.
    I am struggle on get Printer Status ( out off paper,cover open ..etc ).
    For online and offline we write the separate function that working fine.
    public function getprinterStatus($ip)
    {
    $fpsocket = @ fsockopen($ip, 9100, $errno, $errstr, 1);
    if ($errno == 0){
    $printerStatus = ‘Online’;
    } elseif ($errno == 110) {
    $printerStatus = ‘Offline’;
    } else {
    $printerStatus = ‘Offline’;
    }
    return $printerStatus;
    }
    But major problem i am facing is out off paper case.
    As per your printer library –
    I look over your function
    Printer::getPrinterStatus (experimental);
    But the your Printer class does not having Method –
    getPrinterStatus (experimental)
    I am wondering how i can invoke method Printer::getPrinterStatus (experimental);
    Is there any way to get live printer status and cover error handling out of paper case.
    I was also try javascript library for capture the error handling ( we capture the 9 error case).
    Basically this is based on SOAP service call –
    https://192.168.9.75:9100/cgi-bin/epos/service.cgi?devid=local_printer&timeout=1000.
    But our requirement is auto printing means that when online order place the automatically printer print the ticket.
    This auto printing is implemented by me using php script.
    So i need printer live status in php variable.
    We tried for php soap method and fsocket write soap action but did not get any success.
    Please help me to handle the error when printer is out off paper.
    Thanks in Advance.

Leave a Reply

Your email address will not be published. Required fields are marked *