PDA

View Full Version : USB-RS232 Interface Converter & GPS



mgsimon
01-04-2004, 10:26 PM
Hello KNOPPIX-friends,
my knoppix installation works fine on my VAIO notebook PCG-SR31K. 8)
The wireless network, the usb-hub, the usb-keyboard, the usb-mouse, the usb-hotsync without any problem after some customizations, but one component will not work.
I have an USB-RS232 Interface Converter to get a serial interface.
I want to communicate with my GARMIN etrex VENTURE GPS with this interface.
The software GPS-Drive works fine with the protocol NMEA In / NMEA Out.
I am not be able to use the protocol GARMIN to get or set any route, track or waypoint.
The gpstrans returns the following error message:
Connected GPS [/dev/ttyUSB0] is: <GPS not responding>
gpspoint and gpsman returns nothing.
The output from lsusb:
Bus 001 Device 001: ID 0000:0000
Bus 001 Device 002: ID 05e3:0604 Genesys Logic, Inc.
Bus 001 Device 004: ID 0711:0230 Magic Control Technology Corp. MCT-232 Serial Port
Bus 001 Device 005: ID 046d:c00f Logitech, Inc.
Bus 001 Device 006: ID 046d:c30a Logitech, Inc.
Bus 001 Device 003: ID 04cc:1122 Philips Semiconductors Hub
Bus 001 Device 007: ID 054c:0056 Sony Corp.
The device /dev/ttyUSB0 have to be correct, because the protocol NMEA In / NMEA Out works with this.
The model of the USB-RS232 Interface Converter is U232-P9.
The protocol worked under w2k with FUGAWI and some other applications.
setserial will not work with USB serial interfaces.
setserial /dev/usb/ttyUSB0 will return the message Cannot get serial info: Invalid argument.
I will be happy for any idea to get my GPS running with knoppix.
Thanx,
mgsimon

EmDee
01-07-2004, 12:56 AM
You'll have to wait for Knoppix 3.4 as this is a bug that has been fixed in linux 2.6.1-rc! See http://kernel.org/pub/linux/kernel/v2.6/testing/ChangeLog-2.6.1-rc1. Of course you can try to install that Kernel by yourself, worked well for me anyway!

Good luck!

mgsimon
01-07-2004, 10:22 PM
I don't want to use a release candidate.
Now i have the idea to use a workaround with my palm.
The software GPilotS supports the Garmin-Protocol from GPS to Palm and from Palm to any other device in a Host Mode to emulate a Garmin-GPS.
My first try doesn't work, i'm not be able to see a USB device,
if the Palm is connected in Host Mode.
Hotsync works without any problem.
Have anyone an idea to see the Palm when it is connected in Host Mode?
Thankx,
mgsimon

EmDee
01-08-2004, 01:40 AM
Well, if you'd like to get that usb-to-r232 adaptor to work _right now_ you'll probably don't have a choice but to use said release candidates. But linux 2.6.1-rc2 is already out so it won't be too long until we see a stable release:-) Note that the guy who wrote the update to this driver also created a patch for 2.4.22 but I dunno where it's available. And the other possibility would be using windows:-P
Oh, and I don't quite understand how you'd be using a palm pilot to connect your gps receiver to your computer.
Anyway, here an extract from the linux 2.6.1-rc changelog, it's quite an interesting read:
I've connected a Garmin 'GPS35 TracPak' GPS receiver (RS-232 interface) and an ordinary RS-232 external modem to my PC's USB port via the Belkin F5U109 adapter. Problem: Although _reads_ from either of the RS-232 devices mentioned above work fine via the Belkin adapter, _writes_ to the GPS receiver are not being seen by the GPS.*Writes to the modem, however, work perfectly. Aside: The 'Linux USB Users' archives show that at least one other person (circa May 2002) had the exact same problem I'm having, but it sounds like no solution was ever determined because the person in question just bought a different USB/RS-232 adapter. Investigation: Using the 'seyon' terminal emulator in Linux and acrude hardware RS-232 "breakout box" that I hacked together, I've determined that the problem is related to the RTS/CTS RS-232 hardware handshaking. After further investigation, I've concluded that RS-232 devices which do not assert the 'Clear To Send' ('CTS') signal prevent the Belkin F5U109 adapter from transmitting data to the RS-232 device when the current (version 1.1) 'mct_u232' module is used. The data gets "queued up" (up to a point -- 16 bytes, I think) in the adapter but never transmitted. Since this GPS receiver works perfectly (reads and writes) when connected to a PC running W98se using the same Belkin adapter and the Belkin-supplied Windows driver, the Linux driver became suspect. After some testing with SniffUSB, I found that the Windows driver sends a couple of unique undocumented USB 'device requests' that the Linux driver does not. As it turns out, the second of those 2 requests is critical in making the adapter transmit data to a device which doesn't assert 'CTS'. For completeness, the Windows driver in use was determined from the 'Device Manager', 'Driver File Details' page:*U2SPORT.VXD,*Provider: Magic Control Technology,*File version: 1.21P.0104 for Win98/Me.
Solution: My patch adds the 2 missing USB 'device request' commands right after a baud-change command. This mimics the operation of the W98 driver. Unfortunately, after much testing, I found no other operation (besides a baud-change request) under Windows that triggers either of these 2 'device request' commands. This makes it impossible to fully document the behavior of these requests, but I've made entries for them alongside the others in the 'mct_u232.h' file. Purely for clarity, the patch also modifies various comments in 'mct_u232.h', mostly to reflect proper sizes of the various 'USB Device Request' fields per the USB 1.1 specification. The patch also updates the version number of the driver, corrects a minor typographical error, and documents a difference in the length of the data in a 'baud rate change' command for certain adapters which use a coded baud-rate rather than the conventional RS-232 baud rate divisor. I've provided (tested) patches for both the 2.4.22 and the 2.6.0-test9 kernels. Please note that the changes to 'mct_u232.h' apply to both 2.4.22 and 2.6.0-test9 since that file has not changed between those kernel releases. Nevertheless, I've included that (same) portion of the patch in both attachments for simplicity. Bill Marr

mgsimon
01-08-2004, 09:04 AM
> Oh, and I don't quite understand how you'd be using a palm pilot to
> connect your gps receiver to your computer.

Please see http://www.cru.fr/perso/cc/GPilotS/ .
This Software is very nice,
you can store Tracks, Routes and Waypoint to your Palm.
GPilotS can be set in a Host Mode,
so the Palm will emulate a Garmin GPS.

EmDee
01-08-2004, 01:12 PM
Please see http://www.cru.fr/perso/cc/GPilotS/ .
This Software is very nice,
you can store Tracks, Routes and Waypoint to your Palm.
GPilotS can be set in a Host Mode,
so the Palm will emulate a Garmin GPS.
I see, this does indeed look like a solution to workaroud the problem with the usb-to-serial adaptor. Well, can't heelp you there since I don't own a GPS and my Palm (IIIxe, IIRC) died of a memory fault some years ago, sniff;-(
But you can still try to apply that patch for 2.4.22 and recompile your kernel!

Anyways, good luck!

mgsimon
01-08-2004, 02:31 PM
Did anyone run gpstrans with GPilotS and an usb-interface?

mgsimon
01-09-2004, 09:45 AM
Now i get the patches for the mct_u232 module, but i have a problem to install the new compiled modules.
If i copy the compiled module over the old module, i will get the error message that the module cannot be load. After recover to the old module the driver will load without problems, but without the patch! :cry:
1. I get the patches for the mct_u232 module.
2. I get the kernel sources with apt-get.
3. I use the original knoppix configuration from /boot.
4. Compile without problems with make-kpkg
5. Make the kernel package with make-kpkg kernel_image.
6. Install the generated package with dpkg.
7. Try to generate the modules package with make-kpkg modules_image.
:x
I will get the following output:
--- output begin ---
for module in ; do \
if test -d $module; then \
(cd $module; \
if ./debian/rules KVERS="2.4.22" KSRC="/usr/src/
kernel-source-2.4.22" \
KMAINT="Klaus Knopper"
KEMAIL="knoppix@knopper.net" \
KPKG_DEST_DIR="/usr/src/kernel-source-2.4.22/.."
\
KPKG_MAINTAINER="Klaus Knopper" \
KDREV="10.00.Custom" kdist_image; then \
echo "Module $module processed fine"; \
else \
echo "Module $module failed."; \
echo "Hit return to Continue"; \
read ans; \
fi; \
); \
fi; \
done
--- output end ---
How do i have to install the module?
Thankx,
mgsimon

Stephen
01-09-2004, 01:31 PM
Now i get the patches for the mct_u232 module, but i have a problem to install the new compiled modules.
If i copy the compiled module over the old module, i will get the error message that the module cannot be load. After recover to the old module the driver will load without problems, but without the patch! :cry:
1. I get the patches for the mct_u232 module.
2. I get the kernel sources with apt-get.
3. I use the original knoppix configuration from /boot.
4. Compile without problems with make-kpkg
5. Make the kernel package with make-kpkg kernel_image.
6. Install the generated package with dpkg.
7. Try to generate the modules package with make-kpkg modules_image.
:x
I will get the following output:
--- output begin ---
for module in ; do \
if test -d $module; then \
(cd $module; \
if ./debian/rules KVERS="2.4.22" KSRC="/usr/src/
kernel-source-2.4.22" \
KMAINT="Klaus Knopper"
KEMAIL="knoppix@knopper.net" \
KPKG_DEST_DIR="/usr/src/kernel-source-2.4.22/.."
\
KPKG_MAINTAINER="Klaus Knopper" \
KDREV="10.00.Custom" kdist_image; then \
echo "Module $module processed fine"; \
else \
echo "Module $module failed."; \
echo "Hit return to Continue"; \
read ans; \
fi; \
); \
fi; \
done
--- output end ---
How do i have to install the module?
Thankx,
mgsimon

If the patch is to the kernel source itself then you do not have to build the modules_image the module would be built when you make the kernel_image as long as you have selected it in the kernel .config you used. Also I notice when you build the kernel_image you do not use any switch to build the initrd have you compiled support for your / file system into the kernel you are building otherwise the kernel should not boot. And and one last thing you should use:


export KPKG_MAINTAINER="Your Name"
export KPKG_EMAIL=your@email.net


Before you compile or change the values in the /etc/kernel-pkg.conf for the maintainer and email you are building this kernel not Klaus and lastly can you post the URL where you got the patch so we can look at it and maybe tell you where you are going wrong.

EmDee
01-09-2004, 05:20 PM
I dunno, I always compile my kernels following some generic kernel HowTo:-) BTW, 2.6.1 is out, including the patch we're talkin about here!

mgsimon
01-12-2004, 09:40 AM
Anyway,
the patch doesn't work for my USB-Serial-Converter!
I checked the mct_u232 driver version with dmesg: "1.2",
but i cannot communicate with my GPS with any tool. :cry:
Know i want to buy a new USB-Serial-Converter,
does anyone have some recommendations
about a cheap stabil USB-Serial-Converter? :roll:
Thanx,
mgsimon