Jonathan Thomson's web journal

Parallax USB Oscilloscope in WINE October 10, 2009

Filed under: Electronics — jethomson @ 1:19 am

How to make the COM ports available to the Parallax USB Oscilloscope in WINE.

This HOWTO was tested on: Debian Lenny/Linux 2.6.26-2-686
My version of wine is: wine-1.0.1-174-gc4039bd

These instructions most likely will work on Ubuntu, but you’ll probably want to replace "su -c" with "sudo".

Steps
(0)
Install the USB Oscilloscope program. I installed version 5.1.1.
This HOWTO might work for the older version 4.0 but I didn’t test it out.

(1)
Unplug the oscilloscope.
Open a terminal.
$ lsusb
There’s no need to study the output. You want to compare this output to the output you receive after you plug in the oscilloscope and run lsusb a second time.

$ ls /dev/ttyUSB*
It’s not a problem if you see “No such file or directory”. Again, this output will be for comparison.

(2)
Plug in the USB Oscilloscope.
$ lsusb
You should notice a change indicating the FTDI chip was recognized.
Something like:
Bus 003 Device 002: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

$ ls /dev/ttyUSB*
You should notice a new entry, /dev/ttyUSBn, where n is a number. If it is your first USB tty device n will be 0.

(3)
Go to your .wine directory:
$ cd .wine
Backup your .reg files:
$ ls *.reg | xargs -I "{}" cp "{}" "{}".BAK
Download comport.reg to the .wine directory:
$ wget -O comport.reg http://bugs2.winehq.org/attachment.cgi?id=10210
Import comport.reg using regedit:
$ regedit comport.reg

(4)
While having root permissions, make a symbolic link to /dev/ttyUSBn, where n is the number you discovered in step 2:
$ su -c "ln -s /dev/ttyUSBn /dev/ttyS4"

(5)
Make sure you are in the group that has permission to use the serial devices.
For example when I run:
$ ls -l /dev/ttyUSB0
I get the following output:
crw-rw---- 1 root dialout 188, 0 2009-10-09 19:48 /dev/ttyUSB0
Therefore I should check /etc/group to make sure I’m a member of group dialout.
$ grep dialout /etc/group
Which outputs:
dialout:x:20:jthomson
So indeed I’m a member of dialout.

If I were not, I could add myself to the dialout group like this:
$ su -c "usermod -a -G dialout jthomson"

Your group may not be named dialout, but you should be able to figure out your group’s name from the example given above.

(6)
Open the USB Oscilloscope program.
Go to Settings–>COM Settings…
Choose COM5 and close. The USB icon should be green now. Hit Run to test things out.

(7)
After rebooting or shuffling around other devices that create ttyUSB entries, you’ll need to recreate the ttyS4 link so that it points to the correct ttyUSBn. To do this remove the old link (if it’s there) and repeat steps 2 and 4.

Tips/Troubleshooting

If the program runs slowly, unplug cable before starting the program then plug it back in after starting the program OR trying plugging into a different USB port. For my computer the program only runs correctly if the scope is plugged into a specific, physical port. Unplugging and plugging back into a new port will probably destroy and recreate the same ttyUSBn device you linked to earlier.
You can use “diff system.reg system.reg.BAK” to make sure comport.reg was applied.
A graphical version of regedit can be opened by simply typing “regedit” in a terminal. comport.reg can be imported graphically with Registry–>Import Registry File…
comport.reg only creates 5 COM ports. If for some reason you can’t use ttyS4, try linking ttyS0-3 to ttyUSBn. If you use ttyS3 –> ttyUSB0, then you need to select COM4 (instead of COM5) in USB Oscilloscope. Likewise ttyS2 corresponds to COM3, and so on.

Links
http://bugs.winehq.org/show_bug.cgi?id=9902
http://bugs.winehq.org/show_bug.cgi?id=11811
http://wiki.jswindle.com/index.php/Wine_Registry#Serial_Com_Port
http://forum.winehq.org/viewtopic.php?p=24139

Advertisements
 

8 Responses to “Parallax USB Oscilloscope in WINE”

  1. Roger Says:

    Dude! You are awesome! Many thanks. Am using Ubuntu with Parallax scope on 5 computers. Its great. Saves tons of money.

    🙂 Roger

  2. Rene Pit Says:

    Hi,
    We bought a couple of these devices from DigiKey and thanks to your blog, I managed to get them working in Ubuntu with Wine.
    Absolutely brillant, thanks very much.
    Would a similar procedure work to get the PicoScope working in Wine?

    Cheers, Rene, Isaac Newton Group, La Palma

    • jethomson Says:

      Great. Good to hear. I have no experience working with PicoScopes so I can’t
      say if it would work or not. If you find out, please come back and make a
      comment.

  3. Jim Says:

    Thanks for taking the time to write out the how-to for the neophytes. It’s nice to have the scope back again. It’s fantastic to avoid spending hundreds on either a new computer or a new scope.

    Thankyou thankyou thankyou!

    Jim

  4. robrecht Says:

    thanks

  5. Dan Hockey Says:

    I tried this in ubuntu 10.10 and everything worked like you describe but the parallax basic stamp ide v2.5 will not see any serial ports or my usb boebot.
    But teratermpro, a windows terminal works just fine with the same usb2serial hardware.

  6. Ramiro Marcelo Says:

    The oscilloscope run perfect, tanks a lot for this post all thing work (Ubuntu 12.04)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s