pppd for Beagle Rev C - Angstrom

583 views
Skip to first unread message

Pierrot Lafouine

unread,
Oct 26, 2009, 7:23:01 PM10/26/09
to Beagle Board, pierrel...@sympatico.ca
Hi
I'm new to Beagle board, and have limited experience on Linux (Debian
and Ubuntu).
I succeeded to install and run Angstrom on Beagle. Now I need to
install pppd for USB wireless 3.5G key. Does Angstrom support pppd ?
If yes, where and how can I get it ? (I have no ethernet yet on
Beagle).

Thanks!

Pierre

Koen Kooi

unread,
Oct 27, 2009, 3:48:21 AM10/27/09
to beagl...@googlegroups.com

root@beagleboard:~# which pppd
/usr/sbin/pppd

Alfonso Martone

unread,
Oct 27, 2009, 6:38:19 PM10/27/09
to beagl...@googlegroups.com
> I succeeded to install and run Angstrom on Beagle. Now I need to
> install pppd for USB wireless 3.5G key. Does Angstrom support pppd ?
> If yes, where and how can I get it ? (I have no ethernet yet on
> Beagle).


On my Beagleboard C2 I am successfully using an Huawei E156G key
(3.5G on USB 2.0 High Speed; it appears as "/dev/ttyUSB0"; also has a
microSD slot), provided that the Beagleboard gets sufficient power on
the 5V connector (not USB OTG because the Huawei requires up to 450mA
when sending data).

Any 3.5G key "USB 2.0 High Speed" appearing as a serial port (like "/
dev/ttyUSB0") will work with these scripts - just test it on your
Linux PC to be sure.


My "internet-start.sh" script just does:


# use Italy H3G nameservers:
echo nameserver 62.13.171.2 >/etc/resolv.conf
echo nameserver 62.13.171.1 >>/etc/resolv.conf

# the modem port to use:
PORT=/dev/ttyUSB0

# unlock the SIM sending my PIN (skip this if SIM is already unlocked)
echo AT+CPIN=2311^M >$PORT
# note: the "^M" is actually a character 13 (modem does not like LF -
wants CR)

# start pppd using these parameters:
# - speed 921600 (it seems it is not needed)
# - use rts/cts controls (not sure if actually needed)
# - detach from terminal only after pppd is up (or if error happens)
# - setup default routing to the newly created pppd
# - use peer DNS (does not work with H3G, so I setup manually
nameservers as above)
# - lcp echo is 6*10=60 seconds (lcp echo apparently required by H3G
Italy)
# - connect script sends first an ATZ, then the "tre.it" APN
(required by H3G
# Italy), then the connect stuff
# ***beware*** the following is a single line

/usr/sbin/pppd $PORT 921600 crtscts updetach defaultroute usepeerdns
lcp-echo-failure 6 lcp-echo-interval 10 connect '/usr/sbin/chat -t 6 -
s -v "" ATZ OK AT+CGDCONT=1,\"IP\",\"tre.it\",\"\",0,0 OK
ATDT*99***1# CONNECT \d\c'

To shut down, you just have to do this command and wait a few seconds
(pppd understands what you mean with that HUP signal):

killall -HUP pppd

Note:

as far as I know, these are common Linux procedures; they "just work"
on all Linux systems having some "serial" port on which a "pppd" can
run. Almost anything working under Linux will work on the
Beagleboard; I'm sure the above procedures work on all Beagle boards,
provided a working USB EHCI port and a "high speed USB 2.0" key.

Also, the above scripts do not require user input (so you may write
programs which enable the internet connection only when needed and
shut down when not needed anymore).

The only drawback is that the "internet key" will drain a lot of
current - even when not used.

Another example: if you use Narcissus Angstrom and want to share that
internet connection with the host computer using/powering via USB OTG
connection when you have the "usb0" interface, then you can:

- on Beagleboard (which "usb0" interface is something like
"192.168.5.2" fixed IP): do the natting/masquerading (not sure if all
"modprobe" commands are actually required):

echo "1" > /proc/sys/net/ipv4/ip_forward
modprobe ip_tables
modprobe ip_conntrack
modprobe iptable_nat
modprobe ipt_MASQUERADE
iptables -t nat -A POSTROUTING -d ! 192.168.5.0/24 -j MASQUERADE

- on PC Linux (which "usb0" interface is something like "192.168.5.1"
fixed IP) add the default routing towards Beagleboard:

route add default gw 192.168.5.2

(note: on PC Linux the /etc/resolv.conf must be set up as well).

Fun stuff: it appears that my Huawei key can send data (no more than
15-20 kbytes each time) even with 4.0V only, but I cannot guarantee
it will work on any other E156G key...

alf

PL

unread,
Nov 2, 2009, 8:47:29 PM11/2/09
to Beagle Board
Thanks alf, for this detailed answer
Pierre
Reply all
Reply to author
Forward
0 new messages