Category: Maple Bacon

The Maple Bacon and Bacomatic5000 are our designs based on the leaf labs maple platform.

  • I should drop out more often.

    Things are different.

    In the 2+ years after I gave up on making things for a living a lot of things have changed. Things on my personal radar….

    • The price points for adding wifi for Q<1000 is not $15. It’s $3.
    • The Midi Manufacturers Association finally put 3.3v into the hardware standard.
    • The Non compete agreements with some of the most egregious underpaying jerks that I have ever contracted with have expired….

    So….

    Watch this space…..

  • Making Stephen Wright’s Light Switch with the Adafruit Huzzah!

    23439940833_31be1e9c50_o

     

    Things are Different

    In 2012 I was struggling to put together a stm32 based wireless datalogger using leaflabs libmaple and a $20 wifi module. I had to write most of the code myself because libmaple was based on arduino-0022 and most of the wifi libraries made extensive use of the new classes available after arduino 1.xx (String for instance). It was painful and in the end the project was a complete failure except that I had a premade platform to make an art piece called Stephen Wrights Light Switch.

     

    8346730548_dede0fa72e_n img_0935_23439975343_o

    Nowadays you can get an Arduino capable wifi module for less than 10 bucks.

    Huzzah!

    (look it up on the internets!)


    /*-----------------------------------StephenWrightsLightSwitch.ino
     This is a hack of the provided WifiClient example.
     This is free software (BSD License)
     (C) Donald Delmar Davis , SuspectDevices.
    
     ---------------------------------------------------------------*/
    
    
    #include <ESP8266WiFi.h>
    
    
    #define SWITCH_OFF 1
    #define SWITCH_ON 0
    #define LED_OFF 0
    #define LED_ON 1
    
    
    const char* ssid = "MYWIFI";
    const char* password = "MYSECRET";
    const char* host = "www.suspectdevices.com";
    const int httpPort = 80;
    
    const char* offstate = "OFF";
    const char* onstate = "ON";
    
    #ifdef ESP8266_DEV_BOARD
    const int switchPin = 4;
    const int ledPin = 5;
    #else
    const int switchPin = 4;
    const int ledPin = 5;
    #endif 
    /*
     global variables
    */
    
    bool newSwitchValueFlag = false;
    bool oldSwitchValue = SWITCH_OFF;
    bool lightValue = SWITCH_OFF;
    
    
    /*---------------------------------------------------setup()
    
    */
    void setup() {
     bool flipFlop = SWITCH_OFF;
    
     Serial.begin(115200);
     pinMode(switchPin, INPUT_PULLUP);
     pinMode(ledPin, OUTPUT);
     digitalWrite(ledPin, LED_ON);
     delay(10);
    
     // We start by connecting to a WiFi network
    
     Serial.println();
     Serial.println();
     Serial.print("Connecting to ");
     Serial.println(ssid);
     WiFi.begin(ssid, password);
    
     while (WiFi.status() != WL_CONNECTED) {
     flipFlop = !flipFlop;
     digitalWrite(switchPin, flipFlop);
     delay(500);
     Serial.print(".");
     }
    
     digitalWrite(ledPin, LED_OFF);
    
     Serial.println("");
     Serial.println("WiFi connected");
     Serial.println("IP address: ");
     Serial.println(WiFi.localIP());
    
    }
    
    /*-------------------------------------------------------------------------loop()
    
    */
    void loop() {
     
     bool newSwitchValue;
     
     newSwitchValue = (digitalRead(switchPin)==SWITCH_ON);
     
     Serial.print("Switch="); Serial.println(newSwitchValue?"ON":"OFF");
     
     if (newSwitchValue != oldSwitchValue) {
     newSwitchValueFlag = true;
     } else {
     newSwitchValueFlag = false;
     }
     
     Serial.print("connecting to ");
     Serial.println(host);
    
     // Use WiFiClient class to create TCP connections
     WiFiClient client;
     if (!client.connect(host, httpPort)) {
     Serial.println("connection failed");
     return;
     }
    
     // We now create a URI for the request
     String url = "/art2013/settheswitch/";
     if (newSwitchValueFlag) {
     url += "?state=";
     url += newSwitchValue ? onstate : offstate;
     oldSwitchValue=newSwitchValue;
     }
    
     Serial.print("Requesting URL: ");
     Serial.println(url);
    
     // This will send the request to the server
     client.print(String("GET ") + url + " HTTP/1.1\r\n" +
     "Host: " + host + "\r\n" +
     "Connection: close\r\n\r\n");
     
     for (int t = 8; t > 0 && !client.available(); t--)
     delay(100);
    
     // Read all the lines of the reply from server and print them to Serial
     while (client.available()) {
     String line = client.readStringUntil('\r');
     if (line.lastIndexOf("ON") >= 0) {
     Serial.println("FOUND AN ON!!!");
     lightValue = SWITCH_ON;
     } else {
     lightValue = SWITCH_OFF;
     }
    
     Serial.print(line);
     }
    
     digitalWrite(ledPin, lightValue ? LED_ON : LED_OFF);
    
     Serial.println();
     Serial.println("closing connection");
     // client.close();
    
    }
    
    
  • Stephen Wright’s Light Switch

    As an example of a project for last fall’s “Physical Computing for Artists” class I suggested a light switch based on one of Stephen Wrights comedy bits.

    ‘In my house there’s this light switch that doesn’t do anything. Every so often I would flick it on and off just to check. Yesterday, I got a call from a woman in Germany. She said, “Cut it out.”‘ — Steven Wright

    Using one of the bacomatic5000s I created a light switch that posts its state to the web. The idea is that like the switch in Stephen’s apartment there is no connection between turning the switch on and off and what it effects. You can connect your “things of internet” (ToI ™) to the switch by polling http://www.suspectdevices.com/art2013/swls/ or you can come turn the switch on and off in person this week at the AFRU gallery’s “Byte ME 2013” show which opens Friday (details at http://www.afrugallery.com/ai1ec_event/byte-me/?instance_id=58)

    I should have some code up later this month walking through this.

  • 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.

     

     

  • 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

  • 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.

     

     

     

  • Slicing up Maple Bacon

    I had been itching to do more Eagle projects since I took Laen’s class, so Don tasked me with a variation of the Maple Mini to use with a Gainspan module. It is rather large, but the surface mount parts are large enough to do at home on a hotplate. In fact, the board is designed just for at-home assembly. The project is called Maple Bacon, since the finished product should be as thick as a slice of Sweet Briar Farms maple bacon.

    This was my second attempt at a large-scale Eagle project, so any comments or critiques would be appreciated. You can watch or fork my repo at github.com/soycamo/maplebacon.

    Happy holidays!