Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on Pi Pico W #169

Open
sfozz opened this issue Sep 9, 2024 · 1 comment
Open

Building on Pi Pico W #169

sfozz opened this issue Sep 9, 2024 · 1 comment

Comments

@sfozz
Copy link

sfozz commented Sep 9, 2024

Couple of build issues when building for this target.

I've added the following to allow the builds to get started

diff --git a/components/mitsubishi_heatpump/climate.py b/components/mitsubishi_heatpump/climate.py
index da16834..b9c4d74 100644
--- a/components/mitsubishi_heatpump/climate.py
+++ b/components/mitsubishi_heatpump/climate.py
@@ -53,6 +53,8 @@ def valid_uart(uart):
         uarts = ["UART0"]  # UART1 is tx-only
     elif CORE.is_esp32:
         uarts = ["UART0", "UART1", "UART2"]
+    elif CORE.is_rp2040:
+        uarts = ["UART0", "UART1"]
     else:
         raise NotImplementedError

Following this I had to add the build options from here but the builds were still failing... so I added the following as suggested by g++

diff --git a/components/mitsubishi_heatpump/espmhp.h b/components/mitsubishi_heatpump/espmhp.h
index 110d6be..3f6ff7a 100644
--- a/components/mitsubishi_heatpump/espmhp.h
+++ b/components/mitsubishi_heatpump/espmhp.h
@@ -23,6 +23,7 @@
 #include <chrono>

 #include "HeatPump.h"
+#include <optional>

 #ifndef ESPMHP_H
 #define ESPMHP_H

I'm now getting the following errors, which are well outside of my c++ chops

src/esphome/components/mitsubishi_heatpump/espmhp.cpp: In member function 'virtual void MitsubishiHeatPump::setup()':
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:703:13: error: cannot convert 'MitsubishiHeatPump::setup()::<lambda()>' to 'void (*)()'
  703 |             [this]() {
      |             ^~~~~~~~~~
      |             |
      |             MitsubishiHeatPump::setup()::<lambda()>
  704 |                 this->hpSettingsChanged();
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
  705 |             }
      |             ~
In file included from src/esphome/components/mitsubishi_heatpump/espmhp.h:25,
                 from src/esphome.h:23,
                 from src/esphome/components/mitsubishi_heatpump/espmhp.h:20,
                 from src/esphome/components/mitsubishi_heatpump/espmhp.cpp:21:
.piolibdeps/heatpump/HeatPump/src/HeatPump.h:40:52: note:   initializing argument 1 of 'void HeatPump::setSettingsChangedCallback(void (*)())'
   40 | #define SETTINGS_CHANGED_CALLBACK_SIGNATURE void (*settingsChangedCallback)()
      |                                             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
.piolibdeps/heatpump/HeatPump/src/HeatPump.h:291:37: note: in expansion of macro 'SETTINGS_CHANGED_CALLBACK_SIGNATURE'
  291 |     void setSettingsChangedCallback(SETTINGS_CHANGED_CALLBACK_SIGNATURE);
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/mitsubishi_heatpump/espmhp.cpp:709:13: error: cannot convert 'MitsubishiHeatPump::setup()::<lambda(heatpumpStatus)>' to 'void (*)(heatpumpStatus)'
  709 |             [this](heatpumpStatus currentStatus) {
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |             |
      |             MitsubishiHeatPump::setup()::<lambda(heatpumpStatus)>
  710 |                 this->hpStatusChanged(currentStatus);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  711 |             }
      |             ~
.piolibdeps/heatpump/HeatPump/src/HeatPump.h:41:50: note:   initializing argument 1 of 'void HeatPump::setStatusChangedCallback(void (*)(heatpumpStatus))'
   41 | #define STATUS_CHANGED_CALLBACK_SIGNATURE void (*statusChangedCallback)(heatpumpStatus newStatus)
      |                                           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.piolibdeps/heatpump/HeatPump/src/HeatPump.h:292:35: note: in expansion of macro 'STATUS_CHANGED_CALLBACK_SIGNATURE'
  292 |     void setStatusChangedCallback(STATUS_CHANGED_CALLBACK_SIGNATURE);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@sfozz
Copy link
Author

sfozz commented Sep 9, 2024

esphome:
  platformio_options:
    build_unflags:
      - "-std=gnu++11"
    build_flags:
      - "-std=gnu++17"
  name: heatpump
  friendly_name: HeatPump

rp2040:
  board: rpipicow
  framework:
    platform_version: https://github.com/maxgerhardt/platform-raspberrypi.git

# Enable logging
logger:

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

ota:
  - platform: esphome
    password: "***"

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

  # Enable fallback hotspot in case wifi connection fails
  ap:
    ssid: "Heatpump Fallback Hotspot"
    password: "***"

external_components:
  - source: github://sfozz/esphome-mitsubishiheatpump

climate:
  - platform: mitsubishi_heatpump
    name: "${friendly_name}"

    horizontal_vane_select:
      name: Horizontal Vane

    hardware_uart: UART1
    baud_rate: 4800
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant