Linux for Science Museums

Put your knowledge to good use by helping develop innovative, fun and educational exhibits for a whole new audience.
Tool and Library Selection

Not knowing anything about your project, I can't recommend specific tools and libraries. I won't even try to recommend implementation languages to you. I can, however, suggest a few guidelines that worked for us.

Experienced developers probably have heard this already, but if an existing package is close to what you need to accomplish a particular task, think about modifying and using it. The Traffic Jam user interface is split across four windows—traffic display, density setting, control and other information. We used GTK+ because of its extensive theme capabilities and the icewm window manager for the same reason. We did, however, need to modify the latter slightly.

Carefully read the licenses for the code you want to borrow, of course. Respect the author's wishes, and don't create any liabilities for the museum. As with hardware selection, being conservative is good. If you really don't need the features available in the latest version of a tool or library, don't rush to install it—known bugs are easier to work around than unknown ones. Don't forget about maintenance and project lifetime; either you or someone else may have to modify this project in the future. A nonrelease version of a language or library might seem wonderful and stable now, but two years from now it might be quite different and somewhat incompatible. Even g++ changed in the four years from when I wrote the prototype Linux version of Traffic Jam until the final software was delivered.

Lastly, I'll go out on a limb by suggesting that you also be conservative with regard to selecting a Linux distribution. Latest and greatest may be ideal for your desktop, but again, reliability is far more important in the field. We chose Debian 3.0r0 for our final system deployment soon after it was released, but because Debian has a reputation as a conservative distribution, we felt comfortable with that decision.

Tips and Tricks

Here are several of the problems we encountered and how we solved them. The solutions may not be optimal, but they worked well for us.

Problem: How did we set the systems up as turnkey? They must power into the exhibit software automatically; no user intervention required. Museum staff also must be able to update software easily, as required.

Solution: We solved this by mounting the CD-ROM application directory over (on top of) the exhibit home directory, /home/techcity for example, and automatically logging on as that user at startup. If the appropriate CD-ROM isn't present—each deployment CD contains the software for only one exhibit—the console displays a message asking the user to put it in and then reboot. (Although not accessible to visitors, a keyboard is in the cabinet with each computer.) The reboot monitor watches a FIFO for either an R to reboot the system or a Q to quit, though we also considered using it in other ways. See Listing 1 for pseudo-code describing this process, Listing 2 for our autostart file and Listing 3 for a sample .xinitrc.

Listing 1. Pseudo-Code for Turnkey Application Startup

Listing 2. File 599xx-mytechcity, Inserted into /etc/rc2.d to Sequence Exhibit Software Startup

Problem: This type of application generally needs fine-tuning. How did we accomplish this?

Listing 3. Sound Studio Application .xinitrc File

Solution: Our first idea was to use a configuration file format based on the Windows .ini file. This would have worked for Sound Studio but not for Traffic Jam. The latter required, among other things, the defining of multiple vehicle types, which made XML's ability to represent easily multiple instances of the same class useful. My son coded a C library designed to run on top of xmllib2, which allows our software to access the various elements as a tree—based on the path to that element within the document, in other words.

Listing 4 shows a section of the DTD for the Traffic Jam configuration file, and Listing 5 contains the associated section of the file. Listing 6 is a section of the code used to load vehicle physics—notice how Cfg points to a C++ object wrapped around the library functions mentioned previously.

Listing 4. The Vehicle-Definition Section of the DTD for the Traffic Jam Configuration File

Listing 5. The Vehicle-Definition Section of the Traffic Jam Configuration File

Listing 6. Loading Vehicle Physics Constants from the XML Configuration File

Problem: How to deal with window manager security? Visitors shouldn't be able to exit the software, bring up other applications, move windows around and so on.

Solution: We found that when visitors had access to the keyboard during early testing, they were quite good at finding their way out of the applications. We fixed this with a combination of configuration file and code changes to icewm to disable pop-up menus, window moves and window resizes. Also, neither exhibit requires the use of a keyboard, so that's kept inside the kiosk during normal operation.


White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState