HowTos/6000-Comms
From OpenZaurus
Contents |
Communications and networking on the 6000
The Tosa is equipped with USB client and a serial port on the connector at the bottom/middle, and an USB host mini-A at the bottom/middle. There's also an internal USB bus for controlling a prism 802.11b wireless card.
It's also possible to use the CF slot for wifi, bluetooth and GPS cards.
IP over USB on the Tosa
The USB client port on the Tosa can be used for different purposes, for networking, to emulate a USB mass storage device. Connect the Zaurus to a host (Windows, Linux or Mac computer) via the standard USB cable as supplied. A sync/charge cable is doubly useful for this*.
USB networking is a very powerful facility, as it allows you to log in to the Tosa using "ssh", to copy files to/from it using "scp", and to install packages using "ipkg install".
If the connected "host" PC is running any reasonable modern linux, it should be possible to simply plug it in. It's easiest to have a static IP address at both ends - the convention is 192.168.129.1 for the PC, 192.168.129.201 for the Zaurus.
On the PC, after a few seconds, "ifconfig usb0" on the PC will reveal the new network interface. If you didn't set up a system configuration for the interface, just type "ifconfig usb0 192.168.129.1 netmask 255.255.255.0". If there's a problem, use "dmesg" on the PC or "tail /var/log/messages" to see what went wrong.
On the Z, it will probably be called "usbd0", so "ifconfig usbd0" to check it's "UP". Also look for a default route with "netstat -rn" and observe a default route ("0.0.0.0") via 192.168.129.1. Add a default route with "route add default gw 192.168.129.1" if necessary.
Suspend/resume problems
The suspend/resume script is broken for default OpenZaurus 3.5.4 install, and after resuming, the Z won't do USB networking. The fix is as follows.
Sync/charge problems
Some people wonder why *Sharp supply only a data cable, not a data and power cable.
There are reports that it can overload a USB port and blow it up, but in my experience I have never had a problem with doing this - neither with my 6000 or C860.
However, I have noticed that if the battery is really low, the current draw on the USB port is high enough to make the USB port shut down, but it does continue charging, and then after an hour or so you can replug it and the USB port then works OK.
It's probably best to use a proper charger most of the time (this is easy if you have a cradle) and use a sync/charge cable purely for top-ups or when you want usb networking.
WiFi on the Tosa
The internal wireless is a USB prism chipset, and unfortunately the device only supports WEP and not WPA. See [shmoo] for discussion about WPA/hostap and usb-prism.
To activate it, it's necessary to turn on the internal USB bus, using the *command-line tool
usbctl on 1
You can then use the network configuration tool to set up wlan0. It seems that you can't configure wlan0 as a wireless interface until it's up, as it can't check the interface properly.
Then it is possible to initialise the interface ready for use with:
ifup wlan0
To deactivate it, down the interface and then turn off usb. This is advisable before suspending.
ifdown wlan0 usbctl off 1
Once configured, it seems you can then simply "ifup wlan0" and "ifdown wlan0" without needing to manually poweron/off usb as this is in the scripts.
The commands* are entered at a root prompt - open a terminal, type "su" and enter the root password.
Kismet on the Tosa
[Kismet] is a very powerful wifi analysis tool, allowing passive monitoring of 802.11b signals.
Firstly, you need to be root and be online, perhaps with USB or wifi networking.
Install kismet it with "ipgk install kismet"; install the sounds too if desired "ipkg install kismet-sounds".
Then, edit the /etc/kismet.conf file so as to tell the kismet monitor what type of wireless device exists on the 6000. Look for the "source=" line and change it to look like this:
source=wlanng_avs,wlan0,prism2
Then, to ensure that kismet puts logs into a sensible place, find the line that looks like this:
logtemplate=%n-%d-%i.%l
and change it to this:
logtemplate=/var/log/kismet/%n-%d-%i.%l
then at command-line prompt, create the log directory
mkdir /var/log/kismet
Before starting kismet, ensure you've turned on the wifi device with "usbctl on 1". It's best to add the following lines to /usr/bin/kismet. At line 8:
USB_WAS_OFF=0
/usr/sbin/usbctl status 1 | grep "USB Port 1: Off"
if [ $? -eq 1 ] ; then
echo -n "turning on USB, waiting for 3 seconds to initialise wlan0 "
/sbin/usbctl on 1
sleep 3
USB_WAS_OFF=1
fi
and then right at the end, before the 'echo "Kismet existed." add this:
if [ $USB_WAS_OFF -eq 1 ] ; then
echo "bringing down wlan0 and turning usb off"
ifdown wlan0
/sbin/usbctl off 1
fi
-- work in progress--
Kismet should now start and run as root. This is not too secure so the next stage is to fix things so Kismet can run as a non-privileged user.
chmod 1777 /var/run

