UMTSStick - A little help on adding support for other 3G USB devices?

10 Dec 2010

I have a Pantech USB - UMW190NCD (Qualcomm 3G CDMA on Verizon)... Is there any chance someone could point me in the right direction to add support for this device? I get the following which tells me that it's not supported (duh)..

Setting up...
[..\fwk\drv\umtsstick\UMTSStick.cpp:getSerial@58] Configuration set: vid:106c pid:3716
[..\fwk\drv\umtsstick\UMTSStick.cpp:getSerial@76] Don't know this device!
Error -65533 in setup.

I also set the pppErr line to read:

    pppErr = stick.connect(NULL, "myPhone#@vzw3g.com", "vzw");

I'm wondering after looking in /drv/umtsstick/UMTSStick.h how I would add this device? Any help would be greatly appreciated and would probably benefit several people here...!! =)

10 Dec 2010

Hi Mark

Have a look in the file UMTSStickData.cpp where the vids and pids are defined for the supported devices.

Regards Daniel

10 Dec 2010

Thank you Daniel.. I'm trying to not be dense, but I have not been able to locate UMTSStickData.cpp... I have been able to find the UMTSStickNetIf and it's example.. I've looked at the zip file, etc..

http://mbed.org/users/donatien/programs/UMTSStickNetIf/5yon9 doesn't show any .cpp files.... If I 'edit' the library in the example 'UMTSStickNetIfExample' I don't see it.. Can you help me with what I'm obviously missing?

Much thanks, -mark

10 Dec 2010

Hi Mark

The program you referenced has a precompiled library (UMTSStickNetIf.ar) which is why you can't see the source files.

I located the UMTSStickData.cpp in the source here http://mbed.org/users/donatien/programs/NetServicesSource/5zh9t

Regards
Daniel

11 Dec 2010

Thanks Daniel! That would explain it.. =/ I'll take a look and see what I see, and hopefully figure it out.. =)

11 Dec 2010

Ok, I found a handy utility to find some info on my device.... from http://digital.ni.com/public.nsf/allkb/335A90747734097886257070006415B9

USBView.exe application. This utility gave me the following info about my device...

Device Descriptor:
bcdUSB:             0x0200
bDeviceClass:         0x02
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x40 (64)
idVendor:           0x106C
idProduct:          0x3716
bcdDevice:          0x0000
iManufacturer:        0x03
iProduct:             0x02
iSerialNumber:        0x00
bNumConfigurations:   0x01

ConnectionStatus: DeviceConnected
Current Config Value: 0x00
Device Bus Speed:     Full
Device Address:       0x01
Open Pipes:              0

So, in the UMTSStickNetIf.cpp file I added the bit for my device....

#include "UMTSStick.h"

const UMTSSwitchingInfo UMTSwitchingTable[UMTS_SWITCHING_COUNT] = {

/*
struct UMTSSwitchingInfo
{
  uint16_t cdfsVid;
  uint16_t cdfsPid;
  uint16_t serialVid;
  uint16_t serialPidList[16];
  byte targetClass;
  bool huaweiPacket;
  byte cdfsPacket[31];
};
*/

//Pantech UMW190NCD 
{ 0x106C, 0x3716, 0, {0}, 0x02, true, {0} ),

//Huawei E220, E230, E270, E870
{ 0x12d1, 0x1003, 0, {0}, 0xFF, true, {0} },

//Huawei E1550, E270+
{ 0x12d1, 0x1446, 0x12d1, {0x1001, 0x1406, 0x140c, 0x14ac/*, 0x1003*/}, 0, false, { 0x55, 0x53, 0x42, 0x43, 0x12, 0x34, 0x56, 0x78, 0,    0, 0, 0, 0,    0, 0, 0x11, 0x06, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }

};

Which leads to another dunce question.. I'm trying to get used to publishing libraries... When I edit the source as I show above, export the library... It doesn't create the .ar file.... Sorry to get stuck on such silly details.... =/

11 Dec 2010

Hi Mark

Unfortunately we can't create .ar files in the online compiler. I suggest you import Donatien's source into the compiler, make your edit as above, then add the main.cpp file you need (presumably with a UMTSStickNetIf object), then build it. Libraries aren't relevant until you want to publish it for other users to see (even then you are only making you source available in a bundled fashion rather than a precompiled version).

Regards
Daniel

11 Dec 2010

Thanks again Daniel!

Well, I made a bit of progress... I tried your suggestion and it worked for the most part.. Got it to compile and it runs...

After a little more research I changed my code to the following....

//Pantech UMW190NCD 
{ 0x106C, 0x3716, 0x106C, {0}, 0x02, false, { 0x55, 0x53, 0x42, 0x43, 0x12, 0x34, 0x56, 0x78, 0x24,    0, 0, 0, 0x80,    0, 0x08, 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },

I tried it with and without the 'false { 0x55, 0x53' and so on.... which from what I can see so far is the control packets...? Anyway, the output I get is much more encouraging... But I obviously have some more learning to do...

I get the following now...

Setting up...
[workspaces/users/bc4ec2bcf94ac12794fcec61a0026390/vzwGO/src/drv/umtsstick/UMTSStick.cpp:getSerial@58] Configuration set: vid:106c pid:3716
[workspaces/users/bc4ec2bcf94ac12794fcec61a0026390/vzwGO/src/drv/umtsstick/UMTSStick.cpp:checkDeviceState@143] Match on dongles list
[workspaces/users/bc4ec2bcf94ac12794fcec61a0026390/vzwGO/src/drv/umtsstick/UMTSStick.cpp:checkDeviceState@160] Found device in Serial mode
[workspaces/users/bc4ec2bcf94ac12794fcec61a0026390/vzwGO/src/drv/umtsstick/UMTSStick.cpp:findSerial@280] Interface of type 02

Which is farther than before, but I'm guessing its supposed to be telling me something about the endpoint and so on... Any ideas as to why it's hung at the interface type 02? I've tried 0xFF as well but it doesn't work either...

I checked and the following chart says I should be using 02...

Class	Usage	Description	Examples
00h	Device	Unspecified[8]	(Device class is unspecified. Interface descriptors are used for determining the required drivers.)
01h	Interface	Audio	Speaker, microphone, sound card, MIDI
02h	Both	Communications and CDC Control	Modem, Ethernet adapter, Wi-Fi adapter
03h	Interface	Human interface device (HID)	Keyboard, mouse, joystick
05h	Interface	Physical Interface Device (PID)	Force feedback joystick
06h	Interface	Image	Webcam, scanner
07h	Interface	Printer	Laser printer, inkjet printer, CNC machine
08h	Interface	Mass storage	USB flash drive, memory card reader, digital audio player, digital camera, external drive
09h	Device	USB hub	Full bandwidth hub
0Ah	Interface	CDC-Data	(This class is used together with class 02h—Communications and CDC Control.)
0Bh	Interface	Smart Card	USB smart card reader
0Dh	Interface	Content security	Fingerprint reader
0Eh	Interface	Video	Webcam
0Fh	Interface	Personal Healthcare	Pulse monitor (watch)
DCh	Both	Diagnostic Device	USB compliance testing device
E0h	Interface	Wireless Controller	Bluetooth adapter, Microsoft RNDIS
EFh	Both	Miscellaneous	ActiveSync device
FEh	Interface	Application-specific	IrDA Bridge, Test & Measurement Class (USBTMC),[9] USB DFU (Direct Firmware update)[10]
FFh	Both	Vendor-specific	(This class code indicates that the device needs vendor specific drivers.)

I should also mention I found the control codes from this info....

#######################################################
# Pantech / UTStarcom UMW190 (Verizon)

DefaultVendor= 0x106c
DefaultProduct=0x3b05

TargetVendor=  0x106c
TargetProduct= 0x3716

MessageContent="555342431234567824000000800008ff020000000000000000000000000000"

CheckSuccess=20

Thanks for the help so far!!!

12 Dec 2010

I'm stuck at this point.. I think I've narrowed it down to this line ...

if (desc[5] != 0xFF) //Not a serial-like if

which is in the UMTSStick.cpp... Since my device is in class 0x02, I'm not sure how to proceed.. If I change it to 0x00 in the UMTSStickData.cpp it goes through the switching to serial, but crashes.. If I change it to 0xFF it only gets as far as reporting the 'Match on dongles list'...

If anyone has any suggestions I would really appreciate it... =)

03 Jan 2011

Hi Mark x,

I've been following this thread as I'm interested on including an UMTS stick into my project. As I was blocked when trying to work with my ZTE MF110 HSUPA Usb stick (1&1 Germany), I decided to keep working with ethernet cable. Now my project is mature enough to include the HSDPA usb stick, and instead of start working from scratch on the same issue, I would like to ask you if you had some progress since your last post.

 

Kind regards,

 

CFTM

03 Jan 2011

Hello, I've also following this thread, because I have tried to get a stick from 4g systems running. I have looked into the linux driver. There is a command to switch this type of sticks into serial mode. If connected they appear as memory device to auto-start the driver for windows. Look vor usb_modeswitch.

Regards, Peter

03 Jan 2011

Hello Carlos and Peter... I have not had time to research any further than I have posted so far due to the holidays, etc... I do plan on diving back in very soon... I have ordered another usb device I mentioned in another thread and it is waiting for me to pick up so I will be looking into that one as well.. I'd love to see some success with this as it would be so beneficial to everyone...

Thanks for the interest, and I'll keep everyone posted on what I find (or most likely get stuck on)!

-mark

04 Jan 2011

Hello Peter and Mark,

thank you very much for your replies. I didn't wanted to write you back until I had some results on the table. So here I'm with some interesting outcome.

First of all, the propose of Peter to start looking into usb_modeswitch was an great idea. After reading a couple of forums where people discussed how to enable a UMTS stick under linux, I got a better picture on whats going on on the UMTSStick implementation for mbed. In fact, UMTSStick is doing exactly what usb_modeswitch is doing for linux as Peter said, i.e. it switches the USB stick from mass storage device to serial device. For each mode the USB stick has 2 different Product ids. All this information is well explained on Linux forums, so to get more precise information just look on google for your specific UMTS Stick model including the usb_modeswitch keyword on your search.
I found the device and vendor ids and SCSI message content and I added an entry into the UMTSwitchingTable (UMTSStickData.cpp) with that info.

Well, I'm still not able to make my USB to work, but I'm pretty close to make it. On the last couple of hours I've been fighting with two problems when using the NetServices library:

1.- Timing issues: I'm not sure what I'm doing wrong, it could be my hardware (I'm using the breakout board from coolcomponents), or the library or even the USB stick, whatever the reason is, I have to unplug and plug the usb stick to my board, then reset the mbed in an specific order, and if I'm lucky I get it working (the debugging lines are printed and not just the 'Setting up...' line).
This issue is not completely blocking me, so I'll put it in the low priority list.

2. When I get the UMTS stick initialized and running on serial mode, the UMTSStick::getSerial method fails. It never detects the USB in serial mode even when the USB stick reconnects (confirmed with the red and green LED on the stick).
As a work around, I included a new entry on the UMTSwitchingTable (besides the oneI did before for the ZTE umts stick) and I included this time the serial device id. So now, when the USB stick reconnects in serial mode, I reset the mbed and it should recognize the new serial device and do a successful connection.
Unfortunately I have to perform such dirty work around due to the limited debugging capabilities of the on-line IDE.  As long as I still have the timing issue described above, I can never say for sure if the code is waiting for the USB decive at the right time or not. I included some debuggin printf instructions, but still is not the proper way to go.

Here are some results with and without the work around described above. It seems, in the second log (the one when I reset the mbed as workaround), that the serial device pointer m_pUsbSerial is never referenciated (i.e. it is alway NULL).

Normal operation log:

Setting up...
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:getSerial@58] Configuration set: vid:19d2 pid:2000
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:checkDeviceState@143] Match on dongles list
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:checkDeviceState@146] Found device in CDFS mode
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:getSerial@83] Switching the device by sending a magic packet
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:switchMode@221] Found bulk ep 01
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:switchMode@238] Sending SCSI Packet to switch
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:switchMode@262] The stick should be switching in serial mode now
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:getSerial@89] Now wait for device to reconnect
Setting up...

Workaround (mbed reseted when the UMTS stick reconnects). Please note that the device is recognized first as a masstorage device (PID 0x2000) and as a serial device (PID 0x0031) after reconnection.

Setting up...
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:getSerial@58] Configuration set: vid:19d2 pid:2000
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:checkDeviceState@143] Match on dongles list
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:checkDeviceState@146] Found device in CDFS mode
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:getSerial@83] Switching the device by sending a magic packet
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:switchMode@221] Found bulk ep 01
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:switchMode@238] Sending SCSI Packet to switch
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:switchMode@262] The stick should be switching in serial mode now
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:getSerial@89] Now wait for device to reconnect
Setting up...
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:getSerial@58] Configuration set: vid:19d2 pid:0031
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:checkDeviceState@143] Match on dongles list
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:checkDeviceState@160] Found device in Serial mode
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:findSerial@280] Interface of type ff
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:findSerial@298] Found bulk in ep 81 of payload size 0040
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:findSerial@292] Found bulk out ep 01 of payload size 0040
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:findSerial@317] Endpoints found, create serial object
[~/NetServices/src/drv/umtsstick/UMTSStick.cpp:findSerial@321] UsbSerial object created
Setup OK
Connecting...
can't open serial?
Error -65534 during connection.

I will try to go further, but it is a bit frustrating working with older versions of libraries because of the locked updated libraries. I will try to request to include my UMTS stick information into the library or maybe the author could create a method to add content into the UMTSwitchingTable.

If you guys have any sugestion or idea on what to do or try, I will be happy to get any reply from you.

BR,

Carlos


04 Jan 2011

PS. I have just checked my mbed breakout board schematic, and no, there are not resistors on the D+/D- lines. The new revision of this board (rev. 2) include them now. So I have now a clue why I had so many "timing" problems. I will bring my iron and some smd resistors try to solve this and come back with more results.

But now another question. According to the UMTSStickNetIf library descrition:

This class provides connectivity to the stack using a 3G (or LTE etc...) stick Plug it
to your USB host using two Pull-down resistors on the D+/D- lines

it means, 2 x 15K ohm resistor pulled to ground. Right?

 

Carlos

04 Jan 2011

After soldering the resistors to the D+/D- pins on the USB connector on my prototype board, and executing the UMTS stick test software, I've got the same results.. to get the debug prints is really hard (plug, unplug, connect, diconnect, over and over again until the luck is on my side. The Stick is recognized as a CDFS device then, the magic word is sent to restart the stick in serial mode, and after that I get the following error: UMTSERR_DISCONNECTED

Well, I have to continue debugging. Hopefully I find something.

BR,

CarlosFTM