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

Netduino Plus 2 Problems


  • Please log in to reply
31 replies to this topic

#21 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 12 November 2012 - 02:58 AM

Blah ... I powered down the Plus 2 and hooked it up to a wireless adapter and it went back to its old ways; no static IP address and the wrong MAC. Same thing hard wired on ethernet. The router has it in its list of DHCP Clients also. So setting the network programmaticaly is not permanent. It does indeed look like something is broken here.

Okay, back on the test list for this week :)

It sounds like if it has a reservation...it works properly. But if it doesn't have a reservation on your network, it has an identity crisis ;)

Chris

#22 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 12 November 2012 - 08:54 PM

Okay, back on the test list for this week :)

It sounds like if it has a reservation...it works properly. But if it doesn't have a reservation on your network, it has an identity crisis ;)


Chris,

I am having similiar problems with my NP2, I set the IP Address in MFDeploy to 192.168.0.122

I then load my program and it says that the IP Address is 192.168.0.134

The program works as it should only with the IP 192.168.0.134 not 122 which is setup in my router with port forwarding.

MFDeploy still show the IP as 192.168.0.122

Imports System
Imports Microsoft.VisualBasic.Constants
Imports System.Net
Imports System.Net.Sockets
Imports System.Threading
Imports Microsoft.SPOT
Imports Microsoft.SPOT.Hardware
Imports SecretLabs.NETMF.Hardware
Imports SecretLabs.NETMF.Hardware.Netduino

Namespace Connect_to_Web_2
  Public Class Program
    Public Shared Sub Main()
      ' write your code here
      ' setup the LED and turn it off by default
      Dim led As New OutputPort(Pins.ONBOARD_LED, False)

      ' configure the port # (the standard web server port is 80)
      Dim port As Integer = 80

      ' wait a few seconds for the Netduino Plus to get a network address.
      Thread.Sleep(5000)

      ' display the IP address
      Dim networkInterface As Microsoft.SPOT.Net.NetworkInformation.NetworkInterface = Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()(0)
      Debug.Print("my ip address: " + networkInterface.IPAddress.ToString())

      ' create a socket to listen for incoming connections
      Dim listenerSocket As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
      Dim listenerEndPoint As New IPEndPoint(IPAddress.Any, port)

      ' bind to the listening socket
      listenerSocket.Bind(listenerEndPoint)

      ' and start listening for incoming connections
      listenerSocket.Listen(1)

      ' listen for and process incoming requests
      While True
        ' wait for a client to connect
        Dim clientSocket As Socket = listenerSocket.Accept()

        ' wait for data to arrive
        Dim dataReady As Boolean = clientSocket.Poll(5000000, SelectMode.SelectRead)

        ' if dataReady is true and there are bytes available to read,
        ' then you have a good connection.
        If dataReady AndAlso clientSocket.Available > 0 Then
          Dim buffer As Byte() = New Byte(clientSocket.Available - 1) {}
          Dim bytesRead As Integer = clientSocket.Receive(buffer)
          Dim request As New String(System.Text.Encoding.UTF8.GetChars(buffer))
          Debug.Print("Command: " + request)
          ' request = up(request)
          If request.IndexOf("ON") >= 0 Then
            led.Write(True)
          ElseIf request.IndexOf("OFF") >= 0 Then
            led.Write(False)
          End If

          Dim statusText As String = "LED is " + (If(led.Read(), "ON", "OFF")) + "."

          ' return a message to the client letting it
          ' know if the LED is now on or off.
          Dim response As String = "HTTP/1.1 200 OK" & vbCr & vbLf + "Content-Type: text/html; charset=utf-8" & vbCr & vbLf & vbCr & vbLf + "<html><head><title>Netduino Plus LED Sample</title></head>" + "<body>" + statusText + "</body></html>"
          clientSocket.Send(System.Text.Encoding.UTF8.GetBytes(response))
        End If
        ' important: close the client socket
        clientSocket.Close()
      End While
    End Sub

  End Class
End Namespace

Chuck

Attached Files



#23 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 12 November 2012 - 09:00 PM

An additional problem that I have run into is when I write a new program or update an old program is a loss of communication with the NP2 (device not found). Communications can be restored by changing deploy to serial then back to USB. Chuck

#24 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 12 November 2012 - 09:58 PM

Carb, You might try clearing the arp cache. Open a command window and execute: arp -a . Look for your MAC address in the table output. If it is associated with 192.168.0.134, then delete it with the command arp -d 192.168.0.134. Then ping 192.168.0.122 to populate the arp cache. If the ping fails then you have a problem similar to mine, e.g. MFDeploy will simply not update the network configuration of the Plus 2. Hopefully, Chris will get this fixed. Baxter

#25 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 12 November 2012 - 11:11 PM

Carb,

You might try clearing the arp cache. Open a command window and execute: arp -a . Look for your MAC address in the table output.
If it is associated with 192.168.0.134, then delete it with the command arp -d 192.168.0.134. Then ping 192.168.0.122 to populate the arp cache. If the ping fails
then you have a problem similar to mine, e.g. MFDeploy will simply not update the network configuration of the Plus 2. Hopefully, Chris will get this fixed.

Baxter

Baxter,

I think that I have the same problem as you, the ARP -d didn't help. I couldn't ping 192.168.0.122, but could ping 192.168.0.134.

I am sure that Chris will get it fixed, but wanted to let him know the others were having similiar problems.

Thanks,
Chuck

#26 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 November 2012 - 12:13 AM

Thanks Chuck. We're investigating this and working on an I2C update this week. In the meantime, is everyone working alright with DHCP (or some other method)? Other than getting the wrong IP address...is the networking working alright for you? Chris

#27 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 13 November 2012 - 12:42 AM

Thanks Chuck. We're investigating this and working on an I2C update this week.

In the meantime, is everyone working alright with DHCP (or some other method)? Other than getting the wrong IP address...is the networking working alright for you?

Chris

Chris,

Seems to be working okay. I was just testing with a simple program. I will only need the fixed IP when accessing remotely on the internet (works fine on loacl network) through the router.

Chuck

P.S. I like it! :rolleyes:

#28 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 13 November 2012 - 12:54 AM

Hi Chris, Although I have probably added too much to this thread already, one more comment. Networking works ok; I can talk to it from a PC client, it can retrieve time from a NIST server, etc. The essential problem is that it wants to use DHCP and this cannot be changed and additionally, in my case the MAC cannot be changed. MFDeploy thinks it has updated the network configuration, but it doesn't take on the Plus 2. Baxter

#29 telno

telno

    New Member

  • Members
  • Pip
  • 8 posts

Posted 14 November 2012 - 04:45 AM

Same problem here. DHCP is successfully grabbing an IP but it's showing as MAC 00:04:A3:00:00:00 on my router instead of the actual MAC on the sticker (5C:86:*).

#30 Joel Kunze

Joel Kunze

    New Member

  • Members
  • Pip
  • 8 posts

Posted 18 November 2012 - 11:46 PM

I have the same issue, the board is using MAC 00:04:a3:00:00:00 instead of the address from the sticker. It is obtaining an IP address via DHCP and seems basically functional. It is not getting the IP I would expect since my DHCP server is setup to issue a specific IP to the MAC on the sticker.

#31 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 November 2012 - 12:07 AM

Thank you for all the additional feedback. We are working on a solution to the issue. In the meantime, can you use NETMF's NetworkInterface class to set your MAC and static IP address manually at runtime? That should be a very temporary workaround. We should be able to turn around an update pretty quickly. Chris

#32 VanKurt

VanKurt

    Member

  • Members
  • PipPip
  • 19 posts

Posted 14 August 2013 - 04:03 PM

Is there a solution to this? I've just run into the same 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.