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

AutoPlay Feature - Netduino Plus 2

autoplay usb

Best Answer JerseyTechGuy, 12 January 2013 - 07:02 PM

You are looking at the Netduino as a remote storage device and this is not what the Netduino is.  When the Netduino is powered, the application stored on the Netduino is running.  If the app is written to run in loop mode it continues to execute without end.  If there is no loop the application will run when powered up and run to it's end.

 

You can run something like the NeonMika web server on the Netduino which will host a webpage that a user can access via the Netduino's IP or NetBios name.  This web application can then allow a user to make changes on the webpage and submit the pages which use jquery and .NET to receive and store the settings and update the settings.xml file.

 

I am not sure what exactly you are looking to accomplish, but this sounds like the solution you may be looking for.

Go to the full post


  • Please log in to reply
19 replies to this topic

#1 skobyjay

skobyjay

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 12 January 2013 - 05:01 PM

Hello,

 

I apologize if this is a newb question.

 

Is it possible to have a Netduino execute an "AutoPlay" (similiar to having an auto.inf on a cd or usb stick) feature when connected to a PC?

 

I'm ultimately wanting to launch an HTML file hosted on the SD card or even launch a windows application hosted on the SD card so the user can make changes to the predefined settings xml file on the SD card. is this possible? I would prefer to have it hosted on the SD card for the Netduino so the user doesn't have to install anything on their PC.

 

Am I asking for too much here?



#2 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 12 January 2013 - 07:02 PM   Best Answer

You are looking at the Netduino as a remote storage device and this is not what the Netduino is.  When the Netduino is powered, the application stored on the Netduino is running.  If the app is written to run in loop mode it continues to execute without end.  If there is no loop the application will run when powered up and run to it's end.

 

You can run something like the NeonMika web server on the Netduino which will host a webpage that a user can access via the Netduino's IP or NetBios name.  This web application can then allow a user to make changes on the webpage and submit the pages which use jquery and .NET to receive and store the settings and update the settings.xml file.

 

I am not sure what exactly you are looking to accomplish, but this sounds like the solution you may be looking for.



#3 skobyjay

skobyjay

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 12 January 2013 - 10:06 PM

Hi Dave, thanks for the quick response.

 

 I think you described what i'm hoping to accomplish perfectly. I have a few more questions:

 

1) would this solution require that the user is connected to a network?

2)  Is there a way to auto launch (like in a console or windows app I would just use Process.Start()) the webpage that the NeonMika web server would host? I'm trying to minimize the steps required by a user such as having them find the IP for the Netduino and browse to it in a browser manually.

 

My backup plan would be to build a WPF windows app and equip my module with a FTDI Basic Breakout - 3.3V and use serial communction to update the XML file. I'm trying to do this to give the best user experience.  



#4 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 13 January 2013 - 01:33 AM

Hi Dave, thanks for the quick response.

 

 I think you described what i'm hoping to accomplish perfectly. I have a few more questions:

 

1) would this solution require that the user is connected to a network?

2)  Is there a way to auto launch (like in a console or windows app I would just use Process.Start()) the webpage that the NeonMika web server would host? I'm trying to minimize the steps required by a user such as having them find the IP for the Netduino and browse to it in a browser manually.

 

My backup plan would be to build a WPF windows app and equip my module with a FTDI Basic Breakout - 3.3V and use serial communction to update the XML file. I'm trying to do this to give the best user experience.
 

 

1) Yes, the device would need to be connected either with the build in Ethernet or via an addon WiFly Shield.  The user would access the Netduino over the network.

 

2) If the Netduino has an IP of 192.168.1.2 and a Netbios name of MyNetduino, they would be able to connect to it on the same network by typing http://192.168.1.2/index.html or http://MyNetduino/index.html.

 

You certainly can use an FTDI board and serial communication for this also.  My Pandora's Box project uses a Windows app to set the time on the Netduino and make server other changes and inquiries to the board via serial communication over a Mini USB Cable.  This seemed like the most logical way of communicating with Pandora's Box given the clients we'll market to.  On another project I am specifically using the Ethernet because they may want to connect to the device via the network because they may have more than one device, but then I am also creating a controller box that they connect to the Netduino via an Ethernet Crossover Cable.  The controller also has a Netduino in it.  It will do adhoc communication between the controller and the end product without the need for a PC.  So I am using two different scenarios on two different projects based on the target users and its usage plan.



#5 skobyjay

skobyjay

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 13 January 2013 - 02:54 AM

Okay cool, thanks for the indept responses. I really appreciate it. I will let you know what I end up doing to accomplish my goal.



#6 skobyjay

skobyjay

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 19 January 2013 - 02:42 AM

You are looking at the Netduino as a remote storage device and this is not what the Netduino is.  When the Netduino is powered, the application stored on the Netduino is running.  If the app is written to run in loop mode it continues to execute without end.  If there is no loop the application will run when powered up and run to it's end.

 

You can run something like the NeonMika web server on the Netduino which will host a webpage that a user can access via the Netduino's IP or NetBios name.  This web application can then allow a user to make changes on the webpage and submit the pages which use jquery and .NET to receive and store the settings and update the settings.xml file.

 

I am not sure what exactly you are looking to accomplish, but this sounds like the solution you may be looking for.

 

Dave, Question, I'm running the latest firmware on my ND Plus 2, The Mika webserver doesn't seem to work out of the box for me, lots of build errors. Do you know of any examples or references that have actual working examples for the Mika webserver?



#7 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 19 January 2013 - 03:18 AM

Dave, Question, I'm running the latest firmware on my ND Plus 2, The Mika webserver doesn't seem to work out of the box for me, lots of build errors. Do you know of any examples or references that have actual working examples for the Mika webserver?

 

If you run the ND+2 version (From the NeonMika thread post #91) it works right out of the box.  I actually did an install tonight to work on a new project.  Took the WebServer solution, built and deployed it (after having changed the IP address and other network settings in the program.cs file). After typing the IP in my browser the command webpage came right up showing all the commands you can run.



#8 skobyjay

skobyjay

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 19 January 2013 - 03:58 AM

do you have the link to post 91? I can't seem to find it...



#9 skobyjay

skobyjay

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 19 January 2013 - 04:07 AM

when I download the zip from http://neonmikawebserver.codeplex.com/

 

I get a zip with folders called "executable", and "framework" among others.

 

The project in builds but is referencing 4.1 not the 4.2 MF.



#10 skobyjay

skobyjay

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 19 January 2013 - 04:18 AM

not sure what I"m doing wrong, I downloaded  and opened the soution in location

 

NeonMika.WebserverExecuteableNeonMikaWebserver

 

it builds but is using the 4.1 framework not 4.2, if I update the projects in the soution to be 4.2 I'm getting alot of build errors. where is the "WebServer" solution you are referencing?



#11 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 19 January 2013 - 08:57 AM

do you have the link to post 91? I can't seem to find it...

Here's the link.  http://forums.netdui...e-5#entry41337.

 

 

when I download the zip from http://neonmikawebserver.codeplex.com/

 

I get a zip with folders called "executable", and "framework" among others.

 

The project in builds but is referencing 4.1 not the 4.2 MF.

As I mentioned several times, post 91 in the thread above contains a modified version for ND+2 for the 4.2 framework.  The version on the codeplex site has not been updated by Markus yet.

 

not sure what I"m doing wrong, I downloaded  and opened the soution in location

 

NeonMika.WebserverExecuteableNeonMikaWebserver

 

it builds but is using the 4.1 framework not 4.2, if I update the projects in the soution to be 4.2 I'm getting alot of build errors. where is the "WebServer" solution you are referencing?

 

As mentioned above there is a different version for ND+2 on the 4.2 framework.  You are getting build errors because the code needs to be changed. There are changes from Version 4.1 to 4.2.  You may want to become more familiar with the 4.2 Micro Framework as well as the 4.2.x.x DLLs from Secret Labs for the ND+2



#12 skobyjay

skobyjay

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 19 January 2013 - 01:59 PM

Awesome, thanks for the link Dave. I definitely need to learn more about the MF. Been living in the Web and Windows world too long.

#13 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 19 January 2013 - 02:22 PM

Awesome, thanks for the link Dave. I definitely need to learn more about the MF. Been living in the Web and Windows world too long.

 

Keep us posted of your progress.  Always like to hear success stories.



#14 skobyjay

skobyjay

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 19 January 2013 - 09:55 PM

I'm really pulling the newb questions today, but what are the LE and BE folders in the BIN folder with the DLL's? I had to copy those along with my DLL's for the Webserver references. I have tried to Google but no luck...



#15 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 19 January 2013 - 11:36 PM

I'm really pulling the newb questions today, but what are the LE and BE folders in the BIN folder with the DLL's? I had to copy those along with my DLL's for the Webserver references. I have tried to Google but no luck...

 

Answered by Mr. Walker many moons ago in this post.

 

http://forums.netdui...exttext/?p=1013



#16 Lunddahl

Lunddahl

    Advanced Member

  • Members
  • PipPipPip
  • 152 posts
  • LocationEurope, Denmark

Posted 20 January 2013 - 12:29 PM

And the current hardware based on STM Cortex MCU's is also Little Indian.

 

Just for the reference...:-)



#17 skobyjay

skobyjay

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 23 January 2013 - 02:28 AM

If you run the ND+2 version (From the NeonMika thread post #91) it works right out of the box.  I actually did an install tonight to work on a new project.  Took the WebServer solution, built and deployed it (after having changed the IP address and other network settings in the program.cs file). After typing the IP in my browser the command webpage came right up showing all the commands you can run.

 

Hi Dave, Sorry to ping you again. I guess i'm the only person in the world that thinks the NeonMika webserver is not easy to get up and running. It looks like its running but when I try to go to the IP in the debug window, I get "connection reset" or "taking too long to respond". I have attached a screen shot of what I'm seeing. I get the NeonMika webserver sending response back. I have looked at the code plex site and it looks like the little code examples that were there are gone now. I remember seeing examples before. Anyways, I have found the most basic of webserver examples and can get the ND to send back content responses to the browser. Any ideas?

 

 

 

Posted Image



#18 skobyjay

skobyjay

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 23 January 2013 - 02:52 AM

If I have DHCP disabled it looks like it launches but didn't respond. If I have DHCP enabled I get the message below.

 

Webserver is running on 0.0.0.0 /// DHCP: True

A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll

Exception was thrown: System.Net.Sockets.SocketException

A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll

Exception was thrown: System.Net.Sockets.SocketException

A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll

Exception was thrown: System.Net.Sockets.SocketException

A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll

Exception was thrown: System.Net.Sockets.SocketException



#19 skobyjay

skobyjay

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 23 January 2013 - 04:07 AM

Nevermind, I HAVE NO CLUE what I did wrong in my application but ended up getting the line below to work. I created a new project and add the WebServer reference and that one line of code and it started working.

 

What I'm really confused about is I had to abandon my first project because it started saying "hardware error: check your device", this error came up after adding and removing references several times and I couldn't resolve so I started another project and its working.

 

 Server WebServer = new Server(PinManagement.OnboardLED, 80, true);


#20 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 23 January 2013 - 11:32 AM

Nevermind, I HAVE NO CLUE what I did wrong in my application but ended up getting the line below to work. I created a new project and add the WebServer reference and that one line of code and it started working.

 

What I'm really confused about is I had to abandon my first project because it started saying "hardware error: check your device", this error came up after adding and removing references several times and I couldn't resolve so I started another project and its working.

 

 Server WebServer = new Server(PinManagement.OnboardLED, 80, true);

Probably a mis-matched reference.  Im sure if you give it a day or so and go back and look at the references and versions it will jump right out at you.







Also tagged with one or more of these keywords: autoplay, usb

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.