tray icon indicating copy to clipboard operation
tray copied to clipboard

Add ability to detect "offline" printer status

Open Vzor- opened this issue 2 years ago • 7 comments

Per https://stackoverflow.com/questions/41437023

~~This is a proof of concept, not ready for merge.~~ Ready for testing.

Vzor- avatar Jul 01 '22 07:07 Vzor-

Code looks good. Assigning to @klabarge for testing. This should fire an "offline" event when a USB printer is unplugged.

tresf avatar Jul 07 '22 17:07 tresf

@klabarge pinging again for testing and approval.

tresf avatar Aug 02 '22 14:08 tresf

I'm testing on:

OS: Windows 10 Java: Temurin-11.0.14.1+1

When I unplug my Epson TM-T88VI I get a NOT_AVAILABLE event. However, this is the same behavior as 2.1.6.

- Thu Aug 25 2022 16:24:40 GMT-0400 (Bolivia Time): NOT_AVAILABLE: Level: FATAL, From: EPSON TM-T88VI Receipt, EventType: PRINTER, Code: 4096

When I plug the printer back in, I do see the OFFLINE event after another NOT_AVAILABLE event is thrown.

- Thu Aug 25 2022 16:27:51 GMT-0400 (Bolivia Time): NOT_AVAILABLE: Level: FATAL, From: EPSON TM-T88VI Receipt, EventType: PRINTER, Code: 4096

- Thu Aug 25 2022 16:27:51 GMT-0400 (Bolivia Time): OFFLINE: Level: FATAL, From: EPSON TM-T88VI Receipt, EventType: PRINTER, Code: 128

 Thu Aug 25 2022 16:27:51 GMT-0400 (Bolivia Time): INITIALIZING: Level: INFO, From: EPSON TM-T88VI Receipt, EventType: PRINTER, Code: 32768

 Thu Aug 25 2022 16:27:51 GMT-0400 (Bolivia Time): OK: Level: INFO, From: EPSON TM-T88VI Receipt, EventType: PRINTER, Code: 0

 Thu Aug 25 2022 16:27:51 GMT-0400 (Bolivia Time): OK: Level: INFO, From: EPSON TM-T88VI Receipt, EventType: PRINTER, Code: 0

klabarge avatar Aug 25 '22 20:08 klabarge

@klabarge do you have another USB printer you can test with? @Vzor- any thoughts?

tresf avatar Aug 26 '22 03:08 tresf

@klabarge do you have another USB printer you can test with? @Vzor- any thoughts?

I think the next step is checking to see if that printer property is changing when it is unplugged, rather than us failing to report it.

Vzor- avatar Aug 27 '22 03:08 Vzor-

When I plug the printer back in, I do see the OFFLINE event after another NOT_AVAILABLE event is thrown.

I missed this portion. @Vzor- let us know what you need to reproduce (hardware, remote connection, etc).

tresf avatar Aug 28 '22 16:08 tresf

@Vzor- pinging again. I'd like to find out if this is good to merge of if it needs additional changes.

tresf avatar Aug 29 '22 14:08 tresf

@Vzor- pinging again please provide next steps so we can decide on this.

tresf avatar Sep 27 '22 14:09 tresf

@klabarge in that SO question, the question shows the print dialog with the selected printer's status as offline. Do you see this as well when the printer is disconnected?

If it shows as online even when disconnected, queue a print job then check the status again.

Do you have other printers to test with? anything via usb should work, even consumer printers.

Vzor- avatar Sep 27 '22 22:09 Vzor-

It works on my Boca Lemur (Windows called it a fgl46). This is most likely dependent on the driver.

- Thu Sep 29 2022 15:06:27 GMT-0400 (Eastern Daylight Time): OFFLINE: Level: FATAL, From: Boca BIDI FGL 26/46 200 DPI, EventType: PRINTER, Code: 67108864

Thu Sep 29 2022 15:06:29 GMT-0400 (Eastern Daylight Time): OK: Level: INFO, From: Boca BIDI FGL 26/46 200 DPI, EventType: PRINTER, Code: 0

- Thu Sep 29 2022 15:06:36 GMT-0400 (Eastern Daylight Time): OFFLINE: Level: FATAL, From: Boca BIDI FGL 26/46 200 DPI, EventType: PRINTER, Code: 67108864

Thu Sep 29 2022 15:06:37 GMT-0400 (Eastern Daylight Time): OK: Level: INFO, From: Boca BIDI FGL 26/46 200 DPI, EventType: PRINTER, Code: 0

Vzor- avatar Sep 29 '22 19:09 Vzor-

@Vzor- thanks for testing! So according to your results, this should be good to merge.

tresf avatar Sep 30 '22 02:09 tresf