LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Obscure USB-serial adapter (https://www.linuxquestions.org/questions/linux-hardware-18/obscure-usb-serial-adapter-368278/)

ratman96 09-29-2005 07:11 PM

Obscure USB-serial adapter
 
Hi there. I'm trying to connect a mobile phone (Sony-Ericsson K700) to my PC. Most SE phones communicate with the PC via a USB-to-serial cable adapter known as the DCU-11, and fully supported by the pl2303 driver in Linux.

But, since i'm cheap, i didn't get mine from Sony-Ericsson, and instead bought some work-alike in a flea market. And it doesn't work. Once plugged in, here's what 'cat /proc/bus/usb/devices' says about it:
Code:

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  7 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=6547 ProdID=0232 Rev= 0.01
S:  Manufacturer=ArkMicroChips
S:  Product=USB-UART Controller
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=  4 Ivl=1ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

Now, what's with that vendor? It isn't even listed on http://www.linux-usb.org/usb.ids , which looks pretty up-to-date. And googling around takes me to the Ark Pioneer Microelectronics, which is in chinese.

Anyway, i think it might work with the same pl2303 driver just fine. Only trouble is I can't convince pl2303 to take it!!

My first attempt was "modprobe pl2303 vendor=0x6547 product=0x0232", but the driver doesn't support that.

Any ideas?

paulotex 10-04-2005 12:22 PM

Hi:

I have a cable with the same chip for the Sagem. Have you had any luck yet?

Paulo

ratman96 10-04-2005 06:31 PM

Unfortunately no. I hacked the pl2303 driver included with the 2.6.13 kernel, so it's now recognized and taken by it when plugged in. Then I tried using gammu and minicom to communicate with the phone, but had no success: minicom says it's offline; gammu --identify times out waiting for an answer (with the connection set to at9600 in the ~/.gammurc, of course).

I'd look into the windows driver, but currently i don't know how to test the cable when nothing is plugged in. Any ideas on how to test it?

paulotex 10-05-2005 03:34 AM

Quote:

Originally posted by ratman96
I'd look into the windows driver, but currently i don't know how to test the cable when nothing is plugged in. Any ideas on how to test it?
This Sane site http://www.meier-geinitz.de/sane/misc/develop.html has some info and links on how to understand how a usb driver works under windows. I might try some of the tips. Perhaps it might help you too.

eg_ncc 11-05-2005 01:39 AM

I am also looking for solutions.....I just use that cable for connecting serial console like Cisco device.

spitz0r 12-16-2005 05:05 PM

I got this device working (which is imho an ArkMicroChips device)

try inserting usbserial module with:

# modprobe usbserial vendor=0x6547 product=0x0232

this will create the appropriate /dev/ttyUSB0 link and you can work with that device from now on

Hope this helps?

hallucinogen 01-13-2006 07:23 AM

I have the same problem (ArkMicroChips device) trying connect nokia cell phone

Configuration:

mknod /dev/ttyUSB0 c 188 0
modprobe ohci-hcd
modprobe usbserial vendor=0x6547 product=0x0232
modprobe pl2303

dmesg |grep usb
usbserial_generic 1-2:1.0: Generic converter detected
usb 1-2: Generic converter now attached to ttyUSB0
usbcore: registered new driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0
drivers/usb/serial/usb-serial.c: USB Serial support registered for PL-2303
usbcore: registered new driver pl2303
drivers/usb/serial/pl2303.c: Prolific PL2303 USB to serial adaptor driver v0.12

but when i try to identify phone using gnokii the connection times out
Does anyone know how to use this cable under linux?

krisfx 03-19-2006 12:06 PM

Ca-42 clone ( 6547:0232 ) Solved
 
Hai,
Ive got CA-42 cable clone using this chips.
I used usbsnoop on my winblows then converting to the following :
me using this with nokia 2115 cdma on archLinux.

-------start of code fxusb.c -------------
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/tty.h>
#include <linux/module.h>
#include <linux/usb.h>
#include "usb-serial.h"


int debug=0;
static int fxusb_attach(struct usb_serial *serial);

static struct usb_device_id id_table [] = {
{ USB_DEVICE(0x6547, 0x0232) },
{ },
};
MODULE_DEVICE_TABLE(usb, id_table);

static struct usb_driver fxusb_driver = {
.owner = THIS_MODULE,
.name = "fxusb",
.probe = usb_serial_probe,
.disconnect = usb_serial_disconnect,
.id_table = id_table,
};

static struct usb_serial_driver fxusb_device = {
.driver = {
.owner = THIS_MODULE,
.name = "fxusb",
},
.id_table = id_table,
.num_interrupt_in = 1,
.num_bulk_in = 1,
.num_bulk_out = 1,
.num_ports = 1,
.attach = fxusb_attach,
};
#define FXUSB_SND(a,b,c,d) rst = usb_control_msg(serial->dev,usb_sndctrlpipe(serial->dev,0), a,b,c,d,NULL,0x00, 1000)

#define FXUSB_RCV(a,b,c,d) rst = usb_control_msg(serial->dev,usb_rcvctrlpipe(serial->dev,0),a,b,c,d,buf,0x0000001, 1000)

static int fxusb_attach(struct usb_serial *serial) {
char *buf;
int rst;
rst=0;
buf = kmalloc(1, GFP_KERNEL);
if (!buf) {
dbg("error kmalloc");
return(-1);
}
FXUSB_RCV(0xfe,0xc0,0x0000,0x0003);
dbg("7 control msg return : %d = %0x", rst,buf[0]);
FXUSB_RCV(0xfe,0xc0,0x0000,0x0004);
dbg("12 control msg return : %d = %0x", rst,buf[0]);
FXUSB_SND(0xfe,0x40,0x0001,0x0004);
dbg("17 control msg return : %d = %0x", rst,buf[0]);
FXUSB_RCV(0xfe,0xc0,0x0000,0x0004);
dbg("18 control msg return : %d = %0x", rst,buf[0]);
FXUSB_SND(0xfe,0x40,0x0003,0x0004);
dbg("19 control msg return : %d = %0x", rst,buf[0]);
FXUSB_RCV(0xfe,0xc0,0x0000,0x0006);
dbg("20 control msg return : %d = %0x", rst,buf[0]);
FXUSB_SND(0xfe,0x40,0x0082,0x0003);
dbg("147 control msg return : %d = %0x", rst,buf[0]);
FXUSB_SND(0xfe,0x40,0x000d,0x0000);
dbg("148 control msg return : %d = %0x", rst,buf[0]);
FXUSB_SND(0xfe,0x40,0x0000,0x0001);
dbg("149 control msg return : %d = %0x", rst,buf[0]);
FXUSB_SND(0xfe,0x40,0x0002,0x0003);
dbg("150 control msg return : %d = %0x", rst,buf[0]);
FXUSB_RCV(0xfe,0xc0,0x0000,0x0004);
dbg("151 control msg return : %d = %0x", rst,buf[0]);
FXUSB_SND(0xfe,0x40,0x0003,0x0004);
dbg("152 control msg return : %d = %0x", rst,buf[0]);
FXUSB_RCV(0xfe,0xc0,0x0000,0x0003);
dbg("153 control msg return : %d = %0x", rst,buf[0]);
FXUSB_SND(0xfe,0x40,0x0003,0x0003);
dbg("154 control msg return : %d = %0x", rst,buf[0]);
kfree(buf);
return(0);
}
static int __init fxusb_init(void)
{
int retval;
retval = usb_serial_register(&fxusb_device);
if (retval)
return retval;
retval = usb_register(&fxusb_driver);
if (retval)
usb_serial_deregister(&fxusb_device);
return retval;
}

static void __exit fxusb_exit(void)
{
usb_deregister(&fxusb_driver);
usb_serial_deregister(&fxusb_device);
}

module_init(fxusb_init);
module_exit(fxusb_exit);
MODULE_LICENSE("GPL");
-----------end of code-------------

sagarg 03-22-2006 12:24 PM

Hi

Can you please provide the complete steps.

Regards,
Sachin.

celafon 03-27-2006 01:18 PM

hi all,

have you already figured out how to use the cable on linux?
i cannot even pass the vendor, product params to it - it gives me an error... :/

i tried recent kernel (2.6.15) and still nothing... has anyone tried the driver shown above? how to compile this thing?

------

EDIT: I tried compiling that c file as a module, but no luck (bunch of errors from gcc) - any ideas?

------

EDIT2: Ok, looks promising.

What I did is:
0. I took the code from post above and inserted it into a *.c file.
1. grabed from my current kernel sources the usb-serial.h and copied it to my working directory.
2. created Makefile (yes - that's the name of the file) in working dir and edited it as shown on this site: http://www.captain.at/programming/kernel-2.6/
of course replace the sum-module in the example on that site with the name of the file you inserted the c code into.
3. run 'make' in working dir and you should get a compiled .ko kernel module.

now test it with insmod filename.ko - it worked for me, dmesg:

drivers/usb/serial/usb-serial.c: USB Serial support registered for fxusb
fxusb 4-2:1.0: fxusb converter detected
usb 4-2: fxusb converter now attached to ttyUSB0
usbcore: registered new driver fxusb

you can copy that to /lib/2.6.xx/kernel/drivers/usb/serial/ and run your update modules script (in my case this was modules-update or something...)

Thanks for the fix krisfx.

------

thanks,
Bartek

sagarg 03-29-2006 11:26 AM

Hi Bartek,


Thank You. Your procedure worked!!.
But my phone is still not getting detected as modem

Regards,
Sachin.

celafon 03-30-2006 08:15 AM

I am having problems with gnokii as well - hope this is not the cable thing. anyways - I havent got much time to spend playing with this, maybe later...

Regards
Bartek

sbma44 03-31-2006 06:31 PM

can't build the code... any ideas?
 
celafon, I'm having a bit of trouble with the procedure you outlined. I'm afraid I'm not much of an expert at these things -- any suggestions that folks can offer would be much appreciated. I'm working off of 2.6.11-1.1369_FC4, with the source RPM installed according to the instructions found at the following URL at mjwired (DOT) net (sorry for the ridiculous syntax; linuxquestions won't let me post real URLs):

/resources/mjm-fedora-fc4.html#kernelsrc

But I'm not having any luck building krisfx's code. The error messages I get when I run make--

[tom@localhost fxusb]$ make
make -C /lib/modules/2.6.11-1.1369_FC4/build SUBDIRS=/home/tom/fxusb modules
make[1]: Entering directory `/usr/src/kernels/2.6.11-1.1369_FC4-i686'
CC [M] /home/tom/fxusb/arkmicro.o
/home/tom/fxusb/arkmicro.c:26: error: variable ‘fxusb_device’ has initializer but incomplete type
/home/tom/fxusb/arkmicro.c:27: error: unknown field ‘driver’ specified in initializer
/home/tom/fxusb/arkmicro.c:27: error: extra brace group at end of initializer
/home/tom/fxusb/arkmicro.c:27: error: (near initialization for ‘fxusb_device’)
/home/tom/fxusb/arkmicro.c:30: warning: excess elements in struct initializer
/home/tom/fxusb/arkmicro.c:30: warning: (near initialization for ‘fxusb_device’)
/home/tom/fxusb/arkmicro.c:31: error: unknown field ‘id_table’ specified in initializer
/home/tom/fxusb/arkmicro.c:31: warning: excess elements in struct initializer
/home/tom/fxusb/arkmicro.c:31: warning: (near initialization for ‘fxusb_device’)
/home/tom/fxusb/arkmicro.c:32: error: unknown field ‘num_interrupt_in’ specified in initializer
/home/tom/fxusb/arkmicro.c:32: warning: excess elements in struct initializer
/home/tom/fxusb/arkmicro.c:32: warning: (near initialization for ‘fxusb_device’)
/home/tom/fxusb/arkmicro.c:33: error: unknown field ‘num_bulk_in’ specified in initializer
/home/tom/fxusb/arkmicro.c:33: warning: excess elements in struct initializer
/home/tom/fxusb/arkmicro.c:33: warning: (near initialization for ‘fxusb_device’)
/home/tom/fxusb/arkmicro.c:34: error: unknown field ‘num_bulk_out’ specified in initializer
/home/tom/fxusb/arkmicro.c:34: warning: excess elements in struct initializer
/home/tom/fxusb/arkmicro.c:34: warning: (near initialization for ‘fxusb_device’)
/home/tom/fxusb/arkmicro.c:35: error: unknown field ‘num_ports’ specified in initializer
/home/tom/fxusb/arkmicro.c:35: warning: excess elements in struct initializer
/home/tom/fxusb/arkmicro.c:35: warning: (near initialization for ‘fxusb_device’)
/home/tom/fxusb/arkmicro.c:36: error: unknown field ‘attach’ specified in initializer
/home/tom/fxusb/arkmicro.c:36: warning: excess elements in struct initializer
/home/tom/fxusb/arkmicro.c:36: warning: (near initialization for ‘fxusb_device’)
/home/tom/fxusb/arkmicro.c: In function ‘fxusb_init’:
/home/tom/fxusb/arkmicro.c:85: warning: passing argument 1 of ‘usb_serial_register’ from incompatible pointer type
/home/tom/fxusb/arkmicro.c:90: warning: passing argument 1 of ‘usb_serial_deregister’ from incompatible pointer type
/home/tom/fxusb/arkmicro.c: In function ‘fxusb_exit’:
/home/tom/fxusb/arkmicro.c:97: warning: passing argument 1 of ‘usb_serial_deregister’ from incompatible pointer type
make[2]: *** [/home/tom/fxusb/arkmicro.o] Error 1
make[1]: *** [_module_/home/tom/fxusb] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.11-1.1369_FC4-i686'
make: *** [default] Error 2

Any help would be *greatly* appreciated.

ssinger 04-01-2006 08:15 AM

SMBA44,

Try upgrading your kernel to 2.6.15 or 2.6.16
That should get the driver to compile but the fxusb driver posted but I still couldn't get the driver posted above to work with the ArkMicro adapter I have.

celafon 04-01-2006 04:04 PM

Thats what Ive got - arkmicro. I used this driver in windows - and it found the usb thing. unfortunatelly even on Winblows I cannot get this to work with my nokia 6100... I know this model has infra red but I need to plug in to pc permanently to make an sms gateway :D

Bartek


All times are GMT -5. The time now is 02:19 AM.