LeoStick usb serial and MSComm problem

A shrunk down Leonardo-compatible board, thumb drive sized with native USB support. [Product info]
Post Reply
jake2701
Posts: 3
Joined: Fri Sep 27, 2013 11:07 am

LeoStick usb serial and MSComm problem

Post by jake2701 » Fri Sep 27, 2013 11:47 am

I'm trying to use Leostick to drive flight simulator(real thing) and I'm using VB6 program to send through serial USB data about new position of hydraulics. Serial port operates normally(with speeds I expect) when I connect Profilic USB serial adapter. But when I try to send data to serial port of Leostick USB, after each write to "MSComm.Output" it takes several seconds for instruction to execute, my VB program comes to almost standstill, and becomes absolutely useless.
Under Linux when I use Serial Monitor to test serial communication, everything seems to be OK, there is instant response from Leostick. It must have something to do with Windows drivers of Leostick USB serial because Profilic USB serial dongle works fine. There are no serial interrupts enabled in my program, VB6 just pumps data and polls response, so it must be something to do with driver software.
I didn't try to use D0/D1 serial as my stick just plugs into my hardware board and I can quickly remove it and reprogram at this development stage. Any suggestion?
Jake

drake250
Posts: 19
Joined: Mon May 28, 2012 1:17 pm
Location: Adelaide

Re: LeoStick usb serial and MSComm problem

Post by drake250 » Sun Sep 29, 2013 8:20 am

Sounds like it could be driver related - does serial work at all on the windows machine running the VB6? Does it work with the Arduino IDE's serial monitor?

I have my own set of serial port issues on my main PC - I did something wrong when I first got my leostick and forced it to use a particular driver, and now USB serial does not work at all, and the sketch hangs for about a second if it tries to transmit (but only if the port is opened on the PC). The other functions still work (Keyboard, mouse, joystick) and I can still load sketches. I've tried updating the driver and removed all the old ones I could find, but serial still fails.

Sorry I couldn't be more helpful.

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: LeoStick usb serial and MSComm problem

Post by angusgr » Sun Sep 29, 2013 9:53 pm

jake2701 wrote:I'm trying to use Leostick to drive flight simulator(real thing) and I'm using VB6 program to send through serial USB data about new position of hydraulics. Serial port operates normally(with speeds I expect) when I connect Profilic USB serial adapter. But when I try to send data to serial port of Leostick USB, after each write to "MSComm.Output" it takes several seconds for instruction to execute, my VB program comes to almost standstill, and becomes absolutely useless.
Hi Jake,

USB serial is often associated with latency issues, but these are usually in the order of <20ms not multiple seconds.

Is it the same PC (dual boot or VM) that you get good latency under Linux with? If not it could be a problem with the physical USB port, failed transmission having to be retried and slowing down the process.

Otherwise I agree with you and drake that it's probably a Windows driver issue. Unfortunately the USB Serial (CDC) driver is built into Windows (all the Freetronics .INF file does is tells Windows to use the builtin usbser.sys for our devices), so there isn't much we can do from our end to help.

What version of Windows are you using? Can you try any other versions, or another PC?
drake250 wrote: now USB serial does not work at all, and the sketch hangs for about a second if it tries to transmit (but only if the port is opened on the PC). The other functions still work (Keyboard, mouse, joystick) and I can still load sketches. I've tried updating the driver and removed all the old ones I could find, but serial still fails.
This is very strange to hear as well. What version of Windows are you on, Drake? The bootloader uses the same USB Serial profile as the running sketch, so if one works the other should. Have you tried rolling back to an unedited USB profile from the core, to see if it behaves itself then?

- Angus

jake2701
Posts: 3
Joined: Fri Sep 27, 2013 11:07 am

Re: LeoStick usb serial and MSComm problem

Post by jake2701 » Mon Sep 30, 2013 12:05 pm

I do use Windows 7 as virtual machine under Linux. I did try compiled .exe on another computer which runs Windows 7 directly, with the same result. Because I built quite nice software to run my machine in VB6, I would like to stay with it. Leostick is supposed to update position of rams every 50ms and it does it really nice, with test sketches running. But with real sketch, where position is send by laptop through serial port , because of those delays the whole thing is useless. And delays are really up to 5 secs. I will try D0/D1 pins next. Another thing, I cannot get Freetronic serial installed on XP (also VM). It finds Freetronic loader, but no Freetronics serial (I tought about trying to run it on XP)
Jake
PS. My simulator is old "Venturer 2" joy ride bought from the scrap. Amazing thing, but lots of restoring.

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: LeoStick usb serial and MSComm problem

Post by angusgr » Mon Sep 30, 2013 10:32 pm

jake2701 wrote:I do use Windows 7 as virtual machine under Linux. I did try compiled .exe on another computer which runs Windows 7 directly, with the same result. Because I built quite nice software to run my machine in VB6, I would like to stay with it. Leostick is supposed to update position of rams every 50ms and it does it really nice, with test sketches running. But with real sketch, where position is send by laptop through serial port , because of those delays the whole thing is useless. And delays are really up to 5 secs. I will try D0/D1 pins next.
Very unusual. I forgot to ask before, but do you have LeoStick V2? If you don't it's probably worth updating (guide here) to get the latest USB serial code running on the LeoStick. Also updating to the latest Arduino 1.0.5 if you're on an older version.

I'm afraid I don't have any other ideas though, sorry. Moving to hardware serial (D0/D1) is probably a good workaround.
jake2701 wrote:Another thing, I cannot get Freetronic serial installed on XP (also VM). It finds Freetronic loader, but no Freetronics serial (I tought about trying to run it on XP)
Can you describe exactly what happens? What do you see in Device Manager after the bootloader runs? Are you using the latest (v1_3) INF file?
jake2701 wrote:PS. My simulator is old "Venturer 2" joy ride bought from the scrap. Amazing thing, but lots of restoring.
Sounds like a great project, though. :)

Please let us know how you get on with the LeoSticks.

Regards,

Angus

Post Reply