Posts with «linux hacks» label

Because You Can: Linux On An Arduino Uno

There are a few “Will it run” tropes when it comes to microcontrollers, one for example is “Will it run Doom?“, while another is “Will it run Linux?”. In one of the lowest spec examples of the last one, [gvl610] has got an up-to-date Linux kernel to boot on a vanilla Arduino Uno. And your eyes didn’t deceive you, that’s a full-fat kernel rather than the cut-down μClinux for microcontrollers.

Those of you who’ve been around a while will probably have guessed how this was done, as the ATmega328 in the Uno has no MMU and is in to way powerful enough for the job. It’s running an emulator, in this case just enough RISC-V to be capable, and as you’d imagine it’s extremely slow. You’ll be waiting many hours for a shell with this machine.

The code is written in pure AVR C, and full instructions for compilation are provided. Storage comes from an SD card, as the ATmega’s meagre 32k is nowhere near enough. If you’re having a bit of deja vu here we wouldn’t blame you, but this one is reputed to be worse than the famous 2012 “Worst PC Ever“, which emulated ARM instead of RISC-V.

Thanks [Electronics Boy] for the tip!

Hack a Day 14 Oct 06:00

Converting an 80s Typewriter Into a Linux Terminal

Typewriters may be long past their heyday, but just because PCs, word processor software, and cheap printers have made them largely obsolete doesn’t mean the world is better off without them. Using a typewriter is a rich sensory experience, from the feel of the keys under your fingers that even the clickiest of PC keyboards can’t compare with, to the weirdly universal sound of the type hitting paper.

So if life hands you a typewriter, why not put it back to work? That’s exactly what [Artillect] did by converting an 80s typewriter into a Linux terminal. The typewriter is a Brother AX-25, one of those electronic typewriters that predated word processing software and had a daisy wheel printhead, a small LCD display, and a whopping 8k of memory for editing documents. [Artillect] started his build by figuring out which keys mapped to which characters in the typewriter’s 8×11 matrix, and then turning an Arduino and two multiplexers loose on the driving the print head. The typewriter’s keyboard is yet used for input, as the project is still very much in the prototyping phase, so a Raspberry Pi acts as a serial monitor between the typewriter and a laptop. The video below has a good overview of the wiring and the software, and shows the typewriter banging out Linux command line output.

For now, [Artillect]’s typewriter acts basically like an old-school teletype. There’s plenty of room to take this further; we’d love to see this turned into a cyberdeck complete with a built-in printer, for instance. But even just as a proof of concept, this is pretty great, and you can be sure we’ll be trolling the thrift stores and yard sales looking for old typewriters.

Arduino Comes To The Raspberry Pi, Linux ARM Devices

Arduino is the perfect introduction to microcontrollers and electronics. The recent trend of powerful, cheap, ARM-based single board Linux computers is the perfect introduction to computer science, programming, and general Linux wizardry. Until now, though, Arduino and these tiny ARM computers have been in two different worlds. Now, finally, there are nightly builds of Arduino IDE on the Raspberry Pi and other single board Linux computers.

The latest Arduino build for ARM Linux popped up on the arduino.cc downloads page early this week. This is the result of an incredible amount of work from dozens of open source developers across the Arduino project. Now, with just a simple download and typing ‘install’ into a terminal, the Arduino IDE is available on just about every single board Linux computer without having to build the IDE from source. Of course, Arduino has been available on the Raspberry Pi for a very long time with sudo apt-get install arduino, but this was an older version that cannot work with newer Arduino boards.

Is this distribution of the Arduino IDE the same you would find on OS X and Windows? Yep, everything is the same:

While this is really just arduino.cc improving their automated build process and putting a link up on their downloads page, it does make it exceptionally easy for anyone to set up a high school electronics lab exceptionally easy. The Raspberry Pi is almost a disposable computing device, and combining it with Arduino makes for a great portable electronics lab.


Filed under: Arduino Hacks, linux hacks, Raspberry Pi

The Internet of Linux Things

The Linux Foundation is a non-profit organization that sponsors the work of Linus Torvalds. Supporting companies include HP, IBM, Intel, and a host of other large corporations. The foundation hosts several Linux-related projects. This month they announced Zephyr, an RTOS aimed at the Internet of Things.

The project stresses modularity, security, and the smallest possible footprint. Initial support includes:

  • Arduino 101
  • Arduino Due
  • Intel Galileo Gen 2
  • NXP FRDM-K64F Freedom

The project (hosted on its own Website) has downloads for the kernel and documentation. Unlike a “normal” Linux kernel, Zephyr builds the kernel with your code to create a monolithic image that runs in a single shared address space. The build system allows you to select what features you want and exclude those you don’t. You can also customize resource utilization of what you do include, and you define resources at compile time.

By default, there is minimal run-time error checking to keep the executable lean. However, there is an optional error-checking infrastructure you can include for debugging.

The API contains the things you expect from an RTOS like fibers (lightweight non-preemptive threads), tasks (preemptively scheduled), semaphores, mutexes, and plenty of messaging primitives. Also, there are common I/O calls for PWM, UARTs, general I/O, and more. The API is consistent across all platforms.

You can find out more about Zephyr in the video below. We’ve seen RTOS systems before, of course. There’s even some for robots. However, having a Linux-heritage RTOS that can target small boards like an Arduino Due and a Freedom board could be a real game changer for sophisticated projects that need an RTOS.


Filed under: Arduino Hacks, ARM, linux hacks, news
Hack a Day 25 Feb 16:30

Embedded Linux meets Arduino with the Rascal Micro

Behold the Rascal Micro. It’s running embedded Linux and has a dual-row of pin headers which probably seem pretty familiar. The idea here is to bring Arduino hardware (ie: shields) to a party with a powerful web server.

The image above is the beta version of the hardware. What’s being shown off in a recent Engadget demo is a version that slides two USB ports in between the barrel jack and the NIC. This makes it easy to jump over to wireless with the use of a USB dongle, or you can figure out what other peripherals you want to include in your project.

The novelty here is that the web server included a built-in editor. So not only can it serve you a webpage to control hardware or display sensor status, but it will let you edit the interface without needing to reflash anything.

The price rings in somewhere around $100-150, and like the popular Raspberry Pi board, you can’t get your hands on it right now.


Filed under: linux hacks, Microcontrollers