Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printer stopped sending status update events #266

Open
TheGreenAirplane opened this issue Feb 7, 2024 · 1 comment
Open

Printer stopped sending status update events #266

TheGreenAirplane opened this issue Feb 7, 2024 · 1 comment

Comments

@TheGreenAirplane
Copy link

TheGreenAirplane commented Feb 7, 2024

I have an XPrinter XP-80C printer, plugged into my compputer via USB and set up via a virutal COM port. I have an app that uses the printer, with the following code for setup:

_printer = new SerialPrinter(portName: _port, baudRate: _baudRate);
Thread.Sleep(500);
e = new EPSON();

// Only register status monitoring once.
if (!_hasEnabledStatusMonitoring)
{
_printer.StatusChanged += StatusChanged;
_hasEnabledStatusMonitoring = true;
}
_printer?.Write(e.Initialize());
_printer?.Write(e.Enable());
if (enableStatusBackMonitoring)
{
_printer.Write(e.EnableAutomaticStatusBack());
}

I'm currently developing the app, which means switching it on and off constantly, so the above code runs over and over again. It's been working fine so far (for about a week), but yesterday the status events just stopped coming. (printing still worked as before)
I restarted my app several times but the StatusChanged event was simply never raised. In the end I had to turn the printer off and on again using the power button. This helped, and it's an acceptable solution for development, but if this happens in production I have a serious problem. Also, due to the nature of this issue it's impossible to reliably reproduce it.

Is there anything I can do to make sure this doesn't happen?

@igorocampos
Copy link
Collaborator

You would have to debug the code while facing the said issue.

You can start putting a break point in this method.

Or if the method is never called, go up from there and see where it stops getting the status update and maybe you will figure out why that is happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants