bitbank2 / Thermal_Printer

Arduino library to draw text and graphics on BLE thermal printers
Apache License 2.0
367 stars 54 forks source link

Unable to connect to MTP-II #53

Open zejtin opened 1 year ago

zejtin commented 1 year ago

Hello!

I have an MTP-II printer which should be fine. Name on bluetooth is MTP-II_BC6A I am trying to scan it with tpScane((char *)"MTP-II_BC6A", 15); to no avail, tpScan returns false but printer changes led color to blue like when it is connected when running tpScan.

Any info on this?

Thanks in advance

MYCAMEL222 commented 1 year ago

use library version 1.1.2. It should work when you scan tpScan((char *)"MTP-II_BC6A", 15);

zejtin commented 1 year ago

Tried it just now, it still doesn't find it, difference with 1.1.2 is printer doesn't show there is connection as with the latest one

MYCAMEL222 commented 1 year ago

Your code line in the above post reads "tpScane((char *)"MTP-II_BC6A", 15);".........It should be "tpScan....".

zejtin commented 1 year ago

My bad on that, it is tpScan otherwise it wouldn't compile

MYCAMEL222 commented 1 year ago

I ended up writing my own code without the Thermal_Printer library. I used arduinoBLE library and scanned for UUID. Everything works fine that way, but you'll have to hard code the esc/pos commands.

Sorry I can't help more.

zejtin commented 1 year ago

Do you maybe have some repo or example how you did it?

controllercustom commented 1 year ago

To add a new printer name, truncate it to 9 chars and add it to szPrinterIDs[].

tpFindPrinterName() truncates the advertised printer name to 9 characters or less before looking for a match in szPrinterIDs.