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

Network problem


  • Please log in to reply
9 replies to this topic

#1 Marco1962

Marco1962

    New Member

  • Members
  • Pip
  • 5 posts

Posted 29 October 2011 - 09:35 PM

Hello, I tried to use one of the Netduino WEB server sample, but I have a big problem. Probably there are similar topics in the forum, but not exactly for my issue. Although N+ successfully acquires the address (with DHCP enabled) I cannot see it in the network (I cannot ping it). The Web Server program (I tried with different sample program) doesn't work because remains into Socket Accept() istruction and doesn't receive any character. I tried with fixed IP address too, but I got the same result. Any idea? Thanks in advance. Marco

#2 Swaine

Swaine

    New Member

  • Members
  • Pip
  • 2 posts

Posted 30 October 2011 - 12:29 AM

Make sure you are using the right IP when pinging:

Debug.Print(Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()[0].IPAddress);

Also, you can just try this:

socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Bind(new IPEndPoint(IPAddress.Any, 80));
socket.Listen(10);

Then sleep the thread (infinite) and pinging will work without the need for an entire web server.

#3 monewwq1

monewwq1

    Advanced Member

  • Members
  • PipPipPip
  • 104 posts

Posted 30 October 2011 - 03:07 AM

Although N+ successfully acquires the address (with DHCP enabled) I cannot see it in the network (I cannot ping it).


Marco,

What is the actual response you are getting when you try to ping it?

#4 Marco1962

Marco1962

    New Member

  • Members
  • Pip
  • 5 posts

Posted 30 October 2011 - 11:39 AM

Marco,

What is the actual response you are getting when you try to ping it?


Ping response (after few seconds): "Destination host unreachable"

It is very strange because N+ dhcp works, I see its MAC address correctly assigned among DHCP server leases..

I tried new FW 4.2 and firmware v4.2.0.0 RC3 but I have same problems.

#5 Marco1962

Marco1962

    New Member

  • Members
  • Pip
  • 5 posts

Posted 30 October 2011 - 11:42 AM

Make sure you are using the right IP when pinging:

Debug.Print(Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()[0].IPAddress);

Also, you can just try this:

socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Bind(new IPEndPoint(IPAddress.Any, 80));
socket.Listen(10);

Then sleep the thread (infinite) and pinging will work without the need for an entire web server.


I tried the code you posted, but I am not able to ping N+ too.

#6 monewwq1

monewwq1

    Advanced Member

  • Members
  • PipPipPip
  • 104 posts

Posted 30 October 2011 - 02:53 PM

Ping response (after few seconds): "Destination host unreachable"

It is very strange because N+ dhcp works, I see its MAC address correctly assigned among DHCP server leases..

I tried new FW 4.2 and firmware v4.2.0.0 RC3 but I have same problems.



Ok, that is the message I thought you were getting. Can you let us know the IP address of your computer and the IP address of your N+? I bet the N+ IP address is not on the same subnet as your router and computer.

Edit: try adding this to your code:

Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()[0].EnableDhcp();

#7 Marco1962

Marco1962

    New Member

  • Members
  • Pip
  • 5 posts

Posted 30 October 2011 - 04:04 PM

Ok, that is the message I thought you were getting. Can you let us know the IP address of your computer and the IP address of your N+? I bet the N+ IP address is not on the same subnet as your router and computer.

Edit: try adding this to your code:

Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()[0].EnableDhcp();


I tried using DHCP (forcing DHCP with the above istruction), in that case the IP address of my PC is 192.168.99.38 and the IP address of N+ is 192.168.99.36, netmask 255.255.255.0, and with a fixed IP; I tried with different netmasks 192.168.2.0, 10.10.10.0.

When I have seen the ping error message, I also had the same idea, a netmask mismatch, but now I think that my N+ has a problem.

Could be and interrupt management issue? The ethernet board seems to works fine but the IP stack doesn't receive anything.

Marco

#8 monewwq1

monewwq1

    Advanced Member

  • Members
  • PipPipPip
  • 104 posts

Posted 30 October 2011 - 05:58 PM

I tried using DHCP (forcing DHCP with the above istruction), in that case the IP address of my PC is 192.168.99.38 and the IP address of N+ is 192.168.99.36, netmask 255.255.255.0, and with a fixed IP; I tried with different netmasks 192.168.2.0, 10.10.10.0.

When I have seen the ping error message, I also had the same idea, a netmask mismatch, but now I think that my N+ has a problem.

Could be and interrupt management issue? The ethernet board seems to works fine but the IP stack doesn't receive anything.

Marco


What is the N+ Default Gateway IP address?

Try this:

Debug.Print(Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()[0].GatewayAddress);

Is the N+ Gateway Address the same as the IP address of your router? Or is it different? It should be the same.

Also, try running a traceroute for the N+ IP address and see where it's failing.

#9 Marco1962

Marco1962

    New Member

  • Members
  • Pip
  • 5 posts

Posted 30 October 2011 - 07:47 PM

What is the N+ Default Gateway IP address?

Try this:

Debug.Print(Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()[0].GatewayAddress);

Is the N+ Gateway Address the same as the IP address of your router? Or is it different? It should be the same.

Also, try running a traceroute for the N+ IP address and see where it's failing.


I made ​​several tests with no encouraging results.

I tried using DHCP and no DHCP, setting default gateway and leaving it blank. Using an hub and using and crossover Ethernet cable.

Previous ping errors were due to a wrong metric on my Ethernet PC card, Now I receive a more correct 'timeout error';

I was able to ping the N+ only in one circumstance: crossover cable and interface speed to 10 Mb full duplex. Any other configuration doesn't work, and in that case it works intermittently.

It seems clear that there is something wrong. I do not know if it is an hardware or software problem, but I have the same results with two different firmware version...

I would like to test another Netduino board.

#10 Silent12

Silent12

    New Member

  • Members
  • Pip
  • 5 posts

Posted 30 October 2011 - 07:52 PM

You may be experiencing this bug : Socket.Connect() is broken in RC3
Did you try the .NETMF 4.2 RC1 ?




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.