Oh thank you very much! I was implementing QZ Tray for Odoo a few years ago, but I had completely forgotten the name and was painfully itching my head on how to find it again. Can you believe it? Thanks!
@roquegv What advantages do you see in hardware bridge over QZ Tray?
On the top of my head, I might recall:
QZ Tray has no label based printer routing, but rather extension based (is that actually true?)
The QZ Tray license, seems hardware bridge is less restrictive?
I just looked at the QZ Tray. It looks nice. It could be enough for your requirements.
It seems to be limited to thermal printers. This could not be a problem. However, if the requirement is to use another kind of printer (eg a laser printer), QZ might not work. So, the main advantage I see of the hardware bridge over QZ is that it could handle any kind of printer.
Both support reading/writing serial ports.
QZ Tray has no label based printer routing, but rather extension based (is that actually true?)
Not sure about that.
The QZ Tray license, seems hardware bridge is less restrictive?
Yes. MIT license (hardware bridge) is less restrictive than LGPL (QZ)
The WHB need to be installed into the computer that is connected to the printer(s). No need to configure anything in WHB apart from the “Print Type” section (see more on the repository’s README), so, you could leave the IPs and ports as they come by default.
The communication is via web socket on localhost. So, when you send the print order to the WHB (that acts as the web socket server), it is assumed that the computer from which the order was sent is connected to the printer and therefore the WHB knows which printer to use.
I works well on a scenario that all the printers are connected to the same computer. But I’m working now on way to allows printing from any device, even if it is not connected to any printer (not even in the same LAN)
How Frappe (which is in the cloud) know where to sent the data? We only entered the 127.0.0.1 in the WHB side. And we didn’t enter any IP in the Frappe side also.
UPDATE:
I see this code in the examples.
url: "ws://127.0.0.1:12212/printer"
So ERPNext sends to localhost which WHB listens. It’s ok now. Still interesting approach. We are fighting for moving to cloud for decades and then we struggle to communicate with serial ports.
In a different project I implemented it using the realtime feature: What is Frappe Framework?. So, whenever a print order is send from one devise, it is send as a realtime message first, to the computer that has printer connection. This is a specific scenario though and need to be generalized. That’s what I’m working on.