Communicate with printer

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.

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?

1 Like

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

What operating system?

Its

operating system

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

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, 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?

i'am running on windows

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.

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

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.

1 Like

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 ??

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

1 Like

ok thanks.

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:


The other manuals are here:
http://www.godexprinters.co.uk/industrial/ez2250i

Looks like a little work to do, good luck.

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

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)

1 Like

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

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

Good luck

1 Like

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)
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 :wink:

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?