esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
291 stars 34 forks source link

Remote Receiver not working on RP2040 #4033

Open seanco1 opened 1 year ago

seanco1 commented 1 year ago

The problem

I seem to be getting a compile error when trying to enable the "remote_receiver:" option in the yaml config using the RP2040 platform. remote_receiver: pin: GPIO20 dump: all buffer_size: 1kb

If I remove the above code snippit or hash it out the YAML will compile and upload to the RP2040

Which version of ESPHome has the issue?

2022.12.3

What type of installation are you using?

Docker

Which version of Home Assistant has the issue?

No response

What platform are you using?

RP2040

Board

No response

Component causing the issue

remote_receiver

Example YAML snippet

esphome:
  name: liam-led

rp2040:
  board: rpipicow
  framework:
    # Required until https://github.com/platformio/platform-raspberrypi/pull/36 is merged
    platform_version: https://github.com/maxgerhardt/platform-raspberrypi.git

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  domain: .homea.local

remote_receiver:
  pin: GPIO20
  dump: all
  buffer_size: 1kb

light:
  - platform: rgb
    name: "Liam LED Strip"
    red: output_component2
    green: output_component3
    blue: output_component1
    effects:
      - pulse:
      - random:
      - strobe:

output:
  - platform: rp2040_pwm
    id: output_component1
    pin: GPIO15
  - platform: rp2040_pwm
    id: output_component2
    pin: GPIO13
  - platform: rp2040_pwm
    id: output_component3
    pin: GPIO10

sensor:
  - platform: wifi_signal
    name: "Liam LED WiFi"
    update_interval: 60s

Anything in the logs that might be useful for us?

INFO Reading configuration /config/liam-led.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing liam-led (board: rpipicow; framework: arduino; platform: https://github.com/maxgerhardt/platform-raspberrypi.git)
--------------------------------------------------------------------------------
HARDWARE: RP2040 133MHz, 264KB RAM, 2MB Flash
 - framework-arduinopico @ 1.20604.0 (2.6.4) 
 - tool-rp2040tools @ 1.0.2 
Flash size: 2.00MB
Sketch size: 1.00MB
Filesystem size: 1.00MB
Maximium Sketch size: 1044480 EEPROM start: 0x101ff000 Filesystem start: 0x100ff000 Filesystem end: 0x101ff000
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- WiFi @ 1.0.0
|   |-- Updater @ 1.0
|   |   |-- MD5Builder @ 1.0.0
|   |   |-- LittleFS @ 0.1.0
|   |   |-- PicoOTA @ 1.0.0
|   |   |   |-- LittleFS @ 0.1.0
|   |-- MD5Builder @ 1.0.0
|   |-- lwIP-Ethernet @ 1
|   |   |-- lwIP_CYW43 @ 1
|   |   |   |-- SPI @ 1.0
|   |   |-- SPI @ 1.0
|   |-- lwIP_CYW43 @ 1
|   |   |-- SPI @ 1.0
|   |-- SPI @ 1.0
|-- LEAmDNS @ 1.2
|   |-- lwIP-Ethernet @ 1
|   |   |-- lwIP_CYW43 @ 1
|   |   |   |-- SPI @ 1.0
|   |   |-- SPI @ 1.0
|   |-- WiFi @ 1.0.0
|   |   |-- Updater @ 1.0
|   |   |   |-- MD5Builder @ 1.0.0
|   |   |   |-- LittleFS @ 0.1.0
|   |   |   |-- PicoOTA @ 1.0.0
|   |   |   |   |-- LittleFS @ 0.1.0
|   |   |-- MD5Builder @ 1.0.0
|   |   |-- lwIP-Ethernet @ 1
|   |   |   |-- lwIP_CYW43 @ 1
|   |   |   |   |-- SPI @ 1.0
|   |   |   |-- SPI @ 1.0
|   |   |-- lwIP_CYW43 @ 1
|   |   |   |-- SPI @ 1.0
|   |   |-- SPI @ 1.0
|-- Updater @ 1.0
|   |-- MD5Builder @ 1.0.0
|   |-- LittleFS @ 0.1.0
|   |-- PicoOTA @ 1.0.0
|   |   |-- LittleFS @ 0.1.0
|-- noise-c @ 0.1.4
|   |-- libsodium @ 1.10018.1
|-- MD5Builder @ 1.0.0
Linking .pioenvs/liam-led/firmware.elf
/config/.esphome/platformio/packages/toolchain-rp2040-earlephilhower/bin/../lib/gcc/arm-none-eabi/10.3.0/../../../../arm-none-eabi/bin/ld: .pioenvs/liam-led/src/main.cpp.o: in function `setup':
main.cpp:(.text.setup+0x46c): undefined reference to `_ZTVN7esphome15remote_receiver23RemoteReceiverComponentE'
collect2: error: ld returned 1 exit status
*** [.pioenvs/liam-led/firmware.elf] Error 1
========================= [FAILED] Took 134.60 seconds =========================

Additional information

No response

tomsride commented 1 year ago

Same issue here; using ESPHome 2022.12.3; picow

Thanks for your support & all your great work!

YAML: esphome: name: pico-beamer

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

logger: level: VERBOSE

api: encryption: key: "del"

ota: password: "del"

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

remote_receiver: pin: GPIO1 dump: all buffer_size: 1kb

Response: INFO Reading configuration /config/esphome/pico-beamer.yaml... INFO Generating C++ source... INFO Compiling app... Processing pico-beamer (board: rpipicow; framework: arduino; platform: https://github.com/maxgerhardt/platform-raspberrypi.git)

HARDWARE: RP2040 133MHz, 264KB RAM, 2MB Flash

Nicknakin commented 1 year ago

I'm experiencing the same problem

esphome:
  name: picoremote

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

logger:

# Enable Home Assistant API
api:
  password: "password"

ota:
  password: "password"

wifi:
  ssid: "internet"
  password: "password"

remote_receiver:
  pin: GPIO22
  dump: all
  buffer_size: 512b
NFO Reading configuration picoremote.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing picoremote (board: rpipicow; framework: arduino; platform: https://github.com/maxgerhardt/platform-raspberrypi.git)
----------------------------------------------------------------------------------------------------------
HARDWARE: RP2040 133MHz, 264KB RAM, 2MB Flash
 - framework-arduinopico @ 1.20604.0 (2.6.4) 
 - tool-rp2040tools @ 1.0.2 
Flash size: 2.00MB
Sketch size: 1.00MB
Filesystem size: 1.00MB
Maximium Sketch size: 1044480 EEPROM start: 0x101ff000 Filesystem start: 0x100ff000 Filesystem end: 0x101ff000
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- WiFi @ 1.0.0
|   |-- Updater @ 1.0
|   |   |-- MD5Builder @ 1.0.0
|   |   |-- LittleFS @ 0.1.0
|   |   |-- PicoOTA @ 1.0.0
|   |   |   |-- LittleFS @ 0.1.0
|   |-- MD5Builder @ 1.0.0
|   |-- lwIP-Ethernet @ 1
|   |   |-- lwIP_CYW43 @ 1
|   |   |   |-- SPI @ 1.0
|   |   |-- SPI @ 1.0
|   |-- lwIP_CYW43 @ 1
|   |   |-- SPI @ 1.0
|   |-- SPI @ 1.0
|-- LEAmDNS @ 1.2
|   |-- lwIP-Ethernet @ 1
|   |   |-- lwIP_CYW43 @ 1
|   |   |   |-- SPI @ 1.0
|   |   |-- SPI @ 1.0
|   |-- WiFi @ 1.0.0
|   |   |-- Updater @ 1.0
|   |   |   |-- MD5Builder @ 1.0.0
|   |   |   |-- LittleFS @ 0.1.0
|   |   |   |-- PicoOTA @ 1.0.0
|   |   |   |   |-- LittleFS @ 0.1.0
|   |   |-- MD5Builder @ 1.0.0
|   |   |-- lwIP-Ethernet @ 1
|   |   |   |-- lwIP_CYW43 @ 1
|   |   |   |   |-- SPI @ 1.0
|   |   |   |-- SPI @ 1.0
|   |   |-- lwIP_CYW43 @ 1
|   |   |   |-- SPI @ 1.0
|   |   |-- SPI @ 1.0
|-- Updater @ 1.0
|   |-- MD5Builder @ 1.0.0
|   |-- LittleFS @ 0.1.0
|   |-- PicoOTA @ 1.0.0
|   |   |-- LittleFS @ 0.1.0
|-- MD5Builder @ 1.0.0
Linking .pioenvs/picoremote/firmware.elf
/home/nick/.platformio/packages/toolchain-rp2040-earlephilhower/bin/../lib/gcc/arm-none-eabi/10.3.0/../../../../arm-none-eabi/bin/ld: .pioenvs/picoremote/src/main.cpp.o: in function `setup':
main.cpp:(.text.setup+0x468): undefined reference to `_ZTVN7esphome15remote_receiver23RemoteReceiverComponentE'
collect2: error: ld returned 1 exit status
*** [.pioenvs/picoremote/firmware.elf] Error 1
======================================= [FAILED] Took 1.17 seconds =======================================
kuriburi commented 1 year ago

I also experience the same error: esphome v2023.2.3

INFO Reading configuration /config/esphome/room-ir-remote.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing room-ir-remote (board: rpipicow; framework: arduino; platform: https://github.com/maxgerhardt/platform-raspberrypi.git)
--------------------------------------------------------------------------------
HARDWARE: RP2040 133MHz, 264KB RAM, 2MB Flash
 - framework-arduinopico @ 1.20604.0 (2.6.4) 
 - tool-rp2040tools @ 1.0.2 
Flash size: 2.00MB
Sketch size: 1.00MB
Filesystem size: 1.00MB
Maximium Sketch size: 1044480 EEPROM start: 0x101ff000 Filesystem start: 0x100ff000 Filesystem end: 0x101ff000
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- WiFi @ 1.0.0
|   |-- Updater @ 1.0
|   |   |-- MD5Builder @ 1.0.0
|   |   |-- LittleFS @ 0.1.0
|   |   |-- PicoOTA @ 1.0.0
|   |   |   |-- LittleFS @ 0.1.0
|   |-- MD5Builder @ 1.0.0
|   |-- lwIP-Ethernet @ 1
|   |   |-- lwIP_CYW43 @ 1
|   |   |   |-- SPI @ 1.0
|   |   |-- SPI @ 1.0
|   |-- lwIP_CYW43 @ 1
|   |   |-- SPI @ 1.0
|   |-- SPI @ 1.0
|-- LEAmDNS @ 1.2
|   |-- lwIP-Ethernet @ 1
|   |   |-- lwIP_CYW43 @ 1
|   |   |   |-- SPI @ 1.0
|   |   |-- SPI @ 1.0
|   |-- WiFi @ 1.0.0
|   |   |-- Updater @ 1.0
|   |   |   |-- MD5Builder @ 1.0.0
|   |   |   |-- LittleFS @ 0.1.0
|   |   |   |-- PicoOTA @ 1.0.0
|   |   |   |   |-- LittleFS @ 0.1.0
|   |   |-- MD5Builder @ 1.0.0
|   |   |-- lwIP-Ethernet @ 1
|   |   |   |-- lwIP_CYW43 @ 1
|   |   |   |   |-- SPI @ 1.0
|   |   |   |-- SPI @ 1.0
|   |   |-- lwIP_CYW43 @ 1
|   |   |   |-- SPI @ 1.0
|   |   |-- SPI @ 1.0
|-- Updater @ 1.0
|   |-- MD5Builder @ 1.0.0
|   |-- LittleFS @ 0.1.0
|   |-- PicoOTA @ 1.0.0
|   |   |-- LittleFS @ 0.1.0
|-- noise-c @ 0.1.4
|   |-- libsodium @ 1.10018.1
|-- MD5Builder @ 1.0.0
Linking /data/room-ir-remote/.pioenvs/room-ir-remote/firmware.elf
/data/cache/platformio/packages/toolchain-rp2040-earlephilhower/bin/../lib/gcc/arm-none-eabi/10.3.0/../../../../arm-none-eabi/bin/ld: /data/room-ir-remote/.pioenvs/room-ir-remote/src/main.cpp.o: in function `setup':
main.cpp:(.text.setup+0x404): undefined reference to `_ZTVN7esphome18remote_transmitter26RemoteTransmitterComponentE'
/data/cache/platformio/packages/toolchain-rp2040-earlephilhower/bin/../lib/gcc/arm-none-eabi/10.3.0/../../../../arm-none-eabi/bin/ld: main.cpp:(.text.setup+0x408): undefined reference to `_ZTVN7esphome18remote_transmitter26RemoteTransmitterComponentE'
collect2: error: ld returned 1 exit status
*** [/data/room-ir-remote/.pioenvs/room-ir-remote/firmware.elf] Error 1
========================= [FAILED] Took 12.72 seconds =========================
Mjarred commented 1 year ago

I’m having the same issue, is there a way to resolve this?

PropaneDragon commented 1 year ago

For anyone interested, I did a bit of snooping and it appears there's no RP2040 implementation of remote_receiver so it's never going to compile for a RP2040 board.

I'm guessing this is because implementation for RP2040 is new and this feature will be unsupported as of yet until someone works on it.

freddiemare commented 6 months ago

Any new updates around the implementation of the RemoteTransmitterComponent / RemoteReceiverComponent on the RP2040?

lsellens commented 6 months ago

@freddiemare I submitted a PR for this last week. Works fine for me, but would love to have others test.

external_components:
  - source: github://pr#5974
    components: [remote_transmitter]
    refresh: always
seanco1 commented 6 months ago

I am not able to get this to work.

I updated ESPHome to version 2024.1.0-dev. Added this near the top of the config external_components: - source: github://pr#5974 components: [remote_transmitter] refresh: always

unhashed this from my config remote_receiver: pin: GPIO20 dump: all buffer_size: 1kb

but I get this message "undefined reference to `_ZTVN7esphome15remote_receiver23RemoteReceiverComponentE' collect2: error: ld returned 1 exit status" during the install to the 2040 module. Which seems to be the same message as before. I guess I have not done something correctly although in the logs below you can see the ESPHome version and the Git PR5974.

` INFO ESPHome 2024.1.0-dev INFO Reading configuration /config/esphome/liam-led.yaml... INFO Updating https://github.com/esphome/esphome.git@pull/5974/head INFO Generating C++ source... INFO Compiling app... Processing liam-led (board: rpipicow; framework: arduino; platform: https://github.com/maxgerhardt/platform-raspberrypi.git)

HARDWARE: RP2040 133MHz, 264KB RAM, 2MB Flash

lsellens commented 6 months ago

@seanco1 I didn't add the portion for the remote_receiver just the transmitter. I honestly didn't think about it since I don't use it but I'll look at it when I get home tonight to see if its just as easy to implement.

lsellens commented 6 months ago

@seanco1 try now. I added the remote_receiver code.

external_components:
   - source: github://pr#5974
    components: [remote_transmitter, remote_receiver]
    refresh: always
seanco1 commented 6 months ago

@lsellens This is now working. Thanks for getting this to work on the RPi2040

Here is some of the debug when I pressed a button on a random remote [11:37:44][I][remote.pronto:237]: Received Pronto: data=0000 006D 0002 0000 0160 0052 001A 0180 06C3 [11:37:44][I][remote.pronto:237]: Received Pronto: data=0000 006D 0002 0000 0160 0052 001A 0180 06C3