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 07-May 23)


By content type

See this member's


Sort by                Order  

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




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




#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




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




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




#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




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




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




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




#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




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



#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 ^_^




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




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

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

I forgot to ask. Did you forward the port (80) in your router/modem to your Netduino's ip address (192.168.1.6)

I will attach a screenshot of how it looks inside my modem (your configuration might look similar)port_forwarding.jpg




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

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

Hello shobana.

 

Maybe you have more luck with the webserver project from Martin http://forums.netdui...lem/#entry45239. His projects worked without any changes for me (you need an SD card with some files on it in your netduino). I even got it to work with DDNS so I can access the netduino from any computer over the internet. Its worth trying :)




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




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

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

Maybe you could change the code so it blinks a led (so you know the program is running on your netduino) or show a message in the debugging window? I wish I could advise you on this but my knowledge is not sufficient to understand the problem.




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




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

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

Hi shobana.

 

I attach the zip file containing my current working web server which is far from perfect but it works. Feel free using it and to inform me about improvements so I can learn from it. Attached File  WebserverHelloWorld.zip   154.75KB   9 downloads




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




#48545 Experimental Webserver Problem

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

Thanks :)




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





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.