PDA

View Full Version : Making USB interface look like COM port


kbanks
10-10-2008, 01:35 PM
The USB chip we currently use is from Silicon Labs (www.silabs.com), and can act as a "true" USB device, or (using drivers supplied by Silicon Labs) as a Virtual COM Port (VCP).

It has been our experience that Virtual COM Port (VCP) is not as robust as treating the chip as a true USB device (your mileage may vary). We do not know if this is a Windows issue, or a driver issue.

So, we deliberately chose not to use VCP mode, and Synapse USB devices ship from the factory looking like, well, looking like Synapse USB devices.

Some customers have applications that only know how to talk to "COM" ports, they are unable to interface to the Synapse Gateway and make "data mode" (AKA transparent mode) calls.

Quoting from the attached script:


UsbUtility.py - A helper script for customers that need Synapse USB
interfaces to look/act like a Virtual COM Port (VCP) instead of like
a true USB device.

Doing this allows you to send data from programs that ONLY know how to
interface to COMx devices.

To use:

Load this script into Portal.

With a single Synapse USB device plugged in to your computer, invoke
function makeUsbLookLikeVirtualComPort(). The Product ID (PID) on the
USB chip will be reprogrammed back to its original factory setting.

This will allow it to work with the VCP drivers from Silicon Laborities.
(Silicon Laborities makes the actual USB chip - it is a CP2102)
You can get these drivers from www.silabs.com.

At the time this script was created, the file you need was named
CP210X_VCP_Win2K_XP_S2K3.zip.

You will have to install the Silicon Labs driver (using the zip file),
and let your PC detect/setup the virtual COM port.

Portal (and other programs) will now see the USB equipped Synapse device
as another COMx port.

To restore the Synapse USB device back to the Synapse recommended settings,
invoke function makeUsbLookLikeUsb().


You should get the latest VCP drivers directly from www.silabs.com, but as a convenience I am also attaching the driver file I downloaded from them today.

kbanks
11-04-2008, 01:43 PM
Try putting the following line up near the top of the script (for example, after the import statement).


libraryPath = "C:\Program Files\Portal"


The above example assumes you installed Portal in the default location. If you installed Portal to some other directory, make the appropriate substitution.

TimWhite
07-10-2009, 01:26 PM
Sooo - I'm looking at the SILabs website for the drivers; I'm not seeing any Vista drivers at all?

https://www.silabs.com/support/pages/support.aspx?ProductFamily=USB+to+UART

Am I missing something?

I have lots of clients who have nothing but Vista PCs at their sites now, and it's getting harder and harder to buy a PC (other than a netbook) without Vista on it.

Oddly, the "Driver Customization" doc on that site talks about Vista, but the names of the files don't seem to mention it.

The main issue seems to be that the driver isn't signed; because it hasn't gone through WHQL. I have one client in particular that has pretty draconian install requirements on their PCs (government), so I'm nervous that we won't be able to install the drivers on those PCs because of that.

Any guidance would be appreciated, I feel like I'm missing something here, as I can't be the only person in this situation. :D

Thanks!!!

Tim

mgenti
07-10-2009, 01:47 PM
You are correct, the Synapse provided drivers are not signed. However, the Virtual COM Port (VCP) drivers are signed and work on Vista.

Jheath
09-29-2009, 05:43 PM
Here is a freshly updated script for use with Portal version 2.2.x.

TimWhite
10-01-2009, 02:25 PM
Interesting, thanks! I'll give this a try!

jjwhite
02-12-2010, 06:23 PM
Picking up where Tim left off on this . . .

After changing this to a VCP the baud rate appears to be 38,400 bps and the packets appear to start with 0xC0 and end with 0xC1. Is that what I should be seeing?

Jim

mgenti
02-15-2010, 09:54 AM
Yes, that sounds correct.

jjwhite
02-15-2010, 10:13 AM
Thanks for the confirmation.
Is a protocol definition available?
Jim

mgenti
02-15-2010, 10:17 AM
Currently the protocol that Portal and SNAPconnect uses to communicate with the nodes over the rs-232 ports is not publicly available.

You might want to checkout the CommandLine.py script included with Portal that gives a brief example of how you could create your own script to listen on one of the rs-232 ports and do various actions based on input it receives.

admin
02-16-2010, 09:24 AM
This particular utility is no longer needed with Portal 2.2.29 and later. We have built-in the commands setup_usb_as_vcp(), to change the Synapse USB device into a virutal COM port, and the command setupSynapseUsb(), to change a virtual COM port into a Synapse USB device. These commands must be done from the Portal command line.