esc_pos_printer
esc_pos_printer copied to clipboard
USB Driver / Interface
Hi,
Thank you for this amazing library firstly, secondly I am going to pull it tomorrow as I would like to add the usb printing facility.
Given that it is your work, do you have any guidance?
I was looking at using https://pub.dev/packages/usb_serial, then sending the same commands over the usb serial port? are there any specifics that you are aware of that we should take into consideration.
Once we have it working, we will give it right back to you :)
Hi, Thank you for your feedback, I really appreciate it! I didn't have time yet to dig into USB support but it looks like it's feasible using usb_serial library. Some people already asked about the USB support, so I think it could be really useful to add this feature!
Hi Andrey,
Just to let you know, we have completed the usb driver for this, we are busy testing.
It was really simple enough to get going with very few changes.
Hi Brandon,
Sounds great! Thank you for your work! I'm waiting for your pull request to test it.
Hi Brandon,
Are you ready to make a pull request? I could include your changes into the next release.
Hi Andrey/Brandon
I would be really interested in testing this too? We were looking at embarking on a similar integration.
@broberts-nybble can you share the usb part for this please?
Any updates on the support for USB Driver? I would like to work if @andrey-ushakov you can provide me some guidance.
Hi @AyushBherwani1998 ,
That will be really helpful!
I expect it shouldn't be too hard to develop using this usb_serial library (android only) but I don't have an appropriate device to which I can connect my POS printer and test.
So it would be great if you could play a bit with an Android device, POS printer and this usb lib. Basically all we need to do is to send same POS commands over USB.
For example, you can create a simple demo app where user will choose an USB device (his POS printer) from a list and after that you can print a test ticket sending commands via USB.
The most interesting part would be how to create a class architecture to support USB and WiFi (and probably Bluetooth in future) connections.
Probably we can create a low-level (abstract) class PrinterAbstract
that will generate POS commands and 2 classes - PrinterWifi
and PrinterUsb
that will send those commands over Wifi or Usb.
Hi @AyushBherwani1998 ,
That will be really helpful!
I expect it shouldn't be too hard to develop using this usb_serial library (android only) but I don't have an appropriate device to which I can connect my POS printer and test.
So it would be great if you could play a bit with an Android device, POS printer and this usb lib. Basically all we need to do is to send same POS commands over USB.
For example, you can create a simple demo app where user will choose an USB device (his POS printer) from a list and after that you can print a test ticket sending commands via USB.
The most interesting part would be how to create a class architecture to support USB and WiFi (and probably Bluetooth in future) connections.
Probably we can create a low-level (abstract) class
PrinterAbstract
that will generate POS commands and 2 classes -PrinterWifi
andPrinterUsb
that will send those commands over Wifi or Usb.
Hey, I'm trying to connect the thermal printer but it always throws a Platform Exception. I saw the issue was closed by @broberts-nybble
@broberts-nybble A little help would be appreciated.
Hi @AyushBherwani1998 , That will be really helpful! I expect it shouldn't be too hard to develop using this usb_serial library (android only) but I don't have an appropriate device to which I can connect my POS printer and test. So it would be great if you could play a bit with an Android device, POS printer and this usb lib. Basically all we need to do is to send same POS commands over USB. For example, you can create a simple demo app where user will choose an USB device (his POS printer) from a list and after that you can print a test ticket sending commands via USB. The most interesting part would be how to create a class architecture to support USB and WiFi (and probably Bluetooth in future) connections. Probably we can create a low-level (abstract) class
PrinterAbstract
that will generate POS commands and 2 classes -PrinterWifi
andPrinterUsb
that will send those commands over Wifi or Usb.Hey, I'm trying to connect the thermal printer but it always throws a Platform Exception. I saw the issue was closed by @broberts-nybble
@broberts-nybble A little help would be appreciated.
Hey @AyushBherwani1998, basically the issue was that the device was not set to virtual com, what needed to happen was I had to plug it into my PC, open the sample app they generally provide and set it's comm protocol to Virtual COM, then it connected and did not crash.
Hi @AyushBherwani1998 , That will be really helpful! I expect it shouldn't be too hard to develop using this usb_serial library (android only) but I don't have an appropriate device to which I can connect my POS printer and test. So it would be great if you could play a bit with an Android device, POS printer and this usb lib. Basically all we need to do is to send same POS commands over USB. For example, you can create a simple demo app where user will choose an USB device (his POS printer) from a list and after that you can print a test ticket sending commands via USB. The most interesting part would be how to create a class architecture to support USB and WiFi (and probably Bluetooth in future) connections. Probably we can create a low-level (abstract) class
PrinterAbstract
that will generate POS commands and 2 classes -PrinterWifi
andPrinterUsb
that will send those commands over Wifi or Usb.Hey, I'm trying to connect the thermal printer but it always throws a Platform Exception. I saw the issue was closed by @broberts-nybble @broberts-nybble A little help would be appreciated.
Hey @AyushBherwani1998, basically the issue was that the device was not set to virtual com, what needed to happen was I had to plug it into my PC, open the sample app they generally provide and set it's comm protocol to Virtual COM, then it connected and did not crash.
Can you show me code plz!!
@broberts-nybble any updates in your PR?
I was not able to achieve the functionality using usb_serial library. Instead, I used another package esc-pos-printer-flutter with combination with this package and made an interface to achieve usb and bluetooth. If you are using esc-pos-printer-flutter package you need to add other functionalities by yourself.
esc-pos-printer-flutter this is for usb. What package did you use for bluetooth? @AyushBherwani1998
esc-pos-printer-flutter this is for usb. What package did you use for bluetooth? @AyushBherwani1998
For bluetooth I used blue_thermal_printer plugin. It has all the print options you require.
@AyushBherwani1998 I think this package does not support ios? Have you tried it in ios?
@AyushBherwani1998 I think this package does not support ios? Have you tried it in ios?
Yes, this package only supports Android as of now. You will need to modify the package to support the iOS using PlatformChannel
.
Thanks @AyushBherwani1998
any update on this?