avwuff/esphome-wiegand

Linking fail : *** [.pioenvs/ga-em-b-szoba/firmware.elf] Error 1

Opened this issue · 1 comments

Hello,

I got a failure during complying a simple test project :( .
It would really appreciate if somebody can point out what i am missing here ?
Thank you.

Here is the error:

> INFO Reading configuration /config/ga-em-b-szoba.yaml...
> INFO Generating C++ source...
> INFO Compiling app...
> Processing ga-em-b-szoba (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 3.5.0)
> --------------------------------------------------------------------------------
> HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
> LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
> Dependency Graph
> |-- AsyncTCP-esphome @ 1.2.2
> |-- WiFi @ 1.0
> |-- FS @ 1.0
> |-- Update @ 1.0
> |-- ESPAsyncWebServer-esphome @ 2.1.0
> |   |-- AsyncTCP-esphome @ 1.2.2
> |-- DNSServer @ 1.1.0
> |-- ESPmDNS @ 1.0
> |-- noise-c @ 0.1.4
> |   |-- libsodium @ 1.10018.1
> Compiling .pioenvs/ga-em-b-szoba/src/main.cpp.o
> Linking .pioenvs/ga-em-b-szoba/firmware.elf
> .pioenvs/ga-em-b-szoba/src/main.cpp.o: In function `WiegandReader::ReadD1()':
> /config/.esphome/build/ga-em-b-szoba/src/esphome/components/api/api_pb2.h:704:(.iram1.17[WiegandReader::ReadD1()]+0x3): dangerous relocation: l32r: literal placed after use: .literal._ZN13WiegandReader6ReadD1Ev
> /config/.esphome/build/ga-em-b-szoba/src/esphome/components/api/api_pb2.h:704:(.iram1.17[WiegandReader::ReadD1()]+0x19): dangerous relocation: l32r: literal placed after use: (.literal._ZN13WiegandReader6ReadD1Ev+0x4)
> /config/.esphome/build/ga-em-b-szoba/src/esphome/components/api/api_pb2.h:704:(.iram1.17[WiegandReader::ReadD1()]+0x1f): dangerous relocation: l32r: literal placed after use: (.literal._ZN13WiegandReader6ReadD1Ev+0x8)
> /config/.esphome/build/ga-em-b-szoba/src/esphome/components/api/api_pb2.h:704:(.iram1.17[WiegandReader::ReadD1()]+0x64): dangerous relocation: l32r: literal placed after use: (.literal._ZN13WiegandReader6ReadD1Ev+0xc)
> .pioenvs/ga-em-b-szoba/src/main.cpp.o: In function `WiegandReader::ReadD0()':
> /config/.esphome/build/ga-em-b-szoba/src/esphome/components/api/api_pb2.h:704:(.iram1.16[WiegandReader::ReadD0()]+0x3): dangerous relocation: l32r: literal placed after use: .literal._ZN13WiegandReader6ReadD0Ev
> /config/.esphome/build/ga-em-b-szoba/src/esphome/components/api/api_pb2.h:704:(.iram1.16[WiegandReader::ReadD0()]+0x19): dangerous relocation: l32r: literal placed after use: (.literal._ZN13WiegandReader6ReadD0Ev+0x4)
> /config/.esphome/build/ga-em-b-szoba/src/esphome/components/api/api_pb2.h:704:(.iram1.16[WiegandReader::ReadD0()]+0x1f): dangerous relocation: l32r: literal placed after use: (.literal._ZN13WiegandReader6ReadD0Ev+0x8)
> /config/.esphome/build/ga-em-b-szoba/src/esphome/components/api/api_pb2.h:704:(.iram1.16[WiegandReader::ReadD0()]+0x57): dangerous relocation: l32r: literal placed after use: (.literal._ZN13WiegandReader6ReadD0Ev+0xc)
> collect2: error: ld returned 1 exit status
> *** [.pioenvs/ga-em-b-szoba/firmware.elf] Error 1
> ========================= [FAILED] Took 57.98 seconds =========================
> 
>  

and here is the test yaml:

esphome:
  # https://github.com/avwuff/esphome-wiegand
  includes:
    - wiegand_device.h
    
  name: ga-em-b-szoba

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "x"

ota:
  password: "x"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Ga-Em-B-Szoba Fallback Hotspot"
    password: "x"

captive_portal:
    



sensor:
- platform: custom
  lambda: |-
    auto wiegand = new WiegandReader(16, 17);
    App.register_component(wiegand);
    return {wiegand};
  sensors:
    name: "GA_Em_B_Szoba_Finger_ID"
    on_value:
      then:
        - homeassistant.tag_scanned: !lambda |-
            char buf[16];
            sprintf(buf, "%.0f", x);
            std::string s = buf;
            return s;   

I put is wiegand_device.h to esphome docker container shared directory (it should be ok since we reached linking):

root@GA-HomeA-01:/data/esphome# ls -lart
total 52
drwxr-xr-x 7 root root  4096 Sep 15 13:58 ..
-rw-r--r-- 1 root root    91 Sep 15 22:46 secrets.yaml
-rw-r--r-- 1 root root   170 Sep 15 22:47 .gitignore
-rw-r--r-- 1 root root 19763 Oct 20 16:23 ga-kazan.yaml
drwxr-xr-x 3 root root  4096 Jan  7 14:00 .
-rwxrwxrwx 1 root root  6942 Jan  7 14:00 wiegand_device.h
drwxr-xr-x 5 root root  4096 Jan  7 14:41 .esphome
-rw-r--r-- 1 root root   992 Jan  7 15:23 ga-em-b-szoba.yaml