Tcp/ip over usb
Contents |
Why you would want this?
- To telnet into your GP2x, so you can run you programs from a terminal. To see debuging output.
- So you do not need anything but what comes with the GP2X in order to make programs for it.
- So your GP2x can be on the network. Running ppp over the serial connection can be slow... if you have a serial connection(which I don't).
- Running programs directly off your development workstation would be faster than first copying them to your SD card, and then putting them in the GP2X.
Some cool things you could do with your GP2X on the network.
- Mount a remote drive so that you could run binaries that resided on your computer rather than on an SD card.
- Play movies which are stored on your computer.
- Control your GP2X from a computer.
- Play networked games on your GP2X.
How to get TCP/IP over usb working for the GP2x in firmware 2.0.
- Start up your PC and the GP2x.
- Goto the Setting menu on the GP2x
- In the Setting menu select System.
- In the System menu scroll down, if "Menu Extension" is off then enable it.
- After enabling "Menu Extension", scroll down even further and enable the USB Network, FTP/Telnet and Samba server settings. You definitely need USB Networking, you may or may not need FTP/Telnet and Samba (Samba is Linux's version of SMB - ie Windows networking)
- The default IP filled in is "192.168.0.2" - ie the GP2x is expecting to use the 192.168.0.X private (ie RFC 1918 network). If your computer is already using this network (eg for its Internet connection, be that Ethernet or Wifi) then you will need to use a different private network / address. Most of the rest of these notes assume that 10.1.0.1 is the address used for the GP2x if 192.168.0.2 is not correct.
- Press "B" to exit the settings menu, this could take a few seconds because it's loading some stuff.
Next Steps (Windows)
- Windows should pop up with a connection astablished dialog now. If it doesn't, read "installing the USB Gadget driver" down below.
- Next the network needs to be configured on the windows computer. Default it's on auto detect, that doesn't work in this case.
- Goto the Control Panel - Network Connections, there open the TCP/IP properties of the "Linux USB Ethernet / RNDIS" connection. (This step is quit diffrent for each version of windows)
- Switch the auto config to manual config and enter "10.1.0.1" as IP and "255.0.0.0" as netmask. Make sure it's not the ip you entered in the GP2X!
- Note: Leave the gateway empty, entering a gateway might disable your internet while the USB network connection is open.
- Close the dialog, your network connection should be running now.
- Easiest way to test is test open the start menu, open a run box and enter "telnet 10.1.0.2", it should show some stuff and ask for a login. (login is "root") (if you want to run something, kill the menu first with "killall gp2xmenu")
- If that worked then the network connection is in 100% working order. Try opening a exporer window and enter "\\10.1.0.2" into the address bar, it should popup the filesystem on te GP2x (if you enabled the samba server).
Installing the USB Gadget driver
- Download the driver here: http://www.microsoft.com/whdc/device/network/NDIS/rndis.mspx
- Alternate driver pack if the above drivers don't work for you (includes linux.inf): http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,15,1290
- Windows XP x64 (64-bit) drivers: http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,15,2275
- You need to make the "linux.inf" file for this driver. For now, look in this topic: http://www.gp32x.com/board/index.php?showtopic=27848&hl=telnet for the contents.
Reference: http://www.gp32x.com/board/index.php?showtopic=27848&hl=telnet
Note: Mindlord has tested and confirmed that these drivers are working on Windows Vista
Next Steps (Linux and Mac)
See the page UsbNet_on_Linux. Some of the information there is quite out of date - ie it refers to Linux kernel version 2.4 and there have been some changes in the kernel 2.6 tree which may be breaking communication between the Linux on the GP2x and that in a 2.6 kernel.
How to get TCP/IP over usb working for the GP2x in firmware 1.X.
NOTE: This will *NOT* work with the stock GP2X kernel from GPH as it lacks network support. You have to build your own kernel or wait until GPH/DigniSys do it for you.
NOTE: Most of this information came from here: http://www.linux-usb.org/usbnet/
How would it work
A usb host computer with a driver can act as a gateway for the GP2X if it has a special driver installed.
Windows and Linux hosts should work. There are drivers that come with standard 2.4 and 2.6 linux kernels.
I can't find any information about if it will work with a MacOS computer.
What needs to be done to the GP2X linux kernel.
Note: For detailed Linux instructions, see UsbNet on Linux
This already works with other linux based usb clients. Like the zaurus, and other pdas. Support for it is available in linux kernels. So it should be possible to get it working with the GP2X!
Enabling CONFIG_SA1100_USB_NETLINK in the kernel can do it apparently.
The GP2X presents itself as a USB gadget, using the g_ether module (which may need to be replaced on the GP2X to connect to Linux). The desktop requires the cdc_ether module.
Apparently the netchip 2280 is supported by the linux driver. The GP2X has a NetChip_2272.