Git Product home page Git Product logo

perl-printer-escpos's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

perl-printer-escpos's Issues

Error : Negative repeat count does nothing message when using USB or Serial connection method

We've been using Printer::ESCPOS module but we could not make it to work on USB or Serial connection.

Whenever we tried printing to a POS printer interface to a PC using USB or Serial cable, we always encounter "Negative repeat count does nothing at Serial.pm on line 93

@chunks = unpack "a$n" x ( ( length($buffer) / $n ) - 1 ) . "a*", $buffer;

sub print {
my ( $self, $raw ) = @_;
my @chunks;

my $buffer = $self->_buffer;
if ( defined $raw ) {
    $buffer = $raw;
}
else {
    $self->_buffer('');
}

my $n = 8;    # Size of each chunk in bytes
$n = 64 if ( $self->serialOverUSB );

@chunks = unpack "a$n" x ( ( length($buffer) / $n ) - 1 ) . "a*", $buffer;
for my $chunk (@chunks) {
    $self->_connection->write($chunk);
    if ( $self->serialOverUSB ) {
        $self->_connection->read();
    }
    else {
        usleep(10000)
          ; # Serial Port is annoying, it doesn't tell you when it is ready to get the next chunk
    }
}

}

and 102 for USB,pm.
USB.pm error will be on line 102 (for loop), code snippet below

sub print {
my ( $self, $raw ) = @_;
my @chunks;

my $buffer = $self->_buffer;
if ( defined $raw ) {
    $buffer = $raw;
}
else {
    $self->_buffer('');
}

my $n = 2**14;    # Size of each chunk in bytes
@chunks = unpack "a$n" x ( ( length($buffer) / $n ) - 1 ) . "a*", $buffer;
for my $chunk (@chunks) {
    $self->_connection->bulk_write( $self->endPoint, $chunk,
        $self->timeout );
    usleep(10000)
      ; # USB Port is sometimes annoying, it doesn't always tell you when it is ready to get the next chunk
}

}

How to fix the issue?

Cash Drawer not opening

We have a pos printer connected to a cash drawer, it works fine for a year until it prints abnormally (paper not feeding properly thus receipts are not printed before it cut).

We replace with a different brand of pos printer, printing of receipts are ok but it would not open the cash drawer.
I suspect that the control codes is different, I wanted to try to change the control code but I cannot find where to change from the ESCPOS source code.
Can you point me which source file to amend?

Thank you.

Moo over Moose

have you considered using the lighter weight Moo / Moo::Role / Type::Tiny over Moose / Moose::Role / TypeConstraints?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.