I've been working on a networking stack for the CE called Nanotube. It's based on lwIP, an open-source networking stack designed for embedded systems. It uses the USB port and a USB ethernet adapter to send ethernet packets directly, with no host computer involved.

So far, I've been able to get a file off my webserver over HTTP using the example HTTP client provided with lwIP. I don't have any fancy screenshots of this happening, as I'm logging to an appvar rather than the screen.

Currently, basically everything about the device has to be manually configured. lwIP includes DHCP, but it crashes whenever I try to use it. I'll try to fix that in the future, but the issue has been difficult to debug. You also have to specify a MAC address, MTU, USB configuration number, in and out endpoints, and the relative address of any alternate interfaces that must be selected. I'm currently working on properly parsing USB descriptors so that these can be detected automatically.

The program is also quite large - it's 85KB uncompressed. This makes it inconvenient to use in actual programs. It's also currently statically linked, so you would have to include it in your own programs in order to use it. I'm not really sure how to fix this - ideally, I would make it a dynamically linked library, and libload would relocate the code section to flash and relocate the BSS section to memory the way it currently does with the code of existing libraries.

I'm currently focusing on parsing the USB descriptors, but I only have one device to test it with. If anyone has a USB ethernet device, could you please DM me the USB descriptors (either in raw hex or the output of lsusb -v) so I can make sure my descriptor parser works?

The code is available on GitHub, though you'll have to change several options about your USB ethernet device for it to work.
Nice project Smile

I have access to some USB Ethernet adapters, but they're in a closet at my work place, and it's going to be several more weeks before I return there, presumably. If I do an unplanned trip there for some reason, I'll borrow one to post the information you're looking for.
I've used Nanotube to make a CE IRC demo. For more details, check out my other post.
Here are the USB descriptors from the network adapter I have access to:

# lsusb -v -d 0fe6:9700

Bus 004 Device 003: ID 0fe6:9700 ICS Advent DM9601 Fast Ethernet Adapter
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x0fe6 ICS Advent
  idProduct          0x9700 DM9601 Fast Ethernet Adapter
  bcdDevice            1.01
  iManufacturer           0
  iProduct                2 USB 2.0 10/100M Ethernet Adaptor
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0027
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              120mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass         0
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum