Skip to content
peter-bfPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Badge Hack — Hack the North 2026

Custom ESP32-C3 firmware for the HTN Hacker Badge that turns it into a Bluetooth arcade + a passive networking radar. It plays two-player games over BLE, and it quietly decodes the contact cards other badges broadcast when people bump — so you can see who's around and connect with a tap.

All the source needed to build is in firmware/. It replaces the event firmware but leaves the stock NVS/LittleFS partitions untouched, so a full-flash backup restores the badge exactly.

Games

Chess Connect 4 Tic-Tac-Toe
chess connect4 ttt
Pong Submarine Sonar Duel Flappy Bird
pong sonar flappy

Chess is normal or bullet (1 min + 2 s), with a full legal-move engine, per-side clocks, and repetition/50-move/insufficient-material draws. Pong and Sonar are real-time and host-authoritative; Flappy Bird is solo. Every two-player game has a name, lobby, invites and rematches over BLE.

Networking

Menu + radar HTN Network
menu htn
Connect QR Emulate tab
qr emulate
  • HTN Network — a contact radar. An always-on listener that decodes the stock "Connect" (and Solana) contact cards broadcast during a bump. New people pop a toast anywhere in the UI — name + rough distance from signal strength (Grace Hopper · ~5 m away). The list is saved to NVS, so it survives reboots and reflashes.
  • Connect QR. On any contact, START shows a QR of their Hack the North profile — https://my.hackthenorth.com/qr/2026/<badge-id> — to add them from your phone. Generated on-device (vendored qrcodegen).
  • Emulate tab (←→ to switch): an always-saved set of cards you can present.

The hack (protocol)

The stock badge shares contacts in an extended BLE manufacturer advertisement, reverse-engineered by capturing real bumps:

AD len | FF | FF FF | "BPA1" | own nonce u32le | peer nonce u32le
       | "BMP2" 02 00 | (tag u8, len u8, bytes)...

Tags: 1 id, 3 name, 4 email, 5 LinkedIn, 6 Discord, 7 Instagram, 8 X, 9 phone, 10 ripple. The decoder is firmware/main/htn.c, verified against a real captured frame in the host tests.

Build

Needs ESP-IDF 5.5.3 (ESP32-C3). From this folder:

. $IDF_PATH/export.sh                 # your ESP-IDF 5.5.3 checkout
idf.py -C firmware build

Output is firmware/build/arcade.bin.

Install

Connect the badge over USB-C (it shows up as a USB Serial/JTAG port, e.g. /dev/cu.usbmodemXXXX). Flash with esptool — --before usb_reset reboots the chip into download mode over USB, so no buttons are needed:

cd firmware/build
python -m esptool --chip esp32c3 -p /dev/cu.usbmodemXXXX \
    --before usb_reset --after hard_reset \
    write_flash --flash_mode dio --flash_size 4MB --flash_freq 80m \
    0x0 bootloader/bootloader.bin \
    0x8000 partition_table/partition-table.bin \
    0x10000 arcade.bin

To keep a restore point first, dump the current flash: python -m esptool --chip esp32c3 -p PORT --before usb_reset read_flash 0 0x400000 stock.bin. If usb_reset ever fails, power the badge off, hold START, power on (that holds the boot strap), then flash with --before no_reset.

Controls

D-pad moves · A select · B back · HOME menu · START QR (on a contact) · left/right switch tabs. USB console: menu <n>, accel, off.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages