Printer Emulator

photon
Tags: #<Tag:0x00007fe21e26b800>

#1

I am trying to create a printer emulator with my Particle Photon. I want the photon to behave like a printer and save digital files so that it can be retrieved when connected to a PC. I don’t really know where to start, so it will be great if I can get pointers :grinning:


#2

You’ll want to save the files either in the EEPROM of the photon or on an external memory device. Where you save it depends on how big and how many files you have since the Photon is limited on how much memory is available for use. Aside from that, this seems like a pretty hefty task just to reproduce a USB flash drive, is there a reason you want to go this route specifically?


#3

Well saving the files is really an extra. One of the systems we are using crashes without a printer. I tried with an USB, but that didn’t work. I’m looking for a way to add an external device to emulate a printer so that the system thinks a printer is attached.


#4

@jrufina, is this a USB printer or an older style parallel printer?


#5

@peekay123, It’s an USB printer.


#6

@jrufina, you will not be able to emulate a USB printer with a Photon. Currently, the Photon can emulate a keyboard or a mouse but a printer is too complex and not supported by the underlying deviceOS. You would need to emulate the VID/PID of the specific printer(s) supported along with parsing all printer commands and providing the correct responses to those commands. A quick google search will tell you this is not a straight forward problem to solve. I anything, you would want to do something with the printer driver to dump data to a file instead of the actual printer. However, if the application is controlling the printer directly, you are most likely AOL.