Author Topic: Intercepting data being sent to an Ethernet connected printer  (Read 6655 times)

0 Members and 1 Guest are viewing this topic.

Online Marco

  • Super Contributor
  • ***
  • Posts: 6966
  • Country: nl
Re: Intercepting data being sent to an Ethernet connected printer
« Reply #25 on: May 29, 2018, 03:54:13 pm »
A simple TCP/IP bidirectional proxy in python is like 10 lines of code, add some regular expressions to fish out the data aand pipe them to the RFID writer and you're done.
 

Offline darrylp

  • Regular Contributor
  • *
  • Posts: 127
  • Country: gb
Re: Intercepting data being sent to an Ethernet connected printer
« Reply #26 on: May 29, 2018, 04:31:44 pm »
Put the printer into dump mode, it will print out what is being sent to it. If it's ZPL a form of EPL the programming manuals will help you read and understand it. It's a very simple text based command language.

Sent from my HTC One using Tapatalk 2

 

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Re: Intercepting data being sent to an Ethernet connected printer
« Reply #27 on: May 29, 2018, 07:13:31 pm »
Thanks but I know exactly what data is being sent to the printer and how to interpret it. I just want to remove the printer and capture that data. It’s the transfer mechanism that’s causing me grief not the data.

Reduce the problem to it’s basics - capturing a plain text document sent using Notepad and using the Windows ‘Generic text’ printer driver to an ethernet port.
 

Offline ThaHandy

  • Newbie
  • Posts: 7
Re: Intercepting data being sent to an Ethernet connected printer
« Reply #28 on: May 29, 2018, 10:08:34 pm »
What about add a new local port and save it to a file.
Next thing is to process the file at every print and relay it.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9935
  • Country: us
Re: Intercepting data being sent to an Ethernet connected printer
« Reply #29 on: May 29, 2018, 10:29:12 pm »
If you have an Ethernet HUB (switch won't work), plug it in just ahead of the printer.  Now your normal TCP/IP goes into the hub and on to the printer, just like normal.  But the traffic also comes out every other port so just hang a PC running Wireshark on the hub and get creative with the filtering if necessary.

I would expect the upstream switch to limit traffic on the link to the hub as being either broadcast or address specific.  You can filter out the broadcast stuff in Wireshark if it is a  PITA.

When I was writing code to emulate a plotter by mashing up step commands into HPGL sentences, the first thing I did was aim the traffic at a Linux box with an open port.  I wrote a little piece of Berkeley Sockets code to listen on the port and copy the traffic to disc.  This really expedited getting the sentences correct.  However, I never expected to have to reply.

I don't know what that possible reply stuff is about but you'll see it with Wireshark.  Look for the packets with the source address of the printer and the destination address of the host sending the stream.

« Last Edit: May 29, 2018, 10:37:25 pm by rstofer »
 

Offline thermistor-guy

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: au
Re: Intercepting data being sent to an Ethernet connected printer
« Reply #30 on: May 30, 2018, 12:39:01 am »
Yes but the Wiznet device is yet another that requires the virtual serial port driver installed on the server. Can’t do that.

Wouldn’t buy it anyway because of the licensing rubbish for the driver:

“If you agree with the End User License Agreement for WIZVSP, you will be able to download the program and get a registration key. When registering the product with license agreement, the MAC address of the product in use and the email address of the contact person are required.”

Driver tied to the MAC address of the device? What happens when the thing fails and the end user has to replace it? Bit of an extra pain, none of the other devices are that fussy.

You need to use some s/w to configure the device, but once configured the device is stand-alone. I haven't needed to use or get a registration key.
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Intercepting data being sent to an Ethernet connected printer
« Reply #31 on: May 30, 2018, 12:59:03 am »
TopLoser

You want simple, do not make it hard.

You state
Quote
Zebra barcode printer that is connected to a Windows server via ethernet.
That is a network printer.
And you state
Quote
you are limited on what you can change on the server
Your Windows server can use a network printer share, this needs no special software.

You can do a test with a test windows computer to prove following works.
On Test windows computer do following.
1. connect a USB to RS232 cable. The Cable creates a COM port.
2. Connect RFID thing to RS232 connector.
3. make this a printer by adding a printer using com-port from #1.
4. Share this printer. this creates a Ethernet connection to printer.
You now have
Computer_name
Printer_Share_name
Username & password

this Printer_Share_name should show in network neighborhood.

When test computer is connected to customers network,
Printer_Share_name should show on servers network neighborhood.
On server, If you right click on printer share name and connect you get this RFID printer on server.

Server should now be able to print to RFID.

This should work.

now the test windows computer could be any windows computer.
Or
you could use any linux computer, even a raspberry Pi

So a linux computer can replace the test windows computer above.  look at previous post for linux.

You have option if needed to have test or linux computer to send input from server to a file and have a program read that file and send it to RS232 if you need to change what is sent from server.

Now the final step on server is
changing the program to use RFID printer instead of Zebra printer.
Or
Changing Zebra printer properties to match RFID printer.

Now to sum it up
No added software on windows server. It is all standard windows stuff and configuration.

The USB to serial cable could need a windows driver.
Linus often has the drivers.
but in ether case the driver is NOT on the server.


C
 

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Re: Intercepting data being sent to an Ethernet connected printer
« Reply #32 on: May 30, 2018, 09:09:03 am »
Thanks C, I quite like that idea.

Customer might kick up a fuss with having another PC appear on their network, but I can ask... They’re generally ok with ‘dumb’ devices being connected to it but anything resembling a PC and people start shouting ‘security’ and ‘maintenance’.

Certainly got possibilities though.
 

Offline bob225

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: gb
Re: Intercepting data being sent to an Ethernet connected printer
« Reply #33 on: May 30, 2018, 09:54:36 am »
This is what I said in my previous posts just put the usr convertor in server mode - clone the ip and mac of the printer

or

just purchase a network rfid reader/writer
 

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Re: Intercepting data being sent to an Ethernet connected printer
« Reply #34 on: May 30, 2018, 10:24:23 am »
Tried that Bob225, got one of them on my desk. Can’t get it to work. I’ll give it another go if you’re convinced it’s possible...

There’s a robot and automatic applicator involved, it’s not ‘quite’ as simple as just a RFID tag - I need access to the other label data to determine pallet sizes and other stuff.
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Intercepting data being sent to an Ethernet connected printer
« Reply #35 on: May 30, 2018, 07:58:30 pm »
TopLoser

As I stated that server can easily send that printer data to another computer.
If they have a windows computer close to RFID that could be cheap option. The problem with this is it takes a more time to configure windows.

On the other hand linux is much cheaper when adding a computer. And ones like the Raspberry Pi makes it even easer as the OS is on an SD card.
You can easily make a backup copy.

Linus is also built more for remote management.
SSH lets you get a remote command line, need putty on windows for this. By using SSH and putting a copy of Raspbian OS on SD card you can do it all.
You want WEB management load webmin and get something like you see on a lot of devices these days.

Need to remember that the cloud is mostly built on linux or unix like OS and with simple tools it is easy to manage a huge number of computers.
I often use a program called "Ansible" to build,configure & update a bunch of linux computers.

If now or in the future you need to make changes, you can do it.
Need more then what is in printer stream again this is a good choice.
You could even have a web page showing status of pallets

If customer likes it, linux makes more locations easer.

C
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf