What is UsbClient? - Netduino 2 (and Netduino 1) - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

What is UsbClient?


  • Please log in to reply
20 replies to this topic

#1 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 29 July 2010 - 04:35 AM

[This thread was in regards to the initial Netduino v4.1.0.0 firmware -- but focused on UsbClient functionality. The firmware has been updated, but the remainder of the thread remains.]

#2 holger

holger

    New Member

  • Members
  • Pip
  • 1 posts

Posted 04 August 2010 - 09:34 AM

Hi, what does it mean that it has UsbClient functionality. Is this just the interface for Visual Studio programming (downloading, debugging) or does it connect to every pc and provides communication over USB without having visual studio? Is this a virtual COM port over USB? If not, then I miss the possibility to commnicate with every PC like the Arduino does it over virtual COM... Sincerely Holger

#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 04 August 2010 - 01:48 PM

Hi,
what does it mean that it has UsbClient functionality. Is this just the interface for Visual Studio programming (downloading, debugging) or does it connect to every pc and provides communication over USB without having visual studio?
Is this a virtual COM port over USB?
If not, then I miss the possibility to commnicate with every PC like the Arduino does it over virtual COM...


Holger,

UsbClient functionality allows you to turn the Netduino into a custom USB device. You can deploy/debug over serial instead of USB (via pins D0/D1 and a USB-to-TTL cable or an RS232 shield). Then you can make your Netduino into an HID keyboard (and interact with your iPad via the camera dock) or almost any other type of custom USB device.

Would it be helpful to create a CDC project (so that the Netduino would create a virtual serial port with the PC that you could use in your program--possibly at the same time you're deploying/debugging your code)? An HID project--complete with code for the PC side--that would let you send/receive data from a Netduino without need for any drivers? What would you folks like to see?

Thanks for your enthusiasm, and welcome to the community!

Chris

#4 jeremy

jeremy

    Member

  • Members
  • PipPip
  • 23 posts

Posted 05 August 2010 - 02:53 PM

Holger,

UsbClient functionality allows you to turn the Netduino into a custom USB device. You can deploy/debug over serial instead of USB (via pins D0/D1 and a USB-to-TTL cable or an RS232 shield). Then you can make your Netduino into an HID keyboard (and interact with your iPad via the camera dock) or almost any other type of custom USB device.

Would it be helpful to create a CDC project (so that the Netduino would create a virtual serial port with the PC that you could use in your program--possibly at the same time you're deploying/debugging your code)? An HID project--complete with code for the PC side--that would let you send/receive data from a Netduino without need for any drivers? What would you folks like to see?

Thanks for your enthusiasm, and welcome to the community!

Chris


A HID or CDC example would be useful. Since SW1 already controlls the bootloader would it be possible to use a GPIO pin to have a board start up in either "Normal" USB mode or custom USB mode. This would avoid having to deploy via serial, although I understand we would lose debug via serial that way.

#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 05 August 2010 - 03:52 PM

A HID or CDC example would be useful. Since SW1 already controlls the bootloader would it be possible to use a GPIO pin to have a board start up in either "Normal" USB mode or custom USB mode. This would avoid having to deploy via serial, although I understand we would lose debug via serial that way.


Cool idea! Maybe someone could make a patch file for the source which would enable this (so other users wouldn't have to avoid using those specific pins or have to disconnect wires to get into the proper mode in non-USB applications...)

#6 ajcg1973

ajcg1973

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts

Posted 27 August 2010 - 09:27 PM

Cool idea! Maybe someone could make a patch file for the source which would enable this (so other users wouldn't have to avoid using those specific pins or have to disconnect wires to get into the proper mode in non-USB applications...)


Has there been any progress on any USB samples (not that there aren't a 1000 things on your plate already I'm sure)? I have the latest version of the serial based firmware working so I can turn the Netduino into a USB HID device but I have been unable to get it working. I'm working off of the Mouse example from the .Net Micro Framework SDK and everything will compile and deploy but Windows 7 x64 is unable to enumerate the device. Thanks for any help anyone might be able to give...---AJB

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 27 August 2010 - 09:37 PM

Has there been any progress on any USB samples (not that there aren't a 1000 things on your plate already I'm sure)? I have the latest version of the serial based firmware working so I can turn the Netduino into a USB HID device but I have been unable to get it working. I'm working off of the Mouse example from the .Net Micro Framework SDK and everything will compile and deploy but Windows 7 x64 is unable to enumerate the device. Thanks for any help anyone might be able to give...---AJB


We're working on it. Current target is September (along with the 4.1.1 update).

#8 ajcg1973

ajcg1973

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts

Posted 14 September 2010 - 05:30 AM

We're working on it. Current target is September (along with the 4.1.1 update).



Chris, I know you are going to kill me but I'm really dying for the UsbClient update! Is September still looking good for the latest release? Thanks.---AJB

#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 September 2010 - 05:34 AM

Working on it... We have the desktop code done--and most of the code done for the .NET MF device....but we are working through the USB communication details. Chris

#10 tobsen

tobsen

    New Member

  • Members
  • Pip
  • 4 posts

Posted 24 September 2010 - 09:03 PM

Working on it... We have the desktop code done--and most of the code done for the .NET MF device....but we are working through the USB communication details.

Chris


Great news! I really hope to have USB communication with the .netduino- [= the one without ethernet/microSD] soon. Thanks for keeping us updated.

#11 Jose Torres

Jose Torres

    New Member

  • Members
  • Pip
  • 9 posts

Posted 19 October 2010 - 09:19 PM

Hey Chris, Would you kindly provide an official update on your progress with the device code? I'd love to help develop but don't want to work on something that you will release an update for soon. Thanks!

#12 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 October 2010 - 09:28 PM

Would you kindly provide an official update on your progress with the device code? I'd love to help develop but don't want to work on something that you will release an update for soon.


We'd love the help!

Here's our status:
1. We've finished the HID code (for the desktop side and the client side).
2. There's a bug in the Atmel .NET MF USB code which is causing issues with some endpoints/reports. We can get data from the device to the PC--but there's a glitch keeping data from moving from the PC to the device. And sometimes enumeration gets a bit wonky (which we're also looking into).

There are a few of us hacking away at it. If you'd like to help, we could create a thread where we all pitch in with our findings and dig in. Please note that you'll have to reflash your Netduino to work in serial mode (and use an RS232 shield or a USB-UART cable) while working on the code.

Once the Atmel UsbClient functionality is working both ways properly, we'll test and post the HID bi-directional communication code. It's pretty cool--no drivers required at all. We've tested it on some high-end .NET Micro Framework boards and it works flawlessly.

Chris

#13 Jose Torres

Jose Torres

    New Member

  • Members
  • Pip
  • 9 posts

Posted 19 October 2010 - 10:42 PM

Yo Yo! Thanks for the update. Will UsbClient functionality be limited to HID? Like I said before, I'd love to help. So, if you'd like to do the honors and start a thread. I'll be all over it! :) Just need the deets on how to get started.

#14 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 October 2010 - 10:48 PM

Will UsbClient functionality be limited to HID?


Nope, UsbClient will let you create a whole variety of USB devices. Like a virtual serial port (CDC) if you prefer (or a keyboard/mouse, etc.)

Like I said before, I'd love to help. So, if you'd like to do the honors and start a thread. I'll be all over it! :)

Just need the deets on how to get started.


I'll be happy to start a thread... Are you comfortable hacking on the C++ side of the .NET MF firmware? Have you worked with low-level USB details (enumeration, reports, etc.) before?

Chris

#15 freds

freds

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts

Posted 20 October 2010 - 05:03 PM

We'd love the help!

Here's our status:
1. We've finished the HID code (for the desktop side and the client side).
2. There's a bug in the Atmel .NET MF USB code which is causing issues with some endpoints/reports. We can get data from the device to the PC--but there's a glitch keeping data from moving from the PC to the device. And sometimes enumeration gets a bit wonky (which we're also looking into).

There are a few of us hacking away at it. If you'd like to help, we could create a thread where we all pitch in with our findings and dig in. Please note that you'll have to reflash your Netduino to work in serial mode (and use an RS232 shield or a USB-UART cable) while working on the code.

Once the Atmel UsbClient functionality is working both ways properly, we'll test and post the HID bi-directional communication code. It's pretty cool--no drivers required at all. We've tested it on some high-end .NET Micro Framework boards and it works flawlessly.

Chris


I did a bit more research and found that there's a mismatch between the implied capabilities for USB Client under the framework and the actual capabilities of the processor chip for the netduino and others.

Depending on the mix of HID/serial devices you can basically only have two possibly three devices as the processor only supports five USB endpoints one of which one is the master control endpoint.

So it might be possible to have a serial port and keyboard, but not two serial ports as each serial port requires three end points Interrupt, bulk in and bulk out. Where as a simple keyboard or mouse needs one endpoint for interrupt.

Some types of hardware have pre-allocated endpoint types, so a simple a linier allocation of end port numbers does not work.

#16 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 21 October 2010 - 06:49 AM

Depending on the mix of HID/serial devices you can basically only have two possibly three devices as the processor only supports five USB endpoints one of which one is the master control endpoint.


Just to clarify, the AT91SAM7X microcontroller supports 6 endpoints (0 = control endpoint, 1-5 can be used as application endpoints). Or am I maybe reading the datasheet incorrectly?

Chris

#17 freds

freds

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts

Posted 21 October 2010 - 10:42 PM

Just to clarify, the AT91SAM7X microcontroller supports 6 endpoints (0 = control endpoint, 1-5 can be used as application endpoints). Or am I maybe reading the datasheet incorrectly?

Chris

Sorry Chris brain fade on my part when I mentioned five endpoints.

In the manual in page 447 they do show six end points and what they can be used for, obviously end point zero is the master control end point for the device leaving five for the application device so technically you could have a compound device with one serial, one mouse and one keyboard as the mouse and keyboard by default only use an interrupt endpoint.

Still one endpoint short to do two serial ports on the netduino chip, unless we can do something non-standard and share the interrupt port between two serial ports (it will probably go tilt if we try it.)

#18 Dean

Dean

    New Member

  • Members
  • Pip
  • 1 posts

Posted 07 December 2010 - 02:27 PM

Hi Guys, Was just wondering where you are up to with this? I have just received my Netduino plus and would like to make a HID device once I have found my way around developing with it :) Thanks Dean

#19 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 07 December 2010 - 09:28 PM

Was just wondering where you are up to with this?


Hi Dean,

Right now we're waiting on a bugfix from Microsoft/Atmel. We're working on the extended I2C features right now, but after that we will be digging into the bug as well.

Chris

#20 glober

glober

    New Member

  • Members
  • Pip
  • 4 posts

Posted 07 July 2013 - 03:38 PM

Hi, is there any progress on this feature? I wonder if it is possible to at least run this feature to get data out from netduino into windows app through the built in microusb port?

 

Thanks






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.