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

[FW][FIX] hw_drivers: support for TM-U escpos printer models #131310

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Aug 8, 2023

Before this commit:
When printing a receipt with an epson printers models TM-U2X0 (like TM-U220), random characters will be printed instead of the receipt.
image

This happened as a picture of the receipt is sent to the IoT box, but the TM-U2X0 models does not support all "Bit Image commands". We currently use the GS v 0 one which is not supported by this printer models. See:
https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=94

In addition, of that, the command itself is obsolete.

After this commit:
The support for another command "ESC *" is added which is not obsolete and supported by TM-U2X0 models.

Notes:

Due to the drawbacks, making it the default way to print would be a bad idea. As such, we can configure the mode (with other parameters) using particular name for the printer (which can be done by adding it manually with cups).

The options are:

  • IMC = Image Mode Column
  • LDV = Low Density Vertical
  • LDH = Low Density Horizontal
  • SCALE<XX> = Image Scale in percentage (for instance SCALE50 is half the size of the receipt printer)
    In the case of the TM-U220 on which the fix was tested the name could be set as TM-U220_IMC_LDV_LDH which would give:
    image
    (the picture goes off of the receipt horizontally)

or TM-U220_IMC_LDH which would give:
image
( fully fit on the receipt but text is hard to read)

opw-3351084,3341907

Forward-Port-Of: #126689

Before this commit:
When printing a receipt with an epson printers models TM-U2X0 (like
TM-U220), random characters will be printed instead of the receipt.

This happened as a picture of the receipt is sent to the IoT box, but
the TM-U2X0 models does not support all "Bit Image commands". We
currently use the GS v 0 one which is not supported by this printer
models. See:
https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=94

In addition, of that, the command itself is obsolete.

After this commit:
The support for another command "ESC *" is added which is not obsolete
and supported by TM-U2X0 models.

Notes:
 - Compared to "GS v 0", the receipt printed with "ESC *" is worst:
  - It take longer to print (5 seconds vs 1 second)
  - There is consistently some thin "empty white lines"
 - Most of the code is inspired from `python-escpos`:
 https://github.com/python-escpos/python-escpos/blob/master/src/escpos/escpos.py

Due to the drawbacks, making it the default way to print would be a bad
idea. As such, we can configure the mode (with other parameters) using
particular name for the printer (which can be done by adding it manually
 with cups)

opw-3351084,3341907

X-original-commit: f30085b
@robodoo
Copy link
Contributor

robodoo commented Aug 8, 2023

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Aug 8, 2023

This PR targets saas-16.1 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Aug 8, 2023
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Aug 8, 2023
robodoo pushed a commit that referenced this pull request Sep 13, 2023
Before this commit:
When printing a receipt with an epson printers models TM-U2X0 (like
TM-U220), random characters will be printed instead of the receipt.

This happened as a picture of the receipt is sent to the IoT box, but
the TM-U2X0 models does not support all "Bit Image commands". We
currently use the GS v 0 one which is not supported by this printer
models. See:
https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=94

In addition, of that, the command itself is obsolete.

After this commit:
The support for another command "ESC *" is added which is not obsolete
and supported by TM-U2X0 models.

Notes:
 - Compared to "GS v 0", the receipt printed with "ESC *" is worst:
  - It take longer to print (5 seconds vs 1 second)
  - There is consistently some thin "empty white lines"
 - Most of the code is inspired from `python-escpos`:
 https://github.com/python-escpos/python-escpos/blob/master/src/escpos/escpos.py

Due to the drawbacks, making it the default way to print would be a bad
idea. As such, we can configure the mode (with other parameters) using
particular name for the printer (which can be done by adding it manually
 with cups)

opw-3351084,3341907

closes #131310

X-original-commit: f30085b
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Loan Sens (lse) <lse@odoo.com>
@robodoo robodoo temporarily deployed to merge September 13, 2023 10:33 Inactive
@robodoo robodoo closed this Sep 13, 2023
@fw-bot fw-bot deleted the saas-16.1-15.0-iot-escpos-support-tm-u2x0-models-lse-2Bf7-fw branch September 27, 2023 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants