bitbank2 / Thermal_Printer

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

GOOJPRT PT-210 issue #41

Closed RyanWadewitz closed 1 year ago

RyanWadewitz commented 1 year ago

I'm having an issue with the examples using an ESP-WROOM-32 and a GOOJPRT PT-210. When I use the ESP32 BT Discover example, and via other devices, and Print the Self Test on the PT-210, it says its NAME is MTP-II. I see the library has been corrected to cover this, but I also know using the Bluetooth Clasic > BT_classic_device_discovery example the name does not always broadcast. I think my problem is resolving the Name to address so I would like to use the MAC to connect instead of the Name and fix the type to be MTP-2/PT-210. Being a newbie at software, I dont fully grasp how the syntax is for tpConnect(const char *szMacAddress); when MAC is 86:67:7a:aa:bb:cc. Am I supposed to enter like that or with - instead of : ? Also, looking to use a UROVO K329 in the future or other BTLE thermal printer 2.25" or 3"

bitbank2 commented 1 year ago

The library is for BLE only, not classic BT. The BLE scan will return names (usually) and MAC addresses for nearby devices. The same MAC address string format delivered by the scan should be given to the tpConnect method. I honestly don't remember if it uses hyphens or colons nor the byte order, but if you just print the output of a scan to the terminal and copy/paste the MAC address, it should work.