Arduino Forum

Using Arduino => Networking, Protocols, and Devices => Topic started by: nirupam115 on Aug 08, 2011, 10:13 am

Title: Interfacing Mega ADK with HP usb printers
Post by: nirupam115 on Aug 08, 2011, 10:13 am
guys I was wondering if Hp usb controlled printers can be interfaced using mega ADK.
I know that we can use PCL5 for communicating with the hp printers...can it be implemented in arduino?
if someone has done something similar then please help me out with this.
Title: Re: Interfacing Mega ADK with HP usb printers
Post by: PaulS on Aug 08, 2011, 12:20 pm
A USB printer is a USB slave device. An Arduino is a USB slave device. Two slaves can not talk to each other. You need a USB master/host.

Fortunately, there is a USB Host shield available for the Arduino. Unfortunately, writing a driver for the printer(s) is not a trivial task.
Title: Re: Interfacing Mega ADK with HP usb printers
Post by: nirupam115 on Aug 10, 2011, 05:33 pm
Is there any way of sending PCL commands to my printer using USB host included in arduino_adk....
can someone please attach a sample code of arduino_adk that uses usb host ?
Title: Re: Interfacing Mega ADK with HP usb printers
Post by: PaulS on Aug 10, 2011, 05:46 pm
Hi, I'd like someone to develop a generic USB driver for any HP printer, that fits on an Arduino with USB Host shield, and still leaves room for my sketch.

Is that what you are asking?
Title: Re: Interfacing Mega ADK with HP usb printers
Post by: retrolefty on Aug 10, 2011, 06:39 pm

A USB printer is a USB slave device. An Arduino is a USB slave device. Two slaves can not talk to each other. You need a USB master/host.

Fortunately, there is a USB Host shield available for the Arduino. Unfortunately, writing a driver for the printer(s) is not a trivial task.


Paul, the new Arduino ADK board is a 2560 based board with an on-board USB host chip, so a USB host shield would not be required. However as you said developing the nessessary software to interface with a HP printer is indeed not a trivial task, unless the HP printers will respond to some very basic HID type drivers that should be avalible for this chip.

http://arduino.cc/en/Main/ArduinoBoardADK

Lefty
Title: Re: Interfacing Mega ADK with HP usb printers
Post by: robtillaart on Aug 10, 2011, 08:16 pm

The original HP printers had a serial port that accepted ASCII (subset of HP-PCL  printer control Language). It is a pity that interface has gone...
Title: Re: Interfacing Mega ADK with HP usb printers
Post by: nirupam115 on Aug 11, 2011, 10:33 am
Actually I haven't used the new arduino adk board, so I am not familiar with sending commands via the usb host controller embedded on the board...maybe using this host I can then send some basic commands to the printer...?
Title: Re: Interfacing Mega ADK with HP usb printers
Post by: PaulS on Aug 11, 2011, 12:04 pm
Your going to need to quit beating around the bush and identify, at a minimum WHICH printer you are talking about.

Even then, it is not all that likely that you will be able to do something as simple as Serial.print() to send it data.
Title: Re: Interfacing Mega ADK with HP usb printers
Post by: nirupam115 on Aug 11, 2011, 09:04 pm
I am intending to use LaserJet P4015x printer.
Title: Re: Interfacing Mega ADK with HP usb printers
Post by: sentryGun53 on Oct 09, 2011, 12:22 am
If the printer has a Parallel Port, you can use that to print with an Arduino. I have some code that does this.
cheers
Title: Re: Interfacing Mega ADK with HP usb printers
Post by: robtillaart on Oct 09, 2011, 12:48 pm

Only if you want the most out of your printer you need to know the type. If a printer supports PCL you can do several things as most commands are upwards compatible.
OK every printer has some features not supported on others but if you want just print text or an image that is possible with PCL.

PCL is not too difficult, see - http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpl02705 - most commands are sending a few byte codes to switch internal modi.

Title: Re: Interfacing Mega ADK with HP usb printers
Post by: copiertalk on Oct 09, 2011, 11:51 pm
the 4015n?

HP PCL 6, HP PCL 5e, HP postscript level 3 emulation, direct PDF (v 1.4) printing (with at least 128 MB printer memory)


I am not sure about the USB port or if it would work. you can send PCL commands to port 9100 and they will print over a network though. I never got real robust or even finished my project but I have got characters to print or sentences.
Title: Re: Interfacing Mega ADK with HP usb printers
Post by: vamshich on Mar 22, 2019, 09:08 am
Hi @nirupam115,

Have you been successful in establishing communication between arduino mega adk and a usb printer?