Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Feb 20, 2014
  1. James Adam

    Use latest version of Bounce Arduino library.

    lazyatom authored
    The instructions don't mention downloading any particular version;
    this will be less confusing for people, hopefully.
Commits on Nov 6, 2013
  1. James Adam
Commits on Aug 2, 2012
  1. Chris Roos

    Bump version to 1.0.5

    chrisroos authored
  2. Chris Roos

    Disable debug by default

    chrisroos authored
    We've seen problems where the size of the sketch, with debug enabled,
    causes problems with older Arduinos/Bootloaders.  The motivation for
    disabling by default is that more people will be able to get up and
    running with the sketch "out of the box".
Commits on Jul 25, 2012
  1. Chris Roos James Adam

    Avoid compiler warnings in our use of Stream.find.

    chrisroos authored lazyatom committed
    The `find` function expects a pointer to a string.  We were passing
    string constants which generated compiler warnings, `warning: deprecated
    conversion from string constant to 'char*'`.  Casting the string
    constants to a pointer to a char (at least that's what I think this
    does) makes the warning go away.
  2. Chris Roos James Adam

    Avoid compiler warning in status code declaration.

    chrisroos authored lazyatom committed
    This reduces the number of `warning: deprecated conversion from string
    constant to 'char*'` warnings by 1. It does, unfortunately, increase the
    sketch size from 30,080 to 30,108 when compiled using Arduino 1.0.1.
  3. Chris Roos James Adam

    Avoid compiler warning in filename declaration.

    chrisroos authored lazyatom committed
    This reduces the number of `warning: deprecated conversion from string
    constant to 'char*'` warnings by 1.  It has a nice side effect of
    reducing the sketch size from 30,098 to 30,080 under Arduino 1.0.1.
  4. Chris Roos James Adam

    Avoid compiler warning in debug method signature.

    chrisroos authored lazyatom committed
    While I'm not familiar enough with Arduino programming to fully
    understand this change, I do know that it reduces the number of
    `warning: deprecated conversion from string constant to 'char*'`
    warnings from 14 to 5 (once for each of the calls to debug that pass a
  5. Chris Roos James Adam

    Use an array of type char rather than pointers.

    chrisroos authored lazyatom committed
    This reduces the sketch size by 26 bytes: saving 6 bytes by changing
    printerType, 6 bytes by changing sketchVersion and 14 bytes by changing
  6. Chris Roos

    Abort if there are problems with the SD Card.

    chrisroos authored
    If there are problems opening the SD card for access then there's no
    point continuing as we can't cache the data.
    Slightly controversially, I've chosen the bump the error codes (number
    of LED flashes) of a DHCP failure and cache failure.  I don't think this
    is too much of a problem, partcularly because I've bumped the version
  7. Chris Roos

    Remove unnecessary 'return' statement.

    chrisroos authored
    The `terminalError` function never returns so this return statement is
    just wasted bytes.
  8. Chris Roos

    Remove some unnecessary debug statements.

    chrisroos authored
    *NOTE* The main motivation is to reduce the size of the data we're
    storing in RAM.  The sketch before this commit would fail to print when
    debug was enabled.  The image would be downloaded successfully but would
    appear not to be cached (cache.size() returned 0).
    * Remove 'dhcp fail' debug statement. The flashing error LEDs, along
    with the code comment, should provide enough information.
    * Remove 'failed to clear cache' debug statement. The flashing error
    LEDs, along with the code comment, should provide enough information.
    * Remove 'cache cleared' debug statement. The sketch will 'terminate'
    if we couldn't clear the cache.  If it doesn't terminate, we can imply
    that the cache was cleared.
    * Remove 'starting request, cache size is' debug statement.
    This statement wasn't adding any useful information.  If our sketch
    makes it to the 'Attempting to connect to...' line, then we know that
    the cache was 0, and that we're trying to connect.
    * Remove 'still connected' debug statement. Both the 'still connected'
    and 'waiting for data' debug statements are printed within the loop
    that continues all the time the client is connected.  I think that
    one of these statements is sufficient.
Commits on Jul 24, 2012
  1. Chris Roos

    Fix problem with crazy large durations..

    chrisroos authored
    If the connection to times out (after about 33
    seconds) then we try to report the duration of the request.
    Unfortunately, this relies on `start` being assigned a sensible value,
    which was only happening after a successful connection.  Prior to this fix,
    when the connection timed out, the duration would be reported as a very
    large number like 4289767837.
    This commit also removes the (in hindsight, obvious) compiler warning,
    `printer.cpp:176: warning: 'start' may be used uninitialized in this
Commits on Jul 23, 2012
  1. Chris Roos

    Use terminalError when there's a DHCP failure.

    chrisroos authored
    I've chosen to flash the error LED twice when there's a DHCP error.
    This number is total arbitrary and can definitely be changed; although I
    do plan to document these error conditions so we won't want it changing
    again and again.
  2. Chris Roos
  3. Chris Roos

    Don't return from terminalError

    chrisroos authored
    This makes the sketch slightly smaller (saving 16 bytes under Arduino
    1.0.1) and is consistent with how we currently terminate when
    encountering a DHCP error.  It'll also make it easier to use
    `terminalError` in the setup function.  Without this change, we would've
    had to check the systemOK boolean to see whether we could continue with
  4. Chris Roos

    Allow us to pass an 'error code' to terminalError.

    chrisroos authored
    It's not really an error code as such; it's just the number of times to
    flash the error LED.  This'll be useful to display a different 'code'
    when the system fails for different reasons.
  5. Chris Roos

    Initialise the LEDs before anything else.

    chrisroos authored
    This helps give some confidence that *something* is happening when you
    first boot the arduino.  It'll also make it possible to call
    `terminalError` to provide some useful visual feedback when we fail to
    obtain an IP address.
  6. Chris Roos

    Rename initSettings.

    chrisroos authored
    The purpose of this function is to retrieve or create the Printer ID so
    let's reflect that in its name.
Commits on Jul 22, 2012
  1. James Adam

    Bump the sketch version.

    lazyatom authored
  2. James Adam

    Move the delay which clarifies error flashing to a clearer place.

    lazyatom authored
    This delay is to separate the error flashes from the startup flash,
    so lets keep it with the startup flashes.
  3. James Adam

    Save 14 bytes by avoiding a for loop.

    lazyatom authored
    The code is slightly less clear, but every byte counts.
  4. James Adam
  5. James Adam
  6. James Adam

    Use a positive condition.

    lazyatom authored
  7. Chris Roos
  8. Chris Roos

    Fail fast if we can't clear the cache.

    chrisroos authored
    After initialization, the error LED will flash three times, indicating a
    failure to clear the cache.  The sketch will then 'terminate' in as much
    as it won't do anything in the main loop.
    I've seen the sketch fail to clear the cache on multiple occassions.
    I'm not 100% sure how it gets in this state but the only solution
    appears to be deleting the cache ('TMP') or formatting the card in
    another machine.
    There's some duplication between `abortDueToCacheFailure` and
    `recoverableError` that I should be able to factor out later.
    I've removed the `systemError` function and inlined the switching on of
    the error LED.  This is so that I can use a boolean named systemError to
    indicate that the sketch should terminate.
Commits on Jun 7, 2012
  1. James Adam

    Bump sketch version.

    lazyatom authored
    This should reflect the new 'flush' fix.
  2. James Adam

    Flushing the buffer seems to avoid the issue! Huzzah!

    lazyatom authored
    Thanks to @techbelly for the nudges in the right direction. Our best guess is
    that this might be a buffer issue in the Ethernet library.
  3. James Adam
  4. James Adam

    Remove the version header as it was causing errors.

    lazyatom authored
    When the version header was present, the Arduino would download data, but then
    fail because the cache size (the file on the SD) was apparently zero length. I
    tried this with other dummy headers, and basically any other header seemed to
    screw up the Arduino cache.
    Why sending another header would affect the behaviour of the downloading, or
    the SD card, I have absolutely no idea :(
    I've tried making the requests locally via curl, but the responses are completely identical, even down to a binary diff.
  5. James Adam

    Use a more generic fake MAC.

    lazyatom authored
    ... rather than the one on one of my Arduinos.
  6. James Adam

    Enable debug by default.

    lazyatom authored
    It's just more convenient right now.
  7. James Adam

    Minor sketch tweaks.

    lazyatom authored
    These come from an exploratory branch trying to figure out why the
    version header causes system errors when downloading.
Commits on May 31, 2012
  1. James Adam

    Printers should report their software version.

    lazyatom authored
    This should allow us to prompt people to upgrade when there are bug fixes
    (like the fix for #12) and so on.
Something went wrong with that request. Please try again.