Pages: 1 [2]   Go Down
Author Topic: How to control LED using Arduino as a webclient? [solved]  (Read 5498 times)
0 Members and 1 Guest are viewing this topic.
New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That's the kind of thing I was talking about, get the server to do the work.  I didn't see where the arduino actually turns the light on and off, but that would be relatively easy to do.

What I was talking about was doing something similar where you don't have control of the server.  You can put files on a file serving cloud machine, but the server belongs to someone else.  It's still possible to do huge amounts of work using the viewer's browser.

However, I'm stepping way aside from the OPs original question and hijacking the thread. 
Logged

Trying to keep my house under control http://www.desert-home.com/

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 smiley-red Sorry for the late response. smiley-red

Illukkari from your posts and comments, you're right on the point of where I would like to get at.  Thank you very much for the code.  I will try the code and come back with some comments.

Jantje that's another neat approach I've read about.  However, my idea is to automate my house as much as possible, so it won't be so easy to make the serial connection.

draythomp My idea is that the server and client(s) con communicate with each other, being the internet server the one who controls the arduino wifi clients.  As Illukkari mentioned the best approach is using websockets.  From what I've read polling causes an increase of the use of bandwidth which could affect other users, and it's not in real time so, it is still an option but not the best.  As for hijacking the thread, don't worry, it is a constructive discussion, from were we all learn.  I am new to Arduino and HTML programming so it has been very interesting for me.

Cheers!  smiley-lol
Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You're absolutely right in your concerns about real time and traffic.  The traffic concern is a bit over rated though.  The kind of traffic most automation work uses is far, far less than the traffic from a video download, so the little bit one does for automation doesn't matter.  And, polling does put the action somewhat behind the event that needs to be acted upon.  This CAN be a problem in some circumstances, so I understand your concern.

There is a websocket library out there for the arduino that could be used as a starting point for what you want to do.  If it turns out that using a web interface is unreliable or too much trouble, you can go back to the idea of a serial connection and use any of the little radios that are talked about on this forum as a serial connection between devices.

Have fun.
Logged

Trying to keep my house under control http://www.desert-home.com/

Offline Offline
Newbie
*
Karma: 1
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From what I've read polling causes an increase of the use of bandwidth which could affect other users, and it's not in real time so, it is still an option but not the best.

You are polling the server with a 8 bit 16 MHz machine. Even if you would have hundreds of them looping as fast as they can the web server will not be your bottleneck. If it is, drop the HTTP or even the TCP because the headers are most of the messaging.
« Last Edit: January 10, 2013, 05:23:31 pm by llukkari » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

YESSSSSS !!  smiley-draw

llukkari  You're the man!!

Thank you everybody for all your help.  Now...to practice a little more.

P.S.: draythomp  thanks also for your suggestions.   smiley
Logged

Pages: 1 [2]   Go Up
Jump to: