Main > Everything Else
Monitoring USB for a print command
(1/2) > >>
processedmeat:
Not sure where to put this and mods feel free to delete or move this but since this site is full of absolutely brilliant maker type of people I thought I would ask.

While taking a hiatus from my arcade cabinet, I put together a photobooth for my nonprofit for use at their fundraising galas.  When somebody takes a photo it will print to either one of the two Canon Selphy printers located in two separate bays of the photobooth.  I use the printer spooling feature in Windows so that when one is occupied, it will print to the other.

Is there a way to monitor the USB for the print command and then output a command to turn on the leds of that bay so that the user knows which bay where their photo is coming out of?  Or is there another way to do this?

Thanks for reading this.
behrmr:
I would suggest rather than monitoring the USB port you would look to monitor the print queue activity.  I would imagine a scripting language would be able to do this pretty easily.
SavannahLion:

--- Quote from: behrmr on June 26, 2015, 11:07:12 pm ---I would suggest rather than monitoring the USB port you would look to monitor the print queue activity.  I would imagine a scripting language would be able to do this pretty easily.

--- End quote ---

Be careful with this, some printers will "lie". We have something along the lines of twenty different printers from nearly every manufacturer at my work and they all have their "personalities". Some of the quirkiest I've ever seen. The queue on some behave correctly so you always know when they're available, others will flush the queue as soon as the print job starts (even if it's a 100 pages).

One of my damn scripts at work broke because a new printer we bought always reports a paper jam even though there's no paper jam at all. Took me weeks to figure out why the script would only work for some people. :badmood:

If you have control over the software, why not alternate between printer 1 and 2 during prints? If you send the job to printer 1, the light up #1. if you send the job to #2 light up #2.
processedmeat:

--- Quote from: behrmr on June 26, 2015, 11:07:12 pm ---
If you have control over the software, why not alternate between printer 1 and 2 during prints? If you send the job to printer 1, the light up #1. if you send the job to #2 light up #2.

--- End quote ---

That is what I want to be able to do.  Any ideas how to make this happen?
SavannahLion:
IIRC the Windows API EnumPrinter allows you to enumerate the available printers installed. Once you have that info, build a Round Robin array and send the print jobs to right printer as you go down the list. Check out the MSDN reference for the API https://msdn.microsoft.com/en-us/library/windows/desktop/dd162863(v=vs.85).aspx

Illuminating LEDs is a bit different as you'll likely be relying on an external IO board for that. What did you have in mind for that?
Navigation
Message Index
Next page

Go to full version