This project implements OpenHaystack firmware for ESP32C3 chips, allowing you to create Apple Find My network compatible accessory tags. The firmware is optimized for low power consumption and reliable operation.
- Low power consumption with optimized sleep modes
- Easy key generation and uploading through Python scripts
- Built on NimBLE for reliable Bluetooth LE operation
- PlatformIO (recommended) or Arduino IDE
- Python 3.7 or higher
- Python dependencies (install using
pip install -r scripts/requirements.txt)
-
Clone this repository:
git clone https://github.com/timbeh/esp32c3-openhaystack.git cd esp32c3-openhaystack -
Install Python dependencies:
pip install -r scripts/requirements.txt
-
Open the project in PlatformIO:
pio project init
- Connect your ESP32C3 board to your computer
- Build and upload the firmware:
pio run -t upload
-
Generate keys using the included keygen.py script (modified generate_keys.py from macless-haystack)
python3 scripts/keygen.py
-
It will generate your keys into the scripts/output folder.
- Copy the PREFIX_keyfile to the scripts/input folder
- You can import the PREFIX_devices.json to the OpenHaystack macOS App
-
Upload the keys to your ESP32C3:
python3 scripts/keywriter.py
The script will:
- Auto-detect your ESP32C3 device
- Present a selection menu if multiple ports are found
For manual port or keyfile specification:
python3 scripts/keywriter.py -p /dev/tty.usbserial-XXXX -k your_keyfile
-
After uploading keys, reset the device. It will automatically start advertising.
-
No keys found in partition
- Verify key upload using the keywriter script
- Check the serial monitor for error messages
-
Device not visible in Find My
- Ensure correct public keys are uploaded
- Verify keys are registered in the OpenHaystack or equivalent app
-
Port not detected
- Install correct USB drivers for your ESP32C3 board
- Check device manager for COM port assignment
- Built on NimBLE for Bluetooth LE functionality
- Uses ESP32C3's low-power capabilities
- Stores keys in dedicated flash partition
The firmware is optimized for low power operation:
- Advertises for only 20ms
- Uses light sleep between advertisements
- Average current: ~20μA in sleep mode
- Peak current during advertisement: ~10mA
- Battery life depends on advertisement interval and sleep duration