Skip to content

Hardware

WiFi Button

Set up the Thinger.io WiFi Button, connect it to your account and trigger an endpoint with every press; sounds, troubleshooting and firmware.

Reference8 min read

The WiFi Button is a battery-powered Wi-Fi push button based on an ESP8266. Each press wakes it up, connects it to Thinger.io and calls an endpoint of your account, which can send an email, call a web service such as IFTTT or Slack, or start any other integration. Then the button turns itself off to save battery.

The Thinger.io WiFi Button
WiFi Button

Legacy product

The original firmware of the WiFi Button dates from 2020 and is no longer maintained; it has not been checked against the current versions of the ESP8266 board package or the Thinger.io Arduino library. The instructions on this page describe that firmware. For new projects, see the current boards.

How it works ​

  1. You press the button. It beeps once and wakes up.

  2. It joins your Wi-Fi network and connects to Thinger.io as a device.

  3. The first time, it creates its own device in your account with an access token you give it.

  4. It calls the endpoint WiFi_button_pressed of your account with this payload, and beeps twice:

    FieldContent
    IDDevice ID of the button.
    vbatSupply voltage, as the ESP8266 reads it.
    pressedNumber of presses counted while it was awake.
  5. It turns itself off until the next press.

WiFi ButtonPress: wakes up, ·Wi-Fi2.4 GHz, IOTMPThinger.ioDevice of the buttonIOTMP, description WiFiButtonFirst press only: the button createsits device with your access token(CreateDevice)EndpointWiFi_button_pressed{ "ID": …,"vbat": …,"pressed": … }EmailHTTP RequestIFTTT, Slack…Endpoint called: the button plays · ·Then it turns itself off until the next press
What happens when you press the WiFi Button

With two AAA batteries it lasts over 3,000 presses in good conditions.

Prepare your account ​

Before you configure the button, create in Thinger.io:

  • An access token that allows creating devices (the CreateDevice action). The button uses it once, to create its device. You need its value (YOUR_TOKEN).
  • An endpoint with the Endpoint Identifier WiFi_button_pressed, of any type: for example an Email to notify you, or an HTTP Request to another service. It receives the payload above.

Set up the button ​

  1. Insert the batteries

    Open the battery cover on the bottom, insert two AAA (R03) 1.5 V alkaline batteries and close it. Put the bottom switch in the ON position.

  2. Start the configuration portal

    Press the button. It beeps once and opens a Wi-Fi network called THINGER WIFI BUTTON. Connect your phone or computer to it; the password is the same as the network name.

    The portal stays open for 3 minutes. After that the button turns off; press it again to restart the portal.

  3. Open the portal

    The configuration page opens by itself when you connect. If it does not, open http://192.168.4.1 in a browser.

    Configuration portal of the button, titled THINGER WIFI BUTTON, with the Configure WiFi, Configure WiFi (No Scan), Info and Reset buttons
    Main menu of the configuration portal
  4. Choose your Wi-Fi network

    Click Configure WiFi. Choose your network from the list (click Scan to search again, or type its name), and enter its password. The button only joins 2.4 GHz networks with WPA2 and DHCP.

  5. Enter your Thinger.io settings

    Fill in the fields below the Wi-Fi settings:

    FieldValue
    User IdYour username, YOUR_USER.
    Thinger server URLYOUR_SERVER: iot.thinger.io on the free Cloud account, or the domain of your private instance. Host name only, without https://.
    Access TockenThe access token you created, YOUR_TOKEN. The field keeps the spelling of the firmware.
    Device IDThe device ID for the button, YOUR_DEVICE. Characters other than letters and numbers become _. If you leave it empty, the button uses its MAC address.
    Configuration form of the portal: list of Wi-Fi networks found, SSID and password fields, then the User Id, Thinger server URL, Access Tocken and Device ID fields, the save button and the Scan link
    Wi-Fi and Thinger.io settings in the portal

    Click Save.

The button connects, creates its device and beeps twice. The device appears in Devices as an IOTMP device with the description WiFiButton. If the connection fails, the button opens the portal again so you can fix the settings.

Devices list with the wifi_button device, an IOTMP device with the description WiFiButton, highlighted among the other devices of the account
The device of a WiFi Button in Devices

From then on, each press beeps once, calls WiFi_button_pressed and beeps twice. Turn the bottom switch OFF to avoid accidental presses; the settings are kept.

Sounds ​

· is a short high beep and — a long low tone.

SoundMeaning
·The button woke up. While you hold it, one more beep at 5 seconds and another at 10 seconds.
· ·Done: the endpoint was called.
— — —Wi-Fi error.
· · ·Delete-credentials mode.
—Credentials deleted.
— — —, higherTimeout: the button turns off.

Button actions ​

What the button does depends on how long you hold it. While you hold it, it beeps when it wakes up, again at 5 seconds and again at 10 seconds.

ActionResult
Short press, released before 5 secondsCalls the endpoint, or opens the configuration portal if the button is not configured.
Hold 5 to 10 seconds, release after the second beepDelete-credentials mode, for 10 seconds. Without a confirmation press, the button turns off.
Hold 10 to 15 seconds, release after the third beepOTA update mode, to upload new firmware over Wi-Fi. Press the button again to leave it.
Hold 15 seconds or moreThe button turns off without doing anything.
Press the button: it wakes up and beepsWhile you hold it: one more beep at 5 s and another at 10 sRELEASE BEFORE 5 SRELEASE AT 5–10 SRELEASE AT 10–15 SHOLD 15 S OR MORESettings stored?Wi-Fi and Thinger.ioYesConnect and callWiFi_button_pressedDone: · ·Wi-Fi error: — — —NoConfiguration portalTHINGER WIFI BUTTONSave: connect and callDelete-credentialsmode: · · ·Press within 10 sSettings deleted—, then restartsOpens the portalOTA update modeWi-Fi network OTAUpload from the Arduino IDEPress again to leaveTurns offThe button turns itself offafter each action, or after 10 s with no confirmationin delete-credentials modeAfter 3 minutes awake (except in OTA mode): a higher — — — and off
WiFi Button actions

Except in OTA mode, the button turns itself off after 3 minutes awake, with a higher — — —.

Change the settings ​

To set a different Wi-Fi network, account or device, delete the stored settings and configure the button again:

  1. Enter delete-credentials mode

    With the switch ON, hold the button. Release it after the second beep (5 to 8 seconds). The button plays · · ·.

  2. Confirm

    Within 10 seconds, press the button once more. It plays —, deletes the settings and opens the configuration portal.

Deleted settings cannot be recovered. If you do not want to configure it now, turn the switch OFF or wait 3 minutes for the button to turn off.

Troubleshooting ​

ProblemCauseSolution
After saving the settings there is no · · and the portal opens again.The button could not join the Wi-Fi network.Check the network name and password, and that the network is 2.4 GHz. Some networks block devices with extra protection.
No beep when you press the button.The batteries are empty, or the switch is OFF.Replace the batteries, or turn the switch ON. The configuration portal may also be open already.
The button beeps but the endpoint does nothing.The endpoint does not exist, or its ID is different.Create an endpoint with the ID WiFi_button_pressed and check its settings in Endpoints.

Develop your own firmware ​

The WiFi Button can run your own Arduino sketch. Its hardware is wired to these ESP8266 pins:

ResourceGPIONotes
ButtonGPIO12HIGH while the button is pressed.
Power holdGPIO13Keep it HIGH to stay powered. Set it LOW to turn the button off.
BuzzerGPIO14Active buzzer: HIGH makes a constant sound.
LEDGPIO5Not fitted on every unit.
BatteryInternalRead with ESP.getVcc().

Set GPIO13 HIGH as early as possible in setup(), or the button turns off as soon as it is released. The original firmware uses ThingerWebConfig from the Thinger.io Arduino library for the configuration portal.

To build it, install the esp8266 board package and the thinger.io library as for the ClimaStick. The original firmware also needs the ArduinoJson library.

Upload firmware over Wi-Fi ​

  1. Enter the OTA mode

    With the switch ON, hold the button until the third beep (10 to 15 seconds) and release it. The button opens a Wi-Fi network called OTA.

  2. Upload the sketch

    Connect your computer to the OTA network. In the Arduino IDE, choose the button in Tools > Port (network ports) and upload the sketch. The original firmware protects the upload with the password WiFiButton; set your own in your firmware with ArduinoOTA.setPassword().

Upload firmware over USB-UART ​

If the button has no working firmware, or OTA is not available, program it through its programming connectors. Open the enclosure to reach them. The board has two connectors next to each other:

ConnectorPinFunction
Four pinsGGround.
RxSerial data into the ESP8266 (its RXD).
TxSerial data out of the ESP8266 (its TXD).
VCC3.3 V supply input. Square pad.
Three pinsGGround.
FlashGPIO0. LOW when the board starts: download mode.
RSTReset of the ESP8266, active LOW.

You need a USB-to-UART adapter with 3.3 V logic and a 3.3 V output, such as a CP2102 or FTDI adapter.

  1. Remove the batteries

    Take the batteries out: the adapter powers the board through VCC.

  2. Wire the adapter

    Connect the adapter to the four-pin connector, crossing the data lines:

    USB-to-UART adapter, 3.3 VGNDTXRX3V3GNDGNDTo enter the download mode:WiFi Button boardGRxTxVCCFlashRSTGNDdata indata out3.3 V inGPIO0resetSecond connectorgroundTX to RxRX to Tx3.3 V only, never 5 Vhold Flash at GND……while you touch RST to GNDRemove the batteries before you power the board from the adapter.Dashed lines: connect them only to enter the download mode, then remove them.
    USB-to-UART adapter to the programming connectors

    Never connect VCC to 5 V: the ESP8266 runs at 3.3 V.

  3. Enter the download mode

    Connect Flash to G, touch RST to G for a moment, and then disconnect Flash. The board waits for a sketch until the next reset.

  4. Select the port

    In the Arduino IDE, choose an ESP8266 board in Tools > Board, such as Generic ESP8266 Module, and the port of the adapter in Tools > Port: a COM port on Windows, or a port such as /dev/cu.SLAB_USBtoUART (CP2102) or /dev/cu.usbserial-… on macOS.

  5. Upload the sketch

    Click Upload. When it finishes, touch RST to G again to start the new firmware, or disconnect the adapter and put the batteries back.

A NodeMCU board can be the adapter: connect its EN pin to GND, so its own ESP8266 stays off, and wire GND to G, 3V3 to VCC, RX to Rx, TX to Tx, D3 to Flash and RST to RST. Its labels name the pins of its own ESP8266, so the data lines are not crossed. The NodeMCU then puts the button in download mode by itself when you click Upload.

If the upload fails:

  • Use a USB cable that carries data, not a charge-only cable.
  • Check that the computer detects the serial port of the adapter, and that it is the port selected in Tools > Port. Install the driver of the adapter if it does not appear (for a CP2102, the Silicon Labs driver).
  • Swap the Rx and Tx wires: some adapters label their pins the other way round.
  • Check the boot mode. Open the serial monitor at 74880 baud and reset the board: the boot message ends with mode(3,6) in normal mode, and with mode(1,6) in download mode, ready to receive a sketch. If you see mode(3,6), enter the download mode again.

Downloads ​

Original firmware (Arduino sketch, ZIP)wifi-button-firmware.zipWiFi Button datasheet (PDF)wifi-button-datasheet.pdfDesign files for Eagle (ZIP)wifi-button-design-files.zip

Safety ​

  • For indoor use only. Do not expose it to rain or snow.
  • Use only AAA (R03) batteries, and do not mix battery types. Other batteries can leak or burst.
  • Remove the batteries if you will not use the button for a long time. Do not burn, open or short-circuit them.
  • Do not dispose of the button with household waste: take it to an electronic waste collection point.

Disclaimer ​

INTERNET OF THINGER S.L. sells this device as a self-certified development kit, so it is not subject to the usual commercial homologation rules. The owner of the device is liable for any injury to third parties or damage to their property.