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


By content type

See this member's


Sort by                Order  

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




#48401 ToggleButton sample

Posted by sebswed on 15 April 2013 - 05:55 AM in Project Showcase

Hi there.

 

I see in the code: "ONBOARD_SW1, false, Port.ResistorMode.Disabled",

Should that not be set to pull upp or down to debaunce the switch?




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




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




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




#48378 Remote control heating

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

Thanks! :-)




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




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




#48421 Network Settings

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

I used the following tutorial to get my IP from my Netduino +2 http://wiki.netduino...duino-Plus.ashx Maybe you could try a different webserver application? I downloaded many examples and played a lot before I got it working (14 hours of reading, copy, pasting and testing). The webserver application that I have works for me but I don't know if it will work for you, it never hurts to try. It might feel like a slope learning curve but its like a puzzle. You have to find the right piece to make your project work.

 

My wife studies and lives in a different city and will be there for 2 years. I figured I could play Skyrim for 2 years (I love that game) or start learning programming, I chose programming ^_^




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

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

Hi Martin.

 

I downloaded your code example (Webserver.zip) from http://forums.netdui...lem/#entry45239 I installed it on my Netduino +2. Unfortunately I'm not able to connect to it through my browser (main page does not load for me). I find your code very clean and it looks very interesting.

 

For example, I see a separate HtmlPage.cs and when I look at the code inside it (please correct me if I'm wrong) I think that makes the main html file run in a loop so you get live data on your webserver without the need to refresh the page right?

 

It looks very nice!




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

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

Thanks Martin!

 

I'm grateful that you shared the code for other people to learn from it. I will experiment until I get it working.

 

Kind regards,

Sebastiaan




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

Posted by sebswed on 17 April 2013 - 05:47 PM in Netduino Plus 2 (and Netduino Plus 1)

Hello Martin.

 

Just to let you know that I got it all working (no changes made). I must have entered the wrong ip address in my browser. I even got it to work with DDNS. So I'm really grateful.

 

Vielen Dank :)




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

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

Thanks Martin! Much appreciated.




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

Posted by sebswed on 18 April 2013 - 05:44 PM in Netduino Plus 2 (and Netduino Plus 1)

No, I have a 256mb SD card from Sandisk. I also have this problem with the updated version in the same post. Do you recall how you got the problem solved?




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

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

Hi Martin.

 

As I used the exact same code as you posted on http://forums.netdui...server-problem/, I also have the exact same problem :)  (that I need to have it run from Visual Studio). I read on the above link that you found a solution for this with a new line of code "Thread.Sleep(20);".

 

Now that I read your post again, I see that this problem was related to the SD card? I'm not at home yet but I think I'm using a micro SDHC card with more than 2GB (8 or 16GB). As the storage on the netduino + 2 suports up to 2GB, this might be the problem (I was able to read the files on the Netduino). I will experiment with a regular SD card of max 2GB to see if it makes any difference :)

 

Kind regards,

Sebastiaan




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

Posted by sebswed on 19 April 2013 - 03:56 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi Martin.

 

I tried that yesterday evening after reading your message. Deleted the Fat16 partition and created a new Fat16 partition added some files. Same result. I than deleted the Fat16 and created a Fat32. Same result. :)

 

Don't worry about it. I will try to get it work by commenting out some code and see if it changes things. That will not be before Tuesday as I'm away for a couple of days :)

 

Kind regards,

Sebastiaan




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




#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




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




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



#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




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




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





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.