I'm working on a project to connect an arduino uno via ethernet and send requests to a Creston unit.
Im already familar with the connections to the Creston but what I want to do is achieve the following:
Have a webpage load that allows the end user to store IP settings: ie: IP, Gateway, Subnet:
Do this via using JSON since it seems very light and easy to do.
The json file would be stored onto the the Ethernet shield SD card.
I've been looking for examples and I'm new at this so I'm trying to piece this together.
Does anyone have a good example that I could look at and try to make this work.
You could create a simple PHP file that contains a HTML form and a handler for the submitted data.
The form would contain multiple input fields a user can fill stuff in.
The handler just goes through this, checks if all data are valid and store it as JSON encoded string (with json_encode($submittedDataArray).
Then do with this JSON strong whatever you want (e. g. file_put_contents($fileOnSDCard, $jsonString)).
May be you can be a bit more specific in what you’re looking for, then I can help you better.
So in simple terms this all has to run on the arduino. It will be connected to a switch that talks to the crestron via network.
The webpage will be loaded up in a crestron touchpanel and it needs fields for a user to input. IE. IP settings, Gateway, Subnet.. these are not going to be used for the arduino but stored onto the arduino SD card to be retrieved by the crestron to control/setup another device on the network..
Simple webpage. ===> Submit to JSON string. ===> Stored SD card on arduino uno. ===> can be retrieved from Ardruino SD. from crestron via network...
If there is a simplier method im open to ideas..
I hope that is clear..
Thanks again for any help.. I'm trying to learn at a fast rate and any help will be greatly appreciated.
Why you don’t run the webpage on a normal webserver or at least on a Rasperry if you don’t want to use the internet? I think having a Webserver that processes your data may be a bit too much for an Arduino (just a thought, I don’t know!).
But you could try this and change it to your issue, may be that’s a fitting solution: https://www.arduino.cc/en/Tutorial/WebServer
I could help you with the HTML and PHP stuff in no time, but on Arduino I’m a beginner...
So here is what I've been piecing together from various bits of sources.
I manage to get data written to the EEPROM. The original code was designed to setup a web page and have the EEPROM load the network settings on the next boot.
I want to keep writing it this way but I disabled the EEPROM from setting the arduino network settings.
However this code is so old I think there should be an easier way to do the html. Its very unstable.
This to load correctly 45% to 80% correctly most of the time.. then after that it just wants me to download giberish... .. like its not parsing the html information properly.. when I try to go the designated IP address I have in the code. .. its still is pinging but the page doesnt load correctly..
Any advice or updates would be awesome..
I'm figuring this out slowly so its coming along.
Thanks in advance for any advice.
I've attached my .ino file currently using...