[En-Nut-Discussion] Ajax on ethernut

Harald Kipp harald.kipp at egnite.de
Wed Nov 17 09:13:33 CET 2010


Hi Joerg,

On 16.11.2010 19:53, Joerg Wiegelmann wrote:
> does anyone have any experience with ajax webfrontends on ethernut. Is
> there a recommandation for a softwarepackage?

As Curtis already explained, no special software package is required.

We currently have two applications running. The first one is the
Webradio. Since version 2 we moved from SSI/ASP to AJAX mainly to handle
large radio station lists in the browser, not in the server. I hope I'm
able to create a new download within the next days. Since then you may
check the repository at

http://ewebradio.svn.sourceforge.net/viewvc/ewebradio/trunk/src/

Also the Fischertechnik factory simulation uses Ajax. No code has been
published yet. Yesterday I added a flash movie which shows the web
interface.

http://www.ethernut.de/en/community/factory.html

Actually the animation quite smooth in reality, interferences with the
flash frame rate make it look so bumpy. The interface is a JavaScript,
which manipulates an SVG image.

I never liked XML, it's too bloated for embedded systems and difficult
to read, at least for me. Instead we directly transfer JavaScript
objects (JSON). For example, an array of structures is transfered like this:

"favorit":[
  {"id":"1","name":"egnite","url":"egnite.de"},
  {"id":"2","name":"ethernut","url":"ethernut.de"}
]

In oder to make things more flexible and to separate the web design from
programming work, we use templates files on the embedded system, which
somehow results in a mixture of Ajax and SSI.

The web page is specified as

{
 "page":"favorites",
 "html":[
  {"headline":"Favorites"},
  {"favorite":[$1]}
 ]
}

$1 will be replaced by an array of structures, which is defined as

{
 "id":"$e",
 "name":"$n",
 "url":"$u"
}

$e, $n and $u are replaced by current values.

Regards,

Harald



More information about the En-Nut-Discussion mailing list