sebswed'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.

sebswed's Content

There have been 45 items by sebswed (Search limited from 06-June 23)


By content type

See this member's


Sort by                Order  

#47750 How do I connect Netduino+ to a pc wireless?

Posted by sebswed on 30 March 2013 - 10:14 AM in Netduino Plus 2 (and Netduino Plus 1)

Hello Hanzibal.

You don't need a regulator to reduce the mAh. You only need a regulator if your voltage doesn't match. If you have a battery capacity of 6000mAh and your device consumes only 500mA you could theoretically run your device for 12 hours (6000mAh / 500mA).




#47822 How do I connect Netduino+ to a pc wireless?

Posted by sebswed on 30 March 2013 - 08:59 PM in Netduino Plus 2 (and Netduino Plus 1)

Hello Hanzibal.

 

It might have to do with the way a battery capacity is stated. Asuming the battery has not aged and has the capacity the manufacture states, the capacity is usually only acessible when discharging it with a certain load over a specified time. Peak discharges (I don't know if these occur in a wifi device), device impedance and signal strength of both transceivers might cause deviations in battery operating time but I guess I'm getting off topic now :-)




#48136 Getting Started with Netduino 2

Posted by sebswed on 07 April 2013 - 08:56 AM in General Discussion

Hello Chris (or other expert).

 

First time netduino user here. I have very little programming experience and none in C (installed Visual C# 2010 express yesterday - never used before).

 

I know more about hardware than software so I'm just doing basic coding and I too follow the example in your book. Could you provide me with the code for "[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]If you're using PWM, add the SecretLabs.NETMF.Hardware.PWM.dll assembly as a reference to your project.[/color]" (as I'm using i/o 5 wich from what I understand is the PWM port). Also, on which line should I paste this .dll reference to make it work (under the "using SecretLabs.NETMF.Hardware.Netduino;" ? )

 

Thanks in advance!




#48149 Getting Started with Netduino 2

Posted by sebswed on 07 April 2013 - 07:08 PM in General Discussion

Ok I found the code:

SecretLabs.NETMF.Hardware.PWM pwm = new SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D5);

 

I will experiment with this tomorrow.




#48155 Getting Started with Netduino 2

Posted by sebswed on 07 April 2013 - 08:20 PM in General Discussion

Helllo Cutlass.

 

Thank you for the link to your post. Now I know how to add the refference and how to read analog input data!

It all makes sense now :-)




#48156 Analog Input Example on the Netduino Plus and Netduino Plus 2

Posted by sebswed on 07 April 2013 - 08:45 PM in Netduino Plus 2 (and Netduino Plus 1)

Hello Cutlass I did not know the input voltage was so critical. My first thoughts on reading your post was maybe I should use a 3.3v zener diode (1N746) to protect the input from receiving more than 3.3v before I'm going to read analog data.




#48192 Home Security System - Need help with some considerations

Posted by sebswed on 08 April 2013 - 08:13 PM in General Discussion

Hello Daniel

 

I love Xbee. You can even use them as stand alone devices to connect your sensors to.

 

I found a very informative totorial series (1-5) on Youtube also a nice project is to connect an ionization smoke detector to your analog port and plot the data so you can program your own smoke detector and set the values for it to activate etc. http://dzlsevilgeniu...e-detector.html

 

There is even a way to connect a RFID card reader to it without the need of a micro controller http://bildr.org/201...-xbee-wireless/

 

Like Cutlass said PIR (motion) detectors are sensitive for direct sunlight and drafts so might have to test and change the position of the sensor to find the perfect place. I don't know about the area you live, but I used to live a "short" (3 year) period in Thailand and there we had some large rats (uninvited) that could trigger the sensor.




#48239 PC Xbee and Netduino Xbee communication

Posted by sebswed on 10 April 2013 - 05:39 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi there.

 

Any chance one one of you guys could post the working code? I'm a complete beginner.

I do have 2 Xbee modules successfully talking in AT mode. I have a little Arduino Fio as Router in AT mode sending data to a coordinator connected to my PC but would like to receive this data on my Netduino 2+ instead.

 

ps. I downloaded Grommet but have no idea on how to import this into Visual C# 2010 Express.

 

Thanks in advance!




#48246 Little Tutorial on the NetduinoMini and XBee Connections

Posted by sebswed on 10 April 2013 - 03:40 PM in Netduino Mini

Hello Terry.

 

When I visit the site of your tutorial, I get the message

"NOTICE: This domain name expired on 03/02/2013 and is pending renewal or deletion."

 

Do you happen to have the tutorial on a different site?




#48254 A Tiny TinyCLR web server

Posted by sebswed on 10 April 2013 - 06:19 PM in Netduino Plus 2 (and Netduino Plus 1)

Hello Nick

 

Thank you for providing the code. Unfortunately I'm a complete beginner. I downloaded all the files and opened the one called Program.cs.

When I create a new Netduino Plus 2 project in Visual C# 2010 Express and paste the (uncommented) code I get 4 errors

  • Namespace "NetduinoPlus" does not exist, are you missing an assembly reference
  • The name "Pins" does not exist in the current context
  • Namespace "WebServer" could not be found, are you missing a using directive or an assembly reference
  • Namespace "WebServer" could not be found, are you missing a using directive or an assembly reference

I'm sure most of you guys start laughing now :-)

Fact is, I have no idea what I have to do to make these error go away.

 

I assume (from other coding attempts) that I have to ad a reference? If yes, which one should I ad?

Or do I have to do something with the other files that I downloaded?

 

All help is appreciated :-)




#48258 A Tiny TinyCLR web server

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

Thank you Hanzibal!

That was indeed the problem :-)

 

Tack så mycket




#48359 Simpel timer for security system

Posted by sebswed on 13 April 2013 - 06:26 PM in Project Showcase

Netduino (plus) 2 project

 

I'm a beginner, just started coding and was playing with loops, button, LED and piezo element. I created this to understand the code and provide this for beginners like me who have some kind of security system in mind.

 

It uses the on board LED and button with a piezo element connected on pin 5 (red = +) and GRND (-).

It requires for you to add the PWM.dll to your project reference (right-click on your folder called 'References' and choose 'Add Reference...'). It can be used in combination with a 10K resistor to reduce the volume (I did not use a resistor).

 

When pressing the button a low frequency sound followed by a higher frequency sound will be heard. The later is looped (counted) and creates the (activation) delay. After the delay (10 loops) the on board LED will go on, indicating the system is activated. You could write additional code there where the LED goes on (for example an output port that enables a relay allowing power to an external siren when a sensor detects an intruder.

 

You could use an RFID card reader, code- or key lock instead of the on board button.

 

Its a simple code, just copy and paste and make sure to add the pwm.dll reference to your project.

Posted Image

 

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.Netduino;namespace NetduinoApplication1{    public class Program{        static SecretLabs.NETMF.Hardware.PWM speaker = new SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D5); // Define the speaker    static OutputPort led = new OutputPort(Pins.ONBOARD_LED, false); // Define the LED    static InputPort button1 = new InputPort(Pins.ONBOARD_BTN, false, Port.ResistorMode.Disabled); // Define the button    public static void Main()    {        while (true)        {            if (button1.Read())   //Check if the button is pressed and do the following when pressed            {                                //Period is 1/frequency                //1/1,000,000 second : 1000000 --> 1 sec                // Duration for Sound over PWM (Period / 2)                uint C = 1000000 / 600; //600 Hz tone                uint D = 1000000 / 660; //660 Hz tone                speaker.SetPulse(C, C / 2);  //Play                Thread.Sleep(800); // Duration                speaker.SetPulse(0, 0); // Turn Off                Thread.Sleep(75); //Pause                    int MyVar; // Create variable "MyVar"                    MyVar = 0; // MyVar is 0                    while (MyVar < 10) // While MyVar is less than 10, do the following loop                    { // start the counting loop for MyVar                        MyVar++; // Increase the value from MyVar by + 1                        speaker.SetPulse(D, D / 2);  //Play                        led.Write(true); //LED on                        Thread.Sleep(1500); // Duration                        speaker.SetPulse(0, 0); // Turn Off                        led.Write(false); // LED off                        Thread.Sleep(2000); //Pause                    } // Close the counting loop from MyVar                              // Write your code here                // This code will run directly after the MyVar loop (for example to enable your security system)                led.Write(true); //LED on                        } // Close the button loop            // Write your code here            // Here you can write other code that has to run even if the button not has been pressed            // For example a listener for a button to deactivate your security system        } // Close the while loop    } // Close the Main loop}}

 




#48371 Remote control heating

Posted by sebswed on 14 April 2013 - 09:42 AM in Project Showcase

I was planing on using an IR led to control my heat pump (kind of a reverse airco) and than use a drop down menu on a netduino webserver. It would probably be possible to use 2 netduino's. 1 at home with a IR receiver connected to it sending the pulse signal to netduino 2 at a remote location with an IR LED connected to it so you can use your remote control at home.




#48372 Infrared Receiver on Netduino

Posted by sebswed on 14 April 2013 - 10:04 AM in Project Showcase

That is exactly what I'm planning to do :-)

 

For the arduino there are lots of examples on how to connect and read this.

A good tutorial can be found here: http://learn.adafrui...sensor/overview

 

It should be quite simple to read the signal on your netduino. Don't ask me how (yet) as I'm just a beginner in programming C# (I have more knowledge of hardware).

 

First you have decoded the IR signals you want. My heat pump has a separate signal for each degree Celsius and the different settings like dehumidify (which you could write a separate code for that reads a humidity sensor if you like to have it dehumidify automatically at a certain value). After that it is quite simple to send the signal (same tutorial). The only difference is the code but the basics are the same.

 

Unfortunately I'm not in that stage yet :-)

My first struggle is to get a netduino plus 2 web server working. Once I have that, I can make a page with buttons to send the commands and send you the code and circuit layout.

 

If you already have a working webserver I would love to get a copy of your code :-)




#48374 how can i implement netduino plus garage door opener project

Posted by sebswed on 14 April 2013 - 11:26 AM in Netduino Plus 2 (and Netduino Plus 1)

Hello Muthu.

 

Check the following post: http://androidcodemo...e-door-app.html

 

It uses a Android application to control the Netduino connected to a garage opener.




#48378 Remote control heating

Posted by sebswed on 14 April 2013 - 01:31 PM in Project Showcase

Thanks! :-)




#48379 Infrared Receiver on Netduino

Posted by sebswed on 14 April 2013 - 01:34 PM in Project Showcase

I got a link from another forum member to the code for the netduino with IR receiver and transmitter.

http://highfieldtale...m/tag/infrared/




#48381 Web server up and running - not all html text showing

Posted by sebswed on 14 April 2013 - 03:20 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi there.

 

I'm very proud that I got a web server up and running  :) However, not all text is showing on the html page and I cant figure out why that is. Its like it hangs while loading the page. Does that make sense?

 

The code I use is copy and paste stuff from other forum members (its the best way for me to learn how it works).

 

The code I have now and which produces a partial html page is below and I attach a screenshot of the html page.

 

All help is appreciated :)

using System;using Microsoft.SPOT;using System.Net.Sockets;using System.Net;using System.Threading;using System.Text;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware.NetduinoPlus;namespace WebserverHelloWorld{    public class WebServer : IDisposable    {        private OutputPort dout_0 = new OutputPort(Pins.GPIO_PIN_D2, false);        private OutputPort dout_1 = new OutputPort(Pins.GPIO_PIN_D3, false);        private OutputPort dout_2 = new OutputPort(Pins.GPIO_PIN_D12, false);        private OutputPort dout_3 = new OutputPort(Pins.GPIO_PIN_D13, false);                private Socket socket = null;           public WebServer()        {            //Initialize Socket class            socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);            //Request and bind to an IP from DHCP server            socket.Bind(new IPEndPoint(IPAddress.Any, 80));            //Debug print our IP address            Debug.Print(Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()[0].IPAddress);            //Start listen for web requests            socket.Listen(10);            ListenForRequest();        }        public void ListenForRequest()        {            while (true)            {                using (Socket clientSocket = socket.Accept())                {                    //Get clients IP                    IPEndPoint clientIP = clientSocket.RemoteEndPoint as IPEndPoint;                    EndPoint clientEndPoint = clientSocket.RemoteEndPoint;                    //int byteCount = cSocket.Available;                    int bytesReceived = clientSocket.Available;                    if (bytesReceived > 0)                    {                        //Get request                        byte[] buffer = new byte[bytesReceived];                        int byteCount = clientSocket.Receive(buffer, bytesReceived, SocketFlags.None);                        string request = new string(Encoding.UTF8.GetChars(buffer));                        Debug.Print(request);                        //Compose a response                        string response = "Hello World";                        string header = "HTTP/1.0 200 OKrnContent-Type: text; charset=utf-8rnContent-Length: " + response.Length.ToString() + "rnConnection: closernrn";                                                // New test 2013-04-14                        bool vdout_0 = dout_0.Read();                        bool vdout_1 = dout_1.Read();                        bool vdout_2 = dout_2.Read();                        bool vdout_3 = dout_3.Read();                                                //Make some html                        response = "<!DOCTYPE html>";                        response += "<html>";                        response += "<head>";		                        response += "<title>Netduino Plus</title>";                        response += "</head>";                        response += "<body>";                        response += "<h1>Netduino Plus</h1>";                        response += "Out 1 = " + vdout_1.ToString() + "<br/>";                        response += "Out 2 = " + vdout_2.ToString() + "<br/>";                        response += "Out 3 = " + vdout_3.ToString() + "<br/>";                                                response += "</body>";                        response += "</html>";                        // End test 2013-04-14                                                clientSocket.Send(Encoding.UTF8.GetBytes(header), header.Length, SocketFlags.None);                        clientSocket.Send(Encoding.UTF8.GetBytes(response), response.Length, SocketFlags.None);                                            }                }            }        }        #region IDisposable Members        ~WebServer()        {            Dispose();        }        public void Dispose()        {            if (socket != null)                socket.Close();        }        #endregion    }}

Clipboard01.jpg




#48383 how can i implement netduino plus garage door opener project

Posted by sebswed on 14 April 2013 - 04:15 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi shobana.

 

I wish I could help you but I'm a beginner myself. Maybe you have specified the wrong IP address in your code. You can use MFDeploy.exe that is installed in "C:Program FilesMicrosoft .NET Micro Frameworkv4.2Tools", select your device and click 'Ping' to get your netduino ip-address.

In the tutorial I linked to is even an other tutorial how you create your own Android application but like I said. I just started programming C# myself and have not enough knowledge to help you :)




#48384 Netduino PWM to control Treadmill motor?

Posted by sebswed on 14 April 2013 - 04:46 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi there.

 

I don't know what a MC-60 motor is or what kind of spec it has.

But it is possible to control heavy loads with PWM in a transistor circuit.

Example for DC here: http://tutorial.cytr...modulation-pwm/

Posted Image

 

 

If you need AC see the following link: http://hackaday.com/...pwm-connection/

(or search google for PWM AC motor control)




#48389 Web server up and running - not all html text showing

Posted by sebswed on 14 April 2013 - 07:49 PM in Netduino Plus 2 (and Netduino Plus 1)

Hello Martin.

 

Thank you for replying. I have tried the Thread.Sleep(200); and Thread.Sleep(300); at different places in the code but it does not seem to give any result. If you don't mind could you instruct me on which line I should insert this?

I have tried below line 25, line 30, line 38, line 39, line 44 and line 81.

 

I never heard of NetworkStreams  :)  If that is considered to be better than I will try to find some working examples so I can see the differences.

I was already happy I got this kind of working.




#48390 Web server up and running - not all html text showing

Posted by sebswed on 14 April 2013 - 07:52 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks for the example Baxter.

I going to look over my code and apply your example to improve my code




#48392 Web server up and running - not all html text showing

Posted by sebswed on 14 April 2013 - 08:06 PM in Netduino Plus 2 (and Netduino Plus 1)

I disabled 2 lines in the code and now it works. The question is now... do I need this code for receiving url requests to control i/o ports?

The lines i Disabled are:

//string header = "HTTP/1.0 200 OKrnContent-Type: text; charset=utf-8rnContent-Length: " + response.Length.ToString() + "rnConnection: closernrn";//clientSocket.Send(Encoding.UTF8.GetBytes(header), header.Length, SocketFlags.None);



#48393 Web server up and running - not all html text showing

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

Hi Martin, I totally agree with "why would you declare the response as "Hello World" and later in your code overwrite it without any conditions... not very optimized" I removed it now :) (leftover from copy and pasting code)




#48400 how can i implement netduino plus garage door opener project

Posted by sebswed on 15 April 2013 - 05:40 AM in Netduino Plus 2 (and Netduino Plus 1)

Hello shobana.

 

If you see "i get only response as TINY CLR" than that is correct. I'm not at home right now but from what I remember you click after that in the menu on statistic to see your IP (but I'm not home at the moment so I can not confirm this).

 

The code that I use for my webserver (not related to a garage opener) is not finished yet, but it works. I have it posted in: http://forums.netdui...l-text-showing/

 

To get it working you need to deactivate the 2 lines in the code. You need to do the Pinging again and check the 'Statistic' I think it was called to check the result of the pinging.

 

Take note of the line: using SecretLabs.NETMF.Hardware.NetduinoPlus;

When creating a standard netduino application in Visual express 2010 it does not add this by itself (instead you get the version without the 'Plus') so you will need to add that as a reference to your project (both this line of code and by right clicking on the folder called 'References' and choose add to reference after which you will scroll down the list untill you see the netduinoPlus).

 

Just make sure you have all the references in that folder that are also being used in the code (using xxxxx).

You need the ip address that your router assigns to your netduino by 'Pinging' otherwise you won't know the address to access your netduino in your webbrowser.

 

Hm.... I forgot that I had 2 .cs files in my application. I will post it tonight (local time).





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.