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.

Terrence's Content

There have been 24 items by Terrence (Search limited from 25-April 23)


By content type

See this member's

Sort by                Order  

#63851 Deep dive on Asix AX88796C (Netduino 3 Ethernet's fancy new networking chip)

Posted by Terrence on 10 August 2015 - 09:30 PM in Netduino 3

>>Does that get you on the right path?

 

Yes, it does.

 

Thank you.

 

[Edit]

 

I have uninstalled and re-installed netmf-v4.3.2-sdk-QFE2-RTM, and the R2-Beta and none of them install the samples in the documents folder like it says it will.

 

What is the magic trick to getting the samples?  Can't seem to find a link to download them separately.

 

Thanks for your help.




#63848 Best practices: how to wait for a Wi-Fi network connection

Posted by Terrence on 10 August 2015 - 09:27 PM in Netduino 3

Thank you Chris.




#63832 Best practices: how to wait for a Wi-Fi network connection

Posted by Terrence on 09 August 2015 - 06:23 PM in Netduino 3

In #4 above,

Microsoft.SPOT.Net.NetworkInformation
and
System.Net.NetworkInformation

1. why are you using both?

2 My System.Net does not have .NetworkInformation. What dll is it in?



#63830 Deep dive on Asix AX88796C (Netduino 3 Ethernet's fancy new networking chip)

Posted by Terrence on 09 August 2015 - 03:50 PM in Netduino 3

Is there sample code out there that shows how to post data to a webapi using ND3 Ethernet? I would like to start off fresh and use come code that you experts have approved. I am sure my old code is riddled with inefficiencies.

Thank you.



#63803 Interrupt stops working after a while?

Posted by Terrence on 06 August 2015 - 10:18 PM in Netduino Plus 2 (and Netduino Plus 1)

Nevyn, Something has come up that is taking my attention from this project.  I hope to get back to it soon, and I hope you will read what my findings are. 

 

Thank you for keeping up with my posts.

 

Terrence




#63720 Interrupt stops working after a while?

Posted by Terrence on 30 July 2015 - 09:06 PM in Netduino Plus 2 (and Netduino Plus 1)

I am going to try that out.

 

I will do 100 in a second to see if it melts.

I will do 1 per second so I should get an error in a few hours I hope.

I will report back.




#63704 Interrupt stops working after a while?

Posted by Terrence on 29 July 2015 - 01:55 PM in Netduino Plus 2 (and Netduino Plus 1)

Mark thanks for hanging in here with me on this problem.

 

I am a novice so please bear with me.

 

The Debug.GC(true) returns the amount of memory, and after I clear it each time it returns the same amount.

 

>>Frequency of PIR. 

Well sometimes its 2-3 per hour, but sometimes its 80-90, so I wouldn't think that was overwhelming the framework, would you?

 

>>Auto generating a bunch over a couple of hours to force the issue is a great idea.

 

>>555 Timer?

I will look into that.

 

Thank you again for your thoughts.




#63692 Interrupt stops working after a while?

Posted by Terrence on 28 July 2015 - 09:48 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks Chris and Nevyn

 

Ok, so I put a Debug.GC(true) in my loop to fire if the PIR fired.  I restarted the board on Sunday and the last PIR hit was this morning at 9:00 am CST.  So it lasted about 2 days this time.  The 15 minute timer heartbeat messages are still getting sent an logged in Azure.

 

I am going to remove the GC in the PIR and add it to the timer loop....but that doesn't make sense.  Obviously there is no memory issue because the timer keeps firing and sending data to Azure.

 

I will attempt to catch an exception and write it to the SD card.

 

What do you think about the fact the 15 min timer keeps on working, but the PIR does not?




#63663 Interrupt stops working after a while?

Posted by Terrence on 26 July 2015 - 06:11 PM in Netduino Plus 2 (and Netduino Plus 1)

>>Have you though about wrapping the while loop in an exception handler?

Well it takes about a week to get reach the error state. I can't keep the device connected to my machine that long to "catch" the error. I guess I could write it to the sd card.

Is that what you were thinking?

I am open for lots of ideas.

Thanks for your thoughts on this.



#63659 Interrupt stops working after a while?

Posted by Terrence on 25 July 2015 - 07:45 PM in Netduino Plus 2 (and Netduino Plus 1)

Mark, those are some good ideas.

Thank you for the suggestions. I will put some of them into action.

Memory leak would explain it, except for the fact that the 15 min heartbeat still fires and logs to azure?

Still a good idea to tighten it up though.

Terrence



#63653 Interrupt stops working after a while?

Posted by Terrence on 25 July 2015 - 02:17 AM in Netduino Plus 2 (and Netduino Plus 1)

Chris, can you take a look at this? Please.



#63637 How can customer configure wifi password

Posted by Terrence on 24 July 2015 - 03:24 AM in Netduino 3

No comment on this topic?




#63636 Interrupt stops working after a while?

Posted by Terrence on 24 July 2015 - 02:42 AM in Netduino Plus 2 (and Netduino Plus 1)

I have a ND Plus 2 that has a PIR sensor attached.

Everytime the PIR is triggered by movement I log the bit into Azure.

I have a heartbeat bit I loggin to Azure every 15 minutes to tell me the gateway is alive.

I have been running this code on my ND Plus 2 for many months. 24 X 7 without issue.

As the weeks wear on, my PIR data stops getting logged to Azure.

I reboot the board and things run fine for weeks before I have to reboot.

Then and they run fine for a week before I have to reboot.

Now I have to reboot every day and then the PIR only logs for a few hours.

 

My HeartBeat interupt keeps on logging to Azure.

So my thought is that the PIR interupt is not firing.

 

But I have no idea, I am new at this fun area of micro boards and IOT.

Any idea on what might be happening, or how to improve my code to make it more robust?

Thank you.

public class Program
{
	#region Properties

	private static string SubLocationID = "Gateway";

	private static int HeartBeatTimerPeriod = 15;
	private static Timer HeartBeatTimer = null;
	private static TimerCallback TimerCallback = null;
	private static DateTime LastMotionDetectedTime;

	private static OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
	private static bool MotionDetected = false;
	private static InterruptPort PIRInterupt;
	private static string MACAddress;
	private static InterruptPort sdCardStatusPort;

	#endregion

	#region Methods

	public static void Main()
	{

		if (Program.GetIPAddressAndSetTime(out Program.MACAddress))
		{
			Program.AddData(Program.MACAddress, PIRLocal.MessageType.START);

			Program.TimerCallback = new TimerCallback(HeartBeatTimerInterrupt);
			Program.HeartBeatTimer = new Timer(Program.TimerCallback, null, 0, Program.HeartBeatTimerPeriod * 60000);

			//set the interupts after we get an ip address and time.
			PIRInterupt = new InterruptPort(Pins.GPIO_PIN_D8, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeHigh);
			PIRInterupt.OnInterrupt += PIRInterupt_OnInterrupt;

			NetworkChange.NetworkAddressChanged += new NetworkAddressChangedEventHandler(NetworkChange_NetworkAddressChanged);
			NetworkChange.NetworkAvailabilityChanged += new NetworkAvailabilityChangedEventHandler(NetworkChange_NetworkAvailabilityChanged);

			while (true)
			{
				if (MotionDetected)
				{
					Program.MotionDetected = false; //turn this off.
					Program.Blink(1, 75);
					Program.AddData(Program.MACAddress, PIRLocal.MessageType.PIR);
				}
				Thread.Sleep(500);
			}
		}
	}

	private static bool GetIPAddressAndSetTime(out string macAddress)
	{
		while (!Network.GetIPAddress(out macAddress)) { }

		if (NTP.SetUTCTimeFromNtpServer())
		{
			return true;
		}
		else
		{
			return false;
		}
	}

	private static void AddData(string macAddress, PIRLocal.MessageType messageType)
	{
		WebClient wc = new WebClient("http://xxxxxxx.azurewebsites.net/api/values", "Post");
		PIRLocal sd = new PIRLocal(macAddress, Program.SubLocationID, messageType);
		wc.Data = sd.ToJson();
		wc.Submit();

		Debug.Print(wc.ResponseStatusCode);
		Debug.Print(wc.ResponseStatusDescription);
		Debug.Print(wc.Data);
	}

	#endregion

	#region Interupts

	private static void HeartBeatTimerInterrupt(object state)
	{
		Program.AddData(Program.MACAddress, PIRLocal.MessageType.HB);
	}

	static void PIRInterupt_OnInterrupt(uint data1, uint data2, DateTime time)
	{
		Program.MotionDetected = true;
		Debug.Print(data1.ToString() + " - " + data2.ToString() + " - " + time.AddHours(-6).ToString());
		//bool pin = pirInterupt.Read();
	}

	static void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
	{
		//Program.GetIPAddressAndSetTime();
		Program.AddData(Program.MACAddress, PIRLocal.MessageType.NetworkAddressChanged);

	}

	static void NetworkChange_NetworkAddressChanged(object sender, EventArgs e)
	{
		Program.GetIPAddressAndSetTime(out Program.MACAddress);
		Program.AddData(Program.MACAddress, PIRLocal.MessageType.NetworkAvailabilityChanged);
	}

	#endregion
}




#63120 How can customer configure wifi password

Posted by Terrence on 12 June 2015 - 06:22 PM in Netduino 3

I would like to deliver the nd3wifi boards with my sensors attached to my paying customers.
 
Why method is available for them to select their router and key in their wifi password?
 
Surely I am not the only person with this requirement?
 
Thank you for your thoughts.

[edit++]

So I am googling around on this topic and I find this great TI wifi chip that has WiFi Provisioning, just what I need...

http://processors.wi...xx_Provisioning

<snip>
Wi-Fi provisioning is the process of connecting a new Wi-Fi device (station) to a Wi-Fi network (access point). The provisioning process involves loading the station with the network name (often referred to as SSID) and its security credentials. The Wi-Fi security standard distinguishes between personal security, mostly used in homes and businesses, and enterprise security, used in large offices and campuses. Provisioning a station for enterprise security usually involves installing certificates, which are used to verify the integrity of the station and the network by interaction with a security server managed by the IT department. Personal Wi-Fi security, on the other hand, needs to be handled by users at home, and it simply involves typing a pre-defined password. To provide robust security, the password can be as long as 64 characters.
</snip>

...and I think I will include this chip on the board that I will eventually get into production...then I come back here and do some more reading and low and behold...the nd3wf has the chip...TaDa!!!

But it is not enabled according to this forum post.

http://forums.netdui...hip/#entry62307

So I put my vote in for Chris to spend this weekend getting this feature enabled. :)



#62060 Will this power supply work?

Posted by Terrence on 08 April 2015 - 07:13 PM in Netduino Plus 2 (and Netduino Plus 1)

I now see the specs

 

6v-9v only.




#62059 Will this power supply work?

Posted by Terrence on 08 April 2015 - 05:13 PM in Netduino Plus 2 (and Netduino Plus 1)

I am sorry if this has been answered before.

 

I have a bunch of wall warts that...

 

Output: 12V - 1.5A, +center

 

 

Will I melt the world if I run my Netduino Plus 2 on these?

 

If I can, are there any drawbacks about using them?

 

Thank you.

 

Terrence




#61839 raspberry pi 2

Posted by Terrence on 10 March 2015 - 07:45 PM in General Discussion

Juzzer, what boards are those?  The Carbon and Helium?




#61777 Preferred way to get IP from DHCP...

Posted by Terrence on 04 March 2015 - 02:52 PM in Netduino Plus 2 (and Netduino Plus 1)

Herb, thanks for the info and the link.  Just what I was looking for.

Terrence




#61771 Preferred way to get IP from DHCP...

Posted by Terrence on 04 March 2015 - 02:27 AM in Netduino Plus 2 (and Netduino Plus 1)

So no one accesses the internet from their nd+2? 

 

Surely someone is using this great platform to hit the internet.




#61761 Preferred way to get IP from DHCP...

Posted by Terrence on 02 March 2015 - 05:06 PM in Netduino Plus 2 (and Netduino Plus 1)

What is the preferred library to get an IP address from my DHCP server?

I can't seem to find a consensus.

 

Thank you.

Terrence

 

 




#61041 PIR interrupt fires exact opposite

Posted by Terrence on 22 December 2014 - 02:05 AM in Netduino Plus 2 (and Netduino Plus 1)

Ok, I figured it out, I had my pins connected incorrectly.

 

Thank you CT1 for your reply.

 

Terrence




#61036 PIR interrupt fires exact opposite

Posted by Terrence on 21 December 2014 - 12:17 PM in Netduino Plus 2 (and Netduino Plus 1)

pirInterupt 
= new InterruptPort(Pins.GPIO_PIN_D8, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeHigh);

pirInterupt.OnInterrupt += pirInterupt_OnInterrupt;

static void pirInterupt_OnInterrupt(uint data1, uint data2, DateTime time)
{
	Program.flag = true;
	Debug.Print(data1.ToString() + " " + data2.ToString());
}


Netduino Plus 2

Netmf 4.3

VS 2013

 

I have a PIR motion detector sensor attached to my board and it fires continuously.

 

I started waving my hand in front of it and I noticed that it stopped firing.

 

So the interrupt fires when there is no motion and does not fire when there is motion.

 

I have tried this on analog and digital ports.  I have tried reversion the gnd and vlt pins, but that did not fix it.

 

Any idea what is happening?




#61035 Cant get an IP address

Posted by Terrence on 21 December 2014 - 11:28 AM in Netduino Plus 2 (and Netduino Plus 1)

Thanks guys for the reply.  Turns out setting the MAC address before did the trick.

 

Terrence




#60998 Cant get an IP address

Posted by Terrence on 17 December 2014 - 04:03 AM in Netduino Plus 2 (and Netduino Plus 1)

public static void WaitForIPAddress()
{
	byte[] MAC = { 0x5C, 0x86, 0x4A, 0x00, 0xF2, 0x15 };

	NetworkInterface ni;
	NetworkInterface.GetAllNetworkInterfaces()[0].EnableDhcp();
	NetworkInterface.GetAllNetworkInterfaces()[0].PhysicalAddress = MAC;

	while (true)
	{
		ni = NetworkInterface.GetAllNetworkInterfaces()[0];
		if (ni.IPAddress != "0.0.0.0") break;
		Debug.Print("Waiting for an IP Address...");
		Thread.Sleep(1000);
	}
}
}

I have a Netduino plus 2, running netmf 4.3.1

I can't get an ip address.  When I look at the network interface it tells me my dns ip address, but that number is actually my gateway address?  My IP address is always 0.0.0.0.

 

I have read other posts, and am using the suggested code.  Any help would be great.

Thanks.

Terrence

 

 

 





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.