Mktwo Badge: Difference between revisions

From All Hands Active Wiki
Jump to navigation Jump to search
No edit summary
m LogiK moved page Penguicon Badge Mk.II to Mktwo Badge
(No difference)

Revision as of 09:56, 20 July 2016

Download

Code may be found in our git repo, https://github.com/allhandsactive/con_badge


OTA (Over The Air, A.K.A. via HTTP) firmware loading!

Reference: https://github.com/esp8266/Arduino/blob/master/doc/ota_updates/readme.md#application-example


Flashing

If this is the first time you are flashing the code, or you need to update the WiFi settings in the current code, you will need to use an FTDI cable, like the one here: https://www.sparkfun.com/products/9717 -- Make sure the black wire on the FTDI cable faces toward the left side of the board (assuming you are viewing the front of the board).

We will flash this code as we would normally using the FTDI cable -- no sweat! This will allow us to update OTA with HTTP going forward (unless something really goes wrong).

OK, now that we've done it the old way, let's try an OTA flash.

You might wish to save yourself some grief: if you have a running firewall, make sure you can receive Avahi/mDNS/Bonjour requests by allowing port 5353/UDP from 224.0.0.251 (or IPv6 FF02::FB).

Reboot the board, and hold down the programming button (the top button). If you do this in time, all the LEDs will flash blue, letting you know it's ready to receive a binary. If you have the serial monitor running, you will catch it telling you about it going into programming mode, and if everything is configured correctly, should eventually give you a web address like "http://esp8266-<ESP ID>-webupdater.local/update". You can also use "avahi-browse -art" in the commandline to get a listing that should include this board's hostname. It is possible to get these confused very easily if there are multiple boards running on OTA programming mode, since there's no easy way to determine ESP ID by looking at the chip (that I'm aware of anyhow).

NOTE: If the board gets stuck trying to associate with the network, the LEDs will flash red, and after a few tries will simply reboot. Check your SSID/network password strings if this keeps happening.

Go to the webupdater URL on your computer's browser. You will see a very simple form with "Browse..." and "Upload" buttons. Click the Browse button and choose the binary image you wish to flash. Make sure it's built by using Ctrl+R, or "verify" the project in the Arduino IDE, and it should be compiled to a location like "/tmp/build<hex string>.tmp/<sketchname>.ino.bin". In the file chooser, select that file, then hit upload on the webpage. If the OTA programming succeeds, the website will reply with "OK", and the board will then reboot.

Caveats:

  • If things ever go sideways, you can always re-flash with the FTDI cable again.