Real time data on web page

I would like to know different ways to implement real time data on web page It's an embedded web server application.

I am not thinking for specific technology as I have not finalize any thing for my project implementation but it's an embedded application so memory and speed will be limited.

Microcontroller will be 32bit 150 MHz Appro.

4 to 8 mb RAM. Data and program memory is not fix.

My requirements are

  1. To send the Real time alarms to web client.
  2. Display real time trend.
  3. display real time data points 25 per page.
  4. Real time refresh rate should be less than 2 sec.
  5. My application should run on generally used browsers.
  6. If I can implement above features without any plug-in or additional component than browser on client side it would be preferable.

Thanks and Regards, Rama

Reply to
vika
Loading thread data ...

Rama,

Use javascript to trigger auto refreshes, I think you can count on all browsers having javascript. Java though is iffy.

Me, I'd write a 'c' language cgi-bin program that would output html/javascript, and setup an apache server. The cgi bin program can then do whatever it needs to to gather the information -- say open a network socket to some other device or whatever, or bang some hardware or whatever.

The cgi bin can output image data also.

Can do with other languages like php, ruby, python, perl even...but I like 'c' and already have the cgi-bin infrastructure and familiarity built up.

-Dave

--
David Ashley                http://www.xdr.com/dash
Embedded linux, device drivers, system architecture
Reply to
David Ashley

You don't need scripting. There is a HTML tag for auto reload with a time value in seconds. This tells the browser to automatically refresh the page. This way any browser can be used, such as Lynx, or a PDA or cell phone (if such exists with a web browser).

Any way you look at it you will need to do some kind of cgi (building a web page with your dynamic data). Calling it real time is probably not accurate, but certainly dynamic works.

The trick will be in fitting in your small memory requirements 4-8Meg is not alot for embedded Linux. I presume you also have some flash for permanent storage. You could do this with any RTOS, but the trick of rolling your own for everything will be doing the ethernet/tcp/ip/html/cgi stack.

Have fun! Steve

There is no "x" in my email address.

Reply to
Steve Calfee

I don't know Java technology much

Is it possible to use JAVA applets ? make seperate scoket connection to server from client and keep seeding data on event basis from server. I know new a browsers have capability of JRE. Without installing JRE as a seperate component can we implement this with what is supported by new IE ?

Thank you and regards

Reply to
vika

Linux will require < 2.5 MB code for the kernel (Don't know how much data the kernel needs), and if you run a flash disk then there is not so much need for RAM.

--
Best Regards,
Ulf Samuelsson
This is intended to be my personal opinion which may,
or may not be shared by my employer Atmel Nordic AB
Reply to
Ulf Samuelsson

There is an article at

formatting link
on how to get "real-time" data written to a pipe to appear on a web page. The article is only a tutorial but it might help.

A really good/short book for this is "Ajax in 10 minutes" by Phil Ballard.

Bob

Reply to
Bob Smith

Real time data with polling is not possible.

You can use this:

formatting link
formatting link

The real time chat > I would like to know different ways to implement real time data on web

Reply to
ai

Reply to
Steve at fivetrees

It kind of is, but indirectly.

HTTP is a stateless protocol - you ask for a web page, you get it back - end of story. At this point the webserver has forgotten all about you. There is no direct way for it to send refresh data to you. (Even if it could, your firewall would probably block it as unsolicited data. It's the client that needs to ask for the data.)

So, one way is to set the page to auto-refresh. This works, but you get the whole page back every time, when perhaps all you want is an update of some fields within the page.

To leave the page intact, but to update some part of it, requires a separate connection which can talk (custom protocol, if necessary) to the server, retrieve new data, and then refresh the page fields via the DOM. This can be done in Javascript (just about) or Java (more usually). No doubt there are other ways.

But you're right: HTTP does not allow the server to refresh a page that's already been served.

Steve

formatting link

Reply to
Steve at fivetrees

Well, this is what AJAX is good for.. You can let Javascript on the client request updates from the server and when the data comes back, the client Javascript can update only the parts of the page that needs it. This avoids the full page reload, and makes the experience much more "real time". But it's still the client that have to poll the server for updates.

Reply to
Anders

Hi,

What about using Applets for Real time data update? Can Internet explorer execute JAVA code for applets with out installing JRE?

Regard, Rama

Reply to
vika

I use applets. Having the page reloaded periodically is annoying. Java applets are nice, you can redraw without visible effect. You need a server on the embedded side listening for connections (sockets). But using sockets is applets is a bit tricky, you have to certify that socket.

Reply to
Adrian

I am not a JAVA person. I am embedded c programmer but now will have to deal with web technology to some extend. My application demand is as mentioned below

1) To display real time parameters on web page when they are changed at server side. Typical number of parameters could be 50 parameters on one page. 2) I need to display real time alarms. 3) I need to show real time trends. Example ...parameter value would be sampled at every few milliseconds by webserver device but will be updated on webpage... say after every 1 to 2 sec. 4) Stretched requirement could be to send 100 data points per second from web server to web client. 5) If I think of using XML for data transfer amount of data will increase.

I don't know ....but it looks like server push kind of requirement than client pull. Can any one guide me to select suitable technology to implement?

Can I implement JAVA applets without external JRE installation? My information is some part of JRE is supported by IE or other browsers.

This is an embedded application so all the typical constrains for embedded project are applicable to my project.

I would appreciate suggestions regarding selection of embedded web server and OS for such application as I mentioned above ....embedded system would have 32 bit 150 MHz microcontroller with 4 to 8 Mb RAM

Thank you, Regards, Rama

Reply to
vika

Take a look at the Lantronix XPort

It might be a (nearly) drop-in solution, as it already includes the

10/100BaseT hardware, TCP/IP stack, and web server. There are example apps that show a relatively straightforward way of using Java to put "live" values onto the served web page. It basically becomes your "network device" with the balance of your design resident on your main embedded processor.

Disclaimer: I haven't used it extensively, just picked one up to "play with" and to get an idea of its capabilities/limitations for future projects. Here's one place I found with working code examples:

--
Rich Webb   Norfolk, VA
Reply to
Rich Webb

The easiest way to update some of the page, but not all, is to use frames. You can then automatically regularly refresh only the one frame, leaving everything else intact.

If you go for Javascript, you have plenty more options. It should be perfectly possible to refresh all or part of the visible document, and when updating images, it is possible to have two images and swap them over to avoid showing partial images during updates. It is also possible to use an invisible frame which is refreshed to hold Javascript code which then updates the other frames.

If you decide to go for Java, make sure that users have can use the system without Java, and don't start up a Java applet without a warning

- not everyone likes Java, or has it enabled (or even installed). If you need the power of Java, but don't fancy learning it, you could also try Jython (Python being much easier to work with than Java).

Reply to
David Brown

Java and JavaScript are two different entities, but their source code can look similar. JavaScript functionality is much more limited; I don't know if it would be possible to get useful TCP/IP data streams working with JavaScript alone. You'd get much more functionality out of a Java applet.

Most desktop web browsers have JavaScript capability built in, but the user may disable it. Your web page should be able to provide some minimal functionality even if JavaScript is disabled, even if it's just a diagnostic message asking the user to turn JavaScript on.

In order to use all the functionality of a Java applet, the user must have a Java Run-time Environment installed. Microsoft used to include its own JRE implementation along with Windows, but Sun put a stop to that. So, any web pages that use Java applets now require that the user must have an external JRE installed. JREs are available that will work with all major web browsers of all popular operating desktop systems.

- Luke

Reply to
lfmorrison

Tibbo

formatting link
make a similar product: the EM202 & DS202 and thei documentation is much better. I reccomend looking at it.

Like Rich, I have only played a little with the Lantronix and the Tibbo so this is only my early impression.

If you want to present a web page then the Tibbo seems to be an easie product to use. It allows you to reprogram the internal firmware and the you can program it in Basic to interface with the serial port, massage th info and merge it into JPEG files to create the web page. I tried to fin how to do this on the Lantronix, I was told it could be done using Java but I found no concrete examples.

Also there is an article in Circuit Cellar

formatting link
of Jul

2006 on the Tibbo "Device surfer" by Tom Cantrell.

-Aubrey

Reply to
antedeluvian

And of course there's the Rabbit. Having used both the Xport and the Rabbit, I find the Rabbit far more versatile. YMMV.

Steve

formatting link

Reply to
Steve at fivetrees

Thank you Information is useful. JRE implementation is no more a part of Windows then my product user will have to install JRE if I think to use Applets for real time data update. Purpose of making installable "device monitoring tools" web sever base is to get rid of installable components and versioning issues. Instructing customers to install JRE is not a good option. can there be good alternate way to implement Real time web page ? Regards,

Reply to
vika

Whoa - hold on one second. Which part of your system is embedded - the server or the client? Both?

If, as I presume, your server is the embedded side, all you need is a socket. The Java etc stuff is for the client, presumably running on a PC (else why use http at all?). The Java on the client is there to provide a means of connecting the socket comms with the DOM on the page.

Or am I missing something?

Steve

formatting link

Reply to
Steve at fivetrees

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.