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.
Perhaps the other thread dug back out of oblivion was too confused.
I have a simple need: to ping another host on the network from my netduino plus' c# code.
I've owned it for days and gotten it to do all manner of other things but can't seem to figure this one out. .NET seems to have a ping class but it is not supported on the netduino?
Please let me know how this can be done. I really would think such a simple functionality is possible on this unit so surely I'm missing something obvious.
Great device and thanks in advance!
Well.....here is this.
I started looking into this thinking it wouldn't be that hard, and it was harder than I thought it would be.
I don't actually have my netduino yet as I'm waiting for it to arrive still. I did test this in the emulator and it does seem to work as far as I can tell. I'm sure it could work better, but this seems to do ok. I'll actually try it out when my netduino plus arrives this weekend(hopefully).
I used a bunch of the code from here and cut a lot out and changed it a bit to work with the micro framework, but it was my basis:
http://www.winsocket...nication8i.html
You can download the original full framework C# completed solution that goes with that tutorial here:
http://www.winsocket...ocketPingCS.zip
I also used the code for the BitConverter by Ravenheart that he posted here:
http://forums.netdui...ch__1#entry2082
I took out the unsafe methods as they weren't being used.
I created the NetworkHostConverter.cs since the micro framework doesn't have those conversions. I just loaded the original dll in dotpeek and did it the same way microsoft does.
All that being said, there is probably some super easy way to do it, but sometimes you learn more doing it the hard way.
I believe that the emulator uses the closed-source RTIP networking stack instead of the lwIP open-source networking stack.
If this is supported in lwIP and it fits, we could certainly enable it.
Chris
Well, just got home and got my netduino today, I'll see if I can figure anything out.
Is there a way to know what is and isn't supported by the lwIP stack?
I believe that the emulator uses the closed-source RTIP networking stack instead of the lwIP open-source networking stack.
If this is supported in lwIP and it fits, we could certainly enable it.
Chris
Chris,
If there is anything you can do to enable this soon it would be greatly appreciated by many. In my situation I bought one netduino plus to test an application. If this can be made to work I'll almost instantly be purchasing several more to use for my ping testing application. I think your choices are either to fix what these guys are hitting with sockets or implement .net's ping() class, which may just handle more of this inherently.
I just reviewed the Netduino firmware to make sure we weren't disabling outgoing pings.
The Netduino firmware does compile in ICMP support in the lwIP networking stack. It appears that there may be a bug in the .NET MF implementation of lwIP which supports incoming pings correctly...but does not support outgoing pings directly.
Would those of you interested in ping support in NETMF please file and/or vote for a work item over on netmf.codeplex.com? The final .NET MF 4.2 beta is currently being wrapped up...and now is the time to get any last-minute features/fixed checked in. We file a lot of bug reports/fixes...so having this come from the community will make sure it doesn't get lost in the noise.
Thank you,
Chris
I also voted...but if this works in the emulator is this not somehow an issue with the selection of stuff in firmware on the netdunio rather than the .NET framework? I could easily be wrong but just asking.
We'll need to update the firmware to incorporate the new RC code. Should be posted by next week, for all three Netduinos (regular, Plus, and Mini).
Chris
Ah, ok. I was thinking since you had mentioned earlier:
The Netduino firmware does compile in ICMP support in the lwIP networking stack. It appears that there may be a bug in the .NET MF implementation of lwIP which supports incoming pings correctly...but does not support outgoing pings directly.
That it would work straight away. I'm looking forward to next week in that case