Open putheng opened 1 year ago
hi, I have updated the ios implementation, could you check it?
Now it does not print at all. Worked till before updating package. Now libGSDK.a is removed.
Hi, Thank you for keeping up to date with this package. I just discover that not only ios devices but also some Android devices get the same issues
Like this kind of machine I have tested 2 machines. I'm not sure if it is because of devices or the code issues, for the receipt widget, I just follow the example
@M6268 i decided to implement from the CoreBluetooth instead libGSDK. Its happened to the example project?
there is no logs from IOS side what is happening.
@putheng is the device use bluetooth connection to the printer?
@ekasetiawans yes it does
Hi, Thank you for keeping up to date with this package. I just discover that not only ios devices but also some Android devices get the same issues
Like this kind of machine I have tested 2 machines. I'm not sure if it is because of devices or the code issues, for the receipt widget, I just follow the example
Usually android printers wont work by default, you have to manually add UUID of the device , it can be found from sunmi android sdk
@M6268 i decided to implement from the CoreBluetooth instead libGSDK. Its happened to the example project?
i haven;t tried the example yet, i will update
@M6268 could you debug the example project from the xcode?
@M6268 it does print but it got a white line through the text as I mentioned above image
@M6268 could you debug the example project from the xcode?
yes
2022-12-13 14:13:49.257944+0530 Runner[50448:2804378] Metal API Validation Enabled 2022-12-13 14:13:49.515916+0530 Runner[50448:2804378] Warning: Unable to create restoration in progress marker file 2022-12-13 14:13:49.562128+0530 Runner[50448:2804878] flutter: The Dart VM service is listening on http://127.0.0.1:49422/tG5MTzXIxcs=/ 2022-12-13 14:13:50.012529+0530 Runner[50448:2804852] fopen failed for data file: errno = 2 (No such file or directory) 2022-12-13 14:13:50.012594+0530 Runner[50448:2804852] Errors found! Invalidating cache... 2022-12-13 14:13:50.044212+0530 Runner[50448:2804851] fopen failed for data file: errno = 2 (No such file or directory) 2022-12-13 14:13:50.044243+0530 Runner[50448:2804851] Errors found! Invalidating cache...
This is the only thing found from console
It connects with the printer , in my printer connectivity LED is on after few seconds it get disconnected.
@M6268 it does print but it got a white line through the text as I mentioned above image
Its hard for me to find out the cause, its seems like the raster size is too big for your printer, but I'm not sure about that.
Text printing is working fine. Image printing with a single line of text in receipt fails
Text printing is working fine. Image printing with a single line of text in receipt fails
https://github.com/ekasetiawans/flutter_bluetooth_printer_plugin/blob/3e2975368fcb5bfb87e3c75eae5f8f9742ec8aac/packages/flutter_bluetooth_printer/lib/src/flutter_bluetooth_printer_impl.dart#L60 You can try to change this by hardcode to lower value.
This is the error getting from Xcode.
hi @M6268, I have added option useImageRaster on print method, it will use an obsolete method to raster the image, could you try it?
hi @M6268, I have added option useImageRaster on print method, it will use an obsolete method to raster the image, could you try it?
Sure, i will update, is the above error is related to that ?
hi @M6268, I have added option useImageRaster on print method, it will use an obsolete method to raster the image, could you try it?
Sure, i will update, is the above error is related to that ?
I'm not sure enough, but its seems error while sending data to the printer.
Still Error Domain=CBATTErrorDomain Code=13 "The value's length is invalid." UserInfo={NSLocalizedDescription=The value's length is invalid.}
Two left are from iPhone X iOS 15.6.1 and the right side is from Redmi S2 Android 9PKQ1
Still Error Domain=CBATTErrorDomain Code=13 "The value's length is invalid." UserInfo={NSLocalizedDescription=The value's length is invalid.}
I think it caused by limitation of BLE payload length. You can try change the size here (total/5) with smaller value depending your device for example explicit to 30 bytes each payload.
Two left are from iPhone X iOS 15.6.1 and the right side is from Redmi S2 Android 9PKQ1
Did you tried with the latest version I'd recently published?
Two left are from iPhone X iOS 15.6.1 and the right side is from Redmi S2 Android 9PKQ1
Did you tried with the latest version I'd recently published?
Yes I do, I just clone and run it
https://stackoverflow.com/questions/24349945/maximum-data-size-when-sending-data-via-btle-on-ios
It seems the data was corrupted while being transmited to the device because there are difference maximum supported payload length on every device.
I think this is related issue, i will implement it when I have enough time.
Still Error Domain=CBATTErrorDomain Code=13 "The value's length is invalid." UserInfo={NSLocalizedDescription=The value's length is invalid.}
I think it caused by limitation of BLE payload length. You can try change the size here (total/5) with smaller value depending your device for example explicit to 30 bytes each payload.
Thanks for idea. size set to 50. and working .
Still Error Domain=CBATTErrorDomain Code=13 "The value's length is invalid." UserInfo={NSLocalizedDescription=The value's length is invalid.}
I think it caused by limitation of BLE payload length. You can try change the size here (total/5) with smaller value depending your device for example explicit to 30 bytes each payload. https://github.com/ekasetiawans/flutter_bluetooth_printer_plugin/blob/95f507d42614508d6c69dc210bb02aca5c912bcb/packages/flutter_bluetooth_printer/ios/Classes/Bluetooth/BluetoothPrinterManager.swift#L293
Thanks for idea. size set to 50. and working .
Yeayy!! Now we should think to make it flexible depending on the device
Yes, but still the same slow printing !
Yes, but still the same slow printing !
Yes, because the payload is more smaller on every write
Yes, but still the same slow printing !
Yes, because the payload is more smaller on every write
Trying to make chunk size dynamic. i will update the results.
Yes, but still the same slow printing !
Yes, because the payload is more smaller on every write
Trying to make chunk size dynamic. i will update the results.
Cool thank you
hi @M6268 I have updated the chunkSize based on peripheral, please check it if you have time
hi @M6268 I have updated the chunkSize based on peripheral, please check it if you have time
In my test it is broken again. I can give details by tomorrow.(reverting to my patch again, passing size from flutter)
https://stackoverflow.com/questions/24349945/maximum-data-size-when-sending-data-via-btle-on-ios
It seems the data was corrupted while being transmited to the device because there are difference maximum supported payload length on every device.
I think this is related issue, i will implement it when I have enough time.
Ohh, because I have zero knowledge of iOS so waiting for your update. By the way, how can we implement auto paper cut?
For iOS print getting better now, but still abit more issue
For iOS print getting better now, but still abit more issue
could you try to run the example project, and print the example receipt?
Hi there, Thank you for your package. I have an issue with ios printing as you see below image the top one is printed by an Android device and the bottom one is printed by an iOS device (iPhone 10) I really don't know where the white line comes from and how to solve it. By the way, why do Android devices print faster than iOS devices?
thank you