Error writing to connection: Broken pipe

Hi!

I occasionally run into an issue where my Android is apparently paired (verified by looking in Android settings, and also had just accepted via the dialog on both the TC70 and the QLn320). Also, the Link.OS connection is connected and open (similar to below):

if (connection != null)
{
   if (!connection.IsConnected)
       connection.Open ();

 

But when sending a connection.Write command, I receive an error:

Message: Error writing to connection: Broken pipe

 

Part of the stack trace:

at Zebra.Sdk.Comm.ConnectionA.Write (System.Byte[] p0) [0x0005c] in C:\repos\xamarin-sdk\Binding          Libraries\ZSDK_ANDROIDX\ZSDK_ANDROIDX\obj\Release\generated\src\Zebra.Sdk.Comm.ConnectionA.cs:921

at LinkOS.Plugin.ConnectionImplementation.Write (System.Byte[] data) [0x00000] in C:\repos\xamarin-sdk\Link_OS_SDK_for_Xamarin_Portable\LinkOS\LinkOS.Plugin.Android\ConnectionImplementation.cs:162

 

Any suggestions on how to handle this smoothly? Thanks!

Manuel Caicedo-...
Hi Peter,Are you using the

Hi Peter,

Are you using the LINK-OS Xamarin component?  Otherwise, could you give us more details about the version of the LINK-OS you are using in your integration project. Also, The version of the firmware of the printer will be useful to analyze the context of the error generated.

Thanks,

MC

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Thank you, Manuel.Yes, LinkOS

Thank you, Manuel.

Yes, LinkOS_Xamarin_SDK, version 1.1.75. The QLn320 firmware is 68.19.13Z. I’ll attach the printer configuration in case it is helpful.

Peter

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Manuel Caicedo-...
Peter,Thank you for your

Peter,

Thank you for your quick update, also, could you give us the android version and build of the TC70, we are documenting and investigating the issue.

Thanks again,

MC

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Thanks again!Android 4.4.3,

Thanks again!

Android 4.4.3, build 01-23257-K-18-03-00-MV

pd

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Peter,This is usually

Hi Peter,

This is usually caused by the printer powering off unexpectedly or going out of range.  I'm not sure if this applies to you.  The IsConnected() code shows it as open because the connection was not specifically closed properly (Android native functionality).  The way to handle this properly is to catch the exception and dispose of the connection object, then recreate it. 

Robin

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Thank you, Robin (and team)

Thank you, Robin (and team)!

Peter

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anderson Pinheiro
Same error

Hello, after 3 years ...
You can check the bluetooth connection.
I had the same issue and the problem was that the bluetooth connection was closed and reopened before the print connection was closed. So when I call the write method to print another string, the errors are thrown.
I solved the error by creating and closing the two connections together.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments