Building

This probably won't work on Windows, unless you use msys2 or Cygwin.

  1. Install Arduino
  2. Install the "git version" of the esp8266 Arduino toolchain (I used version 2.4.0-rc2, 0c897c3), following the instructions in the README.
  3. Run make TOOL_HOME=<arduino-home>/hardware/esp8266com/esp8266 from this project's root directory.

PlatformIO

This procedure doesn't work yet. It produces this message:

.pioenvs/nodemcuv2/firmware.elf section \`.text' will not fit in region \`iram1_0_seg'

This seems to be caused by the object files ending in .o instead of .cpp.o (see the linker script eagle.app.v6.common.ld).

This won't build with the stock PlatformIO ESP8266 Arduino toolchain, because version 3.2.0 doesn't handle verifying TLS keys. To fix this:

  1. Check out the latest Arduino toolchain, copy the contents to ~/.platformio/packages/framework-arduinoespressif8266 (make a copy of your old directory first)

  2. In the above directory:

  3. Create version.txt, put in it: 1.20300.1

  4. Create package.json, put in it:

    {
        "description":"Arduino Wiring-based Framework (ESP8266 Core)",
        "name":"framework-arduinoespressif8266",
        "system":"all",
        "url":"https://github.com/esp8266/Arduino",
        "version":"1.20300.1"
    }
    
  5. Run pio platform show espressif8266; it should show (note Installed: Yes):

    Package framework-arduinoespressif8266
    --------------------------------------
    Type: framework
    Requirements: ~1.20300.1
    Installed: Yes
    Description: Arduino Wiring-based Framework (ESP8266 Core)
    Url: https://github.com/esp8266/Arduino
    Version: 1.20300.1 (2.3.0)
    
  6. Run pio run; it shouldn't download a new Arduino toolchain.

  7. Edit ~/.platformio/platforms/espressif8266/builder/main.py, comment out "-Wl,-wrap,register_chipv6_phy"

Resources:

Wiring

To connect a NodeMCU 1.0 to the RFID-RC522:

ESP8266-12E NodeMCU RFID-RC522
GPIO12 D6 MISO
GPIO13 D7 MOSI
GPIO14 D5 SCK
GPIO04 D2 SDA
GPIO05 D1 RST

Fixing poor range

The cheap "RFID-RC522" boards have inductors which can't handle the transmit current. Replacing the inductors L1 and L2 with 2.2µH, 150mA ones increases the range to a few centimetres.

Other projects