HSI88 on USB->Serial using CDC context

Moderator: Moderators

HSI88 on USB->Serial using CDC context

Postby fulda » 31.03.2013, 19:56

Hi All,

I have little problem - I have HSI88 connected on USB<->Serial converter.
My one converter using CDC context. It means, that it act as a serial modem (as usual for USB-Serial converters). Little problem is, that in CDC (Comunication Device Context) is not defined CTS pin. Micro$oft Windows present this pin as =0. The functionality of hardware flow control (RTS/CTS) is responsibility of converter.
You can find those converters for example as Microchip - MCP2200 chips.

When I try to start Rocrail, I will get following messages (at the end of post).
When I try it Railroad & Co. / Train Controller, it works fine.
(config and log in Rocrail.zip)

Does anybody know some solution?

------

Little update - once I switch to "USB" mode and use "doted name" for serial port ("\\.\COM23" insted of "COM23") it will start communication, but write an error I ont understand.
Attached in file Connect_as_USB_dot_named.zip

------

... and small hint - if someone enable terminal mode on HSI interface, it will not work, Rocrail will not switch it off and not understand terminal mode commands.
see: Connect_as_USB_dot_named_Term_mode.zip
---
20130331.154351.296 r9999W hsi88fb OHSI88 0199 CTS timeout, check the connection.
20130331.154351.296 r9999E hsi88fb OHSI88 0422 Could not send version-sequence to HSI Device. retrying...
20130331.154407.921 r9999W hsi88fb OHSI88 0199 CTS timeout, check the connection.
20130331.154407.921 r9999E hsi88fb OHSI88 0551 Could not send init-sequence to HSI Device. retrying...
20130331.154423.546 r9999W hsi88fb OHSI88 0199 CTS timeout, check the connection.
20130331.154423.546 r9999E hsi88fb OHSI88 0422 Could not send version-sequence to HSI Device. retrying...
You do not have the required permissions to view the files attached to this post.
fulda
 

Re: HSI88 on USB->Serial using CDC context

Postby rjversluis » 31.03.2013, 21:36

fulda wrote:Little update - once I switch to "USB" mode and use "doted name" for serial port ("\\.\COM23" insted of "COM23") it will start communication, but write an error I ont understand.

HSI88-USB is not the same as HSI88 + USB-SerialConverter.
http://wiki.rocrail.net/doku.php?id=hsi88-en

HSI88-USB is not supported.

If you encounter USB-Serial Converter problems:
http://wiki.rocrail.net/doku.php?id=usb-rs232-en
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: HSI88 on USB->Serial using CDC context

Postby fulda » 01.04.2013, 12:18

rjversluis wrote:If you encounter USB-Serial Converter problems:
http://wiki.rocrail.net/doku.php?id=usb-rs232-en


:( It look like hsi not understand this parameter

I have still same result - see attachement
You do not have the required permissions to view the files attached to this post.
fulda
 

Re: HSI88 on USB->Serial using CDC context

Postby fulda » 01.04.2013, 13:18

I'm looking into source code. Starting at line 164 is function "CheckCTS"

Code: Select all
/* Check if CTS is set. Retry configured times */
static Boolean CheckCTS( iOHSI88Data o ) {
  int wait4cts = 0;
  if( o->usb ) {
    return True;
  }

  while( wait4cts < o->ctsretry ) {
    if( SerialOp.isCTS( o->serial ) ) {
      return True;
    }
    ThreadOp.sleep( 10 );
    wait4cts++;
  };
  return False;
}


It look like it missing info about "rtsdisabled"
Then new version can be like this:
Code: Select all
/* Check if CTS is set. Retry configured times */
static Boolean CheckCTS( iOHSI88Data o ) {
  int wait4cts = 0;
  if(( o->usb ) || (wDigInt.isrtsdisabled( ini ))) {
    return True;
  }

  while( wait4cts < o->ctsretry ) {
    if( SerialOp.isCTS( o->serial ) ) {
      return True;
    }
    ThreadOp.sleep( 10 );
    wait4cts++;
  };
  return False;
}


Or - better solution will be - add parameter "checkCTSdisabled", because "rtsdisabled" is used as serial port parameter and in this case it should be enabled. USB converter is informed, that should handle RTS/CTS communication and it will be handled, but CTS gefore any communication will not be chcecked, because CTS is not valid on operating system level.

unfortunately I have no environment where I can compile source codes, than I can not try it.
From the other hand - I have environment to produce HSI device with native USB interface and price around 4€, then if anybody (Rob Versluis / rjv) is interested and will promise quick change, I will send one as free of charge :D

DIY page
fulda
 

Postby rjversluis » 03.04.2013, 16:38

Hi,

thanks for the offer, but I do not want to use or invest time in s88.
The USB version of HSI88 is not supported in Rocrail because it only has a device driver for Windows which is a NoGo.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Postby fulda » 03.04.2013, 20:07

rjversluis wrote:The USB version of HSI88 is not supported in Rocrail because it only has a device driver for Windows which is a NoGo.


you are 50% right - The original LDT HSI-88 USB is not good solution.
That is reason, why I'm developing that one with generic USB CDC interface, which act as original RS232 version. My one works fine without driver also under Solaris, FreeBSD and other UX systems
BTW: I'm not vendor; I'm developer of DIY - You can check on my web page

I see few problems with current situation:
  1. Users can be confused, that you have option for USB and you not support it
  2. Users can be confused, that option rtsdisable NOT disabling all requests for CTS signal
  3. It is good by general follow trends, as you can know many of virtual serial ports (WiFi, Bluetooth, Ethernet) transfer hardware handshake (RTS/CTS) to remote device and not sending CTS information back to client
fulda
 

Postby rjversluis » 04.04.2013, 06:41

OK, in that case I will give it a try.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Postby rjversluis » 04.04.2013, 07:47

You do not have the required permissions to view the files attached to this post.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Postby fulda » 04.04.2013, 20:31

rjversluis wrote:I added a CTS option:
http://wiki.rocrail.net/doku.php?id=hsi88-en#options


Nice, first test working fine
:goodjob:

Thank you
fulda
 


Return to HSI88