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 22-June 23)


By content type

See this member's


Sort by                Order  

#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




#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

 




#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.




#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



#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



#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.




#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!!!");        }    }}



#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




#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?




#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).




#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.




#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.




#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



#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



#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




#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




#49749 How to reboot netduino + from code on a socket exception?

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

This link might be useful to reboot the Netduino Plus by software http://forums.netdui...lus/#entry49735

 

Good Luck,

Mohammad




#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




#48675 how do you read analog signal to digital

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

Could you show us your code and circuit so we can diagnose the issue?

 

Hi Verdis,

 

Here is my code which is now working properly:

using System;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.NetduinoPlus;namespace SWEIoT{    public class Sensor:Constants    {        AnalogInput voltagePort;        OutputPort lowPort, highPort;        public Sensor()        {            //Temperature senso           voltagePort = new AnalogInput(AnalogChannels.ANALOG_PIN_A1);           lowPort = new OutputPort(Pins.GPIO_PIN_A0, false);           highPort = new OutputPort(Pins.GPIO_PIN_A2, true);        }        public double read()        {            double rawValue = voltagePort.ReadRaw();            double value = (rawValue * maxVoltage) / maxAdcValue;            double result = (((value - 0.5) * 1000) / 10) - 4;            return result;        }    }}

 

Thanks for your concern,

Mohammad




#47196 how do you read analog signal to digital

Posted by mohammad on 14 March 2013 - 06:02 PM in Netduino Plus 2 (and Netduino Plus 1)

Hello Dave,

 

I really appreciate you. I read some threads, but none of them couldn't solve my problem.

 

Cheers,

Mohammad




#49858 Software Reboot for Netduino Plus

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

Thanks Khmesmer.

I am working with Netduino Plus (or generally microcontroller programming) since 2012. I recommend you to follow the "getting started with the nternet of Things" book, first. Then, try to implement codes and ask your questions in this forum. To be honest, this forum and its members :) helped me a lot in my projects and learning.

If you have any questions, feel free to let me know.

 

Good Luck




#49735 Software Reboot for Netduino Plus

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

Hello,

 

I had a problem for 1 month to use a Watchdog mechanism in Netduino Plus. FYI, the "Watchdog" acts as a software reboot with a predefined timer.

The watchdog functions have been already developed in C# Micro Framework, but they never work. Based on the comment I got from Chris: "No watchdog implemented in the gen1 hardware.  We're currently designing a software update for gen2 hardware which would enable it."

Finally, I created my own watchdog function which works well to reboot the Netduino after a fixed time (e.g., 5h).

public class MainFrame{        const Int32 wdDelay = 1000 * 60 * 60 * 5;   // 5h        static Timer wdtimer = new Timer(watchdog, null, wdDelay, 0);                public static void Main()        {            // Write your codes here        }        public static void watchdog(object state)        {            PowerState.RebootDevice(false);     //Watchdog.Enabled = true;        }}

I hope it helps you in your project :)




#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.





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.