Tag Archives: wireless

Wireless in Powerbook G4 part 2

Below is a small script to configure the network interfaces in the Powerbook. It will probably work in other Linux systems too, maybe some modifications would need to be made. wlan0 is the wireless interface and eth0 the broadband interface.


#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

echo "Checking whether NetworkManager is running"
if [ -f /var/run/NetworkManager.pid ]; then
        echo "NetworkManager is running, stopping it"
        /etc/init.d/network-manager stop
else
        echo "NetworkManager is not running"
fi

Interface() {
echo "Choose the name of the interface you want to configure"
echo "1 = Interface ethernet eth0"
echo "2 = Interface wireless wlan0"
echo "0 = Quit the program"
echo
read INT

if [ $INT = 1 ]; then
ETH=eth0

elif [ $INT = 2 ]; then
ETH=wlan0 
echo "Choose the essid you want to connect to"
iwlist $ETH scan | grep -i essid
read ESSID
iwconfig $ETH "$ESSID"

elif [ $INT = 0 ]; then
echo "Quitting"
exit 0
fi
}

Interface

Configure() {
echo
echo " 1 = static "
echo " 2 = dhcp "
echo " 0 to quit the program "
echo
read CHOICE

static() {
echo "Write the IP of the interface"
read IP
echo "Write the network mask"
read NETMASK
echo "Write the default gateway"
read ROUTE
echo "Configuraning the interface"
ifconfig $ETH $IP netmask $NETMASK
echo "Configuraning the gateway"
route add default gw $ROUTE
echo "search" > /etc/resolv.conf
echo "Write the IP of the first DNS server"
read DNS_1
echo nameserver $DNS_1 >> /etc/resolv.conf
echo "Write the IP of your second DNS server"
read DNS_2
echo nameserver $DNS_2 >> /etc/resolv.conf
} 

dhcp() {
        dhclient $ETH
        }

if [ $CHOICE = 1 ]; then
static

elif [ $CHOICE = 2 ]; then
dhcp

elif [ $CHOICE = 0 ]; then
echo "Quitting the program."
exit 0
fi
}

Configure

exit 0

Suggestions are always welcome. 🙂

Wireless in Powerbook G4

I have an old Powerbook G4 12 inch running Debian. I had issues connecting to the wireless if I was not using Gnome. I found out it was because of Network Manager. While Network Manager is running I can not connect to the wireless network from command line. Currently I am using OpenBox so it doesn’t connect automatically to the wireless. Here is a small howto.

First we check module b43 is installed.

[19:16:50] xavi@NewYork:/tmp $ sudo modinfo b43
filename:       /lib/modules/2.6.30-2-powerpc/kernel/drivers/net/wireless/b43/b43.ko
firmware:       FW13
license:        GPL
author:         Michael Buesch
author:         Stefano Brivio
author:         Martin Langer
description:    Broadcom B43 wireless driver
alias:          pcmcia:m02D0c0448f*fn*pfn*pa*pb*pc*pd*
alias:          ssb:v4243id0812rev10*
alias:          ssb:v4243id0812rev0F*
alias:          ssb:v4243id0812rev0D*
alias:          ssb:v4243id0812rev0B*
alias:          ssb:v4243id0812rev0A*
alias:          ssb:v4243id0812rev09*
alias:          ssb:v4243id0812rev07*
alias:          ssb:v4243id0812rev06*
alias:          ssb:v4243id0812rev05*
depends:        pcmcia,mac80211,ssb,input-polldev,pcmcia_core,rfkill,rng-core,cfg80211
vermagic:       2.6.30-2-powerpc mod_unload modversions 
parm:           bad_frames_preempt:enable(1) / disable(0) Bad Frames Preemption (int)
parm:           fwpostfix:Postfix for the .fw files to load. (string)
parm:           hwpctl:Enable hardware-side power control (default off) (int)
parm:           nohwcrypt:Disable hardware encryption. (int)
parm:           qos:Enable QOS support (default on) (int)
parm:           btcoex:Enable Bluetooth coexistance (default on) (int)
parm:           verbose:Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug (int)
[19:16:54] xavi@NewYork:/tmp $ lsmod | grep -i b43
b43                   138992  0 
rfkill                 15184  3 rfkill_input,b43
rng_core                7952  1 b43
mac80211              178904  1 b43
cfg80211               72376  2 b43,mac80211
input_polldev           7836  2 b43,ams
ssb                    51292  1 b43
pcmcia                 32336  2 b43,ssb
pcmcia_core            40868  3 b43,ssb,pcmcia
[19:17:09] xavi@NewYork:/tmp $ 

Stop Network Manager

bash$ sudo /etc/init.d/network-manager stop

Bring up wireless interface. Wlan0 in my case.

bash$ sudo ifconfig wlan0 up

Scan the available wireless networks.

bash$ sudo iwconfig wlan0 scanning

Connect to the ESSID

bash$ sudo iwconfig wlan0 essid

Get an IP from the wireless access point.

bash$ sudo dhclient wlan0 

Ping an external address to see you are connected to the internet.

[19:31:57] xavi@NewYork:/tmp $ !ping
ping -c 3 debian.org
PING debian.org (194.109.137.218) 56(84) bytes of data.
64 bytes from klecker.debian.org (194.109.137.218): icmp_req=1 ttl=50 time=119 ms
64 bytes from klecker.debian.org (194.109.137.218): icmp_req=2 ttl=50 time=116 ms
64 bytes from klecker.debian.org (194.109.137.218): icmp_req=3 ttl=50 time=101 ms

--- debian.org ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 101.768/112.858/119.928/7.940 ms
[19:32:02] xavi@NewYork:/tmp $ 

You should now be ready to go. I will write more on this later on.