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.

Wayneio's Content

There have been 24 items by Wayneio (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#52634 Xively

Posted by Wayneio on 07 September 2013 - 04:29 PM in Netduino Plus 2 (and Netduino Plus 1)

Anyone have any experience with Xively? (used to be cosm / pachube apparantly)

 

This is the first I have seen of this, and it looks like it will improve a lot upon my current set up, whereby the netduino writes all the code to a device connected on LAN, because I should be able to use this anywhere in the world!

 

My main question is if there is a library for the code for this, or any sample code?

 

Thanks!




#51894 Controlling a toy car from smart phone through WIFI

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

Can't understand a word of the video, but it looks good. Get a battery pack on the car to power the netduino, a web app with buttons and your sorted.




#51893 Write full website to browser

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

I'm using a web server to control devices in the house with the netduino. The code below writes a simple html page to the pc when typing in the netduinos ip address.

	    while (true)		    {			    Socket clientSocket = listenerSocket.Accept();			    bool dataReady = clientSocket.Poll(5000000, SelectMode.SelectRead);			    if (dataReady && clientSocket.Available > 0)			    {				    byte[] buffer = new byte[clientSocket.Available];				    int bytesRead = clientSocket.Receive(buffer);				    string request =				    new string(System.Text.Encoding.UTF8.GetChars(buffer));				    if (request.IndexOf("ON") >= 0)				    {					    outD7.Write(true);				    }				    else if (request.IndexOf("OFF") >= 0)				    {					    outD7.Write(false);				    }				    string statusText = "Light is " + (outD7.Read() ? "ON" : "OFF") + ".";				    string response = WebPage.startHTML(statusText, ip);				    clientSocket.Send(System.Text.Encoding.UTF8.GetBytes(response));			    }			    clientSocket.Close();		    }
public static string startHTML(string ledStatus, string ip)	    {		    string code = "<html><head><title>Netduino Home Automation</title></head><body> <div class="status"><p>" + ledStatus + " </p></div>        <div class="switch"><p><a href="http://" + ip + "/ON">On</a></p><p><a href="http://" + ip + "/OFF">Off</a></p></div></body></html>";		    return code;	    }

This works great, so I wrote a full jquery mobile website to use instead. But my problem is the jquery website only writes the html to the browser, with none of the JS/CSS files that are referenced in the HTML. How can I make sure the  browser reads all of these files?

 

The code I wrote to read the website from the SD is:

 private static string getWebsite()	    {		    try		    {			    using (StreamReader reader = new StreamReader(@"SDindex.html"))			    {				    text = reader.ReadToEnd();			    }		    }		    catch (Exception e)		    {			    throw new Exception("Failed to read " + e.Message);		    }		    return text;	    }



#51890 5v Power Supply?

Posted by Wayneio on 01 August 2013 - 05:31 PM in Netduino Plus 2 (and Netduino Plus 1)

iam using that:

 

http://at.mouser.com...ualkey967-LS355

 

i like it a lot. there are also more simmiliar aviable, with different voltages and power.

That looks good. Is there one with multiple outputs to control a few relays all across the house?




#51830 Broken Digital IO?

Posted by Wayneio on 31 July 2013 - 08:52 PM in Netduino Plus 2 (and Netduino Plus 1)

Cpu.Pin.GPIO_Pin13 is the problem. thats the reference to the hardware pins, like pin13 on the uC itself.

 

use Pins.yourpin and it will work (like you did for the onboard_led)

 

Oh! Thank you! Such a simple thing that had me stumped for ages.

 

Where is the cpu pin 13 then?

 

Now I have this sorted, i'll put up a video of my app controlled home lights and fan soon!




#51826 Broken Digital IO?

Posted by Wayneio on 31 July 2013 - 08:45 PM in Netduino Plus 2 (and Netduino Plus 1)

I have just bought and soldered together a relay board and connected it in between an extension lead. The netduino is connected to the relay, and for testing, when I press the button on the netduino it should output on port 13 a 3.3v that should switch the relay.

 

My problem is that when i press the button on the netduino, nothing happend! So i connected the wire that controls the relay to the 3.3v output on the netduino and it switched. So that made me think the problem must be that there is no voltage coming from port 13.

 

I tested the output using a multimeter, and sure enough there is no voltage from port 13 when pressing the button. I've tried 4 different GPIO ports.

 

Have I broken my netduino, so it no longer outputs voltage out the GPIO ports??

 

The simple code is below:

 (by the way, the onboard LED turns on with button press, so i know the code is running.

  InputPort btn = new InputPort(Pins.ONBOARD_BTN, false, Port.ResistorMode.Disabled);		    OutputPort out13 = new OutputPort(Cpu.Pin.GPIO_Pin13, false);		    OutputPort outLED = new OutputPort(Pins.ONBOARD_LED, false);		    bool buttonState = false;		    while (true)		    {			    buttonState = btn.Read();			    out13.Write(buttonState);			    outLED.Write(buttonState);		    }



#51784 Controling Mains Power (UK)

Posted by Wayneio on 30 July 2013 - 09:32 AM in Netduino Plus 2 (and Netduino Plus 1)

Better to be safe than small.

 True, but also the price difference was quite big, especially as I will be buying a few.

 

So i'v also bought a cheap plastic box to keep the relay in and fingers out.




#51770 'DirectoryInfo' could not be found

Posted by Wayneio on 29 July 2013 - 06:41 PM in Netduino Plus 2 (and Netduino Plus 1)

I can't seem to delete this thread?




#51744 Controling Mains Power (UK)

Posted by Wayneio on 28 July 2013 - 05:31 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Paul. Thanks for the info. That one you linked looks good, and it's nice and small compared to the options I found, which will be really useful.




#51741 Controling Mains Power (UK)

Posted by Wayneio on 28 July 2013 - 04:48 PM in Netduino Plus 2 (and Netduino Plus 1)

Actually scratch that, this looks much safer! http://www.powerswit...es/PSTKKit.aspx

 

The only problem is it's out of stock and looks to have a USA style plug.




#51737 Controling Mains Power (UK)

Posted by Wayneio on 28 July 2013 - 12:00 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi, I'm looking at controlling mains appliances with a netduino.

 

Will this product work for UK power (240V)? http://www.seeedstud...ield-p-693.html

I assume it's pretty simple in terms of code, just turning the relay on and off?

 

Also, from anyone's experience, is it still easy to access the other Digital IO ports for controlling other items?




#51419 IR Control Possible?

Posted by Wayneio on 14 July 2013 - 01:46 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Guys,

 

In my current quest to create a full home automation system, my current task is to control IR devices (TV, DVD etc).

 

After a bit of searching around there are some posts where people say the netduino won't run fast enough to read and write IR signals. Is this the case?

 

If it is possible, I found these that may be useful




#48787 Serial can't use ReadLine();

Posted by Wayneio on 27 April 2013 - 08:11 AM in Netduino Plus 2 (and Netduino Plus 1)

yes, the while loop immediately turns the led on after it has turned it off.  If you want it to take 5 sec per cycle (as you have coded it), break the 5 sec into two delays of 2.5 sec, and put one after when you turn on, and one after when you turn off.  e.g.

//flash by set amountint cnt = 0;while (cnt < CMDNo){	theExLED.Write(true);	Thread.Sleep(2500);	theExLED.Write(false);	Thread.Sleep(2500);	cnt++;}

Oh god. Now i feel daft. I'll make the excuse that it was late at night when i was trying this. Thanks :)




#48781 Serial can't use ReadLine();

Posted by Wayneio on 26 April 2013 - 09:10 PM in Netduino Plus 2 (and Netduino Plus 1)

Just another related question, i have read the command, and then the amount of times that the command should be executed. When i run this code and step through it with visual studio, the LED flashes as I would expect, but if I run it with no breakpoints, the LED stays on constantly.

 

I guess this is something to do with the speed that it all happens without breakpoints. Can anyone shed any light?

 

 

//flash by set amount					    int cnt = 0;					    while (cnt < CMDNo)					    {						    theExLED.Write(true);						    Thread.Sleep(5000);						    theExLED.Write(false);						    cnt++;					    } 

 

 

 

Thanks




#48779 Serial can't use ReadLine();

Posted by Wayneio on 26 April 2013 - 08:17 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks for the replys, I have got the applciation working without ReadLine functionality now (after fianlly giving up with MF 4.3 and VS2012, resorting to another computer with VS2012).




#48741 Serial can't use ReadLine();

Posted by Wayneio on 25 April 2013 - 09:14 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I'm starting to have a bit more luck with the netduino and VS2012, but have hit an annoying point in my code.

 

I am using serial.ReadLine(); to read data sent back from the netduino to the pc, but I now need the netduino to also read the information, however I get the error "System.IO.Ports.SerialPort' does not contain a definition for 'ReadLine' and no extension method 'ReadLine' accepting a first argument of type 'System.IO.Ports.SerialPort' could be found (are you missing a using directive or an assembly reference?)"

 

Now I can't understand why, as the code on the netduino for serial communication is virtually identical to that of the code on the pc-side applicaiton, and that works fine.

 

This is a seciton of the code that has the error in it

 

 

	 static void serial_DataReceived(object sender, SerialDataReceivedEventArgs e)	    {		    // create a single byte array		    byte[] bytes = new byte[1];		    // as long as there is data waiting to be read		    while (serial.BytesToRead > 0)		    {			   theLED.Write(true);			   Thread.Sleep(500);			    // read a single byte			   serial.Read(bytes, 0, bytes.Length);               // the bit that doesn't work...			   theText = serial.ReadLine();			   // send the same byte back			   serial.Write(bytes, 0, bytes.Length);			    theLED.Write(false);		    } 

 

 

 




#48566 So far dissapointed

Posted by Wayneio on 19 April 2013 - 02:02 PM in Netduino Plus 2 (and Netduino Plus 1)

If it helps, the rare occassion that it does say "ready" and appear to be in debug mode, pressing the button causes the netduino to disconnect (and disappear from devices) then releasing the button makes it appear again.




#48563 So far dissapointed

Posted by Wayneio on 19 April 2013 - 12:56 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I have ensured that .netMF 4.3 is installed, have followed the guide to install firmware 4.3 on the netduino plus 2.

 

However, when i press debug it still says "target is not in initilized state, rebooting..." then says ready in blue (but not debugging) and some of the time the code has worked on the netduino, other times it hasnt, but it's never in debug mode.

 

Or it often says "Unable to communicate with device USB:Netduino" or "Device not found or cannot be opened - USB:Netduino  "  




#48555 So far dissapointed

Posted by Wayneio on 19 April 2013 - 09:28 AM in Netduino Plus 2 (and Netduino Plus 1)

So my first day with the Netduino hasn't gone as well as I had hoped.

 

Firstly there was the difficulty in getting it to actually be detected by VS2012

 

Then eventually, it worked, where it started to blink the leds...

 

so then I try another simple application to control it via the button, and i either get the error message in that post above, "the device is not in an initilised state" or "Error  1  Unable to communicate with device USB:Netduino"

 

So at the moment, I cant even get the most simple test applicator to deploy properly. I've tried various USB ports. Windows does detect the netduino fine.




#48538 Netduino Serial Port Code Review

Posted by Wayneio on 18 April 2013 - 10:28 PM in Project Showcase

Hi,

 

I have just downloaded this application to learn the netduino (only had it a couple of hours) and I can get the terminal window to show button pressed when pressing the netduino onboard button, but typing the word ON doesn't turn on the LED.

 

Any ideas?




#48534 Help! New Netduino Problem

Posted by Wayneio on 18 April 2013 - 08:24 PM in Netduino Plus 2 (and Netduino Plus 1)

I solved this first by installing .net MF 4.3 RTM

 

http://netmf.codeple...ases/view/81000

 

But then had to move MicroFramework folder from

 

C:UsersWayneioDocumentsVisual Studio 2010TemplatesProjectTemplatesVisual C#Micro Framework

 

to

 

C:UsersWayneioDocumentsVisual Studio 2012TemplatesProjectTemplatesVisual C#Micro Framework

 

However, now it's not working at all. I have changed transport level to USB and tried the following code:

 

        public static void Main()        {            // write your code here            OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);            while (true)            {                led.Write(true); // turn on the LED                Thread.Sleep(250); // sleep for 250ms                led.Write(false); // turn off the LED                Thread.Sleep(520); // sleep for 250ms            }        }

It does nothing. No flashing LED. just solid on. Is it bricked from the factory?

 

In VS I get "The debugging target is not in an initialized state; rebooting..." - then it reboots and just says Ready




#48533 Help! New Netduino Problem

Posted by Wayneio on 18 April 2013 - 08:11 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I just purchased a netduino plus 2 and have tried to set it up following this guide http://netduino.com/...tingstarted.pdf

 

the netduino sdk intalls fine, but when i try to install .net micro framework it says I require visual c#2010 to be installed. I already have visual studio 2012?

 

 




#48351 New here - feasable project?

Posted by Wayneio on 13 April 2013 - 01:57 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks for the replies. I've been busy with Unviersity work recently, so am just getting back to this.

 

The steps i'll take to learn this is:

 

1)Buy a Netduino and attempt to control it's onboard LED from a Win Forms Application.

2)Use the application to control a motor connected to the netduino

3)Either use a light sensor or time of day reader to control the motor, and attach it to the blind

4)Look at switching from the serial communication to ethernet

 

So, for stage 1, i'm going to buy:

Netduino Plus 2 here

USB To TTL here (although it doesnt state voltage)

 

Anything else I need to buy to get me started?

 

P.S The reason I am using a computer to talk to the netduino is that I want to also be able to override it with an application on the PC.

 

I will also follow this example to communicate with it




#47523 New here - feasable project?

Posted by Wayneio on 24 March 2013 - 11:24 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi there,

 

I am thinking of purchasing a netduino plus 2, with the aim of refreshing my old A-level electronics knowledge. I am an average C# coder, so that side of things is fine, but my electronics knowledge is rather rusty, and so before I buy, I would like to know if there are tutorials that can help me with my first project idea.

 

I have a blind on my window instead of curtains, but in front of it, I have desk and TV etc, so it's rather difficult to get to. My idea is to have a netduino on the window-sill connected to a motor, which would connect to the blind string. Could I then, using a simple c# application, control the motor to open and close the blind? I would like to make this a web app, so I could control it via my android phone, and as an extension to the project, possibly have it automatically open the blind at say 7am and close it at 9pm.

 

Any advice as to the feasability, and then tutorials for controling a small motor would be appricated.

 

Thanks





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.