ESCPOS-ThermalPrinter-Android icon indicating copy to clipboard operation
ESCPOS-ThermalPrinter-Android copied to clipboard

Print from multiple devices at the same time

Open saghbinylb opened this issue 10 months ago • 2 comments

I developed an order-taking application in a restaurant and I use this great library to print the tickets. I noticed that when 2 tablets send a text to the same printer at the same time, the printer starts by printing part of the 1st text received then it switches the 2nd text when it receives it without having finished the first text. I suppose that this problem comes from the fact that when we print a text, there are several consecutive writes sent to the printer for formatting and the printer stupidly executes what it receives from each socket.

Does anyone have an idea that can help me? I'm thinking of modifying the library so that it sends the text and formatting in a single message in the socket.

saghbinylb avatar Apr 13 '24 06:04 saghbinylb

Please share the code, if you made it. My thoughts:

  1. Library should have a "isBusy" method, to check if the printer is printing at the moment. - don't know if this is available
  2. Create a service running on one of the devices, which takes the messages from all devices and handles the work sequence. - this is not so easy to implement, but then you have one program which actually is using the printing library and devices which only creates the printing strings and sends it to the service.

DimiDR avatar Jun 04 '24 05:06 DimiDR

which type of connection method do you used?

vikrammani-t2s avatar Jul 02 '24 11:07 vikrammani-t2s