Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Vzor-
Copy link
Contributor

@Vzor- Vzor- commented Jul 1, 2022

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

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

@tresf tresf changed the title offline listener test Add ability to detect "offline" printer status Jul 5, 2022
@tresf
Copy link
Contributor

tresf commented Jul 7, 2022

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

@tresf
Copy link
Contributor

tresf commented Aug 2, 2022

@klabarge pinging again for testing and approval.

@klabarge
Copy link
Member

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

@tresf
Copy link
Contributor

tresf commented Aug 26, 2022

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

@Vzor-
Copy link
Contributor Author

Vzor- commented Aug 27, 2022

@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.

@tresf
Copy link
Contributor

tresf commented Aug 28, 2022

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
Copy link
Contributor

tresf commented Aug 29, 2022

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

@tresf
Copy link
Contributor

tresf commented Sep 27, 2022

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

@Vzor-
Copy link
Contributor Author

Vzor- commented Sep 27, 2022

@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-
Copy link
Contributor Author

Vzor- commented Sep 29, 2022

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

@tresf
Copy link
Contributor

tresf commented Sep 30, 2022

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

@tresf tresf merged commit b04ee16 into qzind:master Sep 30, 2022
@tresf tresf deleted the offline-listener branch September 30, 2022 04:14
@tresf tresf changed the title Add ability to detect "offline" printer status Add ability to detect "offline" USB printer status Dec 6, 2022
emkah4 pushed a commit to Fourbolts/orderkrab-tray that referenced this pull request May 24, 2025
Adds the ability to monitor for offline USB printers

Co-authored-by: Tres Finocchiaro <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants