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 happened to the following...?


  • Please log in to reply
9 replies to this topic

#1 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 27 November 2010 - 01:18 AM

I am trying to retrieve xml or text from a website. How can I do this using the netduino plus' System.Net ? With a regular C# app I have several options such as System.Xml, HttpWebRequests... so on.is it possible on the netduino plus? is there Xml support for the plus that I am not aware of?

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 27 November 2010 - 01:24 AM

XML may be possible, but it's generally too big for a small board like Netduino. HttpWebRequests are there. You'll need to use the 64KB firmware and pull in the System.Http assembly. Linq is not supported by .NET Micro Framework as there are no generics (although some people have successfully got an alternative form of Linq up and running). Chris

#3 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 27 November 2010 - 03:04 AM

XML may be possible, but it's generally too big for a small board like Netduino.

HttpWebRequests are there. You'll need to use the 64KB firmware and pull in the System.Http assembly.

Linq is not supported by .NET Micro Framework as there are no generics (although some people have successfully got an alternative form of Linq up and running).

Chris


Which the 64KB firmware :unsure: ? I imagine its not the regular N+ firmware because I can't find the System.Http namespace

EDIT:

:huh: I found the System.Http but I no no HttpWebRequest

EDIT:

HttpWebRequest is in System.Net ? thats odd, before it wasn't well I found all that now... lets see if I can get this working. Thanks for the help Chris!

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 27 November 2010 - 06:30 AM

Which the 64KB firmware :unsure: ? I imagine its not the regular N+ firmware because I can't find the System.Http namespace


Here you go. This new "64KB" firmware will be shipping on all production Netduino Pluses.
http://forums.netdui...ore-code-space/

:huh: I found the System.Http but I no no HttpWebRequest

EDIT:

HttpWebRequest is in System.Net ? thats odd, before it wasn't well I found all that now... lets see if I can get this working. Thanks for the help Chris!


The System.Net.HttpWebRequest class is in the System.Http.dll assembly. Perhaps they should have called it System.Net.Http.dll to clarify :)

Chris

#5 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 27 November 2010 - 02:23 PM

Here you go. This new "64KB" firmware will be shipping on all production Netduino Pluses.
http://forums.netdui...ore-code-space/

Chris

I have the latest one, v4.1.1 ALPHA 3 . Is there a reason why I need the one you linked, other than more space?

EDIT:
I just got an OutofMemory exceptions ... guess that 64KB is sounding pretty good right now :D

I am trying to get info from a website right now, and it would help if I had more space, i guess I'll have to chop stuff up into little pieces.

#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 27 November 2010 - 06:29 PM

I have the latest one, v4.1.1 ALPHA 3 . Is there a reason why I need the one you linked, other than more space?


The System.Http.dll is pretty big. You can fit it in your app with the old 48KB firmware, but it doesn't leave much room for rich code.

I just got an OutofMemory exceptions ... guess that 64KB is sounding pretty good right now :D


Be careful when downloading web content. Devices like Netduino have dozens of KB, not thousands of MB. You'll need to process the web page in small chunks. The 64KB firmware will add additional code space to store your code, but it can't give your Netduino MBs of RAM :)

Working with web content on these small devices is very do-able, but one needs to "think small" when one works with data in memory.

Chris

#7 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 27 November 2010 - 06:37 PM

The System.Http.dll is pretty big. You can fit it in your app with the old 48KB firmware, but it doesn't leave much room for rich code.



Be careful when downloading web content. Devices like Netduino have dozens of KB, not thousands of MB. You'll need to process the web page in small chunks. The 64KB firmware will add additional code space to store your code, but it can't give your Netduino MBs of RAM :)

Working with web content on these small devices is very do-able, but one needs to "think small" when one works with data in memory.

Chris


yeah I am trying to figure out how to use the stream reader correctly to read 18 bytes of data at a time, what I am doing is getting some weather data from a xml weather feed, and I need to parse out the temperatures. its a nice little project for the plus, and I need to buy one of those 16x2 LCDs to show the data. but first I need this to work! getting close thought, I am almost there...

#8 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 27 November 2010 - 06:58 PM

strings dont have the .Contains method? thats nuts! its soooooooo useful... ugh I might have to use what I learned in Computer Science class and make my own Contains method <_< .NET MF is micro indeed.

#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 27 November 2010 - 06:59 PM

strings dont have the .Contains method? thats nuts! its soooooooo useful... ugh I might have to use what I learned in Computer Science class and make my own Contains method <_< .NET MF is micro indeed.


Are you going to create it as an extension method...and then you can use the same code on your PC and Netduino?

Chris

#10 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 27 November 2010 - 07:23 PM

Are you going to create it as an extension method...and then you can use the same code on your PC and Netduino?

Chris

I fixed it. It works now, I'll post the code so other people (that have a text output other than Debug.Print) can use it. You can check out what I did in the code I post/




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.