USBNet with Nokia770 / WinXP
February 21, 2006 on 6:46 pm | In maemo, nokia770, winxp | 1 CommentBack when I was coding for the Zaurus, the easiest method for coding was to SSH into the Zaurus over the USB network interface. With SSH and SCP I could code on the Zaurus from any platform. Even my corporate Win2k system.
Well that Zaurus is dead and gone, and now I have the 770. Now i do concede that the USB flash drive interface is a lowest common denominator mdel, and perhaps more appealing to the non-geek, but TCP over USB is much more functional for any interactive coding / development.
Since the USB interface on the 770 has been designed to support both the flash memory interface and the TCP over USB interface the hard part has already been done. So now our problem becomes two separate problems. The first is to manage the interface on the Nokia so it looks like a USBNet interface. The second is to get the WinXP system to configure to talk over it.
In order to enable the USBNet interface on the 770, the g_ether module needs to be loaded and the usbnet interface needs to be enabled. This displaces the g_memory module that would normally be hooked in when the USB interface is connected to a master device.
The manual process for enabling and managing the USBNet interface and Linux hosts has been defined and discussed on at least two other maemo.org pages (http://maemo.org/maemowiki/HowTo). So if you are interested in how it works, look at those pages.
Based on the content of the pages I have written a bash script (usbnet) and packaged it for the 770. It places a the usbnet script on the /var/lib/install/usr/sbin directory and supports service like commands such as ‘usbnet start|stop|restart|status’. However it should be noted that Nokia has indicated that the USBNet interface is not particularly stable. I believe it is related to conflicts associated with the automatic enabling / disabling the g_memory module when the usbcable is connected (when the g_ether module owns the usb interface).
On WinXP (sp2) hosts, it already has usbnet drivers installed. However you have to follow a certain process in order to create a virtual network device for the USBNet interface.
- copy the linux.inf file to the some convenient location on the WinXP host
- put the Nokia 770 in USBNet mode.
- connect it to the WinXP host.
- When prompted for the device driver point windows as the linux.inf file/
- it should load the driver. name the interface something salient, like Nokia770 USB.
- Set the IP address staticly to 192.168.2.1 / subnet 255.255.255.
- SSH to address 192.168.2.15 (Nokia 770). If your SSH server is running you should get a login prompt.
That should work.
Right now if the script indicates that the usbnet interface is up on the Nokia 770, but WinXP does not recognize it on connection, try ‘usbnet restart’. That forces re-initalization of the g_ether module. This is usually associated with disconnection of the usb cable (and the event drives some code). If i get around to it, i will try to dig into the event response code and find out what is going on and update my script to deal better with it.
ubergEEk.
PS – Like everything else on this blog, use at your own risk. Just because it worked for me, does not mean i assume responsibility for anything you do.
1 Comment »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
Hi ubergEEk,
I recently started the Howto on connecting the N200 to WinXP/2k via USB (https://maemo.org/maemowiki/USBnetworkingWinXP).
I adapted linux.inf to utilize the latest template from Microsoft, i.e. you can use Win2k with the drivers provided there.
Anyway, I have probs when reconnecting the USB cable. So the trick currently just works once and then I will have to reboot.
My script is very similar to yours in the way it uses insmod/ifup and ifdown/rmmod.
Would appreciate if you can find a solution.
the only hint I saw so far is with “dmesg”:
usb0: can’t enable eplin-bulk, result -22
I could not figure out so far what eplin-bulk actually does. Is it related to the g_memory module?
Regards,
Michael
Comment by Michael — February 23, 2006 #