Jump to content


Photo

Howto: Wiz Usb-Ethernet With Stock Usb Cable


  • Please log in to reply
66 replies to this topic

#31 hcf

hcf

    GP32 User

  • Members
  • PipPipPip
  • 32 posts
  • Gender:Male
  • Location:Milpitas, CA, USA

Posted 07 December 2009 - 05:26 PM

Although if you are behind NAT it is probably not a big issue, be warned if you are using telnetd on the Wiz on the open Internet that anyone out there can also telnet to your Wiz...

I think busybox' dhcp client is on the Wiz already if you want to give that a try (invoke it from the NetworkUp script instead of manually ifconfig'ing the interface).

Now I'm re-double-guessing if we want the NetworkUp to be different from ApplicationUp, since you wouldn't want telnetd running/using memory to run a network multiplayer game...

#32 jbruno

jbruno

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 22 December 2009 - 03:41 AM

Is this actually working for anyone?

For me, I never see a thing in dmesg on the linux host side (I'm using Fedora 12 i386)

I can use USBSerial just fine, but would like TCP/IP to the wiz.

Here's what I'm doing:

I launch the NetworkUp.gpe on the wiz and it pauses for a couple of seconds, then redisplays the menu. I then plug in the stock USB cable to my laptop, and it prompts me for which disk to mount, I hit "X - Cancel". Then, looking at dmesg on the laptop, there is no activity at all.

Thanks for any help!

#33 mb1967

mb1967

    Member

  • Members
  • PipPip
  • 6 posts

Posted 22 December 2009 - 09:41 AM

Is this actually working for anyone?

For me, I never see a thing in dmesg on the linux host side (I'm using Fedora 12 i386)

I can use USBSerial just fine, but would like TCP/IP to the wiz.

Here's what I'm doing:

I launch the NetworkUp.gpe on the wiz and it pauses for a couple of seconds, then redisplays the menu. I then plug in the stock USB cable to my laptop, and it prompts me for which disk to mount, I hit "X - Cancel". Then, looking at dmesg on the laptop, there is no activity at all.

Thanks for any help!


Same problem here. The module postet by "hcf" does not work in my case. I've done the following things:

Firmware 1.1.0
uname -a: Linux wiz 2.6.24#663

Using qtopia terminal:

insmod lf1000_udc.ko
Load is ok. lsmod brings up:

lf1000_udc
usbhid
hid
ohci_hcd
usbcore
rtc_pollux_m41t80
rtc_core

dmesg shows no errors

Now I try:
insmod ./g_ether.ko

I get: Using ./g_ether.ko
Segmentation fault :(

dmesg shows much garbage - pc:[...], sp:[...]
looks like a blue screen, dumping the CPU-status...

but - lsmod shows me, that g_ether has been loaded. :unsure: but it does not work.

The MD5-Checksum of this module ends with 3906ea003 - hcf should check if his module has the same md5checksum - maybe he posted the wrong module?

FYI: USBSerial works fine.

TNX for all your help!

#34 kasi

kasi

    GP32 Hardcore

  • Members
  • PipPipPipPip
  • 110 posts

Posted 22 December 2009 - 12:17 PM

@jbruno,

Just to confirm, it works quite fine for me.
(Only sometimes the WIZ and my host want talk to each other. But I think that's just because I was playing around with the routing tables on the host.)

Maybe you could check the test.log file? If you, too, have the entry "Segmentation fault" than at least you know that you seem to have the same problem as mb1967.
If not, you could use a teminal to check dmesg and ifconfig. I am using termula on the WIZ.
http://dl.openhandhe...i?0,0,0,0,8,163

If ifconfig shows the following lines:
root@wiz:/mnt/sd/apps/telnetd# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 <img src='http://www.gp32x.com/board/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' />  TX bytes:0 (0.0 <img src='http://www.gp32x.com/board/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> 

usb0      Link encap:Ethernet  HWaddr C6:7D:31:3B:0D:1D
          inet addr:10.0.0.2  Bcast:10.0.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:80 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6840 (6.6 KiB)  TX bytes:6549 (6.3 KiB)
The problem may be on the hosts side.

@mb1967 Sorry, I still can't really help you ;-)

@ hfc
Here's my dmesg after telneting into the WIZ, in case you can make anything our of it:

root@wiz:/mnt/sd/apps/telnetd# dmesg
On node 0 totalpages: 10752
  DMA zone: 84 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 10668 pages, LIFO batch:1
  Normal zone: 0 pages used for memmap
  Movable zone: 0 pages used for memmap
Calibrating delay loop... 263.78 BogoMIPS (lpj=1318912)
[Device Version]>> 1
[JB]>> 2048 : mtd->writesizetype
[JB]>> 64 : mtd->oobsize
[JB]>> 262144 : mtd->erasesize
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   262144 bytes (256 KiB)
UBI: logical eraseblock size:    258048 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "d1"
UBI: MTD device size:            128 MiB
UBI: number of good PEBs:        512
UBI: number of bad PEBs:         0
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             0
UBI: total number of reserved PEBs: 512
UBI: number of PEBs reserved for bad PEB handling: 5
UBI: max/mean erase counter: 4/1
UBI: background thread "ubi_bgt0d" started, PID 214
VFS: Mounted root (ubifs filesystem).
Freeing init memory: 152K
UBIFS: background thread "ubifs_bgt0_0" started, PID 240
mmcblk0: mmc0:b368 SDC   7830016KiB
 mmcblk0: p1
UBI: attaching mtd2 to ubi1
UBI: physical eraseblock size:   262144 bytes (256 KiB)
UBI: logical eraseblock size:    258048 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
1 vol->vol_id = 0, vol->ubi->ubi_num = 1
UBI: attached mtd2 to ubi1
UBI: MTD device name:            "d2"
UBI: MTD device size:            892 MiB
UBI: number of good PEBs:        3568
UBI: number of bad PEBs:         0
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             0
UBI: total number of reserved PEBs: 3568
UBI: number of PEBs reserved for bad PEB handling: 35
UBI: max/mean erase counter: 2/0
UBI: background thread "ubi_bgt1d" started, PID 680
UBIFS: background thread "ubifs_bgt1_0" started, PID 683
FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
MES_MLC_SetLayerPriority.829: MES_ASSERT error
usb insert....
IOCTL_SET_SOFT_DISCONNECT:
usb insert....
lf1000_udc: version 03 Jul 2007
lf1000_udc_probe: base addr = f0018000
g_file_storage gadget: File-backed Storage Gadget, version: 7 August 2007
g_file_storage gadget: Number of LUNs=1
g_file_storage gadget-lun0: ro=0, file: /dev/mmcblk0p1
g_file_storage gadget: high speed config #1
FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
IOCTL_SET_SOFT_DISCONNECT:
MES_MLC_SetLayerPriority.829: MES_ASSERT error
lf1000_udc: version 03 Jul 2007
lf1000_udc_probe: base addr = f0018000
ether gadget: using random self ethernet address
ether gadget: using random host ethernet address
usb0: OpenWiz Ethernet, version: HCF 0
usb0: using lf1000_udc, OUT ep2-bulk IN ep1-bulk
usb0: MAC c6:7d:31:3b:0d:1d
MES_MLC_SetLayerPriority.829: MES_ASSERT error
MES_MLC_SetLayerPriority.829: MES_ASSERT error
MES_MLC_SetLayerPriority.829: MES_ASSERT error
usb insert....
usb0: high speed config #1: 100 mA, OpenWiz Ethernet, using CDC Ethernet Subset
ether gadget: set_interface ignored!

I hope I could help a little at least.

rds

Kasi

#35 kasi

kasi

    GP32 Hardcore

  • Members
  • PipPipPipPip
  • 110 posts

Posted 22 December 2009 - 12:46 PM

@mb1967,

One more thing. My lsmod shows far less modules than yours:

root@wiz:/mnt/sd/apps/USBNetwork# lsmod
Module                  Size  Used by    Not tainted
g_ether 16500 0 - Live 0xbf00d000
lf1000_udc 16328 1 g_ether, Live 0xbf008000
rtc_pollux_m41t80 7408 0 - Live 0xbf005000
rtc_core 14840 1 rtc_pollux_m41t80, Live 0xbf000000

Maybe you get a conflict with one of these:
usbhid
hid
ohci_hcd
usbcore

Kasi

#36 mb1967

mb1967

    Member

  • Members
  • PipPip
  • 6 posts

Posted 22 December 2009 - 04:15 PM

@mb1967,

One more thing. My lsmod shows far less modules than yours:

root@wiz:/mnt/sd/apps/USBNetwork# lsmod
Module                  Size  Used by    Not tainted
g_ether 16500 0 - Live 0xbf00d000
lf1000_udc 16328 1 g_ether, Live 0xbf008000
rtc_pollux_m41t80 7408 0 - Live 0xbf005000
rtc_core 14840 1 rtc_pollux_m41t80, Live 0xbf000000

Maybe you get a conflict with one of these:
usbhid
hid
ohci_hcd
usbcore

Kasi


It's really a pain! I've removed the modules and the situation has not changed :(

Can you give me your md5sum of the g_ether - module? I want to check if my g_ether is corrupted.

TNX in advance!

#37 kasi

kasi

    GP32 Hardcore

  • Members
  • PipPipPipPip
  • 110 posts

Posted 22 December 2009 - 06:59 PM

kasi@mars:~> md5sum g_ether.ko

9d1be2c4f3ff1aebc1b964b3906ea003  g_ether.ko



#38 mb1967

mb1967

    Member

  • Members
  • PipPip
  • 6 posts

Posted 22 December 2009 - 09:43 PM

kasi@mars:~> md5sum g_ether.ko
9d1be2c4f3ff1aebc1b964b3906ea003  g_ether.ko


TNX!!!

Now, I give up ... my md5sum is the same ...

If you take a look into the USB-Cable-Wiz-Site-Connector - what do you see then? If you see an integrated circuit, than it's the "old" WIZ-version. My USB-Connector has only cables - no external hardware components. Maybe not only the hardware differs. GPH, I love you :angry:

#39 kasi

kasi

    GP32 Hardcore

  • Members
  • PipPipPipPip
  • 110 posts

Posted 22 December 2009 - 11:12 PM

Hi mb1967,

Sorry, that's (far) beyond my skills.
If you suspect the cable to be different, maybe andymanone could help.
But that's no help to the segmentation fault....

What about flashing the firmware to 1.1.0 and re-formating the SD just to make sure?

Have no other clue.

Kasi


#40 hcf

hcf

    GP32 User

  • Members
  • PipPipPip
  • 32 posts
  • Gender:Male
  • Location:Milpitas, CA, USA

Posted 24 December 2009 - 06:15 PM

Can you capture the corrupt/garbage dmesg output in a file on your SD card and quote it here?

My only guess is that we're looking at some kernel incompatibility (g_ether was compiled for Wiz firmware 1.1.0, but if we're looking at a kernel version difference then I would also expect the insmod to complain about a mismatch). But I'm curious to see the output in question anyway.

#41 zort

zort

    Member

  • Members
  • PipPip
  • 9 posts

Posted 27 December 2009 - 07:13 PM

hi

when i run NetworkUp.gpe from the launcher i dont see anything appearing in dmesg of my host (debian)linux

serial line works though... so i connected via kermit an tried to load the NetworkUp.gpe there ;)

this is what happens:

root@wiz:/mnt/sd/game/00-usb/USBNetwork# ./NetworkUp.gpe 
Using /lib/modules/2.6.24/kernel/drivers/usb/gadget/lf1000_udc.ko
insmod: cannot insert `/lib/modules/2.6.24/kernel/drivers/usb/gadget/lf1000_udc.ko': File exists (-1): File exists
SIOCSIFADDR: No such device
SIOCSIFNETMASK: No such device
view created...
GP2X wiz Mode...
FB_OpenMouse()
Using tslib touchscreen
Check joystick...
Killed
root@wiz:/mnt/sd/game/00-usb/USBNetwork#

ok lf1000 is in use for the serial line i guess, but how would i find out what happens when i start it through the launcher, with no usbserial loaded?
screen just flickers then i see the main menu again... it should display some debug info

any ideas?

#42 kasi

kasi

    GP32 Hardcore

  • Members
  • PipPipPipPip
  • 110 posts

Posted 27 December 2009 - 08:40 PM

Hi zort,

Thanks for helping. I think the dmesg info hcf needs is the the one on the WIZ, not the host.

If you want to know what is going on, you can try it via termula: http://dl.openhandhe...i?0,0,0,0,8,163

@all:

On the German board if have seen that there are different revisions of firmware 1.1.0. It came up as subject to the touchscreen bug.
With revision 244 or 255 the touchscreen seems to be more accurate than with the "official" revision 222. This is a test with 255:
http://www.imgbox.de.../h43151n168.jpg
Obviously GPH have done some significant modifications with the revisions that have not officially been release for updates :unsure: .
Maybe we should check our firmware revisions?
I have 222 and the USB Network works fine.
What about yours?

Kasi

#43 hcf

hcf

    GP32 User

  • Members
  • PipPipPip
  • 32 posts
  • Gender:Male
  • Location:Milpitas, CA, USA

Posted 28 December 2009 - 07:56 PM

serial line works though... so i connected via kermit an tried to load the NetworkUp.gpe there ;)


Ah, that definitely won't work. It is a combination of hardware and software (Linux "USB Gadget Interface") limitations, although a USB hardware component might be capable of presenting plural "endpoints", and it could send configuration blocks that mix and match the meaning of those endpoints, the lf1000 hardware supports only 2 endpoints (one in, one out), and even if that weren't true the Linux USB Gadget API allows at most one "gadget driver" to take control of a hardware device at a time...there is no API that dynamically assigns endpoint descriptors, the gadget drivers assign their own (usually statically in the sources).

Could you perhaps add 'dmesg > dmesg.out' to the end of your NetworkUp.gpe and try to run it after a fresh shutdown/power-on of your Wiz (this ensures the Serial gadget, or any other stray gadget is unloaded)? Then use NetworkDown.gpe (or restart your wiz), and copy the file off the SD card separately.

ok lf1000 is in use for the serial line i guess, but how would i find out what happens when i start it through the launcher, with no usbserial loaded?
screen just flickers then i see the main menu again... it should display some debug info


As there is no VTY, displaying debug info is slightly more difficult than it sounds. Not impossible, just hard enough I haven't tried...


On the German board if have seen that there are different revisions of firmware 1.1.0. It came up as subject to the touchscreen bug.
With revision 244 or 255 the touchscreen seems to be more accurate than with the "official" revision 222. This is a test with 255:
http://www.imgbox.de.../h43151n168.jpg
Obviously GPH have done some significant modifications with the revisions that have not officially been release for updates :unsure: .
Maybe we should check our firmware revisions?
I have 222 and the USB Network works fine.
What about yours?

Kasi


Ah, I am using the 1.1.0 firmware that is on the openhandhelds archive;

http://dl.openhandhe...?0,0,0,0,42,112

And the kernel sources (with only config modifications for serial gadget, and some minor source modifications (beginning of thread) for network gadget) also from openhandhelds archive;

http://dl.openhandhe...?0,0,0,0,46,151


I am not sure why the USBSerial would work, but the USBNetwork wouldn't. That is a little more mystifying.

#44 kasi

kasi

    GP32 Hardcore

  • Members
  • PipPipPipPip
  • 110 posts

Posted 29 December 2009 - 01:14 PM

Ah, I am using the 1.1.0 firmware that is on the openhandhelds archive;


AFAIK that is 222 - the same as I have.

Now it would be interesting to hear if anybody got 244 or higher with (not) working USBNetwork.

BTW, I never tried the USBSerial - didn't need it. ;)

Kasi

#45 zort

zort

    Member

  • Members
  • PipPip
  • 9 posts

Posted 29 December 2009 - 04:26 PM


Ah, I am using the 1.1.0 firmware that is on the openhandhelds archive;


AFAIK that is 222 - the same as I have.

Now it would be interesting to hear if anybody got 244 or higher with (not) working USBNetwork.

BTW, I never tried the USBSerial - didn't need it. ;)

Kasi

thx hcf for the explanation!
i found out that NetworkUP.gpe is just a shell script ;)

#!/bin/sh

# Load the g_ether module.
insmod lf1000_udc.ko
insmod ./g_ether.ko > test.log 2>&1

# Wait a few moments for things to settle.
sleep 2

# Configure the 10.0.0.2 address locally.
/sbin/ifconfig usb0 inet 10.0.0.2 netmask 255.255.255.0

# Return to GP2X default menu.
cd /usr/gp2x
exec ./gp2xmenu

so i checked test.log, its just one line there "Segmentation Fault"

and kasi: i'm using 255 firmware that was on board...

btw this is a nice and helpful tool that i found:
termula

so if the g_ether.ko module works on 222 that means someone has to compile it for the new 255 i guess...
i would try it if i had the source code ;)