Leave it to Microsoft to shoot down neat project ideas. I decided to get stuck into the Ethernet (and the HTTP and TCP/IP) protocols so I could make an embedded webserver using the USBKEY, with the Ethernet data being transmitted to the computer over USB using the Ethernet subclass of the CDC class.
Well, as usual, Microsoft doesn’t want to play ball. I’ve been trying to make all my MyUSB demos platform agnostic, but I’m in a bit of a bind. Microsoft haven’t implemented the Ethernet subclass of the CDC standard class, nor have they implemented the newer EEM CDC subclass. Instead they’ve gone and developed their own “RNDIS” subclass which contains proprietary extentions.
That makes perfect sense. Why implement a standard defined class, so defined as to promote platform and driver independence? Why not go for a slightly different method instead, breaking compatibility with the existing defined subclass that everyone else supports?
That puts me into a bind. I have several options:
1) Give Windows the finger, and develop for the standard EEM or Ethernet subclass. Require someone to write a EEM or Ethernet CDC subclass driver to make the demo compatible with Windows (note, these exist, but the rubbish “Jungo” company wants $4000 for a developer’s licence).
2) Ignore the standard and all other OSes, and develop a demo for Microsoft’s proprietary standard. Make the demo compatible with Windows, but not work on any other OS (unless the Linux developers have made a RNDIS driver).
3) Forget it, and concentrate on other things. Get back to writing my book, or developing other demos/parts of the MyUSB library.
4) Develop two demos with identical functionality, but using the different standards. This one doesn’t really appeal to me.
5) Make one demo, with dual standards - either via a compile time option, or some other method. I’d just expose both standards via the descriptor and let the OS sort it out, but Windows has a habit of not loading its native drivers for any compliant device that also contains non-standard interfaces.
I guess I’ll put it to public vote. Which option should I take?
EDIT: Some people are wondering about the utility of an embedded Ethernet webserver running over USB. I see two reasons to write it:
1) Because I can, and because it would serve as a demo for the CDC EEM class standard.
2) Because it would provide a more modern configuration interface to a complicated device. Think of it as a replacement for configuration via serial terminals - this way the user can configure the device over USB with nothing more than a standard web browser.
May 7th, 2008 at 8:51 pm
I don’t tend to use windows much, though I wasn’t even aware there was an ethernet CDC subclass and would probably be unlikely to use it. Then again I’d never even heard of a Communications Device Class until I read about them on your blog around 3 months ago.
That aside I can’t wait to read the book and an embedded webserver would be pretty sweet.
May 8th, 2008 at 12:45 am
I don’t use windows, then the best option for me is 1.
Give windows the finger!
May 8th, 2008 at 8:32 pm
What I prefer in this situation is 3, forget it.. do you really need a webserver? It seems pretty pointless to me since you are plugged into a computer that could run the webserver itself.
Or is it going to run in host mode and talk to a usb->ethernet converter? That seems a lot more useful. Then I don’t think you care about windows since there is no OS involved.
May 9th, 2008 at 8:54 am
You should implement the RNDIS class, Dean. It’s standard on all Windows machines which would give you plug-and-play capabilities for a very wide audience.
The RNDIS interface is actually easier to implement than the Ethernet CDC class. It keeps both endpoints of the ‘Ethernet’ connection on the PC so your USB device won’t have to actually deal with a virtual Ethernet MAC. Plus I’m pretty sure RNDIS exists in Linux too.
Keep in mind that there’s a lot of code that will need to ride on top of this for it to work. You’re going to need a TCP/IP stack with a DHCP server, a web server, and potentially some sort of file system (for HTML and graphics files). After your USBKEY enumerates and gives out an IP address it’s likely going to result in all of your Internet traffic being rerouted through it, so Internet communications will stop working.
May 27th, 2008 at 5:13 am
Beware RNDIS. Its specs are incomplete and broken. I’d go for CDC Ethernet since it’s widely supported. EEM isn’t (yet).