by on Maple Bacon

(the -> means estimate based on gps data from the bus, * means scheduled time)

A while a go TriMet opened up several APIs to let people access its Transit Tracker data. Since the bus on our route is rarely on time its always nice to know if you can relax and eat your breakfast or if you have to bolt out the door. It seemed like having access to the arrival times without either a full computer or starring at the phone would be a good thing.

The apis are documented at Its basically a pile of XML that you ask for with a url like this

you could also call the same url like this.

Some where in the resulting pile is the data are a couple of arrival times.

<arrival block="7514" departed="true" dir="1" estimated="1346270336000" fullSign="75 Chavez Blvd to Milwaukie" piece="1" route="75" scheduled="1346270214000"shortSign="75 To Milwaukie" status="estimated" locid="7536" detour="true">

Now thats not exactly a pretty thing but its parse-able. Fortunately for us we don’t have to deal with it yet. Because a fellow portlander Dan Colish has published some python to do exactly what we need to do

So now with a little hacking we put a serial lcd on our maple-bacon and have it forward all serial from the usb port to the display.

Since the lcd requires 5 volts we plug its power into the maple-bacon’s vin and then we connect its serial rx line to tx3. Then we mangle Mr Colish’s code until it works.


Of course this morning when I went to actually use. it.

The next step will be to get the python and the maple bacon onto the pogo plug.

The step after that will be to hook the maple directly to the internet using ethernet.

by on Maple Bacon

Cooking with Maple Bacon

Suspect Devices Presents: Cooking with Maple Bacon

In this workshop we will introduce the Leaflabs Maple platform using our own varient of the maple mini, the “Maple Bacon”. This will be a software only (no soldering required) class and it will focus on programming.

  • An introduction to the Maple IDE and a comparison of it to the Arduino and Wiring Platforms.
  • An introduction to using libmaple from the command line and integrating it into an ide
  • Hardware Hello World.
  • Software Hello World (serial).
  • A more complicated example which will serve the following discussion
  • C(++) in an embedded environment
    • Datatypes
    • Structures,arrays,and enums
    • Scope, constants, and macros
    • C++ and Classes
  • Hardware interaction
    • Basic IO, Analog to Digital
    • Serial Ports (usb, usart, spi, twi)
    • External Interrupts
    • Timers
    • PWM

What to Bring:

A laptop and a standard usb a-b cable.


You can rsvp for this workshop at

(note: A Maple Bacon is included in the rsvp for the class. However please note that if you are unable to attend you are responsible for making other arrangements to recieve your board. )

by on Arduinoelectronics

Now that you’ve taken the plunge into microcontrollers, here are some good resources to help you with your first project.

  • Getting Started in Electronics by Forrest Mims
    A good resource if you have zero experience with electronics.
  • Physical Computing: Sensing and Controlling the Physical World with Computers by Dan O’Sullivan and Tom Igoe
    Covers all the common use cases for kinetic sculpture and other art applications. The example code is being updated for Arduino-compatible microcontroller boards by Don as Errata for Physical Computing.
  • Practical Electronics for Inventors by Paul Scherz
    If you have some basic understanding of electronic principles, this is the book for you.

I would also recommend Forrest Mims’ Engineers Mini Notebooks, as they have lots of common circuits that you can use for a variety of projects.


If you have other sites or books or other resources that have been helpful, post them to the comments and (eventually) I’ll add them to this list.

by on Maple Bacon

Here are the missing links and notes from my Open Source Bridge Talk for 2012.

A web copy of the slides are at — makers of the arduino. — makers of the Maple platform. — maker of the teensy++ — hardware for the bom5k and the maple bacon. — libmaple firmware for the bom5k that I did as part of some thought work at random hacks of kindess at the beginning of June.



by on Arduino

A few months ago Paul Stoffregon asked to borrow an arduino mega 2560 to look at a bug that he was working around. I had access to several as I was working on a project for a client that was based on the same board. Around the same time I made the mistake of trying to add a watch dog timer to a complicated piece of code that I inherited. The results were disastrous and made me look more closely at both the stripped down opti-boot boot-loader that the arduino team is using and the not so stripped down but still buggy stk500v2 code that is currently on the arduino mega2560 which is there because opti-boot doesn’t handle the larger memory.

I was not so happy.

I am less happy with the fact that two years after issues #181 and a year and a half after #393 were filed you can still buy an arduino mega2560 with these bugs and re-burning the boot-loader will not fix the problem.

Issue #393.

void setup() {

void loop() {

The above sketch will not load through the bootloader.

#include <avr/wdt.h>

print "Hello world\n";

print "I am going to not get stuck..\n";
for(x=0; x<100; x++) {
print "I am going to get stuck now..\n";
for(x=0; 1; x++) {

The above sketch will hang the board until you power down or re-burn the boot-loader, setting the WDT to 15ms and waiting is a common practice for getting a clean software reset. But more importantly the WDT is an vital tool to make sure that systems don’t get stuck for long periods when things go wrong (and they do).

Fortunately some people aren’t waiting and there is source code for the bootloader that has these issues resolved is here.

and a hex file for the bootloader is at the bottom of the issue #181 if this direct link doesn’t work.


by on armMaple Bacon

For a while we have been working with a board that Cameron created called the Maple Bacon (, as well as a logging and wireless shield that we are calling the Baco-matic5000. The maple bacon is a clone of the maple mini ( . The point in recreating it was that LeafLabs did not stock it directly and that the only supplier was a chinese fab. It made more sense to redesign it and run it through the DorkbotPDX group pcb order and if we needed anything faster to go through Sunstone.


The maple platform ( is a wiring(arduino) port for the STM32 series of ARM microcontrollers.

Maple Mini and Maple RET6


Like the Arduino most of the details needed to get a program running are tucked neatly out of the way.

There are a few things I like about the maple platform  on top of having thrice as much memory, 3 serial ports and a usb serial port, a pair of i2c ports and another pair of spi ports in a package that costs less than 80 bucks. One of them is that the documentation for the language and the ide is local. The other part is that the ide is optional.

Maple is a library first and an Arduino clone second. So you can test things in the ide and then when you are ready to create a project you can actually use a real code editor and “make install” it onto your board. And its fast (look ma no java). See:

Getting our clone board up and running was relatively simple the STM32s have a serial bootloader which you can program with any 3.3v serial adapter and a cross platform python script. Using this you load a usb based bootloader which loads your code. Much easier than having to in circuit program your boot-loader with a platform specific programmer. See:


Speaking of 3.3v no more  converting rom 5 to 3v to talk to your wireless modules or an sd card. In the picture at the top of this post over 2 thirds of the parts on the hydrogen are devoted to converting signals from the arduinos 5v processor to the 3.3v gainspan wifi module and the 3.3v sd card. In the bacomatic these lines are directly connected to the processor.  Below is an ethernet solution that is also 3.3v based connected to the Maple Mini and the shield that Cameron designed.

It’s been brought to my attention that while lots of folks in this group are doing arm based processing it still hasn’t been brought down to where it can be used by artists and musicians like the Arduino and Wiring (and even the teensy). So I hope to be presenting more Maple and Libmaple based projects in the near future.




by on arm

The dorkbotPDX mailing list recently posted a link to a 25 dollar arm linux based nas called the PogoPlug. It was pink and ugly but it was $33 with shipping, so I bought one. It was stashed conspicuously under the rug by the nice people at UPS yesterday after I signed a slip saying they could leave it.

Using the thing was scary. I plugged it in but it didn’t show up anywhere. When I went to the pogo plug site they told me to download their software and when I did I was able to enable any disk that I plugged into it and then i could let it sync and share my personal files with some cloud thing in the wild blue yonder. This wasn’t done in any transparent and secure-able way but through a software wedge that made the thing show up as a drive locally. The scariest thing was that when I logged into the web site it was able to figure out where my device was (I assume because it was on the same lan as the computer I logged in from) reset the password and enable ssh on the weird looking box. Yeah it cut a hole into my lan.

There was only one thing to do with the scary pink beast. Name it Bradley and put another operating system on it.

So, after figuring out which particular pogo plug I had, I dug up a flash drive and followed the bouncing prompt from and less than an hour later I had a relatively usable linux box.

Now to figure out what to do with it.