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

socket.Connect failure


  • Please log in to reply
11 replies to this topic

#1 spaceyguy

spaceyguy

    Member

  • Members
  • PipPip
  • 10 posts

Posted 29 January 2011 - 10:52 PM

I've tried about a 5 different ways of doing this, namely this one, and it keeps failing; a System.Net.Sockets.SocketException is being thrown, without much information about what exactly the error is.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 29 January 2011 - 10:57 PM

Hi spaceyguy, Due to its extremely compact nature, .NET Micro Framework does not have detailed error messages in its sockets library (although it does give a limited number of error codes that may be useful here). Have you set the IP address of your Netduino Plus? Can you ping your Netduino Plus from the other computer? Welcome to the Netduino community, Chris

#3 spaceyguy

spaceyguy

    Member

  • Members
  • PipPip
  • 10 posts

Posted 29 January 2011 - 11:22 PM

Thank you for the welcoming. I couldn't ping it at first, finally after struggling with MFConfig I set the netduino up with DHCP and found the IP through my router. Once I got that working I could ping it, but the problem persists.

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 29 January 2011 - 11:45 PM

Hi spaceyguy, Do you have a short example (including the server you're trying to connect to) that you could zip up and attach to your post? Also, have you looked at the SocketClient example which comes with the .NET Micro Framework SDK? If you remove the Microsoft proxy server from it, you should be able to connect to servers on the Internet. Also, please be aware that some DHCP servers are having trouble with the lwIP networking stack used by .NET Micro Framework on the Netduino Plus. We're working on a bug fix to enable wider compatibility with DHCP servers--but you may want to try a static IP address for diagnostic purposes. Chris

#5 spaceyguy

spaceyguy

    Member

  • Members
  • PipPip
  • 10 posts

Posted 30 January 2011 - 12:24 AM

When I reconfigure it to use a static IP I can't ping it anymore, even after changing it to several different one (after checking if they weren't taken of course). Even giving it the IP that it had been assigned using DHCP while it hadn't been released it still didn't work.

#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 January 2011 - 01:01 AM

When I reconfigure it to use a static IP I can't ping it anymore, even after changing it to several different one (after checking if they weren't taken of course). Even giving it the IP that it had been assigned using DHCP while it hadn't been released it still didn't work.


If you configure as static IP and can't ping it anymore, then that's a more general network-related issue (i.e. the router doesn't support static IP clients or there's an address conflict or the gateway/subnet mask are wrong, etc.)

Go back to where you can ping your device, and try running Microsoft's SocketClient sample. That should download a page from the Microsoft website.

Chris

#7 Frank

Frank

    Advanced Member

  • Members
  • PipPipPip
  • 62 posts
  • LocationNorth Waterboro Maine

Posted 30 January 2011 - 01:54 AM

If you configure as static IP and can't ping it anymore, then that's a more general network-related issue (i.e. the router doesn't support static IP clients or there's an address conflict or the gateway/subnet mask are wrong, etc.)

Go back to where you can ping your device, and try running Microsoft's SocketClient sample. That should download a page from the Microsoft website.

Chris

I wholeheartedly agree. I just spent too much time chasing my tail, and it was nothing with the NEtduino or the programming, just a router issue ! And my key was when I couldn't ping the board!
Retired -stone sculptor -macro photographer- novice but avid Go player - Geek

#8 spaceyguy

spaceyguy

    Member

  • Members
  • PipPip
  • 10 posts

Posted 30 January 2011 - 02:16 AM

If it is the router, how do I proceed? EDIT: Initial test without the router failed as well.

#9 Frank

Frank

    Advanced Member

  • Members
  • PipPipPip
  • 62 posts
  • LocationNorth Waterboro Maine

Posted 30 January 2011 - 11:07 AM

If it is the router, how do I proceed?
EDIT: Initial test without the router failed as well.

My router problem was based on sheer ignorance, followed by uninformed tweaking! I solved a multitude of home problems when I did a lot of reading, and eliminated my tweaking. If you failed without the router, one of the many real experts will surely help you. This board has good depth in experience.
Retired -stone sculptor -macro photographer- novice but avid Go player - Geek

#10 spaceyguy

spaceyguy

    Member

  • Members
  • PipPip
  • 10 posts

Posted 31 January 2011 - 01:51 AM

After enough messing around I got it to work using the SocketServer example at least, I'm not even sure exactly what I did though.

#11 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 31 January 2011 - 02:04 AM

After enough messing around I got it to work using the SocketServer example at least, I'm not even sure exactly what I did though.


Very good news. That means your hardware appears to be working properly. Now to get your socket client project running...

Chris

#12 spaceyguy

spaceyguy

    Member

  • Members
  • PipPip
  • 10 posts

Posted 31 January 2011 - 04:04 AM

That is working as well now, I downloaded the sample again after I had changed it. It worked after that, so maybe my changes were part of the problem but I doubt that was all of it. After thinking using the router config more often then normal I noticed problems frequently, so I'm guessing thats the problem.




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.