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

After a few deployments, my Plus 2 ... bad things happen


  • Please log in to reply
2 replies to this topic

#1 smrdd

smrdd

    New Member

  • Members
  • Pip
  • 2 posts

Posted 15 November 2014 - 09:27 PM

I searched for an answer and couldn't find one, so maybe someone knows how to solve my issue...

 

I haven't used my Plus 2 in awhile, so I updated the firmware to the 4.3 one that was posted. Using VS 2012, I wrote (or am writing...) a simple network pinger. It will run an indeterminate amount of times before getting the VS error "Error 1 Device not found or cannot be opened - USB:Netduino". When I check the build settings, there is no device listed under USB. Windows will register it as "unknown usb device (device descriptor request failed)" in the device manager.

 

Following the advice of other posts, I tried pressing the button while restarting it, and checking it with MFDeploy. MFDeploy doesn't list it. In fact the only workaround I have is to restart my computer, which is a bit inconvenient. This leads me to believe I'm actually having some bizarre driver issues I cannot figure out. Below is my code, in case it is the problem (it's only the one class):

public class Program
    {
        public static void Main()
        {
            OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
            InputPort butan = new InputPort(Pins.ONBOARD_BTN, true, Port.ResistorMode.Disabled);
            byte[] words = System.Text.Encoding.UTF8.GetBytes("check");
            byte[] data = new byte[64];
            data[data.Length - 1] = 0x40;
            Array.Copy(words, data, words.Length); 
            byte[] ping = new byte[data.Length + 4];
            ping[0] = 0x08;
            ping[1] = 0x00;
            Array.Copy(data, 0, ping, 4, data.Length);
            Array.Copy(chksm(ping), 0, ping, 2, 2);

            Socket socket = new Socket(
                AddressFamily.InterNetwork,
                SocketType.Raw,
                ProtocolType.Icmp);

            EndPoint ep = (EndPoint)(new IPEndPoint(IPAddress.Parse("192.0.2.1"), 0));
            
            while (!butan.Read())
            {
                led.Write(true);
                socket.SendTo(ping, 0, ping.Length, SocketFlags.None, ep);
                Thread.Sleep(500);
                led.Write(false);
                Thread.Sleep(500);
            }

        }

        static byte[] chksm(byte[] data)
        {
            uint chcksm = 0;
            for (int i = 0; i < data.Length; i+=2)
                chcksm += (uint)BitConverter.ToUInt16(data, i);
            chcksm = (chcksm >> 16) + (chcksm & 0xffff);
            chcksm += (chcksm >> 16);
            return BitConverter.GetBytes((ushort)(~chcksm));
        }
    }

Please advise me if there is any log outputs or anything else needed to diagnose this issue. I appreciate the help in advance :)

 

- Doug



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 16 November 2014 - 12:00 AM

Hi smrdd,

Try putting your board into bootloader mode (by pressing the button while plugging it into your PC). Then run Netduino Update, click on advanced options for your board, switch to the Tools tab and click "Erase App".

Then unplug and re-power your board. Does it show up now? If so then this may be an issue on the board side (possibly a lockup in lwIP).

Welcome to the Netduino community,

Chris

#3 smrdd

smrdd

    New Member

  • Members
  • Pip
  • 2 posts

Posted 18 November 2014 - 01:25 AM

After it faulted again (three builds in), I tried your instructions to no avail. tcpdump showed that frames were still being sent as expected, and the ACT LED was lit. Also, the built-in switch seemed to be unresponsive?!

 

Thank you for your help.






1 user(s) are reading this topic

0 members, 1 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.