In my usual blundering way I have attacked this project like a bull in a china shop. I had a lot of "ideas" as to how I was going to do the project, but very little experience or planning. As a result I am left with two parts of the project working, but no way to communicate with each other.
I am building a home automation system based on an Arduino Mega; the plan is to be able to set up a schedule and/or be able to control data pins in real time over the web. I have written a web page hosted on "homeauto.mywebpage.com" using HTML. This page allows the user to enter data using comboboxes, checkboxes and radio buttons. Once the has been entered, the user hits a button and the entered data is read and converted into a string.
The Arduino Mega is connected to the internet using an Ethernet shield and can be accessed at "myarduino.myip.com". I have a small server set up on the arduino waiting for a connection. If I manually connect to the arduino server using the url "myarduino.myip.com/1234567890" where "1234567890" represents the schedule data contained in the string, it will take that data and convert it back to a schedule to control the pins.
Both of the above work, however I am at a loss as to how get the web page to send the data to the arduino! Ideally after the text string has been created it would then be pushed to the arduino at "myarduino.myip.com" using the url "myarduino.myip.com/textstring. The arduino would receive the text and close the connection and then continue to process the data. My other thought was to have the text string stored in a file on the web server so that the next time the HTML page was opened, the previous user data could be read from the file to populate the form.
Having spent a few days researching all this, it appears Ajax is probably the best way to go (if I can wrap my aging brain around a new language). Are there other, simple, solutions?
Any guidance as to how to achieve the above would be greatly appreciated!