Cannot Connect to Pachube - Netduino Plus 2 (and Netduino Plus 1) - Netduino Forums
   
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

Cannot Connect to Pachube


  • Please log in to reply
3 replies to this topic

#1 phutton11

phutton11

    New Member

  • Members
  • Pip
  • 1 posts

Posted 05 October 2011 - 10:46 PM

Long time micro-coder but new to Netduino Plus system. I just recently acquired a Plus unit after buying the book "Getting Started with the Internet Things". The book focuses on the Plus unit and the Pachube data sharing website. Seemed like a great idea, but I cannot get the Plus unit to connect to the outside world. After completing the traditional LEDBlink & Voltage Divider programs to better understand the MS .NET Micro Framework environment, I loaded the books sample "HelloPachube" azpplication (after creating my own Pachube account and feed). Every time I tried to run it (no build errors) I received the following errors: #### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (1) #### #### Message: #### Microsoft.SPOT.Net.SocketNative::getaddrinfo [IP: 0000] #### #### System.Net.Dns::GetHostEntry [IP: 0008] #### #### System.Net.HttpWebRequest::EstablishConnection [IP: 00e1] #### #### System.Net.HttpWebRequest::SubmitRequest [IP: 0013] #### #### System.Net.HttpWebRequest::GetRequestStream [IP: 0008] #### #### Gsiot.PachubeClient.PachubeClient::CreateRequest [IP: 003e] #### #### Gsiot.PachubeClient.PachubeClient::Send [IP: 0025] #### #### HelloPachube::Main [IP: 0065] #### #### SocketException ErrorCode = 10060 #### SocketException ErrorCode = 10060 A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll #### SocketException ErrorCode = 10060 #### SocketException ErrorCode = 10060 #### Exception System.Net.WebException - 0x00000000 (1) #### #### Message: host not available #### System.Net.HttpWebRequest::EstablishConnection [IP: 00f1] #### #### System.Net.HttpWebRequest::SubmitRequest [IP: 0013] #### #### System.Net.HttpWebRequest::GetRequestStream [IP: 0008] #### #### Gsiot.PachubeClient.PachubeClient::CreateRequest [IP: 003e] #### #### Gsiot.PachubeClient.PachubeClient::Send [IP: 0025] #### #### HelloPachube::Main [IP: 0065] #### A first chance exception of type 'System.Net.WebException' occurred in System.Http.dll A first chance exception of type 'System.Net.WebException' occurred in System.Http.dll System.Net.WebException: host not available It suggests that the Host is not there. But manualy creating the messages and sending them via browser results in a correct response. I used the MFDeploy tool to verify that the Plus unit was obtaining an IP address (192.168.5.100) and the correct MAC address is loaded. But using Wireshark (see attachment) it appears that the Plus unit is not making a live connection. The application just seems to be in a loop trying to get a connection but failing every time. Can anyone help me here? BTW when I use a regular Arduino board with am eithernet shield I have no problems. Does it sound like I might have a bad board? Thanks

Attached Files



#2 Cuno

Cuno

    Advanced Member

  • Members
  • PipPipPip
  • 144 posts
  • LocationZürich / Switzerland

Posted 06 October 2011 - 08:29 AM

Hi phutton11, with the current Netduino Plus firmware, there seem to be occasional problems with DHCP. Maybe the IP address of your Netduino Plus is just a stored default value, and was not really obtained via DHCP? Could you try to switch off DHCP in MFDeploy and assign a suitable static IP address? Best regards Cuno

#3 erich

erich

    Member

  • Members
  • PipPip
  • 21 posts
  • LocationFrance

Posted 06 October 2011 - 12:52 PM

I have seen N+ hang on a socket connection and also with DNS. I would try hard coding the target IP address. The other thing to bare in mind is the networking using a lot of memory which the then causes indirect and undefined errors, especially if you have a lot of other stuff going on.

#4 ColinR

ColinR

    Advanced Member

  • Members
  • PipPipPip
  • 142 posts
  • LocationCape Town, South Africa

Posted 06 October 2011 - 05:13 PM

I have seen N+ hang on a socket connection and also with DNS. I would try hard coding the target IP address. The other thing to bare in mind is the networking using a lot of memory which the then causes indirect and undefined errors, especially if you have a lot of other stuff going on.



What has worked well for me is to do a DNS lookup once and use the IPEndPoint from then on, something like;

private static IPEndPoint wwwaddresscom;
...
static Socket Connect(string host, int timeout)
{
  if (wwwaddresscom == null)
  {
    var hostEntry = Dns.GetHostEntry(host);
    var hostAddress = hostEntry.AddressList[0];
    wwwaddresscom= new IPEndPoint(hostAddress, 80);
  }
  if (wwwaddresscom == null) return null;
  ...
}





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.