Skip to content


Repository files navigation

Nearkey (previously known as Virkey)

Nearkey aims to be a professional access control device using Bluetooth Low Energy (BLE).

Official site:

Use cases

  • Garage door opener.
  • Safe switch.
  • Clocking machine.

Main characteristics

  • Asymmetric encryption algorithm (libsodium)
  • Unlimited users per device.
  • Over-the-Air (OTA) firmware updates. The updates are transparent through users normal utilization. For example, when users open a garage door they send firmware chunks transparently. When all chunks are received, Nearkey hardware switches to new firmware version. This feature is crucial to fix potential security or functionality flaws.
  • Supports complex time restriction rules.
  • Android and iOS app (they are free but not open-source right now).

Supported ESP32 boards

Flash your board with precompiled images

First you must install esptool.

Go to bin directory located in Nearkey working directory. Run this command replacing COM_PORT with the correct com port and BOARD_XXX.bin with the correct board file. --chip esp32 --port COM_PORT --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 bootloader.bin 0x10000 BOARD_XXX.bin 0x8000 partitions.bin

If you want erase full flash before flashing Nearkey (YOU WILL LOSE PREVIOUS CONFIGURATIONS), run this command: --chip esp32 --port COM_PORT --baud 115200 erase_flash

Compile sources

Follow esp-idf install instructions.

Nearkey uses version 3.0 of esp-idf. So you must checkout this branch on esp-idf working directory.

git checkout release/v3.0
git submodule update

If you want reproduce the same official binary, you must checkout esp-idf to commit referred in idfver file.

"master" branch points to last stable release. Development unstable code lives in "develop" branch.

Once esp-idf is installed, you must select the right board. On Nearkey's working directory:

$ make menuconfig
--> Component config
    --> config
        --> Board

Compile and flash:

$ make -j4
$ make erase_flash
$ make flash

Execute make monitor after successful flash if you want see Nearkey's debug output.

Using Nearkey

After successful flash, launch Nearkey APP and follow instructions to add your device to your account. You can also manage your account with the web manager here