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

Cash Drawer not opening #5

Open
Jezzrel opened this issue Sep 8, 2018 · 4 comments
Open

Cash Drawer not opening #5

Jezzrel opened this issue Sep 8, 2018 · 4 comments

Comments

@Jezzrel
Copy link

Jezzrel commented Sep 8, 2018

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.

@sonntagd
Copy link
Contributor

sonntagd commented Sep 8, 2018

Hi, have a look here:

$self->driver->write( _DLE . _DC4 . "\x01" . chr( $pin ) . chr( $time ) );

@Jezzrel
Copy link
Author

Jezzrel commented Sep 13, 2018

Hi,

Is below the code for the control code?

$self->driver->write( _DLE . _DC4 . "\x01" . chr( $pin ) . chr( $time ) );
If my printer control code to open a cash drawer is 27.112.0.25.250, how can I put on the above code?

@sonntagd
Copy link
Contributor

This should probably done by

$self->driver->write( _DLE . _DC4 . join("", map { chr } qw( 27 112 0 25 250 )) . chr( $pin ) . chr( $time ) );

(untested, please try for yourself)

@Jezzrel
Copy link
Author

Jezzrel commented Sep 18, 2018

I will try later and let you know. Thank you.

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

2 participants