Skip to content

Commit ba4609b

Browse files
lse-odooStraubCreative
authored andcommitted
[IMP] iot: esc-pos ESC * support documentation
Documentation regarding the fix: odoo/odoo#126689 opw-3351084,3341907 Authored by: lse-odoo <lse@odoo.com> Co-authored by: tiku-odoo <tiku@odoo.com> Co-authored by: Felicious <feku@odoo.com> Co-authored by: jero-odoo <jero@odoo.com> Signed-off-by: StraubCreative <zst@odoo.com> X-original-commit: 974c59f
1 parent 9a249c1 commit ba4609b

12 files changed

+244
-2
lines changed

content/applications/productivity/iot/config/troubleshooting.rst

Lines changed: 244 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,249 @@ Printer`. Follow the steps and select the *make* and *model* corresponding to th
9999
Epson and Star receipt printers and Zebra label printers do not need a driver to work. Make sure
100100
that no driver is selected for those printers.
101101

102+
Epson configuration special case
103+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104+
105+
Most Epson printers support printing receipts in Odoo :abbr:`POS (Point of Sale)` using the `GS v 0`
106+
command. However, the following Epson printer models do not support this command:
107+
108+
- TM-U220
109+
- TM-U230
110+
- TM-P60
111+
- TMP-P60II
112+
113+
Bypass this issue by configuring the printer to use the `ESC *` command instead.
114+
115+
Process to force ESC * command
116+
******************************
117+
118+
Epson printer compatibility
119+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
120+
121+
The first step is to check whether the printer is incompatible with `GS v 0` command.
122+
123+
.. seealso::
124+
125+
- `Epson GS v 0 documentation <https://reference.epson-biz.com/modules/ref_escpos/index.php?
126+
content_id=94>`_ for `GS v 0` compatible printers.
127+
- `Epson ESC * documentation <https://reference.epson-biz.com/modules/ref_escpos/index.php
128+
?content_id=88>`_ for `ESC *` compatible printers.
129+
130+
If the printer is not compatible with the `ESC *` command then the following process is not
131+
possible. Should the printer be compatible to use the `ESC *` command to print, follow this process
132+
to configure the printer with the :abbr:`IoT (Internet of Things)` box.
133+
134+
IoT box configuration for ESC *
135+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136+
137+
To configure the :abbr:`IoT (Internet of Things)` box to use the `ESC *` command to print, go to the
138+
:abbr:`IoT (Internet of Things)` box homepage by navigating to :menuselection:`IoT app --> IoT
139+
Boxes`. Then click on the :guilabel:`IP address` and this will direct to the :abbr:`IoT (Internet of
140+
Things)` box homepage.
141+
142+
**Choosing the printer**
143+
144+
Now click on the :guilabel:`Printers server` button. This will redirect the browser to the *CUPS*
145+
page. Next, go to :menuselection:`Administration --> Printers --> Add Printer`, choose the printer
146+
that should be modified, and then click :guilabel:`Continue`.
147+
148+
.. tip::
149+
If the name of the printer is still uncertain, take the following steps:
150+
151+
#. Take note of the listed printers on the *CUPS* page.
152+
#. Turn the printer off and refresh the page.
153+
#. Now compare the difference with the first list to see which printer disappeared.
154+
#. Turn the printer back on and refresh the page again.
155+
#. Double-check the list again to see if the printer re-appears.
156+
#. The printer that disappeared and reappears again on the listed printers is the name of the
157+
printer in question.
158+
159+
.. note::
160+
This can be :guilabel:`Unknown` under :guilabel:`Local printers`.
161+
162+
**CUPS naming convention**
163+
164+
`CUPS` will prompt the admin for three pieces of information: the :guilabel:`Name`,
165+
:guilabel:`Description` and the :guilabel:`Location`. The last two pieces of information do not need
166+
to be specific, however, the :guilabel:`Name` should follow a particular convention to work with the
167+
`ESC *` command.
168+
169+
The :guilabel:`Name` should match this convention:
170+
`<printer_name>__IMC_<param_1>_<param_2>_..._<param_n>__`
171+
172+
A breakdown of the naming convention:
173+
174+
- `printer_name`: This is the printer name. It can be any character as long as it does not contain
175+
`_`, `/`, `#`, or ` ` (space character).
176+
- `IMC`: This stands for *Image Mode Column* (the simplified name for `ESC *`).
177+
- `param_1`: This stands for the specific parameter:
178+
179+
- `SCALE<X>`: Scale of the picture (with the same aspect ratio). `X` should be an integer
180+
describing the scale percentage that should be used.
181+
182+
.. example::
183+
`100` is the original size, `50` is half the size, `200` is twice the size.
184+
185+
- `LDV`: *Low Density Vertical* (will be set to *High Density Vertical* if not specified).
186+
- `LDH`: *Low Density Horizontal* (will be set to *High Density Horizontal* if not specified).
187+
188+
.. note::
189+
*Density* parameters might need to be configured in a particular way depending on the printer
190+
model.
191+
192+
.. seealso::
193+
Visit `Epson's ESC * documentation
194+
<https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=88>`_ and click on the
195+
printer model printer in the table above to see if the printer should set these parameters.
196+
197+
.. example::
198+
The following are examples of proper and improper name formatting:
199+
200+
Proper name formatting:
201+
202+
- `EPSONTMm30II__IMC__`
203+
- `EPSON_TM_U220__IMC_LDV_LDH_SCALE80__`
204+
205+
Improper name formatting (this will not prevent printing, but the result might not have the
206+
expected printed output):
207+
208+
- `EPSON TMm 30II` -> The name can't have spaces.
209+
- `EPSONTMm30II` -> The name itself is correct, but it won't use `ESC *`.
210+
- `EPSONTMm30II__IMC` -> This name is missing the end `__`.
211+
- `EPSONTMm30II__IMC_XDV__` -> The parameter `XDV` does not match any existing parameters.
212+
- `EPSONTMm30II__IMC_SCALE__` -> The parameter `SCALE` is missing the scale value.
213+
214+
**Finish adding a printer**
215+
216+
After setting the name of the printer with the appropriate naming convention, click
217+
:guilabel:`Continue`. Next, set the :guilabel:`Make` value to :guilabel:`Raw` and for the
218+
:guilabel:`Model` value, set this to :guilabel:`Raw Queue (en)`.
219+
220+
After completing these steps, click :guilabel:`Add Printer`. If everything was done correctly, the
221+
page should redirect to the *Banners* page.
222+
223+
At this point the printer should have been created, now the :abbr:`IoT (Internet of Things)` box
224+
just needs to detect it and then sync to Odoo's server (this could take a few minutes).
225+
226+
**Adding the printer to Odoo PoS**
227+
228+
Once the printer is visible on the Odoo database, don't forget to choose it in the :abbr:`PoS (Point
229+
of Sale)`configuration as the :abbr:`IoT (Internet of Things)` printer. Navigate to
230+
:menuselection:`Pos App --> Settings --> Connected Devices --> IoT Box --> Receipt Printer -->
231+
Save`.
232+
233+
.. note::
234+
If the printer was set up incorrectly (it is still printing random text or the printed receipt is
235+
too big or small), then it cannot be modified via the printer name with *CUPS*. Instead, the
236+
above process can be repeated to set up another printer from scratch to create one with modified
237+
parameters.
238+
239+
**Example setup of the Epson TM-U220B printer using ESC**
240+
241+
.. spoiler::
242+
Click this text to reveal the example
243+
244+
The following is an example of the troubleshooting process for a TM-U220B printer model using the
245+
`ESC *` command. The receipt pictured below is an example of a receipt that is printing correctly
246+
due to proper formatting (in theory):
247+
248+
.. image:: troubleshooting/receipt-example.png
249+
:align: center
250+
:alt: Properly formatted receipt picture from a demo database.
251+
252+
Trying to print this receipt right-away prior to the proper formatting will not work as the
253+
TM-U220B printer model does not support `GS v 0`. Instead random characters will print:
254+
255+
.. image:: troubleshooting/receipt-print-random-letters.png
256+
:align: center
257+
:alt: Printer paper with seemingly random characters.
258+
259+
To properly configure formatting for the Epson TM-U220B printer model take the following steps.
260+
261+
After consulting Epson's website for compatibility for both of the commands: `GS v 0
262+
<https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=94>`_ and `ESC *
263+
<https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=88>`_, it can be seen
264+
that indeed the TM-U220B is not compatible with `GS v 0`, but is compatible with `ESC *`.
265+
266+
.. image:: troubleshooting/epson-compatibility-compare.png
267+
:align: center
268+
:alt: Epson compatibility evaluation from Epson website.
269+
270+
When adding the printer, *CUPS* will ask which printer should be added:
271+
272+
.. image:: troubleshooting/add-printer.png
273+
:align: center
274+
:alt: Administration menu, add printer selection.
275+
276+
In this case, the printer is connected via :abbr:`USB (Universal Serial Bus)` so it won' be part
277+
of the :guilabel:`Discovered Network Printers`. Instead it is likely part of the
278+
:guilabel:`Unknown` selection under :guilabel:`Local Printers`. By unplugging the printer's
279+
:abbr:`USB (Universal Serial Bus)` cable from the :abbr:`IoT (Internet of Things)` box and
280+
refreshing the page, the :guilabel:`Unknown` printer disappears. By plugging it back in, the
281+
printer reappears, so it can be said that this is the printer in question.
282+
283+
For the naming convention, since it will need to print using the `ESC *` command, it is
284+
imperative to add `__IMC`. Reference the printer model on `Epson's ESC * site
285+
<https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=88>`_ to find out more
286+
about the *density* parameters.
287+
288+
.. image:: troubleshooting/epson-tm-u220-specification.png
289+
:align: center
290+
:alt: Epson TM-U220 specifications on manufacturer's website.
291+
292+
For this particular model, TM-U220, `m` should be equal to 0 or 1. While referencing the
293+
:guilabel:`Description` below the pink box in the above picture, the `m` values could be 0, 1, 32
294+
or 33. So in this printers case, the `m` value can NOT be 32 or 33 (otherwise there will be
295+
random characters printed).
296+
297+
The table includes the numeric values: 32 and 33, they both occur if the :guilabel:`Number of
298+
bits for vertical data` is set to 24. This means that is a *High Vertical Density*. In the case
299+
of configuring the Epson TM-U220, the *Low Vertical Density* will need to be forced, as this
300+
printer model does not support *High Vertical Density* for this command `ESC *`.
301+
302+
To add a *Low Vertical Density*, add the `LDV` parameter to the naming convention.
303+
304+
.. image:: troubleshooting/add-printer-filled.png
305+
:align: center
306+
:alt: Add a *Low Vertical Density* (the `LDV` parameter) to the naming convention.
307+
308+
Click :guilabel:`Continue` to proceed. Next, set the :guilabel:`Make` value to :guilabel:`Raw`
309+
and for the :guilabel:`Model` value, set this to :guilabel:`Raw Queue (en)`.
310+
311+
.. image:: troubleshooting/add-printer-add.png
312+
:align: center
313+
:alt: Epson TM-U220 specifications on manufacturers website.
314+
315+
However when trying to print with the naming convention: `EpsonTMU220B__IMC_LDV__`, it will print
316+
the receipt, but it will be too big and outside the margin. To resolve this, add a new printer
317+
(and naming convention) with the `SCALE<X>` parameter to adapt to our receipt size.
318+
319+
Here are some examples:
320+
321+
.. list-table::
322+
:header-rows: 1
323+
324+
* - Printer Naming Convention
325+
- `EpsonTMU220B__IMC_LDV__`
326+
- `EpsonTMU220B__IMC_LDV_SCALE75__`
327+
- `EpsonTMU220B__IMC_LDV_LDH__`
328+
- `EpsonTMU220B__IMC_LDV_LDH_SCALE35__`
329+
* - .. image:: troubleshooting/receipt-example.png
330+
:align: center
331+
:alt: Receipt example format.
332+
- .. image:: troubleshooting/tm-u220-ldv.png
333+
:align: center
334+
:alt: Receipt format using naming convention: EpsonTMU220B__IMC_LDV__.
335+
- .. image:: troubleshooting/tm-u220-ldv-scale75.png
336+
:align: center
337+
:alt: Receipt format using naming convention: EpsonTMU220B__IMC_LDV_SCALE75__.
338+
- .. image:: troubleshooting/tm-u220-ldv-hdv.png
339+
:align: center
340+
:alt: Receipt format using naming convention: EpsonTMU220B__IMC_LDV_LDH__.
341+
- .. image:: troubleshooting/tm-u220-ldv-hdv-scale35.png
342+
:align: center
343+
:alt: Receipt format using naming convention: EpsonTMU220B__IMC_LDV_LDH_SCALE35__.
344+
102345
The Zebra printer doesn't print anything
103346
----------------------------------------
104347

@@ -109,8 +352,7 @@ User Interface --> Views` in :ref:`developer mode <developer-mode>` and look for
109352
template.
110353

111354
.. seealso::
112-
Check out Zebra's instructions on printing :abbr:`ZPL (Zebra Programming Language)` files
113-
`here
355+
Check out Zebra's instructions on printing :abbr:`ZPL (Zebra Programming Language)` files `here
114356
<https://supportcommunity.zebra.com/s/article/Print-a-zpl-file-using-the-Generic-Text-Printer>`_.
115357

116358
Barcode scanner
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)