pairble
GitHub

Wi‑Fi onboarding for connected devices

The box has a QR code. That's the whole manual.

pairble gets your product onto Wi‑Fi in about thirty seconds. The phone scans the code, the device lists the networks it can actually reach, and the password travels encrypted over Bluetooth. No app to install, on iPhone, Android or a computer.

Open source · Apache‑2.0

Supported today: ESP32, C2, C3, C5, C6 and S3 on ESP-IDF 5.1+, and the Raspberry Pi Pico W and Pico 2 W on Arduino. More chips and platforms are on the way.

What your customer sees, step by step

    How it works

    Four steps, about thirty seconds

    Everything the person does is scan, tap and type one password. Everything else happens between the phone and the device.

    1. Scan the code

      With the ordinary camera app. The code holds the device's name and a secret that proves the person has the device in hand, in the part of the address that never leaves the phone.

    2. Nothing to install

      An iPhone opens an App Clip, a small piece of an app that appears from the camera and disappears afterwards. Android phones and computers open a web page that can talk Bluetooth.

    3. The device lists the networks

      The device scans for itself, so the list shows only networks it can really join: on a band it supports and within range. Nobody picks a network the device can't connect to.

    4. Encrypted, and confirmed

      The password goes over an encrypted Bluetooth session. The device tries it and reports back within about twenty seconds: online, wrong password, or network not found.

    Features

    Made for people who will never read your manual

    Each of these exists because something went wrong during setup on real hardware, and we made sure it can't anymore.

    No app to install

    Why Every extra step before setup loses customers, and "download our app" is the biggest one. Everyone already knows how to scan a QR code with the camera.

    For example A customer unboxes a lamp, points the camera at the sticker, and the setup card slides up. No App Store, no account.

    Works from a computer too

    Why Setting devices up at a desk, in a lab or at the end of a production line is quicker with a keyboard. Chrome or Edge on a computer with Bluetooth, which almost every modern laptop has, does the same job as a phone.

    For example An installer opens the setup links from the delivery sheet on a laptop and sets up twenty sensors one after another.

    Only networks that will work

    Why The phone's list of networks is not the device's. Showing what the device itself hears removes the most common support ticket: someone picked a network the device can't join – a 5 GHz network on a chip that only does 2.4 GHz, say.

    For example The home has "Novák" and "Novák 5G". The page offers only the one the device can join.

    Errors people understand

    Why "Connection failed" sends people to support. pairble tells a wrong password from a network that is out of reach, answers in about twenty seconds rather than a minute, and lets people fix it without starting over.

    For example A typo in the password: the page says so, the person corrects it, the device joins. Same session, no restart.

    A plan B is built in

    Why No Bluetooth, no internet on the phone to fetch the App Clip, an old browser? At the same time as Bluetooth, the device opens its own Wi‑Fi network with the setup page stored in its flash.

    For example A cottage with no signal: a second QR code joins the phone to the device's network and the setup page opens by itself.

    Survives a new router

    Why Routers get replaced and passwords get changed. When the stored network stops answering, setup reopens by itself, and nothing is erased, so a router that was only restarting costs nothing.

    For example The internet provider swaps the router. Two minutes later the device is ready to be set up again: scan the same sticker, pick the new network, done.

    Secure by default

    Why An encrypted session keyed by a secret unique to each unit. That secret stays out of server logs, and the Wi‑Fi password is never written to any log.

    For example Support asks for a device log. It shows the network's name, never its password.

    Speaks ten languages

    Why The setup page and the App Clip follow the phone's language: English, Czech, Slovak, German, Polish, French, Spanish, Italian, Portuguese and Dutch.

    For example A German phone sees "WLAN einrichten", a French one "Configurer le Wi‑Fi", with no setting to change.

    Code

    Real code, straight from the examples

    Every sample was built and run on an ESP32-S3. The output under it is what the device actually printed.

    Add the component

    Run this in your ESP-IDF project. The component manager fetches pairble and its one dependency on the next build.

    shell
    # in your project's directory
    idf.py add-dependency "pairble/pairble"
    Output
    Executing action: add-dependency
    NOTICE: Created "~/myproduct/main/idf_component.yml"
    NOTICE: Successfully added dependency "pairble/pairble": "*" to component "main"
    Done

    The settings that matter

    All of them live in menuconfig under "pairble". The defaults suit a development board.

    OptionDefaultWhat it does
    PAIRBLE_SETUP_URLhttps://pairble.com/sThe address in the QR code. pairble.com is free to use, in production too.
    PAIRBLE_SERVICE_UUID021a9004-…The Bluetooth service the device advertises during setup.
    PAIRBLE_NAME_PREFIXPAIRBLE-The start of the device's name; the end comes from its MAC address.
    PAIRBLE_POP_GENERATEyCreate the secret on first boot. Turn it off when the secret is printed on a label.
    PAIRBLE_SOFTAPyAlso offer setup over the device's own Wi‑Fi network.
    PAIRBLE_IMPROV_UARTnAlso speak Improv Wi‑Fi over USB serial, for web installers such as ESP Web Tools.
    PAIRBLE_RECOVERY_AFTER_SECONDS120Reopen setup after this many seconds offline. 0 means never.
    PAIRBLE_SETUP_BUTTON_GPIO-1A button that reopens setup when held. -1 means none.
    PAIRBLE_POWER_CYCLE_COUNT3Switch it on this many times quickly to reopen setup. 0 means never.
    PAIRBLE_BT_MEMORYRELEASE_CLASSICWhat happens to Bluetooth memory after setup.
    PAIRBLE_LOG_SETUP_URL= POP_GENERATEWrite the setup address, which contains the secret, to the log.

    Guides

    Step by step, from real situations

    A lamp with a printed label

    The classic product: the secret is created at the factory and printed on the box, never generated by the device.

    1. In sdkconfig.defaults, set your own Bluetooth service and turn off secret generation (see "Product config" above).
    2. At the end of the production line, read the unit's MAC address with esptool.py read_mac.
    3. Run @pairble/cli unit with that MAC. It creates the secret, the QR code and the NVS file.
    4. Write the NVS file to the chip with the two commands the tool prints.
    5. Print the QR code on the label and on the box, with the device's name underneath for anyone who has to type it.
    6. At home, the customer scans the box and the lamp is online half a minute later.

    A device with a display

    A thermostat or a clock can show its own QR code, so there is nothing to print.

    1. Keep secret generation on. On first boot the device creates its secret and keeps it.
    2. In your event callback, on PAIRBLE_EVENT_STARTED, draw pairble_setup_url() as a QR code.
    3. For phones without Bluetooth, draw pairble_wifi_qr() next to it, which joins the device's own network.
    4. On PAIRBLE_EVENT_SUCCESS, clear the codes and show the device's normal screen.

    The customer changed their router

    What happens without anyone touching the firmware, and what the person sees.

    1. The stored network disappears. The device keeps trying, less often as time goes on, and your callback gets PAIRBLE_EVENT_OFFLINE with the reason. A good moment to turn an LED red.
    2. After two minutes offline, setup reopens over Bluetooth and the device's own network. The old network is still tried every thirty seconds.
    3. The customer scans the same sticker as on day one and picks the new network.
    4. Only once the device has joined does the new network replace the old one. If the old router was only restarting, setup simply closes again.

    An iPhone with no internet

    In a basement or a holiday cottage, the phone can't download the App Clip. The device's own network takes over.

    1. Scan the second QR code, the one for Wi‑Fi. The phone offers to join the device's network, protected by the same secret.
    2. The setup page usually opens by itself. If it doesn't, open http://192.168.4.1 in the browser.
    3. Pick the home network from the list the device found and type the password.
    4. The device joins, the phone returns to its usual network, and the device's own network switches off.

    Setting up at a desk

    No phone needed: a laptop with Bluetooth and Chrome or Edge does the same.

    1. Open the device's setup link on the computer. It is the address from the QR code, found in the production records or in the device's log.
    2. Click Connect. The browser shows a list of nearby devices; choose the one with the name from the label.
    3. Pick the network and type the password, exactly as on a phone.
    4. Close the tab and move on to the next device. pairble lets go of the device as soon as you are done.

    FAQ

    Questions and troubleshooting

    Why only 2.4 GHz networks?

    Most of the chips supported today have a 2.4 GHz radio only (the ESP32-C5 also does 5 GHz). Because the device scans for itself, the list only shows networks it can really use, so nobody has to know about frequencies.

    Why does the iPhone use an App Clip instead of the web page?

    Safari on iPhone and iPad cannot talk to Bluetooth devices. An App Clip is Apple's way of running a small part of an app straight from the camera, without installing it. If the phone has no internet to fetch it, the device's own Wi‑Fi network works instead.

    Can I set a device up from a computer?

    Yes, with Chrome or Edge on Windows, macOS or ChromeOS and a computer with Bluetooth, which almost all modern laptops have. On Linux, Chrome's Bluetooth support may need to be switched on first. Firefox and Safari do not support Bluetooth on the web.

    Does it work with web installers such as ESP Web Tools?

    Yes. With PAIRBLE_IMPROV_UART on (in Arduino, call pairbleImprovSerial(Serial)) the device speaks Improv Wi‑Fi over USB, so the installer can set the network straight after flashing. As over Bluetooth, the old network stays until the new one works. It is off by default.

    The phone doesn't find the device.

    Check that Bluetooth is on and the device is within a few metres. While one phone or tab is connected, the device is invisible to everyone else. The setup page and the App Clip let go after two idle minutes, and the device itself drops an idle client after five. If nothing helps, switch the device off and on again.

    It says the code doesn't match the device.

    The code belongs to a different unit, or was typed in wrong. Codes are case-sensitive. Scan the code printed on the device itself, not a photo of someone else's box.

    The page says the browser can't use Bluetooth.

    Firefox and the browsers built into apps like Facebook or WhatsApp do not support Bluetooth. The page offers a button that opens it in Chrome.

    What is supported today?

    Every ESP32 with Bluetooth LE on ESP-IDF 5.1 or later: ESP32, C2, C3, C5, C6 and S3, including Arduino projects built on ESP-IDF. The ESP32-S2 has no Bluetooth, so the build stops with a clear error rather than producing a product that can't be set up. On Arduino, also the Raspberry Pi Pico W and Pico 2 W (arduino-pico with Bluetooth). More chips and platforms are on the way.

    How much flash and memory does it take?

    pairble itself is about 35 KB of flash, including the setup page in ten languages. The rest of a typical 1.1 MB firmware is ESP-IDF's Wi‑Fi and Bluetooth stacks, which any connected product needs. While setup is open it uses about 90 KB of RAM, and gives all of it back afterwards.

    What if the power goes out during setup?

    The network that worked before is kept aside until the new one is confirmed. After a power cut in the middle of an attempt, the device goes back to the old network on the next start.

    How secure is it?

    The phone and the device agree on a key with X25519, mix in the unit's 60-bit secret and encrypt with AES. The device's own network uses WPA2 with the same secret, and its setup page only answers devices connected to it. Whoever holds the code from the label can set the device up; that is the point, so keep labels off photos.

    Can I use pairble.com in production, or my own domain?

    pairble.com is free to use, in production too, with no limits: the setup page and the App Clip are ready. Your own domain is possible, but an iPhone then needs an App Clip of your own, approved by Apple and ideally part of your own app. Write to [email protected] and we will help you set it up.

    What does it cost?

    Nothing. pairble is open source under the Apache 2.0 licence, and that covers commercial products.