Flash Html + SD Html (Arduino Ethernet)

Hi All,

I am able to find some good example on arduino ethernet, but most of them either purely display webpages using flash like client.println(…) or calling a webpages to display from it’s sd card. Which both of cons like:
Flash : limited design, cannot have images and nice layout – in expense of speed and flash memory
SD card: can only display and give command to arduino, can’t update some of it’s content based on arduino feedback
So my question is:
is there anyway that I can combine these two to achieve full duplex communication, which means i can have a nicely layout with command button , yet it can constantly update of the content from a sensor value?
Can anyone please enlighten me? thanks. :slight_smile:

yet it can constantly update of the content from a sensor value?

You need to explain this better.

The Arduino is a server. A client contacts it for a some data, typically a whole web page. The Arduino as server serves up that web page, and closes the connection. That client is then history as far as the Arduino is concerned.

There are ways, using META tags, to make the client request the same page again on a regular basis, but the server will not see the same client connection ever again.

Thanks for reply paul.

let me explain it in detail for what i need. I have several motors and a sensor connected to my arduino mega + ethernet . What i need is to control the motor from a webpage ( done, modifying from some example ) yet at the same time, the arduino need to feedback to me about sensor value, so I can decide what value that i need to send it to my motor. These sensor values are important to me as they are my reference for my next command. by using meta tag, I managed to send the value back to webpage display in the interval of 10 seconds. (this is seperate program from motor control command that i mention earlier). I tried to combine these two by just using the flash only. well, it will work normally for the first few refresh, but then after a while, it will start to display funny things or maybe several replication of the webpage contents. I suspect is due to the limitation of the flash memory. Another big problem that i face is I need to have a fairly presentable layout for this project, in which I prefer using css and javascript for the layout. hence, i think i need to display webpage from the sd card. but i really have no idea of how to pass and update the value of the sensor to the html file in the sdcard before get it to display. This is my first project on arduino so i am kinda of lost. once again, thanks.

To be short: sure it's possible.

As every web server is doing the same: Getting a request with URI, parsing that URI to decide what to deliver, deliver that content. After the parsing you can switch between delivering some content from the SD card or building a response by some code and including measured values. The HTML can be parsed too during deliver and you can replace some strings (p.e. ##VARIABLE##) in it. I would do that only if really needed to be autonomous. If possible I would let a standard web server deliver as much as possible and get just some JSON (good term to search for) from the Arduino.

Thanks pylon,

I will go and read through JSON. Do you have any idea of how to send the sensor value to the html file in the sd card before get it display? an example will be greatly appreciated. Thanks.

As I already told you: I would not do it that way (inserting it into HTML).

Anyway, you have to send the HTML byte by byte. If you take the example I gave, you put out every character till you hit a ''. Mark that state and look for the next character to be a '#'. If it is look for the next character to be a '' again, else put it out just after the preceding '*'.

That's a complex example, you might go as well with using simpler substitution strings like '@VAR@'.

HI.. I have no experience with Arduino Ethernet stuff.. (nor hosting the page from the Arduino)..

but I do have some flash experience..

Im a bit confused/unclear as to all you want to do.. and what parts are or are not working..

Flash has several options.. (not sure which will work for you)..

but flash can use a LoadVars() object to send and load data.. usually in a POST or GET type format..

Flash cna also load text files or .xml files.. so if you can output your data to a data file.. you can code you flash movie/app to read it and display the new data...etc (much like simple/generic polling chat system.. one project updates/provides the source.. and one end displays it)

Flash and HTML can also work together.. (even calling functions from with-in one another.. (ie: javascript) from the container page)

Im not 'up' on the size limitations..or if this would help you though (if serving page from Arduino)

xl97: HI.. I have no experience with Arduino Ethernet stuff.. (nor hosting the page from the Arduino)..

but I do have some flash experience..

if I am not mistaken, I think he is referring to flash as in storing html in flash memory vs storing it in SD card, and not flash as in shockwave flash.

DOH!.. hahaha.. well disregard my post then! :P

thanks!