libretiny: Error when compiling climate platform: heatpumpir

I get this error every time

image

esphome:
  name: rf

bk72xx:
  board: generic-bk7231n-qfn32-tuya

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.0.124
    gateway: 192.168.0.1
    subnet: 255.255.255.0

logger:

api:

ota:

web_server:
  port: 80

        

climate:
  - platform: heatpumpir
    name: "AC"
    protocol: gree
    horizontal_default: auto
    vertical_default: auto
    min_temperature: 10
    max_temperature: 40


remote_transmitter:
  pin: P7
  carrier_duty_percent: 50%

About this issue

  • Original URL
  • State: open
  • Created 9 months ago
  • Comments: 27 (7 by maintainers)

Most upvoted comments

Ok, finally got it working. I’ve created a PR in HeatpumpIR repository, but while it’s being accepted and released, this is not usable in esphome. So I’ve created a updated component that’s referring to the fork of this repository in ESPHome.

In the end, what you need to do is:

  1. In your HASS server, enter the esphome docker container to remove any trace of IRremoteESP8266 like this:
$ sudo docker ps
# Find the esphome container id (for example, mine is b87f6e5c7d13)
$ sudo docker exec -it b87f6e5c7d13  /bin/bash
root@b87f6e5c7d13-esphome:~# cd /
root@b87f6e5c7d13-esphome:/# find -name "IRremoteESP8266" -print0 | xargs -0 rm -r
root@b87f6e5c7d13-esphome:/# find -name "IRremoteESP8266@2.7.12" -print0 | xargs -0 rm -r
Ctrl + D to exit
  1. Then in your device YAML in ESPHome config, add this above the esphome: section
external_components:
  - source: github://X-Ryl669/esphome-hpir
    components: [heatpumpir]
    refresh: 1h

Save and install, it should work by downloading my esphome repo containing the updated heatpumpir component, which refers to my fork to arduino-heatpumpir including the patch.

I think the IRremoteESP8266 library is installed when arduino-heatpumpir is installed since its library.json contains:

"dependencies": [
    {
      "owner": "crankyoldgit",
      "name": "IRremoteESP8266",
      "version": "~2.8.4",
      "platforms": ["espressif8266"]
    }
  ]

Once it’s installed, it’s safe to be deleted and it won’t reinstall it. I don’t know why.

Well:

Compiling .pioenvs\irremotesouth\lib401\IRremoteESP8266\ir_Daikin.cpp.o
.piolibdeps/irremotesouth/IRremoteESP8266/src/IRrecv.cpp:140:7: error: '_IRrecv' has not been declared
  140 | using _IRrecv::timer;
      |       ^~~~~~~
.piolibdeps/irremotesouth/IRremoteESP8266/src/IRrecv.cpp:174:3: error: expected unqualified-id before 'if'
  174 |   if (params.rawlen) params.rcvstate = kStopState;
      |   ^~
.piolibdeps/irremotesouth/IRremoteESP8266/src/IRrecv.cpp:181:1: error: expected declaration before '}' token
  181 | }
      | ^
.piolibdeps/irremotesouth/IRremoteESP8266/src/IRrecv.cpp:184:27: error: expected initializer before 'gpio_intr'
  184 | static void USE_IRAM_ATTR gpio_intr() {
      |                           ^~~~~~~~~
.piolibdeps/irremotesouth/IRremoteESP8266/src/IRrecv.cpp: In member function 'void IRrecv::enableIRIn(bool)':
.piolibdeps/irremotesouth/IRremoteESP8266/src/IRrecv.cpp:389:35: error: 'gpio_intr' was not declared in this scope
  389 |   attachInterrupt(params.recvpin, gpio_intr, CHANGE);
      |                                   ^~~~~~~~~
*** [.pioenvs\irremotesouth\lib401\IRremoteESP8266\IRrecv.cpp.o] Error 1
======================================================================= [FAILED] Took 17.25 seconds =======================================================================

What I did was to change the platform to ESP8266, which made PIO download the library. Then, I changed it back to BK72xx, but the library stayed there.

As soon as I remove the IRremoteESP8266 directory from .piolibdeps, the error goes away. Renaming the directory doesn’t help - it seems like PIO is just including every library it finds there. This is a PlatformIO bug.