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

Running out of memory


  • Please log in to reply
11 replies to this topic

#1 CalumCawley

CalumCawley

    New Member

  • Members
  • Pip
  • 3 posts

Posted 18 March 2011 - 04:06 PM

Hello all, Im currently developing a project using a netduino plus and seem to be running into a brick wall with regards to memory. I can get all of my project to run correctly apart from a http POST transaction. Before the transaction (which sends around 1k of data) I have 15k of ram free and im running out of memory when the HttpWebResponse is closed. Is there any secret way of optimising this task or am i simply asking too much of the netduino? It's looking increasingly likely that I'll have to look into some other hardware. Would any of the smaller FEZ boards be much of an addition or would i need to find something a bit beefier?

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 18 March 2011 - 06:58 PM

Hi Calum, Have you thought about adapting the SocketClient sample--and posting the data that way? Alternatively you can always buy an Arduino Ethernet Shield, reflash your Netduino Plus with "regular Netduino" firmware, and offload all the TCP processing to the shield. But you'll be back to using sockets... Chris

#3 KodeDaemon

KodeDaemon

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 18 March 2011 - 09:04 PM

I would say your best option would be using sockets as Chris stated. A current project I'm working on is using sockets and I'm able to send megs of data without memory issues.

#4 CalumCawley

CalumCawley

    New Member

  • Members
  • Pip
  • 3 posts

Posted 18 March 2011 - 09:47 PM

Thanks for the tips guys, I'll have a play around with sockets tomorrow and see what I can come up with. I'm on a fairly tight schedule with this so dont really have time to mess about with an ethernet shield but from what I've seen the next step up hardware wise seems to be the FEZ cobra which is a monster compared to the netduino!

#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 18 March 2011 - 09:53 PM

Thanks for the tips guys, I'll have a play around with sockets tomorrow and see what I can come up with.
I'm on a fairly tight schedule with this so dont really have time to mess about with an ethernet shield but from what I've seen the next step up hardware wise seems to be the FEZ cobra which is a monster compared to the netduino!


Hi Calum,

If you're going the non-open-source route, check out Device Solutions' Tahoe II board as well. We've generally had good luck with their hardware on other projects...

As far as low-end boards like Netduino go, sockets is pretty straightforward and should work well for you.

Chris

#6 Gus Issa

Gus Issa

    Member

  • Members
  • PipPip
  • 14 posts

Posted 18 March 2011 - 11:02 PM

Hi Calum,

If you're going the non-open-source route, check out Device Solutions' Tahoe II board as well. We've generally had good luck with their hardware on other projects...

As far as low-end boards like Netduino go, sockets is pretty straightforward and should work well for you.

Chris


By the way, GHI officially supports Wiznet's W5100 natively on FEZ Panda and FEZ Domino. You get TCP server/client + UDP + DHCP + HTTP + DNS, all at minimal memory usage, basically about 60KB RAM and 140K FLASH is left free. The speed is very comparable to netduino+ too. This is not open source but it is commercially supported.

Gus Issa
GHI Electronics

Edited by webmaster, 19 March 2011 - 03:55 AM.
Added vendor signature


#7 CalumCawley

CalumCawley

    New Member

  • Members
  • Pip
  • 3 posts

Posted 18 March 2011 - 11:53 PM

By the way, GHI officially supports Wiznet's W5100 natively on FEZ Panda and FEZ Domino. You get TCP server/client + UDP + DHCP + HTTP + DNS, all at minimal memory usage, basically about 60KB RAM and 140K FLASH is left free. The speed is very comparable to netduino+ too. This is not open source but it is commercially supported.

any idea how much free ram id be seeing with http assemblies loaded? On the netduino plus im seeing about 20k at startup

#8 Gus Issa

Gus Issa

    Member

  • Members
  • PipPip
  • 14 posts

Posted 19 March 2011 - 02:51 AM

any idea how much free ram id be seeing with http assemblies loaded? On the netduino plus im seeing about 20k at startup


I don't have a FEZ to test it now but I saw this on GHI forum today. This user has a 5KB stream in his test application running with HTTP and his first GC run returns 40K. So my guess it is more than 50KB if you only add HTTP. http://www.tinyclr.com/forum/13/2727/

There is a detailed demo that ships from Microsoft about HTTP. It is not a small app and it runs fine on FEZ Panda. Find it at "...\Documents\Microsoft .NET Micro Framework 4.1\Samples\HttpServer"
It is very nice, give it a try.

Gus Issa
GHI Electronics

Edited by webmaster, 19 March 2011 - 03:55 AM.
Added vendor signature


#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 March 2011 - 03:54 AM

By the way, GHI officially supports Wiznet's W5100 natively on FEZ Panda and FEZ Domino. You get TCP server/client + UDP + DHCP + HTTP + DNS, all at minimal memory usage, basically about 60KB RAM and 140K FLASH is left free. The speed is very comparable to netduino+ too. This is not open source but it is commercially supported.


Hey there Gus,

Could you please add a "Gus Issa, GHI Electronics" signature to your posts? [Moderator will go ahead and add it to the bottom of your current posts for your convenience.]

We don't have a "no advertising" policy in the Netduino community, but we do need vendors to disclose their identity and relationship to their products.

We could also change your display name to "GHI Electronics" if that works better for you?

Also, if you could PM me with a bechmark to back up the "speed is very comparable" claim I'd really appreciate it. We've benchmarked the WIZnet solution on several boards and have never been able to approach even half of the native 1mbps offered by the Netduino Plus's built-in networking. Generally WIZnet has proven to be 3-7 times slower.

Thank you, Gus.

Chris

#10 Gus Issa

Gus Issa

    Member

  • Members
  • PipPip
  • 14 posts

Posted 19 March 2011 - 12:48 PM

Hey there Gus,

Could you please add a "Gus Issa, GHI Electronics" signature to your posts? [Moderator will go ahead and add it to the bottom of your current posts for your convenience.]

We don't have a "no advertising" policy in the Netduino community, but we do need vendors to disclose their identity and relationship to their products.

We could also change your display name to "GHI Electronics" if that works better for you?

Also, if you could PM me with a bechmark to back up the "speed is very comparable" claim I'd really appreciate it. We've benchmarked the WIZnet solution on several boards and have never been able to approach even half of the native 1mbps offered by the Netduino Plus's built-in networking. Generally WIZnet has proven to be 3-7 times slower.

Thank you, Gus.

Chris


Oh sorry! It is a bad habit of mine, will sign posts in future. Also, no advertising here but being informative, a developer is going for FEZ Cobra and you suggested tahoe, I am informing him that a little FEZ Panda will probably do the job. What makes networking on FEZ Panda support fast and reliable is that we wrote the divers natively not in C# and the interface is hooked to standard "socket" interface, so it is fast and with standard socket interface. In comparison, when plugging W5100 to netduino, the drivers are usually made in C# so in this case it is much slower like you said. Yes someone can write native driver but then first they have to do the work, it took us about 3 months, and second they need a +$6000 RVDS compiler as using GCC will degrade performance and blow up the firmware, which is why you use RVDS I assume?

As far as the speed test we have done, we first wanted to run the official Microsoft HTTP example on FEZ Panda and netduino+ to compare speed but sadly I remember we couldn't because the example won't fit on netdiuno+ due to its limited memory, please give it a try and correct me if I am wrong. It has been a while so maybe netduno+ offer more memory now?
So we made a smaller example that doesn't use HTTP to transfer a file over the network. The test showed 950Kbps on netduino+ and 400kbps on FEZ Panda. You already own FEZ Panda so it maybe a good idea to try on your end?

When it comes to performance, I would also like you to compare the SD write/read speed :)

Finally, this is our dedicated NETMF community website (forum/open source drivers/wiki/free ebooks) http://www.tinyclr.com/ so if anyone has questions on FEZ then the community and our engineers will be more than happy to assist.

Gus
GHI Electronics

#11 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 19 March 2011 - 01:50 PM

Also, no advertising here but being informative

Thanks God it is just informations and not ads!... :huh:

What makes networking on FEZ Panda support fast and reliable is that we wrote the divers natively not in C#

If I were looking for a C++ development board, then I will go probably to any Arduino-like device. What I want is *just* use C# and .Net (and I am debating a lot on this argument).

Finally, this is our dedicated NETMF community website ...

Also remind to GHI's guys our community (forum/open source/wiki) http://forums.netduino.com/. Just in case they're in trouble with C#/NetMF/Hardware :D

I am not versus GHI's product/company, but I guess that this is a place where some friends are talking each other, learning and make experimentation. That's unfair-play.
Biggest fault of Netduino? It runs by electricity.

#12 Gus Issa

Gus Issa

    Member

  • Members
  • PipPip
  • 14 posts

Posted 19 March 2011 - 02:26 PM

Sorry if this was taken the wrong way. Please contact GHI directly if you have questions Gus GHI Electronics




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.