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

Netduino Firmware v4.1.2 ALPHA 0


  • Please log in to reply
28 replies to this topic

#21 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 02 March 2011 - 07:03 AM

Chris: Are there plans to allow USBClient functionality at the same time as USB debugging/deployment, or will this remain a feature only usable with serial debugging/deployment?


We're looking into it, but there are a few gotchas (some on the PC side of the equation).

BTW, welcome to the Netduino community!

Chris

#22 X7JAY7X

X7JAY7X

    New Member

  • Members
  • Pip
  • 6 posts

Posted 03 March 2011 - 03:20 AM

Chris, when are you expecting to have Serial Port implementation through the USB (ie send receive data from pc via virtual serial port) and a way to store user defined variables/settings on the chip (ie like a eeprom)? These are the two features I am really waiting for before I used the Netduino for my project.

#23 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 March 2011 - 04:57 AM

Chris, when are you expecting to have Serial Port implementation through the USB (ie send receive data from pc via virtual serial port) and a way to store user defined variables/settings on the chip (ie like a eeprom)?

These are the two features I am really waiting for before I used the Netduino for my project.


Hi X7JAY7X,

We're targeting the v4.1.2 release for both of these features.

CDC (virtual serial port) is possible today if you want to roll a bit of C# code to support it. Also, we'll be posting our custom HID solution later this month (with driverless bidirectional comm support).

Chris

#24 ajcg1973

ajcg1973

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts

Posted 04 March 2011 - 03:37 AM

We'll be cooking up a number of HID examples for the new UsbClient feature.

To start with, here's a "Netduino Virtual Keyboard" sample.

Parts required:

  • Serial cable for your Netduino (FTDI 3.3V USB-TTL or an RS232 shield)
  • 7.5V-12V AC/DC adapter for your Netduino. You can also power Netduino via the VIN or 5V headers.
  • Netduino and its MicroUSB cable

Switching from USB debugging to serial debugging:
  • Grab our enhanced version of MFDeploy.
  • Run the enhanced MFDeploy. Select USB transport, and make sure your Netduino is selected.
  • In MFDeploy, select the Target Menu > Configuration > Deployment Transport
  • Switch deployment from USB to COM1. You can switch back anytime (via serial).

Using the NetduinoVirtualKeyboard sample:
  • Load the NetduinoVirtualKeyboard solution into Visual Studio like normal, but select Serial for transport (project properties > .NET Micro Framework)
  • Plug your Netduino into external power and its serial cable into your computer.
  • Run the solution (F5).
  • Once the program starts, you'll see a message to reconnect your USB cable to a PC. [Disconnect it if it's already attached, first.]
  • Windows will automatically install the HID driver for the keyboard.
  • The sample program will then type "helloworld" in the current window.

Since the Netduino will be typing, I'd recommend either plugging it into a separate computer or opening up notepad before plugging the USB cable into your computer.

Enjoy!

Chris




Here is a first run basic HID Custom Device example for a Netduino along with a small USB Console application that will display the data that is sent through USB from the Netduino. Part of the UsbConsole project contains a .NET DLL that does all of the Windows -> USB communication. I'm in the process of cleaning up the code and I hope to include the source for it in a future post.

For my test hardware I have firmware v4.1.2 ALPHA 0 firmware installed and I have a MCP9700A (http://www.microchip...ocName=en027103) Temperature Sensor on Analog Pin 0. The Netduino program reads the Analog voltage, converts it to a temperature and then sends the character bytes of the temperature to the USB host for display in a console window.

I'm going to re-work the code a bit so I can demonstrate two way USB communication using the onboard LED and switch and a simple text protocol but I wanted to get something out to the community.

Stay Tuned!

Attached Files



#25 ajcg1973

ajcg1973

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts

Posted 05 March 2011 - 07:55 AM

Here is a better USB HID custom device example as it only uses the base Netduino hardware. This example still uses the AJB_USB_DLL.dll. I hope to clean up and post the example code for it soon but at least there is really simple working example for an HID custom device.


Windows Desktop Application screen shot:
Posted Image

Let me know if you have any issues.

Attached Files



#26 David S

David S

    Member

  • Members
  • PipPip
  • 11 posts

Posted 19 March 2011 - 04:03 PM

Hi ajcg1973,

Here is a better USB HID custom device example as it only uses the base Netduino hardware. This example still uses the AJB_USB_DLL.dll. I hope to clean up and post the example code for it soon but at least there is really simple working example for an HID custom device.

Let me know if you have any issues.


I think this is pretty amazing, I've always wanted to use the USB on the netduino for communication!

I tested your sample code, but I'm getting an ArgumentException on the ConfigureUsbController method. This is where all the configuration is set, so I'm trying to find some details on what can be causing it. Here is the stack trace:

#### Exception System.ArgumentException - 0xfd000000 (1) ####
    #### Message: 
    #### Microsoft.SPOT.Hardware.UsbClient.UsbController::set_Configuration [IP: 0000] ####
    #### NetduinoUSB.HidDevice::ConfigureUsbController [IP: 017a] ####
    #### NetduinoUSB.HidDevice::StartUsbController [IP: 0023] ####
    #### NetduinoUSB.HidDevice::.ctor [IP: 0008] ####
    #### SimpleHidDevice.Program::SetupHardware [IP: 0003] ####
    #### SimpleHidDevice.Program::Main [IP: 0003] ####

Is there any place I can download the 4.1.2 alpha firmware source?

Thanks!

David

#27 ajcg1973

ajcg1973

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts

Posted 21 March 2011 - 01:50 AM

Hi ajcg1973,



I think this is pretty amazing, I've always wanted to use the USB on the netduino for communication!

I tested your sample code, but I'm getting an ArgumentException on the ConfigureUsbController method. This is where all the configuration is set, so I'm trying to find some details on what can be causing it. Here is the stack trace:

#### Exception System.ArgumentException - 0xfd000000 (1) ####
    #### Message: 
    #### Microsoft.SPOT.Hardware.UsbClient.UsbController::set_Configuration [IP: 0000] ####
    #### NetduinoUSB.HidDevice::ConfigureUsbController [IP: 017a] ####
    #### NetduinoUSB.HidDevice::StartUsbController [IP: 0023] ####
    #### NetduinoUSB.HidDevice::.ctor [IP: 0008] ####
    #### SimpleHidDevice.Program::SetupHardware [IP: 0003] ####
    #### SimpleHidDevice.Program::Main [IP: 0003] ####

Is there any place I can download the 4.1.2 alpha firmware source?

Thanks!

David



Couple of things. First, you need to make sure that you have the 4.1.2 alpha firmware installed on the Netduino, which it sounds like you already do. Second, you need to make sure that you are connecting to your Netduino with a serial debug connection and not the usb debug connection. Lastly, you need to make sure that you are powering the Netduino with an external power source and not through USB - keep the USB cable disconnected until you are prompted by the Netduino. When the Netduino is ready to enumerate it will ask you to plug in the USB cable (In the Debug Window). Once you plug in the Netduino, if it enumerates correctly it will then print out an USB connected message.


If all of the above conditions are true then please step through the code and post the code where the error is being generated so we can help further. Just looking at the exception, it looks like you might be using the USBController for USB debugging and therefore its index is already in use but that is just a guess at this point.

As far as the source, I haven't downloaded any of the Netduino source files so I'm not sure. Send Chris Walker (Neduino Moderater) a private message and he will either email it to you or send you a link.

#28 David S

David S

    Member

  • Members
  • PipPip
  • 11 posts

Posted 21 March 2011 - 08:40 PM

Thanks, indeed I was using the USB for debugging. That might explain :)

#29 Osi

Osi

    New Member

  • Members
  • Pip
  • 3 posts

Posted 20 October 2011 - 06:09 AM

Hi Chris,

I'm really interested in how to create a composite USB device. I mean a mouse and a keyboard emulation with Netduino.
Could you provide a sample please?

Thanks,
Mark

Hi FelixEmman,


The UsbClient feature lets you turn your Netduino into a USB device (keyboard, mouse, joystick, or custom). Yes, you could probably turn your Netduino into a Mass Storage Device and access its SD card from a PC--although that may or may not require a little bit of native code as well.

Another nice feature of the Netduino's microcontroller is that it has 5 USB endpoints available. So you could make a "composite" (combination) device. A keyboard + mouse hybrid. Or a CDC serial port + Visual Studio debugging. Or get really creative...

Chris






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.