NoxiaZ's Content - 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.

NoxiaZ's Content

There have been 11 items by NoxiaZ (Search limited from 27-April 23)


By content type

See this member's

Sort by                Order  

#56451 Write to SD Card

Posted by NoxiaZ on 26 February 2014 - 01:15 PM in Netduino Plus 2 (and Netduino Plus 1)

Ohh :(

 

And thanks for you answer ;)




#56445 Write to SD Card

Posted by NoxiaZ on 26 February 2014 - 11:48 AM in Netduino Plus 2 (and Netduino Plus 1)

I just reformatting it, and its a SDHC 8GB - Is that a problem? :/




#56443 Write to SD Card

Posted by NoxiaZ on 26 February 2014 - 10:53 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi Chris,

 

i have tried everything nearly for writing.

 

  try
  {
  string[] directories = Directory.GetDirectories("");
  string dir = "";
  Debug.Print("Directories count: " + directories.Length);
  for (int i = 0; i < directories.Length; i++)
  {
  Debug.Print("Directory: " + directories[i]);
  if (directories[i].ToLower().IndexOf("sd") >= 0)
  {
  dir = directories[i];
  Debug.Print("Found: " + dir);
  }
  }

  Debug.Print("Finding files");
  string[] files = Directory.GetFiles(dir);
  Debug.Print("File count: " + files.Length);
  for (int i = 0; i < directories.Length; i++)
  {
  Debug.Print("Files: " + files[i]);
  }

  Stream st = new FileStream(dir + @"Log.txt", FileMode.OpenOrCreate);
  }
  catch (Exception ex)
  {
  Debug.Print("Error: " + ex);
  }

 

And this is the log:

 

Directories count: 1
Directory: SD
Found: SD
Finding files
A first chance exception of type 'System.NotSupportedException' occurred in Microsoft.SPOT.IO.dll
A first chance exception of type 'System.IO.IOException' occurred in System.IO.dll
Error: System.IO.IOException




#56385 Write to SD Card

Posted by NoxiaZ on 25 February 2014 - 10:58 AM in Netduino Plus 2 (and Netduino Plus 1)

Hey,

 

Im using framework 4.3 and trying to write to an SD card, but gives me an error:

 

An unhandled exception of type 'System.NotSupportedException' occurred in System.IO.dll

 

on this line:

 

Stream st = new FileStream(@"SDtest.txt", FileMode.OpenOrCreate);

 

Whats wrong? :S




#53963 Netduino Plus 2 Firmware v4.2.2 (update 2)

Posted by NoxiaZ on 11 November 2013 - 12:05 PM in Netduino Plus 2 (and Netduino Plus 1)

Update- I was able to flash with the DFU file, and execute simple programs.  I still have not been able to set the MAC address with the same symptom that I posted in the previous message's screengrab.  

Any suggestions?

Thanks

 

Have you ever installed the v4.3 framework ? - Because im getting thet error if im using the tool from 4.3 to set mac adresse on a board with 4.2. Use the tool from 4.2 to set the mac address and it should work :)




#53844 Intermittent network error. Socket gets dropped

Posted by NoxiaZ on 06 November 2013 - 12:33 PM in Netduino Plus 2 (and Netduino Plus 1)

You got no error handling in your while loop, so if you get any exception the loop will exit.

Use

try

{

...

}

catch { }




#53077 Netduino Plus 2 - Socket seems to depend on debug

Posted by NoxiaZ on 07 October 2013 - 09:47 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

i really stripped down my project - to pretty much a copy of the suggest code, but stil a lot of problems.

 

Know even then ping of the dut will fail in debug mode - I have tried a complete erase of the netduino and a new flash of the firmware, but stil the problem exists.

 

I did fill in the correct mac address and ip address after the complete erase.

 

Any ideas?

 

Martin

 

Paste your code, its nearly impossible to help you without seeing you code :)




#51978 How to read data html with web server?

Posted by NoxiaZ on 06 August 2013 - 12:01 PM in Netduino Plus 2 (and Netduino Plus 1)

Hmm.. think this way is alittle bit better, and you can use it to all the fields :)

string request = "GET / localhost? User = foo HTTP/1.1";Hashtable hashtable = new Hashtable();int indexQuestionMark = request.IndexOf("?");int httpLength = request.Length-request.LastIndexOf(" ") ;string data = request.Substring(indexQuestionMark +1,request.Length-indexQuestionMark-httpLength -1).Trim();string[] fields = data.Split('&');for(int i=0;i < fields.Length;i++){ string[] field = fields[i].Split('='); hashtable.Add(field[0].Trim(),field[1].Trim());}Console.WriteLine(hashtable["User"]);

Hope this help you a bit :)




#51629 Netduino plus 2 Ethernet problem

Posted by NoxiaZ on 22 July 2013 - 11:13 AM in Netduino Plus 2 (and Netduino Plus 1)

JoopC, btw. i have also found out that there are no Connection Timeout on  "Dns.GetHostEntry("api.pachube.com")" and the "Socket.Connect()" - So what you are facing is the timeout problem, (seems like it), because it stops printing out your debug information, but i could be wrong.

 

The only way i can find to fix the problem is to create a watchdog that need to be triggered after "new Socket(..)" - But that’s not a solution, it’s just a work around and the problem will still exist




#51628 Netduino plus 2 Ethernet problem

Posted by NoxiaZ on 22 July 2013 - 10:50 AM in Netduino Plus 2 (and Netduino Plus 1)

JoopC, Yes it seems to be the same, but I’m not sure i understand how you fixed your problem :)

 

Nakchak, that’s correct, it’s not the same like disconnection the router or blocking the traffic with a firewall, but it doesn’t change anything at all. The same happen, so it’s just easier to unplug the cable to simulate it. (And it should still work) :)

I can’t wrap it inside a using block, it would be possible to use the socket after the using block ends, it has to stay open all the time. That’s the reason why it is set to a global variable at the end.

There doesn’t exist any "Dispose()" on the socket class in the micro framework.?

 

But again i can’t see what that would help, because it fails creating a local socket that isn’t even connected or anything, only the parameters are set?




#51623 Netduino plus 2 Ethernet problem

Posted by NoxiaZ on 22 July 2013 - 10:03 AM in Netduino Plus 2 (and Netduino Plus 1)

[font="calibri, sans-serif;"]Hey, [/font]

 

[font="calibri, sans-serif;"]I got some big issues with the netduino when I’m unplugging the network cable (To simulate network failure) and after a while (1-2 minutes sometimes more sometimes less) plugging in the network cable again it still won’t connect to the server. [/font]

[font="calibri, sans-serif;"]I have attached 2 files “Debug info.txt” and “Netduino Info.txt”. [/font]

 

Attached File  Netduino Info.txt   1.43KB   20 downloads[font="calibri, sans-serif;"] contains all the information about the netduino, firmware and such stuff.[/font]

 

Attached File  Debug Info.txt   14.54KB   8 downloads [font="calibri, sans-serif;"] contains information about the program that runs on the netduino and what it is trying to do. The line “Network: False” and “Network: True” is when I unplug the network cable, and plug it in again. You can see that after it write “Network: True” It keeps retrying and get exception with the socket connection.[/font]

 

 

private void Connect()    {	    connectThread = null;	    connectThread = new Thread(() =>	    {		    try		    {			    Print("Creating socket");			    Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); <-- This is where it fails???			    Print("Socket created");			    socket.ReceiveTimeout = 10000;			    socket.SendTimeout = 10000;			    //IPAddress ipAddress = HostnameToIPAdress(ServerHostname);			    //if (ipAddress == null)			    IPAddress ipAddress = IPAddress.Parse(ServerIP);			    EndPoint endpoint = new IPEndPoint(ipAddress, ServerPort);			    socket.Connect(endpoint);			    IsConnected = true;			    this.socket = socket;		    }		    catch (Exception e)		    {			    Print("Exception: " + e.ToString());			    IsConnected = false;		    }	    });	    connectThread.Start();	    int timeout = 0;	    while (connectThread.ThreadState != ThreadState.Stopped && connectThread.ThreadState != ThreadState.Aborted)  	  {		    if (timeout > 10)		    {			    Print("Timeout! ABORT!");			    connectThread.Abort();			    IsConnected = false;			    throw new TimeoutException();		    }		    Thread.Sleep(1000);	    }	    connectThread = null;    }

[font="calibri, sans-serif;"]I created everything in a thread for being sure it would n[/font][font="calibri, sans-serif;"]ever hang, it’s my own little timeout function.[/font]

[font="calibri, sans-serif;"]As you can see in the log it start failing at this line[/font][font="calibri, sans-serif;"] “[/font][color=#2b91af;][font="calibri, sans-serif;"]Socket[/color][/font][font="calibri, sans-serif;"] socket = [color=#0000FF;]new[/color][/font] [color=#2b91af;]Socket[/color]([color=#2b91af;]AddressFamily[/color].InterNetwork, [color=#2b91af;]SocketType[/color].Stream, [color=#2b91af;]ProtocolType[/color].Tcp);” [font="calibri, sans-serif;"]and I have no idea how to fix that? – I have tried nearly everything, also using the global variable instead of a local, but no difference.? You can see in the log that it stop printing [/font] “[color=#a31515;]Socket created”[/color][font="calibri, sans-serif;"] but just throw an exception [/font]

 

[font="calibri, sans-serif;"]Log (View the file for more detailed log information):[/font]

[font="calibri, sans-serif;"]A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll[/font]

[font="calibri, sans-serif;"]06/01/2011 00:06:01 : Exception: System.Net.Sockets.SocketException[/font]

[font="calibri, sans-serif;"]The thread '<No Name>' (0x23) has exited with code 0 (0x0).[/font]

[font="calibri, sans-serif;"]06/01/2011 00:06:01 : Reconnect failure[/font]

[font="calibri, sans-serif;"]06/01/2011 00:06:11 : Creating socket[/font]

[font="calibri, sans-serif;"]A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll[/font]

[font="calibri, sans-serif;"]06/01/2011 00:06:12 : Exception: System.Net.Sockets.SocketException[/font]

[font="calibri, sans-serif;"]The thread '<No Name>' (0x24) has exited with code 0 (0x0).[/font]

 

[font="calibri, sans-serif;"]I hope you guys can help me solving the problem, because it seems like I’m not the only one seeing this problem. I have been reading a lot about Ethernet problems on the forum, where people have created a watchdog to restart the netduino. But I don’t think that it’s the right way to do it, I want this bug to get fixed instead of creating some code to work around the problem, and I’m sure that it will help a lot of people [/font][font="wingdings;"] :)[/font]

 

[font="calibri, sans-serif;"]I can say that the same code is running on Windows and Linux with mono where it is working perfectly. [/font]

 

[font="calibri, sans-serif;"]Best regards [/font]

[font="calibri, sans-serif;"]Jesper [/font][font="wingdings;"] :)[/font]





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.