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.

Guy Dillen

Member Since 17 Dec 2011
Offline Last Active Nov 13 2014 09:54 AM
-----

Topics I've Started

Socket problem

11 November 2014 - 05:40 PM

Hi,

 

I have problems when program executes "socket.Connect". See code below (in the snippet below I changed the real IPAddress in 0s). The Socket "Connect" method is the cause of the errors I get.

 

Any idea what goes wrong here?

 

Thanks.

 

A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll
Microsoft.SPOT.Net.SocketNative::poll
System.Net.Sockets.Socket::Poll
System.Net.Sockets.Socket::Connect
NetduinoPlusApplication1.Program::Main
 
Environment:
- Netduino Plus 1
- Target.NET MF 4.2
- Visual Studio 2013 Pro
- Device capabilities
 
HalSystemInfo.halVersion:               4.2.0.0
HalSystemInfo.halVendorInfo:            Netduino Plus (v4.2.0.1) by Secret Labs LLC
HalSystemInfo.oemCode:                  0
HalSystemInfo.modelCode:                0
HalSystemInfo.skuCode:                  0
HalSystemInfo.moduleSerialNumber:       00000000000000000000000000000000
HalSystemInfo.systemSerialNumber:       0000000000000000
ClrInfo.clrVersion:                     4.2.0.0
ClrInfo.clrVendorInfo:                  Netduino Plus (v4.2.0.1) by Secret Labs LLC
ClrInfo.targetFrameworkVersion:         4.2.0.0
SolutionReleaseInfo.solutionVersion:    4.2.0.0
SolutionReleaseInfo.solutionVendorInfo: Netduino Plus (v4.2.0.1) by Secret Labs LLC
SoftwareVersion.BuildDate:              Sep 19 2012
SoftwareVersion.CompilerVersion:        410894
FloatingPoint:                          True
SourceLevelDebugging:                   True
ThreadCreateEx:                         True
LCD.Width:                              0
LCD.Height:                             0
LCD.BitsPerPixel:                       0
AppDomains:                             True
ExceptionFilters:                       True
IncrementalDeployment:                  True
SoftReboot:                             True
Profiling:                              False
ProfilingAllocations:                   False
ProfilingCalls:                         False
IsUnknown:                              False
 

 

 public static void Main()
        {
 
            try
            {
                Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                IPAddress address = new IPAddress(new byte[] { 0x00, 0x00, 0x00, 0x00 });
                socket.Connect(new IPEndPoint(address, 1883));
                int a = socket.Available;
                Debug.Print(a.ToString());
                socket.Close();
            }
            catch (Exception e)
            {
                Debug.Print(e.StackTrace);
            }
}

Blinking example problems

08 November 2014 - 11:24 AM

Hi,

 

Just for test purposes (after longtime not using my 2 Netduino Plus 1) I entered the "blink" code in VST2013. I can build-run/deploy it to the Netduinos, when running/deploying the Netduino reboots (the blue led goes during reboot), but the program doesn't run = the blue led doesn't go on/off.

 

I'm running VST2013 Pro Update 3 / netmf-v4.3.2-SDK-R2-Beta / netduinosdk_vs2013_experimental.

 

What goes wrong here?

 

Thanks.

Guy

 

 public static void Main()
        {
            // write your code here
            OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
 
            while(true)
            {
                led.Write(true);
                Thread.Sleep(250);
                led.Write(false);
                Thread.Sleep(250);
            }
 
        }
 
 

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.