auctifera-josed / starprnt

Cordova plugin for the Star micronics printers
MIT License
40 stars 39 forks source link

Bluetooth printer (TSP650II) length of time from triggering to print #37

Closed sbpolicar closed 5 years ago

sbpolicar commented 5 years ago

Just wondering what the average time from request to print usually takes with bluetooth printers? I'm using the TSP650II, StarLine emulation string, and it seems to take 10-13 seconds after triggering print for the printer to complete printing. I'm sending raw text, usually 34-68 lines, through a commands array using .print() method. Just wondering if this is normal behavior?

sbpolicar commented 5 years ago

Update: running .connect() before print() seems to speed up delay time, now about 3-4 seconds between triggering print and actual printing starts.

Edit: Seems like the fix was a fluke. Different printers behave a bit differently, its now printing some 3-4 seconds some 10-13 seconds.

infoxicator commented 5 years ago

Hi @sbpolicar, not sure what is causing this, it might be the data you are sending or even the printer. Please download the official Star SDK app and see if you can also reproduce the issue there so we know if it is a printer problem or a plugin/app problem

sbpolicar commented 5 years ago

Hey @infoxicator, Just tested 4 TSP650II printers with the app, 3" text receipt, an image and a raster receipt. Through the app, printing is done by the time the loading spinner has gone, only a half-second/second delay.

Upon further testing using the plugin, we've seen it take anywhere between 4 to 45 seconds to get the data to print. The data I'm sending is no longer than the example receipt and doesn't contain any barcode or larger than standard text.

I've timestamped my code that runs ahead of the the plugin call, and it runs in less than a second, the plugin call runs the same second and the callback fires on average 13 seconds later, with printing actually happening around the 10 second mark. Noticed logging in the Java portion so I'm going to use logcat try to see where the delays are happening.

scragz commented 4 years ago

@sbpolicar How did you fix this? I'm having the exact same issue, using this plugin it takes up to a minute but using the Star app it's always instantaneous. Losing my mind trying to figure this out!