Haserl

Using Haserl scripts for HTML based Runtime Configuration and Monitoring


For many projects its a good idea to have your users use a browser to
view the device state and do runtime configuration for the device.

Of course you need to have a Flash file system to store the configuration values. See the appropriate articles on Flash and on rc-Files on how to install a Flash file system and use it for holding system variables in one or more configuration files.

Usually, when doing runtime configuration via http, you need to write a cgi-program (in C or a scripting language like php) that takes the user's inputs and creates html code, that the http server can send to the client's browser. Writing a dedicated C program seems a lot too high level for the simple task we want to accomplish here, and learning php as an additional language and implementing the php interpreter also does not seem appropriate for a small embedded device.

Haserl is a quite small tool that allows to write scripting code directly in normal html pages. Moreover it does not contain a scripting language interpreter but can be used (e.g.) with an existing command line (shell script) interpreter like bash or hush (or lua, if you need a scripting language specially designed for cgi use). Thus the haserl scripts are a mixture of html and shell script code and you don't need to create html code programmatically and/or provide as well a program and some html based pages. The haserl scrips can be created using a html editor like Quanta.

haserl is provided as a "miscellaneous program" with the µCLinux distr. 

hush is part of the busybox.

The web server boa is provided with the µCLinux distr. 

Attached here, you'll find a file that contains haserl scripts and shell scripts that work together to show some system states on a web page and allow for some common realtime configuration settings like "use DHCP" and "use IP-Address".


Additional considerations

If using haserl with boa 0.94.13, you need to do a

	#include <sylog.h> 
somewhere and add a line like

	syslog(LOG_DEBUG, "haserl start");

and  e.g. in main() in the haserl code and the sylog daemon is activated. (right now nobody seems to know why it does not work otherwise. It does work when called from a command line and it works with boa on a PC.) Happily this problem magically disappeared with upgrading to boa 0.94.14 !


Haserl makes heavy use of the echo command, both because it uses echo when handling the script and because each haserl script will contain lots of echo commands (or "<%: some text maybe containing $VARIABLES %>"   phrases that haserl converts to echo commands.) Fortunately hush (other than msh) has a builtin command "echo" and "test (aka "[" ), so no external and slow loading executables for thoase are necessary.

If using haserl with boa 0.94.14, you need to do hush commands like

<% if [ "$X" = "Y" ]; then %>

instead of

<% if [ $X = Y ]; then %>

even though msh/hush does accept

if [ $X = Y ]; then

in a normal script.
I don&apos;t know the reason why the additional "s are necessary, but if you drop them you&apos;ll see error messages on the console when a haserl script is executed. (There were no such error messages when using the same haserl version with boa 0.94.13)

Tag page

Files 2

FileSizeDateAttached by 
 echo.c
This utility was desigend for use with msh and is not needed with hush.
373 bytes01:48, 8 Dec 2008AdminActions
romfs.tar.gz
Part of a NEEK romfs, containing haserl script files and complex rc init scripts that work together to e.g. manage the IP address of a device. For new designs please replace "/bin/msh" by "/bin/hush" appropriately
55.7 kB15:20, 15 Jan 2009mschnellActions
Viewing 5 of 5 comments: view all
wedding dresses Bra is a relatively common form of bridal styles noble feeling replica watches Because of such a variety of body styles for the bride, bridal gowns Comparison of two is not enough chest fullness of mm cosplay costumes the choice will be your style suspenders and wiser. tiffany jewelry choose the style sling is correct oh An arm & underarm area Rourou relatively large number of mm
Posted 07:09, 26 Jan 2010
Choosing discount eyeglass frames online should not sacrifice a wide selection. It is still a pleasure choice to trust an online store that offers different kinds of discount eyeglass frames. Compared with a site that offers only one or two kinds of discount frames, others providing a larger selection of similar products are more preferable. University online AND Online Public Administration Degree AND Music degree Online Occupational safety and health degree AND Online Nutritional Health Science degree
Posted 11:12, 1 Mar 2010
I think this is so amazing how this works. I would love to hear more on this subject. texas mesothelioma attorneys
Posted 05:22, 4 Mar 2010

Car Insurance Comparison

Compare insurance quotes including car insurance comparison, term life insurance and whole life insurance. term life insurance quotes. Get cheap car insurance rates comparisons. Compare insurance quotes offering affordable car insurance, whole life insurance, term life insurance, car insurance comparison. Offers coverage for auto, whole life insurance, term life insurance and more.
Posted 07:04, 5 Mar 2010
Nowness.com, the Web site unveiled by LVMH Mo?t Hennessy louis vuitton last week, is as different as could be imagined from the group’s defunct burberry handbags outlet, which it replaces. Instead of urgent offers to buy, each video clip, artistic image and cheap lv handbags commentary creates a mood and suggests that you have burberry handbags an exclusive world where you can absorb and be informed.The couple flew to St. Barts in January where they were joined by close eluxury com louis vuitton and in a secret ceremony, the louis vuitton designer exchanged vows with his Brazilian ad-executive boyfriend.
Posted 01:24, 9 Mar 2010
Viewing 5 of 5 comments: view all
You must login to post a comment.
SourceForge.net