cordovarduino icon indicating copy to clipboard operation
cordovarduino copied to clipboard

Crashes when open connection with Bixolon USB thermal printer.

Open safanmomin opened this issue 9 years ago • 11 comments

Hello, I've been using/implementing your plugin for quite a some while now. I've successfully permitted my device using the vendor and product id, But everytime I try to open the connection using the serial.open command the application somehow crashes.

For reference I've been working on Samsung Galaxy Tab A(SM-T355) with android version 6.0.1. The device that I'm using is a Bixolon thermal receipt printer SRP-350II (It's a USB printer). My code looks something like this:

serial.requestPermission({ vid: 5380, pid: 31, driver: 'FtdiSerialDriver' }, function success() { alert('successfully permited') serial.open({ "dtr":false }, function success() { alert('successfully openend'); }, errorCallback); }, errorCallback );

safanmomin avatar Sep 26 '16 12:09 safanmomin

@xseignard please acknowledge. :)

safanmomin avatar Sep 27 '16 09:09 safanmomin

Have you checked the configuration of your printer??

http://www.bixolon.com/upload/download/manual_srp-350ii_user_english_rev_1_05.pdf (page 11, chapter 1.4.1)

xseignard avatar Sep 28 '16 15:09 xseignard

Thanks for the response. Yes I have checked the configuration and implemented the following properties (baudrate, parity check etc) but somehow my app crashes.

safanmomin avatar Sep 29 '16 06:09 safanmomin

With what values??

xseignard avatar Sep 29 '16 06:09 xseignard

These are the values: { baudRate: 9600, dataBits: 1, stopBits: 0, parity: 1, dtr: false };

safanmomin avatar Sep 29 '16 08:09 safanmomin

So the DIP switch 1 of the serial interface is set as the following?

Switch Value
1.1 ON or OFF
1.2 ON
1.3 OFF
1.4 OFF
1.5 ON or OFF
1.6 OFF
1.7 ON
1.8 OFF

This way your printer should be configured with the following:

  • baudRate: 9600
  • dataBits: 8
  • parity: 0 (i.e. none)
  • dtr: false

So then you would be able to use the following:

{ baudRate: 9600, dataBits: 8, stopBits: 0, parity: 0, dtr: false };

Let me know if it works

xseignard avatar Sep 29 '16 09:09 xseignard

Another question: what kind of usb to serial adapter you use? Are you sure it is compatible with the FtdiSerialDriver ?

xseignard avatar Sep 29 '16 09:09 xseignard

And as stated on image 1.2.1 (page 8) set just connect: Tx (pin 2), Rx (pin 3) and signal gnd (pin 7)

xseignard avatar Sep 29 '16 09:09 xseignard

Hello! Thanks again for looking into the issue. I tried to work with the properties that you gave but the app crashes.

I'm using a USB type B adapter(IFG-U type USB interface) and an OTG that connects with my android tablet, Sorry but I don't know much about it's compatibility.

The printer is up and running, I've tested it from one of the applications that is provided by bixolon on google playstore.

safanmomin avatar Oct 02 '16 07:10 safanmomin

Any updates @safanmomin ? I've been afk for a while.

xseignard avatar Feb 07 '17 08:02 xseignard

Did you ever figure out the problem with this? I have a similar issue with the SRP-350II using a native USB interface. When calling DeviceIoControl with control code IOCTL_USBPRINT_GET_LPT_STATUS (0x220030) it always fails with GetLastError equal to 0x17 ERROR_CRC. This is a simple printer status command that works on all other USB printers including SRP-350III. I suspect there is/was a firmware bug on the SRP-350II.

BrianCook avatar Jan 17 '20 22:01 BrianCook