[FW][FIX] hw_drivers: support for TM-U escpos printer models #131310
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this commit:
![image](https://private-user-images.githubusercontent.com/60775325/249479698-61154812-d0bb-4012-8702-e90ecbeeeb5d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA2NDk1NzEsIm5iZiI6MTcyMDY0OTI3MSwicGF0aCI6Ii82MDc3NTMyNS8yNDk0Nzk2OTgtNjExNTQ4MTItZDBiYi00MDEyLTg3MDItZTkwZWNiZWVlYjVkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEwVDIyMDc1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVhMzU0NWM4ZDlmYWJjZWM5M2RiZTA2OWUwNGJlMmUzZWU4NmI1OTQxZTc5YmNiOGFmNmQwZGIxY2EzNDExOWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.r8VdjP3_w0VrUJl2trVfFeLzZAar2NyS8vT_woJqE_U)
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:
Most of the code is inspired from
python-escpos
. Using the library to print the receipt have the same drawback: https://github.com/python-escpos/python-escpos/blob/master/src/escpos/escpos.pyDue 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 ColumnLDV
= Low Density VerticalLDH
= Low Density HorizontalSCALE<XX>
= Image Scale in percentage (for instanceSCALE50
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:(the picture goes off of the receipt horizontally)
or
![image](https://private-user-images.githubusercontent.com/60775325/254312614-104e4450-9824-4354-b28f-5e6b278ce3a6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA2NDk1NzEsIm5iZiI6MTcyMDY0OTI3MSwicGF0aCI6Ii82MDc3NTMyNS8yNTQzMTI2MTQtMTA0ZTQ0NTAtOTgyNC00MzU0LWIyOGYtNWU2YjI3OGNlM2E2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEwVDIyMDc1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ1MGE1ZDhkYTEzYTE2M2U3MjhmY2I2ZTU1NTYwN2YyN2Q3YzQ0N2QyOTc2MzVkZDUyNjNmMjRjODZjYTc1OTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.du5RikRWRlF3euyYnUjS-Od5Kqej5esp8TIcMUskGO4)
TM-U220_IMC_LDH
which would give:( fully fit on the receipt but text is hard to read)
opw-3351084,3341907
Forward-Port-Of: #126689