EW Windows Uploader use of USB-to-serial adapters under Linux

An Eccentric Anomaly: Ed Davies's Blog

Somebody asked me about using EW Windows Uploader with a USB-to-serial adapter when running under Linux (with Wine presumably). My reply might be of sufficient interest to others to be worth posting most of it here.

Hi -

Thanks for developing the uploader software! and apologies for bothering you.

I do have the means to run Windows (a laptop buried somewhere in my study)

My sympathies. I have Windows on a tower system which I haven't unpacked since moving to my current house last October.

but normally use Debian 5 Linux on a Dell Inspiron 6400 laptop.

I normally use Ubuntu 10.10 on an HP laptop.

Has any progress been made in getting the combination of a USB adapter and Linux to work? (I can well understand if you think it not worth bothering, though a few users would like this approach). Do you know what the nature of the problem is?

I run Windows Uploader (and in fact did the development of the most recent version - with just a final test on that Windows box) under Linux using Wine. It mostly runs fine including with a USB-to-serial adapter (like most, I haven't got a real serial port on my laptop).

Strangely, it's not now working with my Belkin USB-to-serial adapter which identifies like so:

edavies@bill:~$ lsusb
Bus 002 Device 011: ID 050d:0103 Belkin Components F5U103 Serial Adapter [etek]

whereas it works fine with a no-name cheapo one I got from Maplin Electronics:

edavies@bill:~$ lsusb
Bus 002 Device 012: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

It opens the Belkin port but doesn't seem to communicate. I'll have another look into that at some point. I thought this used to work but maybe I'm misremembering.

Ironically, I think it was the Prolific driver on Windows which caused all the handshake problems which we didn't discover early on because it all worked so well on my Belkin adapter and somebody else's other type.

What you do need to do is to tell Wine to map Windows' COM1 to the appropriate Linux serial device. Do this by setting up a symbolic link from your .wine/dosdevices directory to the serial port:

edavies@bill:~/.wine/dosdevices$ ln -s /dev/ttyUSB0 com1
edavies@bill:~/.wine/dosdevices$ ls -l --color=never
total 0
lrwxrwxrwx 1 edavies edavies 10 2010-08-09 21:54 c: -> ../drive_c
lrwxrwxrwx 1 edavies edavies 12 2011-08-16 10:20 com1 -> /dev/ttyUSB0
lrwxrwxrwx 1 edavies edavies 1 2010-08-09 21:54 z: -> /

as per: http://ubuntuforums.org/showthread.php?t=1335098

It can be a bit irritating if you unplug the serial adapter and plug it back in quickly as it can then get set up as /dev/ttyUSB1 breaking that link.

There was a problem with Windows Uploader under Wine where the dialog boxes appeared behind the main window - you had to keep moving the main window around to find them. It took me a while to work out what was going on with that. Anyway, trying it now it seems fine - I guess they've fixed the problem in Wine since I last used it.

I'd suggest giving it a try and would be pleased if you could let me know how you get on. In particular, I'd be interested in the lsusb information for any adapters that do or don't work (just the one-line summary - I've no idea what the detailed output from lsusb means, either).

Since writing that I've put a break-out box and multimeter between the Belkin adapter and the EW. It's a bit difficult to tell but it seems like characters are coming out of the Belkin and being responded to by the EW. Using Windows Uploader's logging facility, though, it appears the responses from the EW are not being received for some reason.

As an aside: even with the logging facility's Paranoid option, causing the log file to be closed after each line, it appears Wine or something is buffering the writes so the log file is only updated just over every 4000 bytes. This is a pity as it would be handy to do a tail -f on the log file to see what's happening.

If I get anywhere with the Belkin adapter (F5U103, btw) or anything I'll try to update this entry.