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.

mohammad's Content

There have been 53 items by mohammad (Search limited from 03-May 23)


By content type

See this member's


Sort by                Order  

#47152 Netduino Plus 1 Firmware v4.2.0 (update 1)

Posted by mohammad on 13 March 2013 - 03:57 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Chris,

 

Thank you so much for your reply and your attention.

The line I get those exceptions is this one:

mem = new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.None, 512);

In addition, I didn't try it with any lower-capacity card.

 

Cheers,

Mohammad

 




#47091 Netduino Plus 1 Firmware v4.2.0 (update 1)

Posted by mohammad on 12 March 2013 - 05:18 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi all,

 

I upgraded the firmware of my Netduino Plus from 4.1.0.6 to the new firmware introduced in this thread.

Now, I am writing something on a 4GB MicroSD, but I faced with the following errors. Would you please help me solve this problem?

 

My Code:

using System;using System.IO;using Microsoft.SPOT.IO;using System.Net;using System.Net.Sockets;using System.Threading;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.NetduinoPlus;namespace NetduinoPlusApplication1{    public class Program    {        static string path = "SDSWEIoT.log";        public static FileStream mem;        public static void Main()        {            try            {                mem = new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.None, 512);            }            catch (Exception e)            {                Debug.Print(e.ToString());            }        }    }}

 

The received exceptions:

A first chance exception of type 'System.NotSupportedException' occurred in Microsoft.SPOT.IO.dllA first chance exception of type 'System.NotSupportedException' occurred in System.IO.dllSystem.NotSupportedException

 

Thanks in advance,

Mohammad




#49202 Netduino Plus 1 Firmware v4.2.0 (update 1)

Posted by mohammad on 08 May 2013 - 12:47 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi Chris,

 

Thank you so much for your reply and your attention.

The line I get those exceptions is this one:

mem = new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.None, 512);

In addition, I didn't try it with any lower-capacity card.

 

Cheers,

Mohammad

 

 

Hi all,

 

The problem was solved by Micro SD 2GB. It seems the Firmware 4.2.0.X doesn't know the Mirco SD 4GB and up.




#32957 Netduino Firmware v4.2.0 RC5 (Netduino + Netduino Plus)

Posted by mohammad on 31 July 2012 - 10:58 PM in Beta Firmware and Drivers

If you experience bugs with the .NET MF 4.2 RC5 firmware, please post about it in this thread.

Hi all,

I developed a program for Netduino Plus to work (read/write) with Micro SD 4GB.
This program worked perfect with firmware v4.1.1 betta, but after upgrading to firmware v4.2.0 RC4, I got these errors:
A first chance exception of type 'System.NotSupportedException' occurred in Microsoft.SPOT.IO.dll
A first chance exception of type 'System.NotSupportedException' occurred in System.IO.dll
System.NotSupportedException
Would you please help me solve this problem?

Special Thanks,
Mohammad



#38255 Netduino Firmware v4.2.0 RC5 (Netduino + Netduino Plus)

Posted by mohammad on 30 October 2012 - 06:05 PM in Beta Firmware and Drivers

Hi all,

No updates yet for Netduino Plus firmware to support Micro SD 4GB?

I developed a program for Netduino Plus to work (read/write) with Micro SD 4GB.
This program worked perfect with firmware v4.1.1 betta, but after upgrading to firmware v4.2.0 RC4, I got these errors:

A first chance exception of type 'System.NotSupportedException' occurred in Microsoft.SPOT.IO.dll
A first chance exception of type 'System.NotSupportedException' occurred in System.IO.dll
System.NotSupportedException
Would you please help me solve this problem?


Special Thanks,
Mohammad



#49737 Software reset

Posted by mohammad on 22 May 2013 - 12:06 AM in Netduino 2 (and Netduino 1)

Thanks Chris for your comment. Finally, I figured it out: http://forums.netdui...lus/#entry49735




#49401 Software reset

Posted by mohammad on 13 May 2013 - 11:43 PM in Netduino 2 (and Netduino 1)

Is the watchdog usable now ?

 

Actually, I have the same question for Firmware 4.2.0.0 (RC 5), since the following code doesn't work and the debugger always prints 00:00:00 for the Watchdog.Timer.

using System;using System.Net;using System.Net.Sockets;using System.Threading;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.NetduinoPlus;namespace NetduinoPlusApplication1{    public class Program    {        public static void Main()        {            Debug.Print(Watchdog.Timeout.ToString());            TimeSpan t = new TimeSpan(0, 0, 1);            Watchdog.Timeout = t;            Debug.Print(Watchdog.Timeout.ToString());            Watchdog.Enabled = true;            Thread.Sleep(3000);            Debug.Print("not rebooted yet!!!");        }    }}



#49857 Software reset

Posted by mohammad on 23 May 2013 - 07:46 PM in Netduino 2 (and Netduino 1)

The code you attached before would restart the device repeatedly between 10:00 and 11:00 AM, effectively rendering it unusable during that time. Am I right?

 

Yes, you are right :), but by using the Timer class, you can implement it more effectively.

 

Personally, I think there's no such thing as a software watchdog. You can't write software to check if another piece of software has locked up. If I remember correctly it's one of those NP complete problems within the theories of complexity. :)

I partially agree with you ;), you know in multi-threading world, sometimes one thread blocks all its processes (e.g., this problem), and the problem is solved by a simple reboot. At this time, one thread can be in charge of software reboot, and the other threads are doing their tasks. If any fail or error situation occurs, the reboot thread can perform its task :)




#49930 Software reset

Posted by mohammad on 24 May 2013 - 05:37 PM in Netduino 2 (and Netduino 1)

I'm sure you can find a watchdog IC that is available in DIP8 - just stick it down the breadboard, connect 2 wires (plus power) and you're good.

 

Thanks for your information. I will try to buy one. Since I am not expert, is there any specific name/ID for the IC your mentioned?




#49437 Software reset

Posted by mohammad on 14 May 2013 - 06:41 PM in Netduino 2 (and Netduino 1)

Hi Chris,

 

Thank you so much for your response. Does the following code act like what Watchdog does?

namespace WatchdogSimulation{    public class WatchdogSimulation    {        public static void Main()        {            while (true)            {                Debug.Print(DateTime.Now.Hour.ToString());                if (DateTime.Now.Hour > 10)             //Watchdog.Timeout = 10h                    PowerState.RebootDevice(false);     //Watchdog.Enabled = true;                Thread.Sleep(300000);                   //Wait 5min            }        }    }}

The purpose of mine is to simulate the reboot button pressing every 10 hours.




#49734 Hardware watchdog on Netduino Plus

Posted by mohammad on 21 May 2013 - 11:46 PM in Netduino Plus 2 (and Netduino Plus 1)

 

This might be useful for your watchdog prodecures: http://forums.netdui...-netduino-plus/ (although it is a software reboot).




#49443 Hardware watchdog on Netduino Plus

Posted by mohammad on 14 May 2013 - 07:47 PM in Netduino Plus 2 (and Netduino Plus 1)

Latest version is much more stable, thanks ToniA!

 

Unfortunately my SD Card that worked fine in 4.1, doesn't work in 4.2 :(

Throws the Unsupported Exception in System.IO

 

Is your SD card more than 2GB? The firmware 4.2 only knows the SD cards 2GB and 1GB.




#49855 Hardware watchdog on Netduino Plus

Posted by mohammad on 23 May 2013 - 07:39 PM in Netduino Plus 2 (and Netduino Plus 1)

That's not a watchdog, it's a scheduled reboot.

 You are right, so I should not consider them interchangeably.

 

have you tried out my firmware build?

No, since the firmware of your library was different from mine.

 

 

What are the problems you mention in the other thread ('I had a problem for 1 month to use a Watchdog mechanism in Netduino Plus') ?

The watchdog problem :) to reboot the Netduino Plus after a specific time.




#49740 Socket Exception 10050 after an hour

Posted by mohammad on 22 May 2013 - 12:17 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi all,

 

After spending 2 months on this problem, finally I could solve it. It was fixed by using a watchdog solution: http://forums.netdui...lus/#entry49735

Now, my device is working well and continuously for 10 days.

 

Good Luck




#48851 Socket Exception 10050 after an hour

Posted by mohammad on 29 April 2013 - 07:09 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi all,

 

I have the same problem with some minor differences.

I am sending heart beats every 1min to a data service. My Netduino Plus has a Valid IP address with DHCP enabled in its network configurations. After some hours (e.g. max 56 hours, mean 32 hours in 10 experiments), the network thread stops with no exception.

I tried 10 different methods as probable solutions, but all failed:

  • Using single threading instead of multi-thread programming (asking Netduino to only process the single networking task).
  • Using C# HttpWebRequest/Response library
  • Socket Programming instead of the C# HTTP library.
  • Considering a fixed value for Thread.sleep() in the infinite loop (while true) of heart beat instead of WaitUntilNextPeriod() function which uses the CPU ticks.
  • Removing the infinite loop and trigger the heart beat function by the event driven function (based on the value received on COM port).
  • Using Debug.GC(true) at the beginning and end of each function to clean the memory.
  • Trying different heart beat frequency such as 1min, 2min, and 3min.
  • Considering Try-Catch in each function followed by relevant logs.
  • Mutex_lock and Mutex_unlock for the networking functions.
  • and so forth ....

Unfortunately, the problem exists after 2months and I couldn't find the solution yet :( Any help is appreciated a lot since this project is a part of my thesis and it should be done asap.

 

If you are interested to view my code, I attached into this message. This is the version with "Socket Programming" and "Thread.Sleep(Constant Value = 2min)" which worked longer than other versions (56 hours).

 

Cheers,

Mohammad

Attached Files




#31664 Netduino Plus maximum input voltage

Posted by mohammad on 06 July 2012 - 08:22 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Chris, Thanks for your useful reply. Cheers, Mohammad



#31656 Netduino Plus maximum input voltage

Posted by mohammad on 06 July 2012 - 06:12 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi all, Is there any way for Netduino to understand its input voltage value? Cheers, Mohammad



#49739 Netduino Plus stops running after a while

Posted by mohammad on 22 May 2013 - 12:13 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi all,

 

Just to keep you updated, my problem was fixed by using a watchdog solution: http://forums.netdui...lus/#entry49735

Now, my device is working well and continuously for 10 days.

 

Thanks all specially Ziggurat29 for your valuable comments.




#49271 Problem using AnalogInput

Posted by mohammad on 09 May 2013 - 12:23 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi FVN.Net,

 

I exactly have the same problem. Could you solve the problem? I followed this post and tried everything Kem said (Thanks Kem), but all failed.

I really appreciate if you help me solve it.

 

Thanks,

Mohammad




#48444 Netduino Plus stops running after a while

Posted by mohammad on 16 April 2013 - 08:10 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi there,

 

My Netduino Plus has been programmed in a way that it sends heart beat requests (every minute) frequently to a data service. Unfortunately, after 1 (or sometimes 2) day(s) it stops running with no error or no reason. Is there any limitations on the Netduino Plus hardware structure?

I tested the data service with my PC as a client (instead of Netduino Plus) to send heart beat requests, so I was convinced there is no problem on the data service.

 

FYI. It has no power limitation. I mean its power is provided by a USB cable connected to my computer.

 

Any comments, advice and solutions are more than welcome.

 

Thanks for your time and attention,

Mohammad




#48865 Netduino Plus stops running after a while

Posted by mohammad on 30 April 2013 - 12:35 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi!

 

The problem could be such that it won't show as an exception but simply lock up. Could be you run out of memory in such away that there's not enough memory to even be able to fire and exception.

 

Here are a few questions for which answers might help you in trouble shooting:

 

1. Are you debugging the Netduino for the whole duration of the test?

2. Does it run for a longer time or about the same when not debugging?

3. Does it run for a longer time when not attached to USB but using an external power source?

4. What do you have to do in order for the Netduino to run again - is a soft reset enough or do you have to cycle power (i.e. USB)?

5. Can you talk to the Netduino from MFDeploy when it has stopped?

 

For this kind of long running "critical" stuff you could use a watch dog. I don't know if you can access the integrated watch dog from managed code but if not, there are watch dog modules/chips that you can connect externally. A watchdog could automatically restart your Netdunino every two hours or whatever as appropriate by power cycling (most reliable) or by issuing a reset.

 

Hi Hanzibal,

 

Thanks a lot for your valuable reply. The reason that I am replying late is becasue I was testing my Netduino+ based on your comments.

1. It is not dependent of my debugging. I have the same problem when I also run it in a non-debug environment.

2. Almost the same (the working time is not constant in both situation).

3. I didn't try.

4. Soft reset is enough.

5. I haven't tried it yet.

 

Honestly, I have no watch dog module. How does it understand when it should restart? Can I implement it in my code? Any advice would be appreciated.

 

Thanks again,

Mohammad




#48974 Netduino Plus stops running after a while

Posted by mohammad on 03 May 2013 - 06:55 AM in Netduino Plus 2 (and Netduino Plus 1)

fwiw, mohammad,  I have had a similar problem; in my case with ethernet.  an easy way to stimulate it:

 

*  have a persistent connection to my server.  this runs in a separate thread.

*  in the absence of other traffic, periodically I send heartbeat, and if connection is lost or non-responsive, it loops around to restore the connection, with appropriate backoff, etc.  this code is all thoroughly tested when running on desktop.  I can unplug cables, take interceding routers and server process up and down, and things are resilient.

*  if, however, I am running the same code on the netduino, if the server process it taken down

*  the netduino will detect it, try to reconnect (to the not-yet-back-up server process)

*  and hang forever

*  but only the thread that is handling the ethernet server connection is affected.  my other threads are lively.

*  I confirmed that, while in the fail mode with the locked ethernet thread, I can successfully issue a PowerState.RebootDevice() and at least restart the system.

 

The lockup you are experiencing seems to be similar, but I don't know what stimulates the problem in your case, so maybe it is different.  Anyway, here is what I have done to cope with it -- and mind you I haven't finished implementing yet because I'm on other things just now, so fair warning, but initial testing makes me confident that it works:

 

*  the netduino chip has a hardware watchdog, but it is not really available to us, alas.  so, in lieu of that....

*  I made a software watchdog.  (I also added a MAX824 (-compatible; I think it is actually a diodes inc chip) to my PCB, but that was last minute and I haven't written code for it)

*  the software watchdog works like this:

  *  all my various 'app services' (worker thread that do stuff, like handling the ethernet connection to my infrastructure)

  *  call a 'checkin' function with my 'watchdog service'.  that checkin() says 'reboot if you don't hear back from me in XXX ms, and oh please call this method if you reboot because someone else failed'

  *  a checkin discards any previous outstanding checkin

  *  the watchdog service periodically checks for expired checkin()s (Kentucky Fried Checkins?) and if any were found, it will issue the reboot

 

In my case, I did it this way because I already had all these app services coded, so I needed to retrofit to that impl.  They did handily have idle() methods which I could use those to do the checkin(), but the duration needed to vary because some activities would normally block for up to 3 min in some cases (like cranking up GSM).  The particulars of your design my mean you can do it more simply that I was able to do or think of.

 

hth; dave

 

 

Hello,

 

I just want to let you know that there is firmware with software watchdog added:

 

http://forums.netdui...o-plus/?p=47334

 

Maybe it will solve your problem.

 

Regards

 

 

Hello again Mohammad,
I really think you should read carefully what the other two guys just wrote, but in answer to your question, a watchdog normally listens to some kind of "alive beacon", "heartbeat" or "check-in" (like the others wrote). When the watchdog has not seen/heard the beacon for some pre-defined time (timeout), it issues a reset causing a "reboot". This way, a watchdog could keep your application from locking up.

Watchdogs are for the situations where you can't actually figure out why things eventually go wrong and so instead of trying to solve the actual issue, you simply restart the whole thing. This is a "when all else has failed" type of thing to do but sometimes it's the only thing to do. Personally, I would never trust a software watchdog, instead I want someone to "pull the plug" and then reinsert it again afterwards.

 

Hi All,

 

Thanks for your valubale comments. I am exactly doing as the same as Ziggurat29. Based on my understanding, I should reboot my Netduino after some time (e.g. 10 hours). At this time, the only thing I did was a software reboot by means of Powerstate.RebooteDevice(false). Is it right?

 

Thanks,

Mohammad




#31632 BlueSMiRF Silver (Bluetooth)

Posted by mohammad on 05 July 2012 - 07:33 PM in Netduino Plus 2 (and Netduino Plus 1)

The best solution to solve the problem: http://mohammad.geoc...ebsite/blog.php



#49201 Netduino Plus Network dies

Posted by mohammad on 08 May 2013 - 12:41 AM in Netduino Plus 2 (and Netduino Plus 1)

First of all, the watchdog functionality is not there in the stock firmware. All the interfaces are there, but no functionality.

 

If you would want to use the firmware I built, look at this message, it has a code sample: http://forums.netdui...ge-2#entry47334

 

Hi ToniA,

 

Thanks for your reply. It is a bit rediculous that the interfaces and methods are available, but they are fake :D

Anyway, I gave up to use watchdog for now, but I will surely use your firmware someday.




#49738 Netduino Plus Network dies

Posted by mohammad on 22 May 2013 - 12:08 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi all,

 

My "network die problem" was solved after spending 2 months on it :) Now, I am so happy. The solution I used was software watchdog developed by my own. If you are interested in the solution, take a look at this link: http://forums.netdui...lus/#entry49735

I will later publish a post to elaborate the whole procedures and solutions that were useless except the software watchdog.

 

Good luck :)





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.