# Communicate with printer

**URL:** https://discourse.nodered.org/t/communicate-with-printer/10685
**Category:** General
**Created:** [30 April 2019 15:22 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685 "2019-04-30T15:22:38Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)
#### Post date: [30 April 2019 15:22 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/1 "2019-04-30T15:22:38Z")

</div>

how can i connect to codex printer using IP address and communicate with it?? i don't know wich node i have to use in this case!!  
Thanks in advance.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 April 2019 15:39 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/2 "2019-04-30T15:39:46Z")

</div>

Can you print to it from applications other than node-red? If not then first get that working.  
What are you trying to print from node-red?

---

<div class="post-metadata">

### Author: ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)
#### Post date: [30 April 2019 15:52 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/3 "2019-04-30T15:52:59Z")

</div>

from other application it works. i have a code like this "10203022" i want to send it to the printer and print it out.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 April 2019 16:36 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/4 "2019-04-30T16:36:24Z")

</div>

What operating system?

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [30 April 2019 17:06 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/6 "2019-04-30T17:06:15Z")

</div>

Its

> operating system

Are you running the node-red server on windows, MacOS or linux?

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [30 April 2019 17:57 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/7 "2019-04-30T17:57:52Z")

</div>

Lets all take a step back. Whilst knowing the OS @hathemi is running Node-RED on is interesting information, I doubt that will lead to a big revelation as how to communicate with the printer.

@hathemi - if you cannot find a node for the type of device you are using on [flows.nodered.org](http://flows.nodered.org), then it is unlikely that anyone has done what you are asking.

It may be possible to do - we just don't know. To have any hope of making progress, we need far more detail to understand what you are doing. Right now you have only mentioned the manufacture's name of a printer and that it is a network-connected printer. That doesn't give us much to go on. Do you have more specific details as to the make/model of the printer? With that information, someone with more time than I have may be able to search for any reference documentation on how to communicate with the printer and whether anyone has done it from node.js. Have you searched for anyone successfully communicating with your particular model of printer from code?

---

<div class="post-metadata">

### Author: ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)
#### Post date: [30 April 2019 18:42 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/8 "2019-04-30T18:42:47Z")

</div>

i'am running on windows

---

<div class="post-metadata">

### Author: ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)
#### Post date: [30 April 2019 19:26 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/9 "2019-04-30T19:26:42Z")

</div>

unfortunatly i still cannot find anyone else who has successfuly done something like this in NR .

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [30 April 2019 19:37 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/10 "2019-04-30T19:37:59Z")

</div>

> [@hathemi](#):
>
> unfortunatly i still cannot find anyone else who has successfuly done something like this in NR

Okay - if you cannot tell us _any_ more details about the printer you are trying to use, then we won't get much further.

---

<div class="post-metadata">

### Author: ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)
#### Post date: [30 April 2019 19:41 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/11 "2019-04-30T19:41:01Z")

</div>

the printer is godex EZ2250i .. is this can help ?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 April 2019 19:48 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/12 "2019-04-30T19:48:25Z")

</div>

> [@knolleary](#):
>
> Whilst knowing the OS @hathemi is running Node-RED on is interesting information, I doubt that will lead to a big revelation as how to communicate with the printer.

On Linux I think you can `cat` to the printer. I think on Windows there is a `print` command, perhaps you can call that in an exec node.

---

<div class="post-metadata">

### Author: ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)
#### Post date: [30 April 2019 20:40 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/13 "2019-04-30T20:40:18Z")

</div>

> [@Colin](#):
>
> `print` command

Do you have any idea on how i can use print command. do i need to write like this  
`> print 192.x.x.x file.txt` ??

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 April 2019 20:46 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/14 "2019-04-30T20:46:58Z")

</div>

> [@hathemi](#):
>
> Do you have any idea on how i can use print command.

Not me, I don't use Windows, I am happy to say. Google should help you (other search engines are available).

---

<div class="post-metadata">

### Author: ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)
#### Post date: [30 April 2019 20:48 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/15 "2019-04-30T20:48:15Z")

</div>

ok thanks.

---

<div class="post-metadata">

### Author: ![Dan](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@Dan](https://discourse.nodered.org/u/Dan)
#### Post date: [30 April 2019 20:51 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/16 "2019-04-30T20:51:18Z")

</div>

I made a quick search for your printer and found something interesting.  
Maybe it‘s easier to achieve this via serial then via network. This document describes how to achieve this:

> **[EZPL\_EN\_J\_20180226.pdf](https://www.godexprinters.co.uk/downloads/manuals/desktop/EZPL_EN_J_20180226.pdf)**
>
> 2.21 MB

  
The other manuals are here:  
[http://www.godexprinters.co.uk/industrial/ez2250i](http://www.godexprinters.co.uk/industrial/ez2250i)

Looks like a little work to do, good luck.

---

<div class="post-metadata">

### Author: ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)
#### Post date: [30 April 2019 20:56 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/17 "2019-04-30T20:56:23Z")

</div>

I have to achieve it via network. thanks a lot.for docs 🙂

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [30 April 2019 21:29 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/18 "2019-04-30T21:29:40Z")

</div>

You could use serial over Ethernet?

A serial server is relatively cheap. You communicate over TCP or UDP sending the serial commands to the serial server. The serial server (powered near the printer) then turns the TCP or UDP to serial data.

It's not the most elegant but is doable (I do this to communicate to an old Allen Bradley PLC)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [30 April 2019 22:04 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/19 "2019-04-30T22:04:33Z")

</div>

Actually I'd bet you can send those commands to the printers Lan port.

Looking at the manuals posted by @Dan its just ASCII commands. You should give them a try.

You'll have to determine the transport and port

Something like netstat -an  
E.g. [Netstat](https://stackoverflow.com/questions/48198/how-can-you-find-out-which-process-is-listening-on-a-port-on-windows)

The use injects to send strings as port the manual to TCP node until you figure it out.

Good luck

---

<div class="post-metadata">

### Author: ![Dan](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@Dan](https://discourse.nodered.org/u/Dan)
#### Post date: [1 May 2019 06:16 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/20 "2019-05-01T06:16:20Z")

</div>

I saw a screenshot in the usermanual where port 9100 was configured. Port 9100 means your printer listens to LPR (line printer remote). There is a lpr command in windows to send printfiles to your printer. As far as I remember, you don't really send it to the printer with the Lpr command, instead you send it to your PC where the printer driver software is installed on, to the lpd. The lpr command is described here:  
[https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc731926(v=ws.11)](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc731926(v=ws.11))  
The command is on a fresh installed windows not available, you have to install it first via "activate and deactivate windows features".You have to activate both, LPR commands and LPD service. (By the way, on older windows, the feature to add was called "print services for unix" by Microsoft, not LPR and LPD. Just in case). Once you installed LPD you'll have more choice to connect the driver to. Before it was just Standard TCP/IP port, then you'll have the possibility tho make a new lpr-port there. The Queue Name you give here is the one you'll later use with the lpr command. Then you have to figure out what you should send as printfile. Maybe you print something to your installed driver but configure the driver to "print to file" instead to print to the printer. Then you may examine the resulting file. Maybe you just get away with a .txt file. Once you made some progress, maybe you are able to find someone at godexprinters who is more proficient in printing then I am. These are just some sugestions which may point in the right direction, or may not 😉

---

<div class="post-metadata">

### Author: ![Dan](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@Dan](https://discourse.nodered.org/u/Dan)
#### Post date: [1 May 2019 06:39 UTC](https://discourse.nodered.org/t/communicate-with-printer/10685/21 "2019-05-01T06:39:33Z")

</div>

Are you able to print via network and how do you do this? Is there a printerdriver installed, or do you have to print via their software?

[Next page](https://discourse.nodered.org/t/communicate-with-printer/10685.md?page=2)
