Run HTML file from the SD card - Netduino Plus 2 (and Netduino Plus 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

Run HTML file from the SD card


  • Please log in to reply
11 replies to this topic

#1 Jesus

Jesus

    New Member

  • Members
  • Pip
  • 5 posts

Posted 25 April 2013 - 08:40 PM

I would like to know if there is possible to run a html file from the SD card, but this html file read/write a csv file.



#2 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 26 April 2013 - 01:18 PM

Yes if you run a web server like NeonMika on the Netduino you can serve an HTML page. Then you would need to create server side methods to write to the SD card.

#3 Jesus

Jesus

    New Member

  • Members
  • Pip
  • 5 posts

Posted 26 April 2013 - 05:18 PM

Well, I can run the html file using webwerver, but my html file has call to write/read to a csv file in the SD card, then the html file is not able to read/write to the csv file. My intention is to run the html as it is from the SD card, but looks like it is not possible.



#4 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 26 April 2013 - 06:04 PM

It is absolutely possible.  I currently do this on a Netduino Plus 2.  I am running NeonMika Web Server on the Netduino. When I go to http://192.169.1.12/settings.html this serves an HTML file from my SD Card.  When I save my settings after filling in the form it uses jquery and json to send the data from my browser to the Netduino and the code on the Netduino saves my settings to a file called Settings.cfg on the SD Card.



#5 Verdris

Verdris

    Advanced Member

  • Members
  • PipPipPip
  • 128 posts
  • LocationReno, NV

Posted 26 April 2013 - 07:11 PM

It is absolutely possible.  I currently do this on a Netduino Plus 2.  I am running NeonMika Web Server on the Netduino. When I go to http://192.169.1.12/settings.html this serves an HTML file from my SD Card.  When I save my settings after filling in the form it uses jquery and json to send the data from my browser to the Netduino and the code on the Netduino saves my settings to a file called Settings.cfg on the SD Card.

 

My mind is blown. Had no idea this was possible. Can you share a bit of your main code that calls Settings.cfg?



#6 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 26 April 2013 - 10:47 PM

Check out this project.  This is where I learned from http://diybrewerytem...r.codeplex.com/



#7 Jesus

Jesus

    New Member

  • Members
  • Pip
  • 5 posts

Posted 06 May 2013 - 07:08 PM

Hi Dave, yes, I can see the html file in the SD card runs, but my question was related if the html file itself could open/write on a csv file (it is located in the SD card also), but according with the link looks like the netduino opens the text file then it pass the values to the browser.



#8 Cuno

Cuno

    Advanced Member

  • Members
  • PipPipPip
  • 144 posts
  • LocationZürich / Switzerland

Posted 06 May 2013 - 07:31 PM

my question was ... if the html file itself could open/write on a csv file

I don't understand what you mean with that statement. A pure HTML file can never manipulate a file, because HTML is not a programming language. HTML may contain JavaScript code, but there is no JavaScript interpreter on a Netduino. So as Dave said, you need to write a server method in C# (or Visual Basic) that opens or creates a file and does the processing for whatever you want to do for reading/writing CSV values.



#9 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 06 May 2013 - 07:52 PM

Hi Dave, yes, I can see the html file in the SD card runs, but my question was related if the html file itself could open/write on a csv file (it is located in the SD card also), but according with the link looks like the netduino opens the text file then it pass the values to the browser.

Ok didn't understand the question.  I don't want to be rude, but I like to keep the topics here specifically to the Netduino (just my preference).  Since this board is about Netduinos and not Web programming I'm going to suggest that you find a board about web programming or perhaps take some basic HTML/Web courses on YouTube.  There are lots of great courses on basic ASP.NET as well as HTML, jQuery and Server Side C# with HTML/JavaScript.  A better understanding of basic client/server web interaction would certainly help you.



#10 Jesus

Jesus

    New Member

  • Members
  • Pip
  • 5 posts

Posted 17 May 2013 - 03:14 PM

Thanks Dave and Cuno for your recommendations.

I just got further with HTML/JavaScript and now I am able to have the web page running. But I have a problem, it runs well when I am debugging from C#, but when I leave it running the netduino+ itself the web page doesn't show the complete data as running from the debug.

Any recommendation?, other observation, the page run well (debug mode) on google chrome but in IE doesn't run well.



#11 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 17 May 2013 - 06:48 PM

Hi Jesus,

Any recommendation?, other observation, the page run well (debug mode) on google chrome but in IE doesn't run well.

It sounds like there may be a rendering or timing issue there. I recommend "view source" in Internet Explorer to make sure that it got the whole web page...and then you can work backwards from there. Wireshark can show you if data made it to/from the Netduino Plus 2, etc. Chris

#12 Jesus

Jesus

    New Member

  • Members
  • Pip
  • 5 posts

Posted 24 May 2013 - 02:27 AM

Thanks for your support, I make it works.






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.