[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [SOLVED!] Communicating with USB Modem

Comments and some info at the bottom, so it makes sense when you read it.  (Hey, there's NO way I'm going to top post on this list!)

On Oct 9, 2010, at 3:21 AM, Hal Vaughan wrote:

> I have a Debian Lenny system and I've plugged in a USB 56K modem.  (I know that's as outdated as a Model T, but I need it for business.)  When I type "cat /proc/bus/usb/devices" I get this:
> T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 8
> B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
> D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> P:  Vendor=1d6b ProdID=0002 Rev= 2.06
> S:  Manufacturer=Linux 2.6.26-2-686 ehci_hcd
> S:  Product=EHCI Host Controller
> S:  SerialNumber=0000:00:1d.7
> C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
> I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
> E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms
> T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
> B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
> D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> P:  Vendor=1d6b ProdID=0001 Rev= 2.06
> S:  Manufacturer=Linux 2.6.26-2-686 uhci_hcd
> S:  Product=UHCI Host Controller
> S:  SerialNumber=0000:00:1d.0
> C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
> I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
> E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms
> T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
> D:  Ver= 2.00 Cls=ff(vend.) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> P:  Vendor=047e ProdID=2892 Rev= 2.00
> S:  Manufacturer=Agere Systems
> S:  Product=Agere USB2.0 V.92 SoftModem
> C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=200mA
> I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
> E:  Ad=82(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
> E:  Ad=02(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
> I:  If#= 0 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
> E:  Ad=82(I) Atr=01(Isoc) MxPS=  32 Ivl=1ms
> E:  Ad=02(O) Atr=01(Isoc) MxPS=  32 Ivl=1ms
> I:  If#= 0 Alt= 2 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
> E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> E:  Ad=82(I) Atr=03(Int.) MxPS=  16 Ivl=16ms
>> From what I can find, that means the actual device file for this modem should be at /dev/bus/usb/001/002, but I know I could be wrong on that.
> I'm trying to communicate with this modem.  I've used Minicom, with the device I mentioned above.  There are no /dev/ttyACM0 devices, as sometimes happens with a modem.  I've tried all /dev/ttySx, where x is from 0 to 4, with no results.  The problem with Minicom is that it can take time and a lot of frustrating keypresses to try one device after another.  Also, I'm not sure the serial port speed settings are at all appropriate in Minicom for USB modems.
> I was also trying a Perl program that would simply fork, have the parent open the device for reading and listen, then the child would open the same device for writing and send "ATZ" through to the device, then I could watch for a response -- but then when I tried it on a system with a serial port where I knew the device was /dev/ttyS0, it didn't work, so maybe there's a problem with the program.  (I don't want to post a full Perl program here, since this isn't a Perl board that focuses on debugging Perl.)
> This is a test situation, so I can't be sure the modem works with Linux, but I would think if it's external and USB, it would have to accept serial commands sent over the USB port.  I could be wrong on this, of course.
> So here's the questions:
> 1) What device should I be able to write to and read from to connect to this modem?
> 2) Any suggestions on how to write to and read from the device?  (Write to it in Perl or use echo in bash -- but then how do I read to see results?)
> 3) Any other ideas or suggestions on how to control and use this modem in Linux (without going into C or C++)?

Even after playing around for a while, and with help from others (see other emails in this thread), I could not get the other modem to work properly.  I did try the sl-modem drivers from the non-free repositories.  They would create /dev/modem and link it to /dev/ttySL0, but even with that, it wouldn't work.

When I tested any modem, I did two things: 1) I used Minicom, which is a great term program, and 2) I used my own Perl program that would open a device as a file to read and write to, then send the ATZ command (with a newline character after it) and I'd see if anything came back.  I missed a few details on this program, but once I got it to work (tested it on an RS232 modem on another box), I would see the ATZ printed on the console (as well as knowing it was supposedly sent to the device) and I'd see a blank line, then OK.  No matter what I did with Minicom or my Perl script, I could not communicate with the Encore modem.

Today I received another USB modem, a Rosewill RNX-56USB from NewEgg.  The link to that item is:


(It's NewEgg item number is in the URL, if they change their web page system.)

I had read that for many USB modems, when you plug it in, it's recognized and set up as /dev/ttyACM0.  (Second one is ACM1 and so on.)  I was frustrated that didn't happen, since several of the reviews said it worked "out of the box" and without any binary drivers on Linux.  So I took a while to spend some quality time with my close and dear friend, Google.  By comparing the info from /proc/bus/usb/devices and other info, I found this site:


And, to make a long story short, this link:


I will add that their instructions are a bit outdated.  The Download link on that page leads to a license page, then to a page where you can download the file "cnxinstall.run."  Make sure you have installed unzip first, before running it.  Since I'm using this for an embedded system, I have as little installed as I could get away with.  I had to add it, after getting "does not work" messages.

All you have to do is download that file, then do this:

1) cd to the directory with that file in it
2) chmod +x cnxinstall.run
3) ./cnxinstall.run  OR if you don't have a GUI on the system, run ./cnxinstall -- --tty (yes, there is an extra "--" in there that is needed!)
4) Answer questions and it'll download (or maybe it was already there) a .deb file it'll install.

Once that's done, you have /dev/ttyACM0 and your modem will work.  I had to initialize it with Minicom the first time, but after that, my Perl script worked fine.  I suspect rebooting would have re-initialized the modem.

I would prefer to not have to download drivers, but the advantage is that it's in a .deb format.

Now I have a few notes on this, since there's been a few private conversations with people who are in or have seen this thread.

1) I'm basically making a "black box" for the people I'm working with.  I do NOT want them messing with the computer I give them.  Many times, in embedded systems, there is no PCI slot.  Sometimes there is, but I can't count on that.  (I haven't picked my hardware config yet.)  So I really need an external modem since the only connection I can count on is a USB connector.  (Even with embedded, most systems have 2 or more USB connectors, and some people may need to hook up a printer there.)

2) I can't count on having an RS232 interface, so that rules out a lot of good modems.

3) Yes, I know about US Robotics, I have known about them since my Apple ][e days.  (Yes, I'm that ancient!)  However, their modem is almost twice as much as this one and if things go well, I could need 20 or more of these systems, and 20 * $20 = $400.  That pays for 40 group Argentine tango lessons or almost pays for a 10 pack of private ballroom lessons.  I'd rather be dancing with women than spending extra on modems when I don't have to.  I know that's just crazy and silly, but that's the way I am.

4) I spent the better part of an afternoon and evening on trying to get the Encore modem to work and couldn't, so I ordered the Rosewill one.  Yes, I'd love to have pursued it, but considering that, at this point, I'm only working with one modem and not mass-ordering them, it makes no sense to spend hours on making a modem work when $30 will get me one that should work.  Again, I know it's silly, but I'd rather be dancing with women than working at my computer.  At some point, if an idea hits me, I may go back to working on the Encore modem, but for now I don't see the point of investing more time in it.

Thanks to all that helped me with this.  I would love it if I didn't need to add another package, especially one not in repositories, but this works and it doesn't take much to work, and including this package as part of my setup won't be too hard at all.  I don't know what kind of reputation Rosewill has, but I've had good luck with them, so I'll be sticking with their modem for now and when I get to doing the mass-ordering as well.

If people still have more suggestions, I'm still open, but I'm not going to spend hours Googling or researching or compiling to get the Encore working.

Again, thanks for the help!


Reply to: