thon-ju / bluetooth_print

a flutter plugin connect to bluetooth thermal printer support both Android and IOS (eg. Gprinter pt-380、gp-1324、gp-2120)
MIT License
149 stars 193 forks source link

Can't print after selecting the printer #192

Open jsy11 opened 6 months ago

jsy11 commented 6 months ago

Hello,

We were able to make the bluetooth label printer on the list. However, upon selecting the printer nothing happens.

Can you advise how we can make it print on connected bluetooth label printer?

Thanks so much for your help in advance,

7863D6CE-CCE1-4719-B804-ED9F1EFF64B6

TareqFl commented 6 months ago

2 D/BluetoothSocket( 6613): close() this: XX:XX:XX:XX:07:97, channel: 1, mSocketIS: android.net.LocalSocketImpl$SocketInputStream@7ebaab1, mSocketOS: android.net.LocalSocketImpl$SocketOutputStream@33fcb96, mSocket: null, mSocketState: CLOSED E/DeviceConnFactoryManager( 6613): close Port macAddress -> 86:67:7A:00:07:97 I/BluetoothAdapter( 6613): cancelDiscovery I/BluetoothSocket( 6613): connect() for device XX:XX:XX:XX:07:97 called by pid: 6613 W/System.err( 6613): java.io.IOException: bt socket closed, read return: -1 W/System.err( 6613): at android.bluetooth.BluetoothSocket.read(BluetoothSocket.java:797) W/System.err( 6613): at android.bluetooth.BluetoothInputStream.read(BluetoothInputStream.java:91) W/System.err( 6613): at java.io.InputStream.read(InputStream.java:218) W/System.err( 6613): at com.gprinter.io.BluetoothPort.readData(BluetoothPort.java:130) W/System.err( 6613): at com.example.bluetooth_print.DeviceConnFactoryManager.readDataImmediately(DeviceConnFactoryManager.java:308) W/System.err( 6613): at com.example.bluetooth_print.DeviceConnFactoryManager$PrinterReader.run(DeviceConnFactoryManager.java:387) E/BluetoothPort( 6613): connection device is lost E/DeviceConnFactoryManager( 6613): read 0 E/DeviceConnFactoryManager( 6613): wait read E/BluetoothPort( 6613): read length1 E/DeviceConnFactoryManager( 6613): read 1 E/DeviceConnFactoryManager( 6613): *** wait read

i keep on geting wait read , im using a bluetooth thermal printer that support reciept and label printing

AmanBhangre commented 5 months ago

I am facing the same issue. Did you find any resolution?

jsy11 commented 5 months ago

I am facing the same issue. Did you find any resolution?

no... same. hopefully the contributors can address this issue soon.

AmanBhangre commented 5 months ago

I am facing the same issue. Did you find any resolution?

no... same. hopefully the contributors can address this issue soon.

I finally found the solution. Basically the package was not supporting the Bluetooth version of my printing device which is V2. I found this flutter blue plus package which worked really well with V2 devices.

jsy11 commented 5 months ago

flutter blue plus package ? can you share the url? I can't find this.

AmanBhangre commented 5 months ago

flutter blue plus package ? can you share the url? I can't find this.

Here it is : https://pub.dev/packages/flutter_blue_plus

jsy11 commented 5 months ago

I am facing the same issue. Did you find any resolution?

no... same. hopefully the contributors can address this issue soon.

I finally found the solution. Basically the package was not supporting the Bluetooth version of my printing device which is V2. I found this flutter blue plus package which worked really well with V2 devices.

Thanks! will explore this.

jsy11 commented 5 months ago

The library you recommend not supported in printing as they dnt support Bluetooth classic and printer uses Bluetooth classic not BLE. "❗ Bluetooth Classic is not supported ❗ i.e. Arduino HC-05 & HC-06, speakers, headphones, mice, keyboards, gamepads, and more are not supported. These all use Bluetooth Classic. Also, iBeacons are not supported on iOS. Apple requires you to use CoreLocation.