Digital-Haze
News
Old News

Projects
  ndsrs
  ankidssync
  vnds
  lagth
  wxWepMod
  wxGCNcrypt
  musiccontrol
  kanjilookup
  prismriver
  kepwing

Translations
  Age of Ethanols

Articles
  GC Disk Error
  GP2X USBnet

Photos

irc.efnet.org
#oshtson
GP2X USBnet on Linux

This guide should lead you through getting your GP2X connected to your PC via USBnet.

To start with, you'll need a GP2X and the cable that comes with it (USB to GP2X). Your setup will need to look something like this:


Larger Image

The cable that came with your GP2X goes into the rectangular port on the side of your GP2X under the rubber flap, the other end goes into a USB port (depicted is a USB extension lead (white cable), but it's the same thing). Ideally, you would also connect your GP2X up to the mains, but you can use batteries too.

Now to set everything up. First you need to determine your Linux kernel version (lower than 2.4 will not work). Since the GP2X uses a 2.4 kernel, it has no compatibility problems with a complimentary 2.4 Linux, however, with 2.6, you will need to change the g_ether module.

If you are using a 2.6 kernel on your PC, you must download g_ether.o and create a file with a .gpu/.gpe extension with this:

#/bin/sh

rmmod g_ether
cp -f g_ether.o /lib/modules/2.4.25/kernel/drivers/usb/gadget/g_ether.o
sync

modprobe g_ether
cd /usr/gp2x
./gp2xmenu


Upload both files to your SD card in the same directory. From the menu, execute the .gpu/.gpe file and wait a second or two while it completes the task. You can then delete both files. This lets the GP2X communicate with 2.6 kernels. It doesn't make the GP2X kernel 2.6, but simply fixes problems that a lot of people have.

The next step is to make sure you have the right modules on your PC. Go to your kernel sources directory and make menuconfig.

For 2.4 kernels:
  • Code Maturity Level Options --->
    • [*] Prompt for development and/or incomplete code/drivers
    • USB support --->
      • <M> USB-to-USB Networking cables, Linux PDAs, ... (EXPERIMENTAL)
For 2.6 kernels:
  • Device Drivers ---> USB support ---> USB Network Adapters --->
    • <M> Multi-purpose USB Networking Framework
    • <M> Simple USB Network Links (CDC Ethernet subset)
    • [*] Embedded ARM Linux links (iPaq, ...)
Recompile and install your kernel. Restart your computer. Everything should be configured now. Once everything has started up, plug your GP2X in and switch it on. Wait for the menu to come up, and then run ifconfig usb0 80.0.0.1. 80.0.0.1 is the IP which your computer will use. You're setting up a separate network with your computer and the GP2X essentially. The GP2X's IP is configured from the menu. We'll use 80.0.0.2 for that. You don't have to use 80.0.0.x, it can be anything, but to avoid problems, try and keep it out of your LAN IP range.

After this, your GP2X should be properly connected. Open a terminal on your computer and run ping -c 3 80.0.0.2. If you get feedback like "3 packets transmitted, 3 received, 0% packet loss, time 2007ms", your computer notices your GP2X, that's good! Now, let's test Telnet: again in your terminal, this time run telnet 80.0.0.1. If you connect properly, it will ask you for a "gp2x login", type in root; no password is needed. If you get connection errors, ask around. If you didn't install the g_ether module already, try. Make sure you installed your kernel correctly and give it another go. Once you're in, you can control your GP2X from your computer, and view verbose output from things that you run. That's beyond the scope of this document, but it's like a terminal on your GP2X in a window on your computer.

You can try web services, FTP and Samba too; again, beyond the scope of this document, however, if you still have problems, try asking on irc.efnet.org/#gp2xdev or http://www.gp32x.com/board/. Note that this doesn't cover how to connect your GP2X to the Internet, so don't complain about that to other people.
By Alvin Sipraga, last updated 12/14/07
(k) digital-haze.net

Valid XHTML 1.0 Transitional Valid CSS!