Author Topic: USB to Serial adapter setup  (Read 18290 times)

Doug Clark

  • Sr. Member
  • ****
  • Posts: 343
  • Karma: +9/-1
    • View Profile
USB to Serial adapter setup
« on: July 18, 2023, 10:46:22 pm »
I have a serial device that I have working when connected to a real serial port.

I would now like to get it working through a USB to Serial adapter.  The one that I am using is a Belkin fsu116 hub thingy - which plugs into usb and provides 2 serial, 1 parallel and 2 usb ports.  It is shown as working with os/2 in the wiki.

Do I need to add something to my CONFIG.SYS to get the ports working?  Can I assign a comm port number to a specific port on the belkin?

Is there documentation somewhere that describes how you setup usb-serial adapters?

Thanks

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5041
  • Karma: +114/-1
    • View Profile
Re: USB to Serial adapter setup
« Reply #1 on: July 19, 2023, 01:06:00 am »
IIRC, you need usbcom.sys installed  as a device (DEVICE=x:\os2\boot\USBCOM.SYS /V), I had it after USBKBD.SYS in config.sys with /V for verbose. Default should capture the 1st free serial port.
I thought I had some documentation on it but can't find it right now, mostly about setting up the port. Install and play with the mode command to see if it works. There are others who should know more.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4997
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: USB to Serial adapter setup
« Reply #2 on: July 19, 2023, 04:50:18 am »
Hi Doug

I found this for the moment:
http://www.edm2.com/index.php/USBCOM.SYS

Is it USBSer.sys also needed?
http://www.edm2.com/index.php/USBSER.SYS

I was wondering which kind of devices you want to test on the USB Serial port that you have. Are you trying to access to the console of a device with a terminal application?

Even that I got my hands in some USB-to-Serial adapters, I never found out a device I can use easily to confirm the USB-To-Serial port is working.  Was USBCOM.SYS only meant from modems? Was some other devices like serial mouse, serial cable, etc that may work ?

Please let me know your progress, model number of the device, so I can add that device on the wiki.

Regards
« Last Edit: July 19, 2023, 05:25:02 am by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Doug Clark

  • Sr. Member
  • ****
  • Posts: 343
  • Karma: +9/-1
    • View Profile
Re: USB to Serial adapter setup
« Reply #3 on: July 19, 2023, 05:20:05 am »
Dave,

thanks for the usbcom.sys tip.  That got me started, at least.  I added the following two lines to my CONFIG.SYS

DEVICE=C:\OS2\BOOT\USBCOM.SYS /V /N:2
DEVICE=C:\OS2\BOOT\USBCOM.SYS /V /N:3

and the messages on boot up appear to say the driver is loaded for each com port.

But when I enter MODE COM2  or MODE COM3 I get the message
The system cannot find the device specified.

I have one physical COM port in the motherboard, which is used normally used
by my ACECAD driver.  The CONFIG.SYS lines for that driver are

DEVICE=C:\OS2\ACECAD.SYS
DEVICE=C:\OS2\MDOS\VMOUSE.SYS
DEVICE=C:\OS2\BOOT\POINTDD.SYS
DEVICE=C:\OS2\BOOT\AMOUSE.SYS STYPE=ACECAD$
DEVICE=C:\OS2\BOOT\USBMOUSE.SYS

If I put  COM.SYS in my config.sys with the ACECAD driver I get an error message when it tries to load COM.SYS.

If I take out the ACECAD  stuff out of CONFIG.SYS   COM.SYS loads and I can use COM1 - and MODE COM1 works correctly.

Martin,

The device is an IBM 6094-20 Lighted Program Function Keyboard (LPFK) which needs a serial connection.
You can see it in action, along with a 6094-10 Dials device at

https://www.reddit.com/r/retrobattlestations/comments/g6qfd7/ibm_6094_dials_lpfk_lighted_programmable_function/

I ported the source for a a Linux "driver"  (actually just an interface to the serial port for this device with a test program) to OS/2 - but to do that I had to remove the ACECAD driver and connect the LPFK to the real serial port on my machine.  I am now trying to get it to work through a USB - > serial adapter.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4997
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: USB to Serial adapter setup
« Reply #4 on: July 19, 2023, 05:56:55 am »
Hi

Just for the fun of it I took out a "Prolific USB 2.0 to COM" (HardwareID: 067b:2303) device to try it on my ArcaOS VM.
- Added "DEVICE=C:\os2\boot\USBCOM.SYS /V" after USBKBD.
- Configured the VirtualBox VM to enable COM1
- Rebooted

With the device disconnected I run "MODE COM1" and got
 SYS0021: The drive is not ready.

I plugged the adapter, without any serial device attached.
Mounted in VirtualBox the "Prolific USB 2.0 to COM" USB device, and run again "MODE COM1" I got:
Quote
baud     = 9600                   parity   = NONE
databits = 8                      stopbits = 1
TO       = OFF                    XON      = OFF
IDSR     = OFF                    ODSR     = OFF
OCTS     = OFF                    DTR      = ON
RTS      = ON                     BUFFER   = N/A

So, I guess the device is being recognized in some way. But I don't have any serial device at hand to keep testing.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4997
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: USB to Serial adapter setup
« Reply #5 on: July 19, 2023, 06:11:39 am »
The device is an IBM 6094-20 Lighted Program Function Keyboard (LPFK) which needs a serial connection.
You can see it in action, along with a 6094-10 Dials device at

https://www.reddit.com/r/retrobattlestations/comments/g6qfd7/ibm_6094_dials_lpfk_lighted_programmable_function/

Ok, so you have:
- One serial port on your machine - COM1 (COM.SYS)
- Belking USB to Serial with two serial ports - COM2 and COM3 (USBCOM.SYS)
- IBM 6094-20 Lighted Program Function Keyboard (LPFK)  serial device
- A digitizer tablet (ACECAD) serial device.

It worries me that MODE COM2  and MODE COM3 gives you an error, I'm guessing it should report something like my little sample (guess).

What if you try to connect the serial digitizer tablet to the USB-To-Serial like COM2, just to give it try ?
Will the ACECAD.SYS work? I can not find if you can specify a different COM port on ACECAD.SYS.

Also, can you get the hardwareID of the USB-to-Serial device? maybe with lsUSB. (just for the record)  ;D

Regards

« Last Edit: July 19, 2023, 06:26:23 am by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5041
  • Karma: +114/-1
    • View Profile
Re: USB to Serial adapter setup
« Reply #6 on: July 19, 2023, 07:09:59 am »
Hi Doug, don't know how a real serial port and usbcom.sys interact, possible that order in config.sys is important.
I'd suggest as a test, disable your serial port and rem out com.sys and vcom.sys and test to see if it actually works.
At one point, about a decade ago, I had a computer with no serial port and I was on dial up. Had a weird modem that claimed to be a USB modem but was actually a serial modem with a serial port and an USB port connected to the serial port with a PL2303 chip.
I tried all the usbcom.sys drivers I could find including a couple that claimed to support the PL2303, none worked. Luckily David updated the eCS USB stack and the changelog (12-Sep-2013) said "Fixed PL2303 support in USBCOM driver" and it actually worked. Later worked with Lars trying to get his stack to work with my PL2303 without success.
Moral is that these chips are not all created equal.
Guess another option if you can't get it to work is to open an issue at Arca Noae. David has been working on this stuff a long time. Another option is to try Lars's USB stack, it is on Hobbes. No XHCI support though.

Andi B.

  • Hero Member
  • *****
  • Posts: 867
  • Karma: +13/-2
    • View Profile
Re: USB to Serial adapter setup
« Reply #7 on: July 19, 2023, 09:39:00 am »
Have you tried to set another port than 'the first available' for your USB/serial converter? I've something like -
Code: [Select]
DEVICE=C:\OS2\BOOT\USBCOM.SYS /M:4 /N:COM5in my config.sys. My first PL2303 uses COM5: the second COM6: (maybe COM6 and COM7, check with mode command) and so on. Guess /M means using up to max. 4 USB/serial converters but not sure. There is an usbcom.txt which should explain all the parameters.

I think USB 12.14 was the first which worked satisfactorily for me. Before I used the special PL2303 driver with
Code: [Select]
DEVICE=P:\util\USBCOM_PL2303\usbcom.sys /V /M:1 /N:COM5 /Z
DEVICE=P:\util\USBCOM_PL2303\usbcom.sys /V /M:1 /N:COM6 /Z
DEVICE=P:\util\USBCOM_PL2303\usbcom.sys /V /M:1 /N:COM7 /Z
DEVICE=P:\util\USBCOM_PL2303\usbcom.sys /V /M:1 /N:COM8 /Z
« Last Edit: July 19, 2023, 09:43:26 am by Andi B. »

Neil Waldhauer

  • Hero Member
  • *****
  • Posts: 1067
  • Karma: +27/-0
    • View Profile
    • Blonde Guy
Re: USB to Serial adapter setup
« Reply #8 on: July 19, 2023, 03:09:58 pm »
I use a US Robotics USB modem, which looks like a USB serial port to OS/2.

My config.sys uses this:

Device=C:\os2\boot\usbcom.sys /v

The placement of this line is crucial. OS/2 assigns serial ports in order. Each device statement that claims a serial port gets the next port number. I wanted USB to have COM1, so I made sure my device statement came before device statements for the IBM File and Print client, which claims two. Also place it before any COM.SYS or other serial port driver.

You can direct OS/2 to assign a COM port number higher than the one it would normally receive. (I think it only goes up to 99 serial ports)

Device=C:\os2\boot\usbcom.sys /N:COM99
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Doug Clark

  • Sr. Member
  • ****
  • Posts: 343
  • Karma: +9/-1
    • View Profile
Re: USB to Serial adapter setup
« Reply #9 on: July 19, 2023, 09:28:05 pm »
Thanks all for your help.

The adapter I purchased is listed in wiki as being tested by OS/2 CHL hardware testing team and
"works like a charm!" -it is part number F5U116 and shows in the list below as id 050d:0103

I also plugged in another Belkin adapter F5U109 USB PDA Adapter which is listed on the
wiki as "According to IBM this device should work flawlessly with IBM's serial USB device driver."

It shows up in the list below as id 050d:0109



Martin,
 lsusb reports
 
Bus 001 Device 001: ID 050d:0109 Belkin Components F5U109/F5U409 PDA Adapter
Bus 001 Device 002: ID 050d:0103 Belkin Components F5U103 Serial Adapter [etek]
Bus 001 Device 003: ID 050d:0103 Belkin Components F5U103 Serial Adapter [etek]
Bus 001 Device 004: ID 0d3d:0001 Tangtop Technology Co., Ltd HID Keyboard
Bus 001 Device 005: ID 1293:0002 Belkin Components [hex] F5U002 Parallel Port [uss720]
Bus 001 Device 006: ID 046d:c52b Logitech, Inc. Unifying Receiver
 


Dave, Neil and Andi B

I have tried:
1) disabling the com port in bios and removing usb.sys from config.sys - I don't have a vcom.sys in config.sys
2) specifying usbcom.sys with a starting port number (e.g. /N:COM2), and without a starting port number
3) listing usbcom.sys only once in config.sys as advised in usbcom.txt, and listing usbcom.sys mutliple times, one for each desired com port.
4) I have tried different usb-serial adapter IDs(F5U109 and F5U103 shown above)

On boot up, with
DEVICE=C:\OS2\BOOT\USBCOM.SYS /V /M:3 /N:COM2
I get a message during boot that the driver is loaded and is starting at COM2 with the size of input and output queues

But the MODE command says
SYS0021: The drive is not ready.

or for  COMx where x=5 or higher it says
SYS0020: The system cannot find the device specified.

Plus my program reports an error when it tries to open COM2, COM3 or COM4.

So I think I will open a ticket on with Arca Noae, see what happens.

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 359
  • Karma: +24/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: USB to Serial adapter setup
« Reply #10 on: July 19, 2023, 11:36:34 pm »
Have you tried USBSER.SYS which Martin cited above? (http://www.edm2.com/index.php/USBSER.SYS)

It's list of supported devices includes:  "USB Serial Adapter on Belkin F5U116 USB Multi-Port Hub"
« Last Edit: July 19, 2023, 11:48:29 pm by Rich Walsh »

Doug Clark

  • Sr. Member
  • ****
  • Posts: 343
  • Karma: +9/-1
    • View Profile
Re: USB to Serial adapter setup
« Reply #11 on: July 20, 2023, 06:20:02 am »
Rich: no. I saw Martin's mention of usbcom on EDM and looked at that but somehow passed over the reference to usbser

So after I saw your post (thanks for catching that) I downloaded USBSER and installed it.

The package says to run DDINSTAL - which ran but gave no feed back for success or failure.  However it did add
DEVICE=C:\OS2\BOOT\USBSER.SYS
to my CONFIG.SYS  (I added the /V after for feedback on boot up)

On boot a message is displayed saying the converter (USBSER.SYS)  loaded as COM1

Included in the package is a test program: tstusbc.exe

When I run tstusbc.exe nothing happens - blank screen.  And MODE COM1 says Drive not ready.

I ran it with COM1 turned on and turned off in bios, and with COM.SYS remarked out.

I also booted with just USBSER.SYS and with both USBSER.SYS and USBCOM.SYS - same result.

BTW - I also have an eComStation machine, with a subscription for support and just for kicks tried installing USBCOM.SYS on that machine with the same results.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5041
  • Karma: +114/-1
    • View Profile
Re: USB to Serial adapter setup
« Reply #12 on: July 20, 2023, 07:06:34 am »
Have to remember that Arca Noae did some major changes to the USB stack to support XHCI (USB3). Might want to test with Lars's stack, which I think is a lot closer to the stack that IBM released.

Lars

  • Hero Member
  • *****
  • Posts: 1363
  • Karma: +70/-0
    • View Profile
Re: USB to Serial adapter setup
« Reply #13 on: July 20, 2023, 08:10:30 am »
Have to remember that Arca Noae did some major changes to the USB stack to support XHCI (USB3). Might want to test with Lars's stack, which I think is a lot closer to the stack that IBM released.

I seem to remember that someone said that my USBCOM.SYS hangs the system. I also seem to remember that the AN driver is "fitted" to the AN USB stack as that has turned the inter driver interface to 32-bit and therefore requires the USBCOM.SYS to also have a 32-bit inter driver interface (in other words: they gave up on compatibility and implemented their own proprietary interface).

I think, a ticket to AN is the best choice. If mode.com returns "drive not ready" that likely indicates USBCOM.SYS properly detects the device but fails on the OPEN call or some such. Should be debuggable though.
« Last Edit: July 20, 2023, 08:15:29 am by Lars »

Doug Clark

  • Sr. Member
  • ****
  • Posts: 343
  • Karma: +9/-1
    • View Profile
Re: USB to Serial adapter setup
« Reply #14 on: July 20, 2023, 07:48:53 pm »
Thanks Dave and Lars,

You are both correct.  I looked at the OS2World Wiki to see what worked and purchased from that.  And what is listed there probably worked for OS/2 and maybe even eComStation - if I hadn't updated ecs with the latest USB stuff from AOS.

I did submit a ticket and David Azarewicz confirmed my adapters will not work, and also pointed out there is a list of working usb to serial adapters on the Arcanoe wiki.

So I chalk this to my bad for not looking at  the right information.

Thanks everyone for your help.