Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Nov 2009 13:15:24 -0500
From:      Mark Stosberg <mark@summersault.com>
To:        freebsd-questions@freebsd.org
Subject:   solution: getting a Motorola Razr V3 to work as a GSM modem on FreeBSD
Message-ID:  <20091105131524.3967515f@summersault.com>

next in thread | raw e-mail | index | archive | help
Here's an answer without a direct question:

I've been working on a project send out pages from Nagios directly unto
cell network as SMS messages. The "modem" used for now is a Motorola
Razr V3 phone, which is a GSM phone. We have a "Qwert Corp" texting
plan, which provides unlimited text messages for about $20/month,
without paying for a voice plan we don't need. It is serviced by
T-Mobile's network. The phone connects to the server via USB cable
which (I presume) also charges the phone at the same time. No special
settings needed on the phone to make it work as a modem=20

On the FreeBSD side (with the old FreeBSD 6.1 release), I initially got
a failure when I plugged it in:

Nov 5 09:45:57 azz kernel: uhub0: device problem (SET_ADDR_FAILED),=20
disabling port 1
Nov 5 09:46:06 azz kernel: uhub0: port 1, set config at addr 2 failed
Nov 5 09:46:06 azz kernel: uhub0: device problem (IOERROR), disabling=20
port 1
Nov 5 09:46:10 azz kernel: ugen0: Motorola Inc. Motorola Phone (V3),=20
rev 1.10/0.01, addr 2

###

This initial problem was solved by loading the "ucom" and "umodem"
modules:

kldload ucom
kldload umodem

To make sure these will be loaded on boot, I added some lines to=20
/boot/loader.conf (still need to be tested):

ucom_load=3D"YES"
umodem_load=3D"YES"

Then when I plugin the phone to FreeBSD, I get a more successful
message:

###

Nov 5 11:10:25 azz kernel: ucom0: Motorola Inc. Motorola Phone (V3),=20
rev 1.10/0.01, addr 2,
iclass 2/2
Nov 5 11:10:25 azz kernel: ucom0: data interface 1, has CM over data,=20
has no break
Nov 5 11:10:25 azz kernel: ucom0: status change notification available

###

The related device file for us is: /dev/cuaU0

For software to send the pages, I use the "gammu" port.

I ran "gammu-config" for the initial setup, and then moved the
resulting file from /root/.gammurc to the more standard
location: /etc/gammurc

During the setup, I used the device file mentioned above. I found that
the device file could be reality-checked like this:

 stty -f /dev/cuaU0 -a

That prints out some details including this hint that it's a modem:
"speed 9600 baud"

Finally, I could send a successful test with Gammu:

 echo "sms test" | gammu --sendsms TEXT +1XXXYYYZZZZ

=46rom here, there are already references on integrating Gammu with
Nagios, as well as the possibility of using "gammu-smsd" for
higher-volume paging loads.=20

I thought I would share this in case anyone else ran into the same
problem I did trying to get a USB modem to work when they plugged into
FreeBSD!

    Mark


--=20
 . . . . . . . . . . . . . . . . . . . . . . . . . . .=20
   Mark Stosberg            Principal Developer =20
   mark@summersault.com     Summersault, LLC    =20
   765-939-9301 ext 202     database driven websites
 . . . . . http://www.summersault.com/ . . . . . . . .





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091105131524.3967515f>