I am using and arduino with wifi and port forwarding. My goal is to be able to create a web based program that will communicate with my arduino wirelessly to control a sunrise sunset affect with an led array. I want the program to be accessible anywhere and I want to be able to interrupt the program for set periods of time like a storm for example and then have the program go back to its normal original program(sunrise/sunset)

I am a beginner at programming I have my arduino set on a timed program not on a clock and I'm getting my wifi shield and I need help getting started. Anything with be greatly appreciated.

The Arduino is programmed in C++ (which is a superset of C). The Arduino has to be programmed to served up, and respond to, a web page which is coded in html. But, html is text based, so you will be sending text that some other computer sees as a distinct language.

This is not beginner programming, if you have never done web programming, web page design, client/server communication, or (as appears to be your case) any programming.

You know, someone could make a killing selling an aquarium control shield, given the number of posts on here on the subject. An RGB LED string driver, an RTC module, perhaps some relays for air pump control and feeders, with a library to tie it all together.

In a nut shell that is my overall goal. A complete stand alone module that can control lights. Next would be the I/o for pumps probes ect. I need to first figure out what I need to learn programming wise before I get in over my head too fast. So c++ and then I need to convert HTML a text language into c++ where next?

Forget your project for a moment and get a wi-fi shield and go through the various examples using it. Learn that first.

I've got to disagree, Mike. The wifi shields are not beginner devices. Learning to blink LEDs is first. Then, learn to send data to the serial port, and receive a response. Then, learn to collect that response into a string. Then, learn to parse that string, and do something with the parsed data.

Then, as a completely separate activity, learn to develop web pages. Then, learn to develop functionality to be called when the submit button is pressed.

Then, get an ethernet shield, and learn to make the Arduino serve the web page, and respond to submissions.

In a nut shell that is my overall goal. A complete stand alone module that can control lights. Next would be the I/o for pumps probes ect. I need to first figure out what I need to learn programming wise before I get in over my head too fast. So c++ and then I need to convert HTML a text language into c++ where next?

No - It's a little more complex than that.

First off - what do you mean by "communicate wirelessly with the Arduino"? Do you mean over wifi, xbee, some kind of RF module - something else? The choice there will determine how you communicate with it.

For example, using a wifi module would mean communicating via network message passing, whereas the latter two might mean using a serial port of some kind.

Know this may influence what language(s) you can use on the PC end of things (it may even determine what OS platform you can use; for instance, it is very difficult to perform 2-way serial comms under Windows - not impossible, but they don't make it easy for some reason, either - especially if using PHP); most languages have the necessary interfaces and libraries for both serial and network messaging, but you should plan this carefully.

Also note that once you even know that, you may also need to know how to set up and use a communication protocol to communicate with the Arduino. Fortunately, there are some good libraries out there for both ends (because you need to do this both on the PC side and the Arduino side) of the chain.

As far as programming is concerned, on the Arduino side, it's essentially C/C++; play around with the demos, read some tutorials, etc - but I wouldn't go "whole-hog" into in-depth C/C++ programming tutorials meant for the PC. C/C++ on a microcontroller (especially one like the Arduino where a lot of stuff has been abstracted away for you) is a vastly different beast from doing the same on the PC (mainly due to memory and other resource limitations compared to a PC). So - learning C/C++ programming for the PC may actually hinder your understanding of doing it on a microcontroller (and vice-versa, unfortunately). Keep the differences in mind, though, and you might find that even PC tutorials may be helpful for some things.

On the PC side of things, for a web application, your choices are much broader. I would -not- recommend attempting to do web development using C/C++; while it is possible, for the tasks you are facing it is very much overkill. I would actually say for your application, using PHP or Python (or even a combination) would be the best solutions. Another solution might be Processing (note that Processing is essentially C/C++, which may seem like I am contradicting myself - I only mention it, though, because it is an abstracted form of C/C++ much in the same way the Arduino platform is, which is why the Arduino platform was based on it; thus, it may be easier to learn both the Arduino and Processing in parallel - just something to keep in mind).

If you are windows-centric, there's also the possibilities of using Windows technologies (just be aware that you may limit yourself, and any future users of your system, by doing this). These would include ASP, ASP.NET, C#.NET, VB.NET - plus for DB stuff things like IIS/MSSQL or Access (you may also find connectors and ways to use open-source DBs like MySQL and Python).

At any rate, on the PC side (also note when I say "PC", I generally mean Windows, Linux, or Mac - but each has it own strengths), you'll need to learn a language for the coding of the web application that will communicate with the Arduino (in some manner - it may or may not -directly- communicate with the Arduino, or it may communicate with a service on the PC, which you would have to write, which would run in the background communicating with the Arduino; the advantage of this service method is that, if the service or your web app should fail, the whole thing wouldn't necessarily "freeze up" or otherwise totally fail - however, it is more difficult and complicated to implement). This web application would output (to the browser) an HTML page, which would display your information, and maybe have a form or two that you could submit data back to your web application, which would then act on it to send a message to the Arduino. It may also need to write this information out to a file, or to a database. So there are a couple more things to learn.

A minimum of how HTML and CGI worksAs well as (possibly) DHTML, Javascript, AJAX, POST/GET, etc.

...and a database (as well as how to write SQL), such as:

MySQL (PC)PostgreSQL (PC)IIS/MSSQL or Access (Windows PC)

...and/or:

General file handling (reading and writing files with the language on the PC you use), and serial or network communications and message passing.

Not too mention all the hardware interfacing and electronics. Also - I am sure I forgot something along the line here; everything written above is a very simplified list - there's much more to learn than just the languages and the syntax of them. You'll also have to understand synchronous vs asynchronous communications, event driven vs polling design, stateful processes (as well as how and why web applications don't hold state between requests, what that means, and how you work around it)...

As you can see - this is hardly a beginner's project. But, if you take it one bit at a time (while taking your time, asking questions, and gaining understanding), you can come up with a working system in the end. Just don't let the "grand scope" overwhelm you. Instead, start with the basics (the Arduino, and simple serial communications via the virtual USB serial port) to get a feel for the hardware end of things, and simple messaging via serial (and the terminal). Then you can move on to the PC side of things, and work your way around over there.

Good luck with your project!

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

You may find it a little more motivational if you can take some concrete steps towards building your project - look at your overall requirement and find the one simplest piece of it. Might well be your led array. Look through the examples to find help, also search the forums for other acquarium projects. Light a single led, then many, fade them with PWM. Gradually build it up until you have a standalone controller. Only then would I worry about the web.

To specify a few things: 1 I want to use a wifi shield2 I have the basic program written and in use now but it's simply a timer based program that dims after certain delays and shuts off after certain specified amounts of time delays3 I want to start out controlling the led array only4 what is the simplest way to do this?

Controlling a bunch of LEDs --> go to my webpage www.blinkenlight.netUsing a WIFI or lan shield --> don't do it. An Arduino is to underpowered for a webserver. Also an Arduino + Shield will cost more than a stronger machine. Go for a cheap computer that already supports WIFI and connect the Arduino to it.Guru plug, hacked WLAN routers and other computers come to mind.

I am using and arduino with wifi and port forwarding. My goal is to be able to create a web based program that will communicate with my arduino wirelessly to control a sunrise sunset affect with an led array.

After re-reading that a few times I think this could be achievable with fairly minimal effort. As I read it, you are planning to have an Arduino somewhere (eg. in an office) where you have web access, via wifi (so I presume there is power around). Connecting the wifi to an Arduino ethernet shield could be done by an existing WAP (wireless access point) device, such as the one I use here at home to connect a non-wifi gadget (like a TV) to the wifi, where cables are not available.

You mention port forwarding, so it sounds like you know about that, and thus you have plans to communicate with your device from "outside" its local network. Say, you might be in the street a few blocks away holding a laptop.

Now you want to enter some sort of command on the laptop, which gets sent to the Arduino, which alters what it is doing, am I right?

The tricky bit will be to send the data and have the server understand it. The examples for the Ethernet card, as far as I can see, do not involve web forms. There are probably thousands of pages that explain that, but I investigated a while back when I was trying to do a Lua-based web server, some of my findings are here:

http://www.gammon.com.au/forum/?id=6498

To "send a web page" you need to send the HTTP headers, followed by a blank line, followed by the page, as a minimal example:

To receive a HTTP request you need to parse the various headers you get from the web browser. I'm not sure how much of this the Ethernet library does for you, if any.

There is quite a bit of string manipulation involved, and playing with strings can be problematic when you only have 2 Kb of RAM. You would need to go for something pretty simple (like, very simple commands).

I would agree with the others, start simple, and work your way up. Don't try this particular project as your first one or you will get frustrated.

Please post technical questions on the forum, not by personal message. Thanks!

Of course you can implement a web server with an Arduino. You can implement a web server with less powerful machines. True. But if you look at the other options I would not bother doing so. In my opinion it is way too restricted for a reasonable web server.