views:

115

answers:

3

Hey everyone,

I've recently started a new web development project for an embedded device and wanted to solicit some recommendations for technologies to use. The device will serve HTML pages which include AJAX code to retrieve data from a JSON server. We're tentatively using Cherokee as the web server, though we're not tied to it.

Currently, I'm considering the following technologies:

  • Write it all in PHP. I know it's big, slow, and bloated, but I've got about 10MB available for the web interface (a lot for an embedded system), and we won't be seeing a lot of traffic on any of these devices. It does need to seem responsive for the users, however (pages should load in less than a second).

  • FastCGI + a C program - We're using an in-memory database, so the C program could interact with the database directly through the API. This would have much better performance than PHP, but development time and reliability is a concern since C isn't very well-suited for web development.

  • Lua + Kepler - This seems like a nice middle ground between performance and development time. However, I've never worked with Lua, so I'm not really sure how to implement it in an embedded web project. I'm also uncertain as to how well it integrates with the Cherokee web server.

So any opinions or past experiences with the above stated technologies? Any others I should include in the list?

Thanks, Alex

A: 

How about looking at HipHop, Facebook's PHP compiler?

http://wiki.github.com/facebook/hiphop-php/

That way you can write your code in PHP and effectively compile it to C++.

therefromhere
I was really excited about HipHop when I first read about it, but it quickly slipped from my mind. An interesting idea and certainly worthy of consideration. Have you ever successfully used it in a project?
okalex
@Alex. No I haven't, but it's on my radar for possible use in a couple of projects. I've no idea whether it's suitable for use as an embedded webserver, but it's worth looking at.
therefromhere
A: 

ASP.NET. Assuming that you wouldn't be interested in Embedded Windows Server 2008, you could still leverage ASP.NET by incorporating Mono into Cherokee. You could leverage Visual Studio as your RAD development environment and use things like ASP.NET MVC 2. A lot of third party user controls will also 'just work' with Mono (Telerik Announces Support for their ASP.NET controls on Mono!).

Larry Smithmier
Thanks for the quick reply, but this would be way overboard for our needs. The application I'm creating is a fairly simple user interface to monitor and control the hardware.On a semi-related note, I find it puzzling that Windows Embedded Server requires a minimum of 1.4GHz CPU, 512MB RAM, and 10GB of disk space :)
okalex
I thought it would probably be overkill, but couldn't resist. And yes, the 'Embedded' part in most of the Windows Embedded is really only related to single purpose and reduced licensing cost. Though, the reductions in cost are about what you would expect as well. :-D
Larry Smithmier
+6  A: 

When I was in this area, I used Lua and a simple FastCGI runner (Luaetta [for I'm sure the latest source would be available if you asked the guy] , though I'm also sure that's not the only one, and there's Kepler of course), spawned by lighttpd.

It performed quite well on an embedded media player, and was used for remotely accessing content and controlling the device. Though I don't maintain it anymore, you can find more about it at http://matthewwild.co.uk/projects/wooble . If you think the source would help just poke me for it, it's currently only available via a package manager but I can fix that given the motivation.

Another (again Lua) project in this area is LuCI. These guys are dedicated to making a web interface for embedded devices (routers specifically), and have produced a nice framework with lots of supporting libraries geared towards that kind of system.

I wouldn't be concerned with not knowing Lua. If you know any language then you can pick up Lua in a day or two, the manual documents the whole language and is quite short.

MattJ
Thanks for the encouragement. I've got Lua working with my desktop Cherokee installation now, but I'm a bit lost as to how to get WSAPI/Kepler going (the website isn't even very clear as to what exactly it is).
okalex