IR/RF Remotes transmitted via USB Device

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
coachnatebean
Newbie
Newbie
Posts: 2
Joined: Sun Jul 26, 2009 7:49 am

IR/RF Remotes transmitted via USB Device

Post by coachnatebean »

I hope the long post does not discourage others from reading my request for help. It was meant to trace my steps to solve this problem.

I am currently using WINE 1.1.26 on Ubuntu 9.10

1st Attempt
I am trying to install and get operational a program I use in the classroom called eInstruction-CPS (similar to iClicker). Students respond to questions during a lesson with a remote, which is then transmitted to the program via USB interface for data desegregation. Installation of this program required me to install Microsoft Frameworks 2.0 installed BEFORE actually installing eInstruction. I knew of this from a botched install, and subsequent re-install of Ubuntu 9.10 (wanting to have an absolutely clean platform on which to install the program). This was done using WineTricks.

Microsoft Frameworks 2.0 Thinking I had the necessary support applications installed, I found out I needed to install...
MS Jet 4.0 Service Pack 8
  • $ ./winetricks jet40
and MS MDAC 2.8
  • $ ./winetricks mdac28
It was only after installing these three components was I able to move forward with the installation process. The eInstruction program loads correctly and appears to function normally until I try and use the IR or RF remotes. It reports it can not find the USB device.

2nd Attempt
After looking around on the forums, I followed the advice -HERE- and initiated in a terminal...
  • $ ln -s /dev/ttyUSB0 /dev/ttyS2
    $ ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1
...but, again, was unable to get the program to locate the USB device.

Another search of the forums let me -HERE- to consider the possibility of a driver/device mismatch. From a terminal window I ran...
  • $ lsusb
...which returned the following information.
  • Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 005 Device 028: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Assuming the Future Technology Devices International (FTDI) driver(s) were not installed I went to their website and found the corresponding drivers for FT232 USB-Serial (UART) IC.
READ ME File - Instructions for installing the d2xx shared lib

As Linux distributions vary these instructions are a guide to installation and use. This setup works with Mandrake 9.2 but may require some investigation on other distributions. This library has been tested using kernel 2.4.25. D2XX documentation is available for the Windows dll - some variations may occur between linux and windows implementation. We have endevoured to make the APIs appear the same on both platforms however some issues may slip and we would appreciate that you contact support if you observe this.

D2XX for linux was primarily developed to aid porting windows applications written with D2XX to linux. Unfortunately the source code for D2XX is not freely available - however if you prefer to have the source and are starting a project from scratch you can try libftdi from Thomas Jarosch. Details of this library are on the ftdi web site.

libftd2xx uses an unmodified version of libusb (http://libusb.wiki.sourceforge.net/). Source code for libusb is included in the driver distribution in the libusb-0.1.12 directory.

Installation:
1. unzip and untar the file given to a suitable directory
gunzip libftd2xx0.4.12.tar.gz
tar -xvf libftd2xx0.4.12.tar

2. As root user copy the following files to /usr/local/lib
cp libftd2xx.so.0.4.12 /usr/local/lib

3. Change directory to /usr/local/lib
cd /usr/local/lib

4. make symbolic links to these files using the following commands:
ln -s libftd2xx.so.0.4.12 libftd2xx.so

5. Change directory to /usr/lib
cd /usr/lib

6. make symbolic links to these files using the following commands:
ln -s /usr/local/lib/libftd2xx.so.0.4.12 libftd2xx.so

7. Add the following line to /etc/fstab:
none /proc/bus/usb usbdevfs defaults,devmode=0666 0 0

There have been reports that you may need to use the following command for some distros none /proc/bus/usb usbdevfs defaults,mode=0666 0 0 (use usbfs in 2.6 kernels)

8. Remount all in the fstab file
mount -a

If you have problems with this check with usbview (search on the internet for application or it can be sent to you by ftdi) to check the usb file system is mounted properly.

Other problems will be related to the ftdi_sio driver loading -

1.you must unload this driver (and usbserial) if it is attached to your device ("rmmod ftdi_sio" and "rmmod usbserial"as root user).

2.Your PID/VID has not been included in the distribution.A PID of 0x6006 and VID of 0x0403 should work as a temporary workaround.

Known issues:

2.6 kernels require a usb reset to be performed prior to opening a device otherewise subsequent opens will not be successfull. This can cause a break (if there is a mixture of opened and unopened devices in the system) in communication with any other opened device.

FT_Listdevices and FT_CreateDeviceInfoList will also have this effect.
I had no idea what to make of the information in the READ ME file, so I did nothing.
Other problems will be related to the ftdi_sio driver loading -

1.you must unload this driver (and usbserial) if it is attached to your device ("rmmod ftdi_sio" and "rmmod usbserial"as root user).

2.Your PID/VID has not been included in the distribution.A PID of 0x6006 and VID of 0x0403 should work as a temporary workaround.

Known issues:

2.6 kernels require a usb reset to be performed prior to opening a device otherewise subsequent opens will not be successfull. This can cause a break (if there is a mixture of opened and unopened devices in the system) in communication with any other opened device.

FT_Listdevices and FT_CreateDeviceInfoList will also have this effect.
VCP Drivers
READ ME File
You may require the sources matching the current kernel to be installed on your system (and built).

There are many helpfull websites that can assist you with this step and it isnt as daunting as you first think!

Try http://www.osnews.com/story.php?news_id=2949&page=2 as a first step if the link is still available.

To install the ftdi_sio driver use the following steps:

1. Create a temporary folder in your linux machine.

2. Extract the files from ftdi_sio.tar.gz file to your temporary folder
"gunzip ftdi_sio.tar.gz"
"tar -xvf ftdi_sio.tar"

3. Build the driver
"make"

4. Plug in your ftdi device

5. Check to see if default driver was loaded
"lsmod" - you will see ftdi_sio if a driver is loaded

6. Remove the default installed driver
"rmmod ftdi_sio"

7. Install the newly built driver
"insmod ftdi_sio.o"

NOTES:

1.This driver was adapted from the 2.4.32 kernel to support both the 2232C and 232R chip

2.There is no need to follow this procedure if you want 232R chip supprt. The 232BM driver will be sufficient.Changes made to the driver for the 232R chip are purly cosmetic (plug/unplug will appear as a 232R chip in the kernel log).
Of particular note for the VCP Drivers was...
6. Remove the default installed driver
"rmmod ftdi_sio" <<<This removed the driver I just installed.

7. Install the newly built driver
"insmod ftdi_sio.o" <<<This file was not found in the package.
...so I repeated the steps and stopped at...
5. Check to see if default driver was loaded
"lsmod" - you will see ftdi_sio if a driver is loaded
...which it was.

I also had no idea what to make of these additional notes in the READ ME file, so I did nothing.
1.This driver was adapted from the 2.4.32 kernel to support both the 2232C and 232R chip.

2.There is no need to follow this procedure if you want 232R chip supprt. The 232BM driver will
be sufficient. Changes made to the driver for the 232R chip are purly cosmetic (plug/unplug will appear as a 232R chip in the kernel log).
A restart and attempt to load eInstruction yeilded the same result. The program would load fine, but it was unable to locate the USB device.

3rd Attempt
Going back to the forums, something in -THIS- post connected my experience with WindowsXP and Ubuntu...maybe something is the registry needs to be added/changed. The forum post directed me to the Wine Registry Wiki where I searched for information on -PORTS-.

To the Wine Registry I added...
  • [HKEY_LOCAL_MACHINE\hardware\devicemap\serialcomm]
    "COM2"="COM2"
    "COM1"="COM1"

...and to the system.reg file I added...
  • [HARDWARE\\DEVICEMAP\\SERIALCOMM] 1131331688
    "COM1"="COM1"
    "COM2"="COM2"

...and...
  • [Hardware\\Devicemap\\Serialcomm] 1231984861 @=""
    "Serial0"="COM1"
    "Serial1"="COM2"
    "Serial2"="COM3"
    "Serial3"="COM4"
    "Serial4"="COM5"
    “Serial5"="COM6"
    “Serial6"="COM7"
    "Serial7"="COM8"
    "Serial8"="COM9"

FINALLY, that was the addition I needed for the program to recognize the USB device. BUT the USB device still does not gather the information from the remotes. Each tweak or change gets me one step closer to using this program in Ubuntu, but I need help with two things...

1.How do I get more than one COM port to be recognized? In WindowsXP, I have multiple ports to choose from. In Ubuntu/Wine I only have COM1.

2.How do I get the USB device to recognize and collect the information from the remotes and send the information to the eInstruction-CPS program?

THANK YOU for taking the time to read, and potentially solve, my questions/comments.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: IR/RF Remotes transmitted via USB Device

Post by vitamin »

coachnatebean wrote:1.How do I get more than one COM port to be recognized? In WindowsXP, I have multiple ports to choose from. In Ubuntu/Wine I only have COM1.
Wine auto detects all available com ports. If you already have few regular ports and want to add USB->serrial port then link it to somethign other then com1/com2:

Code: Select all

ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com5
coachnatebean wrote:2.How do I get the USB device to recognize and collect the information from the remotes and send the information to the eInstruction-CPS program?
Does it work with any Linux program that talks to serial ports?
coachnatebean
Newbie
Newbie
Posts: 2
Joined: Sun Jul 26, 2009 7:49 am

Post by coachnatebean »

for purposes of tracking the steps to a solution I was asked on the Ubuntu forums to...
First, unplug the device, then plug it back in. Now, open up a terminal and run "dmesg". Look at the last 10 lines or so, it may tell you which object in /dev it is getting loaded as, something like /dev/ttyS0. If it doesn't then we'll do it the hard way.
I believe this is the information you are requesting...I can copy/paste the whole output, but its pretty much the same thing.
  • [347146.152016] usb 5-1: new full speed USB device using uhci_hcd and address 29
    [347146.350258] usb 5-1: configuration #1 chosen from 1 choice
    [347146.352262] ftdi_sio 5-1:1.0: FTDI USB Serial Device converter detected
    [347146.352291] usb 5-1: Detected FT232RL
    [347146.352335] usb 5-1: FTDI USB Serial Device converter now attached to ttyUSB0
In the terminal, do "ls /dev/tty*" and look at what shows up. Now, unplug the device and run the command again, has anything disappeared? If you plug the device back in, and run the command again, has it reappeared? If it has, then thats the device you're going to need to get going with wine.
According to your directions the following device is the one we need to get going with wine.
  • /dev/ttyUSB0
...could you post the output of "ls -l ~/.wine/dosdevices/"
  • coachnatebean@Discovery-Ubuntu:~$ ls -l ~/.wine/dosdevices/
    total 0
    lrwxrwxrwx 1 coachnatebean coachnatebean 10 2009-07-15 10:42 c: -> ../drive_c
    lrwxrwxrwx 1 coachnatebean coachnatebean 8 2009-07-25 19:00 com1 -> /dev/USB
    lrwxrwxrwx 1 coachnatebean coachnatebean 11 2009-07-15 18:59 d: -> /media/disk
    lrwxrwxrwx 1 coachnatebean coachnatebean 9 2009-07-15 17:02 d:: -> /dev/sdb1
    lrwxrwxrwx 1 coachnatebean coachnatebean 1 2009-07-15 10:42 z: -> /
But it was not until I stumbled upon the words REVERSE ENGINEERING that the pieces started coming together.

When I plugged the same device into a WindowsXP unit, I started looking into the Device Manager at different settings. It further frustrated me that the device was being recognized on COM4, when I could only get Ubuntu to recognize the device on COM1.

The next logical place for me to look was in the WindowsXP Registry, hoping to compare entries to fill in the missing pieces of the puzzle.

In the Windows Registry it listed
  • [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM]
    "\\Device\\VCP0"="COM4"
In the Wine Registry it listed
  • [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM]
    "COM1"="COM1"
    "COM2"="COM2"
    "COM3"="COM3"
    "COM4"="COM4"
    "COM5"="COM5"
In the Windows Registry it listed
  • [HKEY_CURRENT_USER\Software\eInstruction\CPS4x\Settings\ComPort]
    @="4"
In the Wine Registry it listed
  • [HKEY_CURRENT_USER\Software\eInstruction\CPS4x\Settings\ComPort]
    @="1"
After changing the ComPort to 4 and initiating a link via
  • ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com4
I am happy to say the USB receiver and remotes are communicating with each other! Now all that's left is to "student test" the remotes in the classroom.

I guess all I needed was someone to bounce an idea off of to get to the solution.

THANK YOU!
Locked