macless-haystack — ESP32-S3 firmware
Ready-to-flash ESP32-S3 firmware and build config for macless-haystack, the self-hosted Apple Find My network tag (no Mac, no real AirTag).
⚠️ Upstream ships prebuilt firmware only for the original ESP32 (WROOM/WROVER) plus nRF51/nRF52 — there is no ESP32-S3 build. This repo fills that gap: ready-to-flash S3 binaries and the exact changes to compile it yourself.
Why a separate S3 build is needed
The official esp32-firmware.zip will not run on an ESP32-S3:
- Different CPU core — original ESP32 is Xtensa LX6, the S3 is Xtensa LX7. Prebuilt LX6 binaries won’t execute on an LX7.
- Different bootloader offset — original ESP32 flashes the bootloader at
0x1000; the S3 uses 0x0. Following the upstream flash command puts it at the wrong address.
- BLE not enabled by default — the S3 default sdkconfig doesn’t turn on the legacy BLE 4.2 advertising API this firmware relies on.
Quick start (flash the prebuilt binaries)
- Generate your keys with the upstream
generate_keys.py. You get a PREFIX_keyfile (goes on the device) and a PREFIX_devices.json (import into the app).
- Install esptool:
pip install esptool
- Enter download mode (see below), then flash (default = low-power deep-sleep build):
esptool --chip esp32s3 --before default-reset --after hard-reset \
write-flash --flash-mode dio --flash-freq 80m --flash-size detect \
0x0 firmware-deepsleep/bootloader.bin \
0x8000 firmware-deepsleep/partitions.bin \
0x10000 firmware-deepsleep/firmware.bin \
0x110000 PREFIX_keyfile
🔑 Mind the S3 offsets — bootloader at 0x0, not 0x1000. --flash-size detect auto-fits any ≥4 MB board.
Two firmware variants
| Variant |
Advertising pattern |
Power draw |
Best for |
firmware-deepsleep/ |
~100 ms every 60 s (0.17 % duty) |
very low |
battery use; matches upstream behaviour |
firmware-continuous/ |
continuous |
high (keep it USB-powered) |
testing — get located in minutes instead of hours |
The deep-sleep build barely sips power but is slow to be picked up by passing iPhones (the 100 ms broadcast window rarely overlaps a phone’s background scan). The continuous build broadcasts non-stop — great for bring-up while plugged in. The diff between them is build-config/continuous-advertising.patch.
Entering download mode (S3 native USB)
S3 dev boards expose a USB-Serial-JTAG on their native USB-C port.
- Hold
BOOT, plug in USB, then release BOOT. The port enumerates as VID_303A PID_1001 (USB JTAG/serial) and esptool can take over.
- Once our firmware is running, the board stays as USB-JTAG (
PID_1001), so esptool with --before default-reset can enter download mode without touching any buttons on subsequent flashes.
- A factory board often shows
PID_4001 (its stock TinyUSB app) — that’s not a flashing channel; force the ROM download mode with the hold-BOOT trick above and it becomes PID_1001.
Build it yourself
- Clone upstream and
cd firmware/ESP32.
- Append the S3 environment to
platformio.ini (see build-config/platformio-esp32s3.ini):[env:esp32s3]
platform = espressif32
board = esp32-s3-devkitc-1
framework = espidf
monitor_speed = 115200
board_build.partitions = with_key.csv
- Copy
build-config/sdkconfig.defaults into firmware/ESP32/:CONFIG_BT_ENABLED=y
CONFIG_BT_BLUEDROID_ENABLED=y
CONFIG_BT_BLE_ENABLED=y
CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y
CONFIG_BT_BLE_50_FEATURES_SUPPORTED=y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
- Build:
pio run -e esp32s3. Binaries land in .pio/build/esp32s3/.
- (Optional) continuous advertising:
git apply build-config/continuous-advertising.patch before building.
Built & verified with PlatformIO Core 6.1.19 / ESP-IDF (espressif32 platform), toolchain xtensa-esp-elf 15.2.0, on a board reporting ESP32-S3 (rev v0.2), 16 MB flash, 8 MB PSRAM.
Gotchas we hit (so you don’t have to)
fatal error: esp_bt.h: No such file or directory → Bluetooth not enabled. Add the CONFIG_BT_* lines above.
undefined reference to esp_ble_gap_start_advertising → the S3 needs CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y (the firmware uses the legacy BLE 4.2 advertising API, which the S3 doesn’t compile in by default).
Flash memory size mismatch … Expected 8MB, found 2MB → the default 2 MB flash size can’t hold the key partition (ends at 0x210000 ≈ 2.06 MB). Set CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y.
Wrong boot mode detected (0x8) / No serial data received → the board isn’t in download mode. Use the hold-BOOT-plug-USB trick.
- First location fix takes hours → your own iPhone tends not to report a tag sitting next to it (anti-stalking). Carry the tag out among strangers’ iPhones — a walk through town gets points in minutes.
Credits & license
Built on dchristl/macless-haystack (v2.7.2), whose ESP32 firmware in turn derives from OpenHaystack, FindYou and biemster/FindMy.
This firmware is a derivative work and is licensed under AGPL-3.0, the same license as upstream. See LICENSE.
Not affiliated with Apple. For research and educational use — use at your own risk.
评论