Author: feurig

  • A quick one. (Kitchen Transit Tracker)

    (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 http://developer.trimet.org/ Its basically a pile of XML that you ask for with a url like this

    http://developer.trimet.org/ws/V1/arrivals/locIDs/7536/appID/EC36A740E55BB5A803BB2602B

    you could also call the same url like this.

    http://developer.trimet.org/ws/V1/arrivals?locIDs=7536&appID=EC36A740E55BB5A803BB2602B

    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 https://github.com/dcolish/PyMET/blob/master/pymet/pymet.py

    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.

    https://github.com/suspect-devices/cooking-with-maple-bacon/blob/master/sketches/trackdisplay1/trackdisplay1.pde

    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.

    https://github.com/suspect-devices/cooking-with-maple-bacon/blob/master/sketches/trackdisplay1/trymet.py

     

    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.

  • Cooking with the Maple Bacon, Saturday 25AUG12, 1-5 FreeGeek, $40

    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.

    RSVP

    You can rsvp for this workshop at http://www.suspectdevices.com/blahg/workshops/

    (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. )

  • Bacomatic 5000 session notes.

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

    A web copy of the slides are at http://suspectdevices.com/TheBaco-matic5000-OSB/.

    arduino.cc — makers of the arduino.

    www.leaflabs.com/ — makers of the Maple platform.

    pjrc.com — maker of the teensy++

    https://github.com/soycamo/maplebacon — hardware for the bom5k and the maple bacon.

    https://github.com/leaflabs/libmaple — libmaple

    https://github.com/suspect-devices/cache-and-carry firmware for the bom5k that I did as part of some thought work at random hacks of kindess at the beginning of June.

     

     

  • Arduino Cult Induction, FreeGeek 19May12 1-5pm, $35

    Space is limited to 15 people so please RSVP sooner rather than later.

    http://suspectdevices.com/workshops.html

  • Austin likes the Bacon!

    Cameron and I had a refreshing change of attitude and latitude, last weekend.

    Dorkbot Austin let us introduce them to the Maple Bacon which was well received.

    Thanks DorkbotATX!
    Photo from dorkbotatx’s twitter feed @dorkbotatx

  • Two small sketches that will not work on your Arduino Mega2560.

    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() {
     Serial.begin(9600);
    }
    
    void loop() {
     Serial.println("test!!!");
    }

    The above sketch will not load through the bootloader.

    #include <avr/wdt.h>
    
    print "Hello world\n";
    wdt_enable(WDTO_15MS);
    
    print "I am going to not get stuck..\n";
    for(x=0; x<100; x++) {
      wdt_reset();
      x++;
      delay(10);
    }
    print "I am going to get stuck now..\n";
    for(x=0; 1; x++) {
      delay(10);
    }

    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.

    https://github.com/msproul/Arduino-stk500v2-bootloader

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

     

  • Very Good! Very Nice! Very Easy I Wish You Could Smell This.

    For a while we have been working with a board that Cameron created called the Maple Bacon (http://github.com/soycamo/maplebacon), 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 (http://leaflabs.com/docs/hardware/maple-mini.html) . 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 (http://leaflabs.com/) 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: http://leaflabs.com/docs/unix-toolchain.html

    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: http://leaflabs.com/docs/bootloader.html

     

    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.

     

     

     

  • My $33 linux box.

    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 http://archlinuxarm.org/platforms/armv6/pogoplug-provideov3 and less than an hour later I had a relatively usable linux box.

    Now to figure out what to do with it.