Author Topic: Connecting an RS232 host to a USB device  (Read 17624 times)

0 Members and 1 Guest are viewing this topic.

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Connecting an RS232 host to a USB device
« on: September 01, 2015, 08:55:38 am »
I'm very familiar with the normal USB to RS232 converter, use them all the time to connect new PC's with USB to legacy printers and barcode scanners with RS232.

I'm now being asked to connect a new USB only printer to an old system that only has RS232 ports. This is new to me, is there an off the shelf solution that anybody can recommend?
 

Offline LukeW

  • Frequent Contributor
  • **
  • Posts: 686
Re: Connecting an RS232 host to a USB device
« Reply #1 on: September 01, 2015, 09:22:53 am »
Sounds nontrivial. Best bet may be to look at getting a PCI card or similar with USB host ports.
What does the old PC have, in terms of internal card slots such as PCI?
 

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Re: Connecting an RS232 host to a USB device
« Reply #2 on: September 01, 2015, 09:41:11 am »
Trivial:

http://microcontrollershop.com/product_info.php?products_id=5031

thanks to an EEV member who contacted me direct, much appreciated.
 

Offline Balaur

  • Supporter
  • ****
  • Posts: 525
  • Country: fr
Re: Connecting an RS232 host to a USB device
« Reply #3 on: September 01, 2015, 10:23:30 am »
Useful device and it seems to integrate easily and without troubles in an existing set-up.
The price is interesting though.
I guess that a Raspberry Pi enthusiast will quickly tell you that it's trivial to set-up a print server connecting the USB printer to the RPi and some kind of script to copy incoming serial data to the CUPS server (or whatever passes for a printing system these days). You'll also spend the better half of the day trying to make that work.
 

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Re: Connecting an RS232 host to a USB device
« Reply #4 on: September 01, 2015, 10:29:13 am »
Cheaper here, just ordered 2:

https://eshop.t-online.de/epages/Store6_Shop10552.sf/sec0bc80e6964/?ObjectPath=/Shops/Shop10552/Products/SER2USB

But I don't care much about the price. Raspberry Pi based solution fills me with horror, so much time and effort and extra connectors to make, cases to find, power supply problems.... just NO!
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8173
  • Country: fi
Re: Connecting an RS232 host to a USB device
« Reply #5 on: September 01, 2015, 04:25:11 pm »
As this problem indeed is nontrivial, the product in question is not any kind of "adapter" or "cable", but an active software product that only can support some printers. This is explained behind the link you gave, but just as a reminder, it will only work on some printers, but it's not a drop-in solution because some printers require their own, custom drivers and you cannot install them on the PC (your RS232 host); the support must be in that converter product. So better check first if the potential printers are compatible. The "linux driver" hint is a clue, but not a definitive answer; some printers may have a linux driver available, but still use their own custom communication.
 

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Re: Connecting an RS232 host to a USB device
« Reply #6 on: September 01, 2015, 05:56:19 pm »
Thank you for your comments, but the printers I have to connect to are intelligent devices that don't require drivers.

They work on a well defined ASCII protocol using high level commands to generate position text and barcodes. All character/bitmap generation scaling and rotation is carried out internally. All I do is throw a text file at them and out pops a label, just the kind of trivial application these devices seem to be intended for.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Connecting an RS232 host to a USB device
« Reply #7 on: September 01, 2015, 06:16:00 pm »
I'm very familiar with the normal USB to RS232 converter, use them all the time to connect new PC's with USB to legacy printers and barcode scanners with RS232.

I'm now being asked to connect a new USB only printer to an old system that only has RS232 ports. This is new to me, is there an off the shelf solution that anybody can recommend?
I have designed something like that for one of my customers (no, it's not Raspberry Pi based) but depending on the printer it may need extra work to support the printer's USB protocol. How many do you need?
« Last Edit: September 01, 2015, 06:19:46 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Re: Connecting an RS232 host to a USB device
« Reply #8 on: September 01, 2015, 06:28:51 pm »
How many do you need?

Grand total of 1. For a factory in Slovakia so I need something simple and that I can test in the office and ship out knowing it 'just works'. I bought 2 so I can have one in the office as a spare and so I can do any additional troubleshooting in the future.

As I said, it's not about the cost. I want it NOW and I want it to WORK! lol
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: Connecting an RS232 host to a USB device
« Reply #9 on: September 01, 2015, 06:32:04 pm »
Thank you for your comments, but the printers I have to connect to are intelligent devices that don't require drivers.

They work on a well defined ASCII protocol using high level commands to generate position text and barcodes. All character/bitmap generation scaling and rotation is carried out internally. All I do is throw a text file at them and out pops a label, just the kind of trivial application these devices seem to be intended for.

Maybe the old serial printers were, but have you ever used one of the new USB printers that you're trying to interface with now?  What's the protocol?  If you plug it into a Linux system, what does it enumerate as?  Does it require drivers?  Are they built into the Windows kernel?  Linux kernel?
 

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Re: Connecting an RS232 host to a USB device
« Reply #10 on: September 01, 2015, 06:48:34 pm »
Thank you for your comments, but the printers I have to connect to are intelligent devices that don't require drivers.

They work on a well defined ASCII protocol using high level commands to generate position text and barcodes. All character/bitmap generation scaling and rotation is carried out internally. All I do is throw a text file at them and out pops a label, just the kind of trivial application these devices seem to be intended for.

Maybe the old serial printers were, but have you ever used one of the new USB printers that you're trying to interface with now?  What's the protocol?  If you plug it into a Linux system, what does it enumerate as?  Does it require drivers?  Are they built into the Windows kernel?  Linux kernel?

You're all making this far more complicated than it is. It's a Zebra printer and the protocol is ZPL. It's the same old ZPL I used to throw down the old printers RS232 port that I now need to throw down the new printers USB port. This isn't a stripped down printer that requires a host PC to do all the bitmap generation.

I don't have a Linux system and have no intention of mucking about with one! The PC I'm using has ISA slots and runs DOS 6.22 so any suggestion of sticking PCI cards with USB ports on is is falling on very stoney ground!

Heaven forbid I ever have to take any of you on site, it's a shitty old world of pain I have to support out there!
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: Connecting an RS232 host to a USB device
« Reply #11 on: September 01, 2015, 07:05:02 pm »
It's the same old ZPL I used to throw down the old printers RS232 port that I now need to throw down the new printers USB port. This isn't a stripped down printer that requires a host PC to do all the bitmap generation.

And the device you've bought is expecting to speak PCL, not ZPL.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16284
  • Country: za
Re: Connecting an RS232 host to a USB device
« Reply #12 on: September 01, 2015, 07:12:42 pm »
I am sure you can still buy the Zebra printers with 3 ports. USB, serial and centronics. Last one I got at work had all 3 ports, so they must still sell them, as many places that use them still use a mainframe or mini to do the stock inventory. Nice printers, you just have to clean the rollers and heads every so often.
 

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Re: Connecting an RS232 host to a USB device
« Reply #13 on: September 01, 2015, 07:13:45 pm »
It's the same old ZPL I used to throw down the old printers RS232 port that I now need to throw down the new printers USB port. This isn't a stripped down printer that requires a host PC to do all the bitmap generation.

And the device you've bought is expecting to speak PCL, not ZPL.

It's capable of passing through PCL commands, amongst other protocols.
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: Connecting an RS232 host to a USB device
« Reply #14 on: September 01, 2015, 07:16:05 pm »
You're all making this far more complicated than it is. It's a Zebra printer and the protocol is ZPL. It's the same old ZPL I used to throw down the old printers RS232 port that I now need to throw down the new printers USB port. This isn't a stripped down printer that requires a host PC to do all the bitmap generation.

No, you just think the problem is much simpler than it actually is.  See here:
https://km.zebra.com/kb/index?page=content&id=SO8411&actp=LIST

Quote
USB is a common PC connection for many devices and components that have the driver resident in the Windows Operating System. It should be noted that the Zebra Driver, while Microsoft Certified, is not included in the Windows Operating System and must be installed on the host PC before connecting and powering on the printer.

The USB port IS NOT just an RS232 port in disguise where you just need a simple adapter.  Going the other way, from a USB host to an RS232 device, is simple.  Going this way is NOT.  See that quote...this is a real USB device that needs real USB drivers running on the host. You WILL need a smart adapter that's capable of enumerating that USB device and translating your ZPL RS232 commands for it, with all of the necessary drivers for that device built in.
« Last Edit: September 01, 2015, 07:18:36 pm by suicidaleggroll »
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Connecting an RS232 host to a USB device
« Reply #15 on: September 01, 2015, 07:17:17 pm »
You're all making this far more complicated than it is. It's a Zebra printer and the protocol is ZPL. It's the same old ZPL I used to throw down the old printers RS232 port that I now need to throw down the new printers USB port. This isn't a stripped down printer that requires a host PC to do all the bitmap generation.
Still the data needs to be wrapped into USB packets which requires a protocol at the USB level. Each USB device needs its own driver because each device has its own way of packing data into USB packets. A USB device to serial converter needs to implement the specific USB protocol of the printer in order to create the serial stream at the RS232 end. In the devices I have made I run a USB host stack + device specific driver to do that.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Re: Connecting an RS232 host to a USB device
« Reply #16 on: September 01, 2015, 07:20:19 pm »
I am sure you can still buy the Zebra printers with 3 ports. USB, serial and centronics. Last one I got at work had all 3 ports, so they must still sell them, as many places that use them still use a mainframe or mini to do the stock inventory. Nice printers, you just have to clean the rollers and heads every so often.

You can - the ZM600 for example. That has Ethernet as well, nice printer.

 

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Re: Connecting an RS232 host to a USB device
« Reply #17 on: September 01, 2015, 07:22:55 pm »
You're all making this far more complicated than it is. It's a Zebra printer and the protocol is ZPL. It's the same old ZPL I used to throw down the old printers RS232 port that I now need to throw down the new printers USB port. This isn't a stripped down printer that requires a host PC to do all the bitmap generation.
Still the data needs to be wrapped into USB packets which requires a protocol at the USB level. Each USB device needs its own driver because each device has its own way of packing data into USB packets. A USB device to serial converter needs to implement the specific USB protocol of the printer in order to create the serial stream at the RS232 end. In the devices I have made I run a USB host stack + device specific driver to do that.

That's what the bloody adaptor is supposed to do. Why do I need to have drivers when all I have is an RS232 connection to send ASCII strings down?
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: Connecting an RS232 host to a USB device
« Reply #18 on: September 01, 2015, 07:25:16 pm »
That's what the bloody adaptor is supposed to do. Why do I need to have drivers when all I have is an RS232 connection to send ASCII strings down?

The adapter needs to have the drivers, not your computer.  You need an adapter that's designed to translate serial data to USB for that exact printer, that's the problem.
 

Offline Nerull

  • Frequent Contributor
  • **
  • Posts: 694
Re: Connecting an RS232 host to a USB device
« Reply #19 on: September 01, 2015, 07:25:44 pm »
It's the same old ZPL I used to throw down the old printers RS232 port that I now need to throw down the new printers USB port. This isn't a stripped down printer that requires a host PC to do all the bitmap generation.

And the device you've bought is expecting to speak PCL, not ZPL.

From my reading the device doesn't speak anything, it just translates the data stream from RS232 to USB. These printers expect a stream of text in the form of a command language, but that command language must be implemented on the PC side, it isn't done by the device. It just passes on the text it receives. The USB ports on these printers are just USB-to-Serial converters.
« Last Edit: September 01, 2015, 07:28:10 pm by Nerull »
 

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Re: Connecting an RS232 host to a USB device
« Reply #20 on: September 01, 2015, 07:27:31 pm »
It's the same old ZPL I used to throw down the old printers RS232 port that I now need to throw down the new printers USB port. This isn't a stripped down printer that requires a host PC to do all the bitmap generation.

And the device you've bought is expecting to speak PCL, not ZPL.

From my reading the device doesn't speak anything, it just translates the data stream from RS232 to USB. These printers expect a stream of text in the form of a command language, but that command language must be implemented on the PC side, it isn't done by the device. It just passes on the text it receives.

Exactly. Bonus points to that man.
 

Offline TopLoserTopic starter

  • Supporter
  • ****
  • Posts: 1925
  • Country: fr
Re: Connecting an RS232 host to a USB device
« Reply #21 on: September 01, 2015, 07:28:23 pm »
That's what the bloody adaptor is supposed to do. Why do I need to have drivers when all I have is an RS232 connection to send ASCII strings down?

The adapter needs to have the drivers, not your computer.  You need an adapter that's designed to translate serial data to USB for that exact printer, that's the problem.

No.
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: Connecting an RS232 host to a USB device
« Reply #22 on: September 01, 2015, 07:30:32 pm »
It's the same old ZPL I used to throw down the old printers RS232 port that I now need to throw down the new printers USB port. This isn't a stripped down printer that requires a host PC to do all the bitmap generation.

And the device you've bought is expecting to speak PCL, not ZPL.

From my reading the device doesn't speak anything, it just translates the data stream from RS232 to USB. These printers expect a stream of text in the form of a command language, but that command language must be implemented on the PC side, it isn't done by the device. It just passes on the text it receives.

Exactly. Bonus points to that man.

Or at least that's the hope. Actual documentation seems to be fairly scarce.

Let us know if it works.
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: Connecting an RS232 host to a USB device
« Reply #23 on: September 01, 2015, 07:32:55 pm »
The USB ports on these printers are just USB-to-Serial converters.

Are you sure about that?  Why would they need their own drivers?  That's why I asked him to plug the device into a computer so he could see what it enumerates as, which he aggressively refused to do for some unknown reason.  If it just enumerates as a TTY/COM port, then yes it could be simple, but he needs to do some testing to see if that's true.
« Last Edit: September 01, 2015, 07:34:32 pm by suicidaleggroll »
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: Connecting an RS232 host to a USB device
« Reply #24 on: September 01, 2015, 07:38:51 pm »
That's why I asked him to plug the device into a computer so he could see what it enumerates as, which he aggressively refused to do for some unknown reason.

That is not what you asked him to do, and the reason was quite clearly stated.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf