Installing and using TestDrive-Panda |
Loading a USB Networking protocol
Setting up a USB networking protocol to be automatically loaded at boot time.
Belcarra supports a testing environment for testing Networking over USB protocols. This paper explains the Testdrive PandaBoard distribution (available here), how to install it and how to use it. .
Testdrive Panda is a version of the the Precise Ubuntu distribution modified in small ways to facilitate testing with the following standard networking over USB protocols
These instructions will work on an Ubuntu desktop system
ls /dev/sd*
before and after inserting the card
#Capture the archive name to the shell variable ARCHIVE
ARCHIVE=testdrive-panda-yyyy-mm-dd-hh-mm.tgz
LETTER=c # Typical value Your actual drive letter will vary
write-testdrive-panda.sh -a authfile $LETTER $ARCHIVE hostname
Please note that this process takes some time -- up to 20 minutes depending on hardware used, and when it is finished a message is printed on the screen saying that it is safe to remove the card. Removing the card before that will have unpredictable, likely disastrous consequences. Fortunately, you can repair the card simply by re-running the script -- but this time waiting for the very end.
The installation process does the following
After doing all this, you will have a command line “server” version of Ubuntu for the Pandaboard.
It is modified in the following small ways
The user testdrive has no password and is enabled to do anything via the sudo command.
Note the first login prompt is sometimes overwritten (hidden) by various system messages. Just press Enter to get another. This version of Ubuntu uses serial and and Ethernet access methods only. This is a “server” edition (no support for a monitor, mouse, keyboard, etc).
The Avahi mDNS daemon advertises a host called hostname.local where hostname is the name that is specified at installation time (see above). This can changed by modifying the following two files:
However, the easiest way to set the mDNS name is to use the hostname option (3rd argument of write-testdrive-panda.sh) during installation
If the hostname installation option is not used, then the mDNS name will be precise1.local.
After a unique name is selected, the next thing is to specify the SSH authorized_keys2 file. With these two items used in tandem, the Pandaboard can be accessed without a password over the Ethernet port, and also without knowing its IP address as follows:
ssh -l root precise1.local # Using the default name
Five networking over USB protocols are supported
The first step is to determine the protocol. The protocol can be one of the following coded values
Next, determine the VendorID in hex digits (no 0x prefix). For Belcarra, this will be 15ec .
Next, determine the Product ID in hex digits. A typical value for a Belcarra demo driver is d031
Finally (optionally) determine a serial number, which is just a series of decimal digits.
At the conclusion of this process, 4 values have been set:
PROTOCOL
VENDOR
PRODUCT
SERIAL
The last value, SERIAL might be the empty string, in which case no SerialNumber string will be included in the Configuration Descriptor.
Using the four values gathered in the previous section, simply issue a command as follows:
$PROTOCOL $VENDOR $PRODUCT $SERIAL
Examples
ecm 15ec d031 # ECM protocol for 15ec/d031 no serial number
eem 15ec d035 1000 # EEM protocol for 15ec/d035 serial # 1000
ncm 15ec d031 # NCM protocol for 15ec/d031 no serial number
rndis 15ec d037 1001 # RNDIS protocol for 15ec/d037 serial number 1001
subset 15ec d031 2000 # ECM subset for 15ec/d031 serial number 2000
In each case, if a network protocol is already loaded, its module is first unloaded before loading the new network module with parameters as requested.
These parameters are all specified automatically, but are noted here for completeness
Parameter | module(s) | value(s) | default | description |
use_eem | g_ether | 0/1 | 0 | 0 for ECM, 1 for EEM |
idVendor | g_ether/g_ncm | 16-bit hex | 0 (not a reasonable value) | Vendor ID, up to 4 hex digits |
idProduct | g_ether/g_ncm | 16-bit hex | 0 (not a reasonable value) | Product ID, up to 4 hex digits |
iSerialNumber | g_ether/g_ncm | String of decimal digits | empty string (no serial number) | Serial Number |
force_ecm_subset | g_ether | 0/1 | 0 (do not use the subset) | 1 to use the ECM subset |
use_rndis | g_ether | 0/1 | 0 | 1 to use RNDIS |
To enable USB networking to automatically load at boot time, simply write the four values above to the file /etc/usb/usb-network.conf
Example of contents of this file
PROTOCOL=ncm
VENDOR=15ec
PRODUCT=d031
SERIAL=1000
Similarly, to prevent automatic loading at boot time, set PROTOCOL to an invalid value, rename the file, or put #’s at the beginning of each line (these lines are read into part of the boot scripts).
Three types of network testing are suggested:
The flood ping is a good tool to stress-test a network link for stability and endurance
The iperf utility is very useful for establishing complex measurements of a link. For instance a web test (see next section) can establish the effective speed of a web transfer, but we do not know how much TCP/IP traffic was really sent in each direction. iperf can be used to get profiles of traffic shapes. In addition, iperf tests can be run over a long period of time, up to a few hours, limited by the stability of the Windows version of iperf.
The Apache2 web server is started
Once all tests have been run, the system can be shut down via sudo
sudo shutdown -y -g0
You can also reboot the board as follows
sudo reboot
Copyright ©2005-2013 Belcarra Technologies (2005) Corp.
www.belcarra.com info@belcarra.com
Document Created: June 2013