Lego: A Hacker's Best Friend

By Michelle Delio
Wired News

November 7, 2000

What does a conservative company do when hackers suddenly become obsessed with its products?

When programmers started fooling around with the proprietary code used in the microcomputers included with Lego Mindstorms [ http://mindstorms.lego.com/ ] robotic kits, Lego had to decide whether they should batten down the data-hatches or invite the hackers in to play.

Lego had never been confronted with a quandary like this before. The company, which got its start in Denmark in 1932 when Ole Kirk Christiansen began building toys for local farmers' children, prides itself on being a traditional, family-owned business. And none of the farmers' children had attempted to re-engineer the wooden piggy banks or pull toys Christiansen made for them.

Lego finally decided to treat its new and somewhat puzzling clients as nicely as it had treated the children and parents with whom it has been dealing with for the past 68 years. They even opened up the Mindstorms programming source code [ http://mindstorms.lego.com/sdk2/SDK.asp ].

The result? Sales of Lego robotic kits are soaring and open-source programming languages for Mindstorms have vastly expanded the products' possibilities. And, according to some Mindstorms fans, the products are also educating a new generation of "positive hackers."

"Mindstorms has really been a bit of culture shock for Lego, and the company is still not quite sure what to do about the hacking community's interest in the product," said Jonathan Knudson, author of The Unofficial Guide to Lego Mindstorms Robots [ http://www.oreilly.com/catalog/lmstorms/ ].

Linda Dalton, global brand manager of Lego Mindstorms, said that the company had discussed the ways that the products might be used before releasing them, and understood that Mindstorms would appeal to a "different" audience than the typical Lego products.

"And while Lego does not officially encourage or discourage (hackers), the company will continue to provide a software developers' kit for those who choose to use it for personal hobby use," Dalton said.

The company also recently added two new kits to the Mindstorms line: "The Dark Side Developer Kit," for building walking Star Wars-styled droids, and "Vision Command," a video camera that also functions as the "eyes" of a robot.

When the first Mindstorms kit was released in 1998, hackers immediately got to work on breaking the programming code, a task that was accomplished within a few weeks, said Anthony Johnson, an open-source developer. Once the code was open, alternative software for programming Mindstorms robots could be written.

Johnson explained that the Lego RCX code is good for people who haven't done much programming before, but he believes it has limitations that frustrate the more experienced user. But there is plenty of "homemade" code to choose from.

"There is pbFORTH [ http://www.hempeldesigngroup.com/Lego/pbFORTH/index.html ], a FORTH language interpreter that runs on the RCX, Not Quite C [ http://www.enteract.com/~dbaum ], which uses a C-like syntax; and LegOS [ http://www.noga.de/legOS/ ], which lets you write robot programs in real C using GNU compiler tools."

There's also a Java package, leJOS [ http://lejos.sourceforge.net/ ], currently in a "pretty stable" alpha release, which provides a Java programming environment for the RCX, added Knudson, who has written a couple of programs for leJOS and dubs it "very cool stuff."

Ralph Hempel, an embedded systems engineer, adapted the FORTH programming language so that it could be used with Mindstorms robots. Hempel's pbFORTH, like all the other online-development languages for Mindstorms, is an open-source release.

Hempel, who is also a co-author of the recently released Extreme Mindstorms: an Advanced Guide to Lego Mindstorms [ http://www.amazon.com/exec/obidos/ASIN/1893115844/hempeldesigngrou/102-1467086-4544150 ], said he had never developed for the open-source community before he ported pbFORTH, but said that since FORTH itself was essentially open source it seemed right to keep any alternations open.

As soon as Lego released the first Mindstorms kit, Hempel said he knew he wanted it. But after purchasing the product, he soon discovered that the programming environment was too limited for him.

"I knew that with all that RAM, there had to be more that could be done with it -- and like any good engineer the unused capability bothered me."

Hempel isn't the sort to allow even a scrap of RAM go to waste. Back when he was in high school, he was also "bothered" by his Hewlett-Packard calculator, the then-new HP-41. Hempel felt that its 8K of RAM wasn't being fully utilized.

The HP-41 was one of the first "closed" consumer products to be successfully hacked.

"An intrepid group of computer enthusiasts made some discoveries which allowed the HP-41 to be programmed in non-standard ways. We had a newsletter that had international distribution, and we even created a custom ROM, which was a card that you could plug into the calculator to give it more capabilities," Hempel said.

He said that Hewlett-Packard, while not officially supporting the HP-41 project, did not discourage it either. He said that a similar situation exists with the Lego RCX product.

"Lego hasn't really encouraged hacking the product, but more importantly, they haven't discouraged us either," Hempel said. "We have a friendly relationship with the tech staff at Lego. (Lego Executive Vice President) Torben Ballergard Sorenson told me that they were happy to see such an interest in the product. It was a very big leap of faith for them to make Mindstorms publicly available.

"And our hacking efforts have sure helped sales!"

Programmers are attracted to Mindstorms because they are "the most hackable toys in the world," Johnson said.

Johnson also said that Mindstorms is introducing children to the "fine art of positive hacking," which he defines as "hands-on, in-depth self-education and exploration of any subject that fascinates you."

Eleven-year-old Marcus Fischer Mellbin builds Mindstorms that mimic [ http://www.fischer-mellbin.com/ ] the effects of natural disasters.

Elliot Gornell, a 14-year-old from Chicago, is working on one that can walk his poodle puppy. Gornell has already built dancing, drawing and devastation robots. "Devastation is programmed to crash into things, rather than avoid them like most robots do," Gornell said with glee. Michael and Mark Delgiornio, 12-year-old twins who are home schooled by their father Salvatore, a retired public school teacher, have an entire science curriculum built around Mindstorms. The twins have built a robot that proves the refrigerator light really does go out when the door closes, and one that drags a piece of yarn around to entertain the boys' cat. They are now working on a robot that can monitor the activities of their 6-month-old sister –- a sort of a cyber-sitter, said their father. "Re-programming consumer electronics is an awesome education experience for kids, and great training for future tech careers," Delgiornio said. "Lego could be launching an entire new generation of engineers, programmers and -– er — computer systems security specialists."

Copyright 2000