- 1 Introduction
- 2 Before the event
- 3 Getting started!
- 4 Hardware
- 5 Software
- 5.1 Building
- 5.2 Troubleshooting
On this page you'll find all the hints, tips, datasheets, secret codes and assorted stuff you'll need to hack the SHA2017 Badge!
Before the event
You can try out some micropython using the Badge Emulator
Just got your badge and want to get going?
- Unpacking and assembling
- Booting the badge for the first time and general use
- Getting the development software on your computer
- How to check what is wrong with your badge and what to do
- Projects:Badge/Documentation/E-Ink, the DKE Group DEPG0290B1
- Projects:Badge/Documentation/ESP32, the Espressif ESP32 Wroom
- Projects:Badge/Documentation/MPR121, the MPR121 Touch Sensor and GPIO expander
- Projects:Badge/Documentation/EyeSore, the blinky LEDs you can add
- Projects:Badge/Documentation/Power, the power management and battery charging
- Projects:Badge/Documentation/Battery, the battery
- 3D printable case
- Laser cut case
- At-least one more project in the works . .
- Weatherproofing? Nailpolish seems to do the trick. Switches on the back will probably be unusable after applying it...
Currently we have two flash-able Firmware flavours . .
- Pure C
- Projects:Badge/MicroPython enabled
We also have an Emulator to try out some code before you put it on your badge.
TLDR: Clone https://github.com/SHA2017-badge/Firmware and follow the instructions there to flash a new version.
You'll need some tooling, on Debian systems this should be sufficient:
sudo apt-get install libncurses5-dev flex bison gperf
Cloning and setting up your environment:
git clone https://github.com/SHA2017-badge/Firmware.git cd Firmware git submodule update --init --recursive source set_env.sh make defconfig
Optionally change configuration:
Compiling and flashing the Pure C Firmware
Compiling and flashing the Miropython Firmware
make cd micropython/mpy-cross make cd ../esp32 make deploy cd ../..
Interacting with the badge
You can use your favourite serial terminal client or user the builtin monitor.
Installing on non Debian-based systems
Compiling and using the Badge Emulator
cd micropython/unix make axtls make ./micropython
Connect to the badge with a micro USB cable and use your favourite serial client.
We have some higher level api's available . . currently a fast moving target 😁
This example code displays some graphics and text:
import badge, ugfx badge.init() ugfx.init() ugfx.clear(ugfx.BLACK) ugfx.thickline(1,1,100,100,ugfx.WHITE,10,5) ugfx.box(30,30,50,50,ugfx.WHITE) ugfx.string(150,25,"STILL","Roboto_BlackItalic24",ugfx.WHITE) ugfx.string(130,50,"Hacking","PermanentMarker22",ugfx.WHITE) len = ugfx.get_string_width("Hacking","PermanentMarker22") ugfx.line(130, 72, 144 + len, 72, ugfx.WHITE) ugfx.line(140 + len, 52, 140 + len, 70, ugfx.WHITE) ugfx.string(140,75,"Anyway","Roboto_BlackItalic24",ugfx.WHITE) ugfx.flush()
Read more at the MicroPython and modules page.
To talk to the e-ink display, the high-level uGFX library that comes with the firmware is the easiest way to get started. A more low-level API is available under components/badge/badge_eink.h if you need it (e.g. for advanced hacks like greyscale imagery).
When a display responds sluggish (more than on other badges) or is for instance unable to clear the display in one pass, check the soldering on the display connector first.
When you update the display too frequently without proper clearing cycles (inverted image, black screen, white screen, positive image) you may experience something that looks like it was burned in. You can recover your screen by doing the black and white flashes (LOTS of them). Also letting the display rest (without power!) seems to alleviate the issue. So expect ghosting/burn-in when you are doing animations. We do not know the long term effect of (ab)using the display like this.
Removing the display is not something we recommend. Break it at your own risk. The trick seems to be to first remove the cable from the connector on the back, pull it through the hole. Now you can carefully push and wiggle the display downward towards the buttons. If you're lucky the glue-dots havent hardened yet and you can remove the display. Come by the badge tent for new gluedots when you're done (limited supplies).
Touch not working
Check the soldering on the MP121. Reflow if necessary.
LED power not working
If your LEDs aren't getting any power either the MPR121 or the transistor is suspect.
Buzzer motor not working
Either the MPR121 or the transistor are suspect