Commit Graph

82 Commits

Author SHA1 Message Date
Martin Trigaux 8459860b02
[IMP] hw_escpos: more fault tolerant printer detection
In some cases, the description fails (unknow printer, udev issues,...) and while
the printer works fine, the description fails.

This is a cherry pick of 994d45f4 to 8.0 (as the posbox is built on top of it)
2017-03-16 13:37:20 +01:00
Olivier Dony f431cee99a
[FIX] hw_escpos: increase timeout for slow matrix printers
Some printers (e.g. matrix/impact printers) may have a hard time
keeping up with the text output, and may trigger timeout errors
because of this, even though they would otherwise produce a correct
result.

Increasing the default timeout to 5s (from the default 1s) should
take care of most slow printers out there.
2017-01-27 14:42:36 +01:00
Olivier Dony 8e8b7925d2
[FIX] hw_escpos: auto-detect endpoint address
Instead of hardcoding the IN & OUT endpoint
addresses for the ESC/POS printers, we now
attempt to auto-detect them.

This should increase compatibility with many
compatible thermal printers that are simply
using a different address, such as the
- STMicroelectronics POS58 Printer USB
- HU HAI SUNCSW Receipt Printer Co.,Ltd. Gprinter USB Printer

Fixes #12890
2016-11-16 14:52:34 +01:00
Stefan Rijnhart 04765d4917 [FIX] hw_escpos: RBG images do not necessarily have an alpha channel 2016-04-19 15:34:45 +02:00
Joren Van Onder 6f4e7867f0 [IMP] hw_escpos: add the MAC address to the ticket printed at startup
Usually when setting up a POSBox you want it to have a static IP. The
best way to do that is by configuring whatever DHCP server is
used (usually just on the router) to always assign the same IP to a
certain MAC address (naming depends on what is being used, sometimes
it's called static DHCP but it's also known as DHCP reservations and a
bunch of other names).

The process of setting this up is complicated for a non-technical user,
and this attempts to make it a little bit easier to do by immediately
giving them the correct MAC address they should use. To avoid confusion
this only prints the MAC addresses for interfaces which have an IP
address.
2016-01-29 09:25:15 +01:00
Joren Van Onder 546a1d4a32 [IMP] point_of_sale: support Wi-Fi on the posbox
This allows people to connect the posbox to networks using a wireless
network adapter.

When plugging in a USB Wi-Fi adapter and no network cable, the posbox
will boot and host its own Access Point called "Posbox". Users can
connect their device to this network and can then connect to the posbox
the usual way.

An interface for has been provided that also allows users to instruct
the posbox to connect to a different Wi-Fi network. This is useful when
the client is not running Odoo locally.

It is also possible to make this configuration persistent. With a
persistent Wi-Fi network configuration, the posbox will always try to
connect to the specified network after a reboot.

Attempts have been made to make the Wi-Fi connection as robust as
possible. Upon connection loss, the posbox will automatically attempt to
reconnect.
2015-10-09 09:38:09 +02:00
Joren Van Onder f008240411 [FIX] hw_escpos: certain Epson printers do not identify as a printer
We search for USB devices that identify as a printer through their
DeviceClass or one of their InterfaceClasses. The issue is a lot of
printers use vendor-specific Device/InterfaceClasses.

Apparently the Epson TM-T88IV is one of those devices. So in order to
work around this, we now first look for a USB device that identifies as
a printer. If those do not exist, we pick the first Epson device, if
those do not exist we pick the first Star device.

Perhaps we should instead start using some kind of probe-based approach
to identify ESC/POS compatible devices.
2015-10-07 13:03:46 +02:00
Joren Van Onder a11a490d30 [IMP] hw_escpos: support Star TSP650II
In order for the printer to work we need to configure it in USB vendor
mode. This means it will not have a USB interfaceClass of 7. So when
we don't find any USB device that identifies as a printer, we search
for Star devices and use the first one of those we find.

This should be reasonably safe because Star does not manufacture other
devices apart from printers that one would attach to the posbox.
2015-09-17 09:26:33 +02:00
Joren Van Onder ad727be267 [FIX] hw_escpos: don't try too hard to close a printer
Although it might be a good idea to make sure a printer device is
properly closed, trying for >1 min to do so is too much. It can cause a
>1 min delay between receiving a receipt and actually printing. Also,
just because the device is not cleanly closed does not mean that it will
not work when we open it again.
2015-09-17 09:26:33 +02:00
Joren Van Onder 1440dc1c96 [IMP] hw_escpos: don't replace a USBError exception with some string
There's absolutely no point to hiding exceptions like this, it makes
debugging more difficult than it has to be.
2015-09-17 09:26:33 +02:00
Joren Van Onder e7c51228f3 [IMP] hw_escpos: get rid of printer whitelist
It makes more sense to just look for usb devices that identify as a
printer and use whatever we get. This saves us time having to explain to
users how to add their particular printer to the whitelist to test.
2015-08-26 15:12:39 +02:00
Joren Van Onder 86762ef30f [IMP] point_of_sale: add scripts to generate posbox images
Instead of continuing to build upon the old images, these scripts
implement a reproducable way to generate new posbox images. The
generated images will be based on the latest stable Raspbian
release. The image will be created with the help of qemu-system-arm,
which will boot up the image and execute a script that will set up the
posbox image.

This way everything necessary to set up a posbox is readable in the
scripts and accompanying files, instead of being hidden in an image.
2015-08-11 15:19:57 +02:00
Joren Van Onder 59b5f136bf [IMP] point_of_sale: add patches from `posbox` branch
This commit contains the patches from the now obsolete 'posbox'
branch. These patches were written by Martin Donies (@mdo-odoo) and
Frédéric Van der Essen (@fvdsn).
2015-08-11 15:13:17 +02:00
谢立 8fe042ea91 [FIX] hw_escpos: xmlescpos add cp936(GBK) encoding support
Add support for Chinese fonts by adding the cp936(GBK) encoding

Closes #6845
2015-07-02 10:43:21 +02:00
Antony Lesuisse af3a8ada58 [FIX] hw_escpos copyright notice
In v9 we will plan remove the lib and replace it by an optionnal import.
2015-02-10 14:24:54 +01:00
Martin 3cf45e1111 [FIX] hw_escpos: Backport driver robustness 2015-02-10 13:24:59 +01:00
Thomas Rehn af905d0797 [FIX] implement pre-ordering of ESCPOS commands 2014-12-08 19:35:16 +01:00
Frédéric Van der Essen 02bdbee088 Merge pull request #3009 from initOS/8.0-fix_escpos_with_non_rgba_image
Bug: Exception when printing POS receipt via hardware proxy
2014-12-01 15:55:17 +01:00
Thomas Rehn 7659da9fd8 improve patch according to reviewer's suggestion 2014-11-19 10:13:54 +01:00
Frederic van der Essen 6111cf9873 [FIX] hw_escpos: use logger instead of prints to avoid corrupting the odoo.py command line interface. 2014-11-18 19:03:20 +01:00
Thomas Rehn 93dc416dd3 only use alpha channel if it exists 2014-10-09 18:05:09 +02:00
Christophe Simonis 8046b7367d [MERGE] forward port of branch saas-5 up to 7e117b1 2014-08-28 16:51:11 +02:00
Christophe Simonis 7e117b18a0 [MERGE] forward port of branch saas-3 up to ada9724 2014-08-28 16:21:27 +02:00
Fabien Pinckaers 8aca457e34 [IMP] Updated website urls on modules and info page 2014-08-26 21:40:18 +02:00
TheCloneMaster 4b446550c6 [FIX] hw_escpos: Replaced "tab" by space
call to self.open() had a tab instead of spaces
2014-08-25 18:08:40 +02:00
Dimitri del Marmol b021330f0e [MERGE] Bzr branch lp:~openerp-usertesting/openobject-addons/trunk-restaurant-wip-fva 2014-06-13 16:19:05 +02:00
Christophe Simonis a756b82372 [MERGE] forward port of branch saas-4 up to revid bb26dea 2014-05-20 20:19:55 +02:00
Martin Trigaux 583fe74ba2 Forward-port of latest saas-3, up to revision 9455 (rev-id mat@openerp.com-20140514080416-m4t23y0rxx2ot7y6) 2014-05-14 10:37:54 +02:00
Denis Ledoux d2716e2db9 [ADD] hw_escpos: TM-T20II printer added in supported device list
bzr revid: dle@openerp.com-20140512074150-9wepj7andgwrgj7x
2014-05-12 09:41:50 +02:00
Josse Colpaert 8b84615de1 [MERGE] Merge from trunk test
bzr revid: jco@openerp.com-20140502130352-c3h1fk332eqyd78b
2014-05-02 15:03:52 +02:00
Fabien Meghazi 877503143d [REM] html_template from hw_*
bzr revid: fme@openerp.com-20140430132510-smhi39h9oyi8p4nt
2014-04-30 15:25:10 +02:00
Quentin (OpenERP) 398d96f273 [MERGE] merged trunk up to revision 9327
bzr revid: qdp-launchpad@openerp.com-20140414094743-hv0u7qhigv1to2uc
2014-04-14 11:47:43 +02:00
Frédéric van der Essen d704fb0060 [IMP] hw_proxy, hw_escpos: it is now possible to add support for new printers from the posbox hardware status page + fix backward compatiblity for hardcoded receipts
bzr revid: fva@openerp.com-20140411120510-t3a8b3axq1q4wuje
2014-04-11 14:05:10 +02:00
Christophe Simonis 0fad8159f3 [MERGE] forward port of branch saas-3 up to revid 9380 chs@openerp.com-20140407144439-10n8fs6zovodwwtx
bzr revid: chs@openerp.com-20140407163318-hh3jwfkj3o2c83lk
2014-04-07 18:33:18 +02:00
Quentin (OpenERP) ff4726ea7d [MERGE] merged trunk up to revision 9281
bzr revid: qdp-launchpad@openerp.com-20140403081427-7xpn57wdfv08v2al
2014-04-03 10:14:27 +02:00
Christophe Simonis 37c469c5cd [FIX] hw_{scanner,escpos}: ensure we always release the lock.
[FIX] hw_scanner: mark the thread as deamon.

bzr revid: chs@openerp.com-20140329144146-utr8gexna4un65u1
2014-03-29 15:41:46 +01:00
Quentin (OpenERP) 9989113946 [MERGE] merge branch that fixes point of sale accordingly to changes made in stock
bzr revid: qdp-launchpad@openerp.com-20140328145710-ibzo59dv1p06jbg3
2014-03-28 15:57:10 +01:00
Frédéric van der Essen 4745099706 [FIX] hw_escops, point_of_sale: backporting fixes from the pos-restaurant branch
bzr revid: fva@openerp.com-20140328134401-ao85rr8b29nqg626
2014-03-28 14:44:01 +01:00
Frédéric van der Essen 9e801815bf [IMP] hw_escpos, hw_proxy: improved status page appeareance, add a listing of connected devices to hardware status page
bzr revid: fva@openerp.com-20140326103230-ib1myl1rmipoynkn
2014-03-26 11:32:30 +01:00
Josse Colpaert d4eda78813 [IMP] Put company_id on pos config + remove pos config name
bzr revid: jco@openerp.com-20140324120747-v3mt7pwgqylekshg
2014-03-24 13:07:47 +01:00
Frédéric van der Essen 6aa0187ca3 [IMP] posbox: print the homepage url on the status ticket
bzr revid: fva@openerp.com-20140321163740-0o0b3ikmz6jv6cwr
2014-03-21 17:37:40 +01:00
Frédéric van der Essen b206261dd5 [IMP] hw_escpos: re-enabled image printing in xml receipts
bzr revid: fva@openerp.com-20140320170955-ekgya8pcv2wljhl8
2014-03-20 18:09:55 +01:00
Frédéric van der Essen a4afb910e9 [IMP] hw_escpos / point_of_sale: print receipt with an xml template
bzr revid: fva@openerp.com-20140320164530-odpeuf1igh7wkrms
2014-03-20 17:45:30 +01:00
Frédéric van der Essen 53f02309ed [IMP] hw_escpos: print_xml_receipt() controller allows you to print an xml defined receipt
bzr revid: fva@openerp.com-20140320112720-ldshe2764z3fyfvi
2014-03-20 12:27:20 +01:00
Frédéric van der Essen d5a730a0b3 [WIP] hw_escpos: printing client-side defined xml templates
bzr revid: fva@openerp.com-20140317132906-uyr7h1oce8pptny9
2014-03-17 14:29:06 +01:00
Christophe Simonis 4b72678bc7 [MERGE] forward port of branch saas-2 up to revid 9195 chs@openerp.com-20140220154517-6y531n1mqtnfnsmr
bzr revid: chs@openerp.com-20140220163815-69sza1kclnh5mavs
2014-02-20 17:38:15 +01:00
Olivier Dony 7079fc3afd [FIX] hw_escpos: do not start queue processor if ESC/POS not available
bzr revid: odo@openerp.com-20140218110824-pdy54bdmm0appntu
2014-02-18 12:08:24 +01:00
Frédéric van der Essen 22e09cb41e [FIX] hw_escpos: status receipt would not print on the posbox
bzr revid: fva@openerp.com-20140210161701-aolbu63i7w74f97c
2014-02-10 17:17:01 +01:00
Frédéric van der Essen d930115bd3 [IMP] hw_escpos: print a status receipt on printer connection with ip address for easier configuration & debugging. Also setting the driver thread in daemon mode to avoid hanging the tests on the runbot
bzr revid: fva@openerp.com-20140210133109-xll1ijjdhbgpj1kr
2014-02-10 14:31:09 +01:00
Frédéric van der Essen a78af30755 [FIX] hw_escpos: company logo was not centered on the first receipt
bzr revid: fva@openerp.com-20140206151432-avaz87emjzqyvu9t
2014-02-06 16:14:32 +01:00