Author Topic: USB printer Tap device  (Read 7463 times)

ashley

  • Member
  • ***
  • Posts: 2
USB printer Tap device
« on: December 11, 2012, 03:29:38 pm »
Hi, Im trying to implement something that goes between a computer and a USB receipt printer in hardware using Arduino/Raspberry Pi or whatever microcontroller.  Basically I want it to log the information going to the printer as well as pass the info to the printer.
I was thinking of a device that implements both slave and host mode and somehow passes the traffic through. Or since its a printer, I was thinking that I could "tap" the traffic since the transfer is most likely in bulk transfer mode.  Could someone give me some pointers as to the best way to tackle this. Thanks!
 

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB printer Tap device
« Reply #1 on: December 11, 2012, 05:17:20 pm »
USB protocol analyzers monitor USB traffic without affecting it. 

Here is some design information for an analyzer:

http://rdist.root.org/2010/12/27/building-a-usb-protocol-analyzer/

In theory you could use something like a BeagleBoard, which has both USB host and device functions, to emulate a printer, capture the printer data, and send the data on to a real printer. To do this, you would need a good understanding of USB and USB printer-class protocols and the printer language used.


ashley

  • Member
  • ***
  • Posts: 2
Re: USB printer Tap device
« Reply #2 on: January 07, 2013, 07:24:53 pm »
Hey Jan, thanks for your reply.
Quick follow up question:

For this type of "tap" would you recommend a man in the middle type of device where it actually receives the usb info and strips off the protocol then adds the protocol and sends it to the intended device.

OR

Tap the USB communication and attempt to de-encode the communication from both sides so as not to interfere with the existing communication.


My 1st thought would be to use the latter since it doesn't interfere with the communication.
The problem is, is USB a scary protocol to decode in software.  I think its doable, thoughts?


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB printer Tap device
« Reply #3 on: January 08, 2013, 10:08:33 am »
Either way you would need to understand the protocols. Monitoring the data without affecting it might be easier since you don't have to replicate every communication.

Another option would be to write a filter driver that captures the data before it goes to the printer.

For more info, search on:

filter driver printer

Or use a commercial protocol analyzer that supports writing programs to export data such as:

http://ellisys.com/products/usbsdk/index.php