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.

Josh Hawley's Content

There have been 21 items by Josh Hawley (Search limited from 25-April 23)


By content type

See this member's

Sort by                Order  

#60567 enc28j60_lwip_recv: input alloc packet failed

Posted by Josh Hawley on 28 October 2014 - 09:49 PM in Netduino 2 (and Netduino 1)

Thanks =)

 

Seems like we have hit a wall then. sounds like the sparkfun server is not responding fast enough for the timeout every time. you could just wrap the upload section in a try catch and make it loop until it works or fails 20 times. Kinda ugly, but it seems like all we have left until they fix the timeout setting.




#60466 enc28j60_lwip_recv: input alloc packet failed

Posted by Josh Hawley on 20 October 2014 - 12:06 AM in Netduino 2 (and Netduino 1)

Sorry I have been MIA. Wedding/Honeymoon  :wub:

 

If you are getting "SF: " and nothing else, then ex.Message is an empty string. Try using ex.StackTrace




#60380 enc28j60_lwip_recv: input alloc packet failed

Posted by Josh Hawley on 10 October 2014 - 06:25 AM in Netduino 2 (and Netduino 1)

maybe you should spin up a separate thread when the program starts, and have it block using a manualresetevent. then when your timer fires, it just releases the thread (which runs once and then blocks again until next time)




#60371 enc28j60_lwip_recv: input alloc packet failed

Posted by Josh Hawley on 08 October 2014 - 05:31 PM in Netduino 2 (and Netduino 1)

can you post your catch block?




#60362 enc28j60_lwip_recv: input alloc packet failed

Posted by Josh Hawley on 07 October 2014 - 10:46 PM in Netduino 2 (and Netduino 1)

I'm confused as to why a try/catch does not work. Are you only catching specific types of exceptions, or are you catching them all with the base Exception?




#60356 enc28j60_lwip_recv: input alloc packet failed

Posted by Josh Hawley on 06 October 2014 - 05:11 PM in Netduino 2 (and Netduino 1)

When you are catching exceptions inside other peoples code, It is entirely possible that they handled them already so you may not see them.

 

We now know that there is a timeout. Are you sure that the webserver is responding properly?




#60349 enc28j60_lwip_recv: input alloc packet failed

Posted by Josh Hawley on 05 October 2014 - 05:50 AM in Netduino 2 (and Netduino 1)

You can try running it with the debugger attached and setting exceptions to break when they are first thrown. That will frequently show you the deepest exceptions (even if they are handled correctly).

 

Hmm... I'm not actually sure if that will work on a netduino, never tried. I know Visual Studio can do it within external code, but I'm not sure how advanced the debugger is for .netMF. 

 

In VS go to exceptions in the debug menu. turn everything on, and leave it running till it throws.




#60311 enc28j60_lwip_recv: input alloc packet failed

Posted by Josh Hawley on 01 October 2014 - 04:27 AM in Netduino 2 (and Netduino 1)

Have you tried monitoring the memory usage?

 

you could just add it as another data parameter to the ones that you are already tracking. 

If you track it, you can at least confirm or eliminate a memory leak is your problem.

 

use this to get free memory:

uint freemem = Microsoft.SPOT.Debug.GC(false);



#60284 Auto update delpoyed code on boot

Posted by Josh Hawley on 29 September 2014 - 05:25 AM in General Discussion

Bummer. I hope we get this in the next update.




#60283 enc28j60_lwip_recv: input alloc packet failed

Posted by Josh Hawley on 29 September 2014 - 05:22 AM in Netduino 2 (and Netduino 1)

Does time really slip that much on a netduino? Maybe just running the NTP sync on startup is enough?




#60265 enc28j60_lwip_recv: input alloc packet failed

Posted by Josh Hawley on 27 September 2014 - 11:43 PM in Netduino 2 (and Netduino 1)

It is possible that your NTP thread and Upload thread are colliding at the socket. You should put a lock() around all of the code in both of those methods to enforce that one of them does not walk on the other. I know that you "should" be able to maintain multiple simultaneous sockets, but the enc28j60 isn't really that strong of a networking chip.




#60234 enc28j60_lwip_recv: input alloc packet failed

Posted by Josh Hawley on 26 September 2014 - 02:52 AM in Netduino 2 (and Netduino 1)

I still think you have a memory leak somewhere. The error makes me think it is trying to allocate memory for an incoming packet and failing. I agree, seeing all of the code (minus your private key and any other login info of course) would go a long way toward helping you.




#60226 enc28j60_lwip_recv: input alloc packet failed

Posted by Josh Hawley on 25 September 2014 - 04:45 PM in Netduino 2 (and Netduino 1)

Hmm... this was also posted by the .netMF team today... 
Ref: http://blogs.msdn.com/b/netmfteam/archive/2014/09/23/net-micro-framework-sdk-beta-released.aspx
 

 

Networking

The .NET micro Framework team has also been investigating network stability issues that have been reported in the community.  We are looking at the broad range of the product's networking capabilities, including TCP, IP, UDP, and DHCP protocols.  This topic probably deserves its own blog article to go into details but in a nutshell we have been able to reproduce some of the issues reported and the team is putting together an engineering plan to resolve them.




#60225 enc28j60_lwip_recv: input alloc packet failed

Posted by Josh Hawley on 25 September 2014 - 04:39 PM in Netduino 2 (and Netduino 1)

alloc errors are usually tied to memory. Try lowering your memory footprint. 

 

One place to start with that is the way you are concatenating strings. Every time you add one string to another, you create a new string. in a long chain like that there are a ton of these extra strings created that waste memory. 

The StringBuilder class is made to handle that problem. 

 

try something like this:

var sb = new StringBuilder("http://data.sparkfun.com/input/");
sb.Append(sfPublicKey);
sb.Append("?private_key=");
sb.Append(sfPrivateKey);
.
.
.

then when you are done, you can call sb.ToString() to turn it back into a string.

var URLString = sb.ToString();

There is also a more advanced way to do it with a method called AppendFormat(), but it does not appear to be implemented in .netMF =(




#60224 Auto update delpoyed code on boot

Posted by Josh Hawley on 25 September 2014 - 04:25 PM in General Discussion

Has anyone seen/heard of anyone writing a boot strap that can check for and update your code on a netduino?

Similar to the way ClickOnce works. When the netduino boots, the boot strap loads and checks for and updates the netduino code if needed. Then once that is done, it runs the code like normal.




#60223 www.netmf.com has been updated!

Posted by Josh Hawley on 25 September 2014 - 04:21 PM in General Discussion

Yay! 




#60189 Using a graphical display

Posted by Josh Hawley on 22 September 2014 - 07:13 PM in General Discussion

here is a library that will probably work with that display for arduino: http://playground.ar...Code/GLCDks0108

It will probably take a fair amount of work to get that library going on a netduino though.




#60187 N+2 as temperature monitoring server + winforms client

Posted by Josh Hawley on 22 September 2014 - 07:02 PM in General Discussion

You should probably look into something like MQTT to simplify your communications. If not, you will be controlling Sockets yourself which is not fun. 




#60186 Multiple Ethernet Connections

Posted by Josh Hawley on 22 September 2014 - 06:59 PM in General Discussion

Are you making a firewall?




#60181 Home Automation

Posted by Josh Hawley on 22 September 2014 - 02:50 PM in General Discussion

It has been most of a year. Are you still working on this? Would love an update =)




#58717 Microsoft Build 2014 (and Netduino SDK for Azure)

Posted by Josh Hawley on 14 June 2014 - 07:04 PM in General Discussion

Its June, Is there any update on when the Netduino SDK for Azure is coming out? I would like to use it in my fireworks launcher =)





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.