Guidance sought for choosing correct server

I still consider myself new to Arduino, and although I have been studying as much as I can about anything computer related on/off for nearly the last 5 or more years, I am not formally trained in anything which leaves for many gaps in my understanding of things.

I have in mind a project that is to control my indoor garden. I already mentally split my project into phases as I know each will be more difficult than the previous and I will need to learn more to continue the build as I go. I have a master sketch that does need more work, my project box is nearly complete and will be outfitted with an 8 channel relay, each connecting to a duplex outlet, and a DHT sensor to measure the air. Also have a DS3231 RTC (chronodot) to count time. Phase 1 of the project I am building consists of managing these AC outlets with either time or sensor values. I also want to get my project online to at least send the sensor data to my website (a PHP) that I created specifically for this project. My studies indicate that I “can” use a PHP for my Arduino project, but there is very little information of “how” to make it all happen. Of course, once online, my project will then require quite a few changes in code and circuitry as additional phases are built and grafted in. Ultimately, I am wanting my project to control each and every (nearly imaginable) electrical device that can be used in a garden setting. I have an EtherMega, plus also another Mega w/Ethernet shield, and I am looking to get into Udoo just to expand my understanding of how all of this back and forth communication over the internet works.

My current road block is that I don’t yet know enough about transfer protocols and which protocol is most applicable for my project. My current thought is that it would have to be something in the TCP spectrum as my project is not all that time sensitive, but then again, I don’t think the data feeds need to be all that accurate either, so I’m guessing my project can operate in a pretty wide tolerance range. As long as commands are executed within say a 5.0 second time frame, the garden will then become so much more efficient and accurate.

As this post was placed in project guidance, I am seeking guidance to help me choose a path that will get my project online and sharing information to and from my PHP website. I have no web building experience and built my site through HostGator via WordPress and some tutorials. I also created a very basic MySQL table on my site, but have no clue how to use it.

I’ve tried my heart out for about a solid month Googling different combinations of phrases prior to posting this thread, but sometimes if you don’t choose the correct terminology, your Google searches will produce little in the form of material you can learn what specifically applies and if you don’t know exactly what to look for, you can easily glaze right past your solution. So I am hoping to get some good suggestions from this thread, or at very least better combinations of key words for me to once again begin my long tedious process of Google searching. Also, not to sound unappreciative, but please, if you have any specific knowledge that can shorten my time spent researching, please share and do not defer me to “Google”. This concept does spare the sharing party from 5 minutes of typing, but it also adds to the level of stress on the searching party because I literally spent more than a month trying my luck at Google searches that produced fragmented results at best.

Please help?

Thank you all in advance.

Creating a web server and programming an Arduino are two very different things - even if they may be designed to communicate with each other.

Your Arduino program will appear to the server to be pretty much the same as a browser so you should be able to build your server and test it with a browser before ever trying to get your Arduino code to connect to it. Learning how to build the server and connect to MySql is beyond the scope of this Forum.

...R

My intent of with this thread was not meant to over extend the scope of this forum, but rather to ask members for insight into networking protocols, or links to good study info. I tried my best to explain my project so others may be able to identify with what I want to accomplish and hopefully generate some discussion that I can use to collect leads to investigate.

Google "Arduino PHP MySQL" - you will find a wealth of information (I can't vouch for it's accuracy, however).

What you are attempting to do is very complicated - especially when using a shared hosting account on a server that is not under your control.

This post got extremely big, fast - so, go to this pastebin to find the full text - in short, what you are doing is complex, and will tax you if you don't have a great plan or any plan at all. I believe that you have a plan, and that you should work to write it down, break it up into manageable but non-obscure working units (and if those need to be broken up, do it!):

http://pastebin.com/FawsdwUD

I hope this helps - at least a little. Good luck with your project!

Dont get Udoo, it is not neccesary. You are good with mega and ethernet shield. You still need to break into more pieces this project, for example, what is the purpouse of the server and why do you want to use php? You already can mount a webserver on mega with ethernet. Now, if you want a real webserver with sql tables and stuff and want to use the mega just as datalogger, then you can host a server on a raspberry pi (cheaper than udoo). And the mega can connect to the server via tcp/ip. But again, this has already many pieces that have to be separated. First you must choose wether to begin with learning about webservers or arduino and tcp.

My studies indicate that I "can" use a PHP for my Arduino project, but there is very little information of "how" to make it all happen.

That is probably natures warning sign that what you are looking for is not practical or worth pursuing. My understanding of PHP when it was originally developed is that it is a file/database handling application with little application to any actual hardware interaction. If the project is to grow, you might want to develop it on a laptop running Apache or similar and just use the arduino as a hardware I/O interface. You might also want to look at existing home control systems like the below homeseer.

http://www.homeseer.com/

Unfortunately I already got an Udoo, just wasn’t aware enough when ordering to get one of the ones with networking, so am looking to trade it out with a networkable versionbut that is neither here nor there. Zoomkat, thanks for the link to homeseer. That does look like something that provides instant relief in terms of what I’m looking to do. My concern is the startup cost and will it be able to also include my later planned phases.

For my project, Phase 1 was to include creating the basic structure of the overall project, ie project box, a sensor, the AC side of the circuit and the basic network structure to a web page. I chose PHP based on some suggestions made on previous threads along this nature. I realize PHP is just an extended version of HTML and I am confident that if I can learn to direct my project to an HTML page, I should also be able to learn to direct it at a PHP and MySQL. Since my website is a PHP, I began developing it into something that will then also allow me to share media and descriptive information about this project, and how it relates to my garden and the techniques that I use to produce the way I produce. I am confident that with use of Arduino (or other brand) controllers I can really dial in the level of controls I can have in my garden and enable me to really refine my techniques by making subtle adjustments until I find the most ideal of everything that can be controlled which in turn will equate to as perfect of a grow environment that can be produced by a hobbyist gardener in an indoor setting.

Phase 2 will add the use of water pumps and solenoid valves to control the flow of water into the grow area, how it is meted out to each of the reservoirs, and finally pumped away to waste when depleted.

Phase 3 will add peristaltic pumps to be used to mete in liquid nutrients into a master feed manifold that will replenish a depleted and emptied reservoir.

Phase 4 will add nutrient monitoring in the form of Conductivity reading (EC, TDS, PPM) and pH monitoring.

This all in my opinion will refine my ability to control my garden substantially, much more than most gardeners have at their disposal. My plants will thus respond better and produce more higher quality produce and honest to God all these growing pains I only wish to take upon myself which means I DO intend to share this project in every detail and provide added free assistance to help others modify any part of this project to best work in their own situations. Growing pains suck and if one can make it easier for the next, the human race will benefit, even if just a little.

For the record, I am not dead set on anything about this project except to bring it to fruition as quick as I can. I haven’t even been in this pursuit for a year yet and already have come so far. I am confident that Arduino is the way to go, but have not ruled out Rpi, Udoo or whatever. I will link to some pics to hopefully give just a bit more insight into my project.




Because later planned phases are a must have as I see it, I think Arduino or Udoo will be the best option to gain the level of control I seek, but am definitely always open to suggestions and achieving the end result is all that matters to me. If it turns out that the PHP is no good for this project, I can still use it to host my media, and also give me a platform to graphically explain this project in great detail and how to go about building it, the circuits, the code, how it all relates to the garden, different gardening techniques and as much as I can think of to freely share so the next man doesn’t have to shave years off his/her life extensively learning a new subject matter to accomplish a single task or set of tasks.

Edit - The purpose of using a server is to share data to a more accessible interface, like a website. My PHP is a simple .com and the domain name is now preserved for at least a year. Unless mistaken, the name of my site can be used in place of an IP address in my code? The website itself, if properly connected/routed/ported to my website will become in essence equivalent to a touch screen interface (smartphone) that can be accessed from anywhere on earth that has internet access which removes me from needing to be “on location”. This to me is the most priceless part as the automation factor allows me to be away for extended periods of time without losing any control. Granted, initially, all I want from the website is for it to show me data from just a single sensor, plus relay states. Once Phase 1 is functional, I would think grafting in other phases would be much easier.

Due to me being very new to Arduino, and only having fragmented knowledge of all other related fields (networking and circuitry), I accept that added learning is needed. I never wired anything prior to Arduino in DC, all my experience is in AC. I played around with Backtrack some years ago “auditing” router keys that had WEP encryption, so there’s the extent of my Linux and networking experience, plus I also possess slightly more than basic computer skills. I presume I can learn most of this stuff slightly faster than some, but definitely not all. I am old, but still teachable. I’ve never delved into what a server is until I came here. I never considered making my own website until now and I do not intend to profit from this project outside of personal satisfaction as I do love to help others achieve the same things I do, but in much less time.

If anything else is needing to be included about myself, or what I wish for this project to become, please ask. I already made this post too wordy (IMO) and I do not wish to keep rambling. I just feel in this instance that it is best for me to help you help me by being as forthcoming as possible.

@myggle,

short posts with a specific question are easier to deal with.

...R

Granted, initially, all I want from the website is for it to show me data from just a single sensor, plus relay states.

Well, that would definitely be something for you to start working on.

It appears that I am giving too much info.

Can someone point me in the direction of information about "The Internet of Things" and how the Arduino can be used in that capacity?

Thank you in advance

Can someone point me in the direction of information about "The Internet of Things" and how the Arduino can be used in that capacity?

Have you tried Google? Have you looked at post in the home automation section of this forum? You have chosen a large and possibly complex project. I doubt you will find others that will develop your project for you. Do you have an arduino and an ethernet shield to start working with?

zoomkat: Have you tried Google? Have you looked at post in the home automation section of this forum? You have chosen a large and possibly complex project. I doubt you will find others that will develop your project for you. Do you have an arduino and an ethernet shield to start working with?

I have a Mega 2560 r3 clone and an Ethernet shield that is also a clone. Also recently just acquired an EtherMega which is a combo of the Mega and Ethernet shield. Aside from some issues I have programming time triggers with if statements, phase 1 (minus networking of course) is nearly where I want it to be in terms of code and circuitry. I definitely wasn't aware of an Automation forum within this forum, but I will now find it that I know it exists. Aside from the great information that you good people share with me, I will still always use Google because one can never know enough. I do realize mine is a very tall order and I most certainly do not wish for anyone to write my code for me. I will pursue this project till my death if that's what it takes. I do apologize if my posts are overly wordy or not enough words, I can't seam to find that happy medium of efficient communication followed by my question. In this case I am seeking opinions from you all regarding what you think might work best for this project. I want to control my devices via smartphone on the internet via a website, via the EtherMega. I've read my fair share of material to know that this is very possible and I am chasing that end goal till I am satisfied.

@myggle, I don't know about others but I find it much easier to make sense of your Post in Reply 11 when I break it up into paragraphs like this.

I have a Mega 2560 r3 clone and an Ethernet shield that is also a clone.

Also recently just acquired an EtherMega which is a combo of the Mega and Ethernet shield.

Aside from some issues I have programming time triggers with if statements, phase 1 (minus networking of course) is nearly where I want it to be in terms of code and circuitry.

I definitely wasn't aware of an Automation forum within this forum, but I will now find it that I know it exists.

Aside from the great information that you good people share with me, I will still always use Google because one can never know enough.

I do realize mine is a very tall order and I most certainly do not wish for anyone to write my code for me. I will pursue this project till my death if that's what it takes. I do apologize if my posts are overly wordy or not enough words, I can't seam to find that happy medium of efficient communication followed by my question.

In this case I am seeking opinions from you all regarding what you think might work best for this project. I want to control my devices via smartphone on the internet via a website, via the EtherMega. I've read my fair share of material to know that this is very possible and I am chasing that end goal till I am satisfied.

Just a suggestion ...

And, as others have already said, you need to think of your project as similar series of small pieces.

If you have not even browsed far enough down the Forum index to see that there is a Home Automation section it suggests to me that you are not reading nearly enough Threads on the Forum. They are a great source of learning even when they do not seem immediately relevant to your project. Read several Threads every day - just to absorb the information.

...R