esphome / issues

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

Unable to upload to Pico W #4070

Open Maarten-buelens opened 1 year ago

Maarten-buelens commented 1 year ago

The problem

i have tried a lot of different ways but none of them work on windows and on a raspberry pi

After a lot of trying it was discovered in the dashboard but as a esp01_1m and i was still unable to upload Logs where sometimes working over wifi but not over serial.

I also tried different usb cables but no change

Which version of ESPHome has the issue?

2023.1.0-dev

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

No response

What platform are you using?

RP2040

Board

No response

Component causing the issue

No response

Example YAML snippet

esphome:
  name: led-blink-pico

rp2040:
  board: rpipicow  # rpipico for Pico (non-W)

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

output:
  - platform: gpio
    pin:
      number: 32  # 25 for Pico (non-W)
      mode: output
    id: LED

wifi:
  ssid: REDACTED
  password: REDACTED
  fast_connect: true

logger:
  level: DEBUG

interval:
  - interval: 500ms
    then:
      - output.turn_on: LED
      - delay: 250ms
      - output.turn_off: LED

Anything in the logs that might be useful for us?

esphome run pico.yaml  --device /dev/sda1

Processing led-blink-pico (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
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
RAM:   [===       ]  26.3% (used 68944 bytes from 262144 bytes)
Flash: [====      ]  36.3% (used 379000 bytes from 1044480 bytes)
Building .pioenvs/led-blink-pico/firmware.bin.signed
========================= [SUCCESS] Took 5.47 seconds =========================
Processing led-blink-pico (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-mklittlefs-rp2040-earlephilhower @ 5.100300.221223 (10.3.0) 
 - tool-openocd-rp2040-earlephilhower @ 5.100300.221223 (10.3.0) 
 - 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
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
RAM:   [===       ]  26.3% (used 68944 bytes from 262144 bytes)
Flash: [====      ]  36.3% (used 379000 bytes from 1044480 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, jlink, picoprobe, picotool, raspberrypi-swd
CURRENT: upload_protocol = picotool
Looking for upload port...
Using manually specified: /dev/sda1
Forcing reset using 1200bps open/close on port /dev/sda1
Uploading .pioenvs/led-blink-pico/firmware.elf
rp2040load 1.0.1 - compiled with go1.15.8
.....................
*** [upload] Error 1
========================= [FAILED] Took 16.02 seconds =========================

Additional information

No response

Maarten-buelens commented 1 year ago

Today i was able to upload via ota.

I first uploaded a config on my brothers pc. Serial does work on his. Still not able to upload via serial myself.

TheCre8r commented 1 year ago

I am also having this issue. I received this error in the logs: Terminal disconnected: TypeError: Cannot read properties of null (reading 'pipeThrough')

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

rixvet commented 10 months ago

OTA update issue on RP2040 still persists, running 203.10.1 stable

Updater log entries:

INFO ESPHome 2023.10.1
INFO Reading configuration /config/esphome/growatt-reader.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing growatt-reader (board: rpipicow; framework: arduino; platform: https://github.com/maxgerhardt/platform-raspberrypi.git)
--------------------------------------------------------------------------------
HARDWARE: RP2040 133MHz, 264KB RAM, 2MB Flash
 - framework-arduinopico @ 1.30400.0 (3.4.0) 
 - 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
Dependency Graph
|-- WiFi @ 1.0.0
|-- LEAmDNS @ 1.2
|-- Updater @ 1.0
|-- noise-c @ 0.1.4
|-- MD5Builder @ 1.0.0
|-- lwIP-Ethernet @ 1
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
RAM:   [===       ]  28.1% (used 73692 bytes from 262144 bytes)
Flash: [=====     ]  51.1% (used 533624 bytes from 1044480 bytes)
Building .pioenvs/growatt-reader/firmware.bin.signed
========================= [SUCCESS] Took 7.58 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of growatt-reader.local
INFO  -> 192.168.178.142
INFO Uploading /data/build/growatt-reader/.pioenvs/growatt-reader/firmware.bin (545656 bytes)
Uploading: [==                                                          ] 4% 
ERROR Error sending data: [Errno 104] Connection reset by peer

Log entries on local serial console:

[D][ota:151]: Starting OTA Update from 192.168.178.151...
[D][ota:320]: OTA in progress: 0.2%
[W][ota:311]: Error writing binary data to flash!, error_code: 131
ssieb commented 10 months ago
Flash size: 2.00MB
Sketch size: 1.00MB
Filesystem size: 1.00MB

According to that, there's no space to put the OTA data. I don't know why there's a filesystem section...

leftsock commented 4 months ago

Several DIFFERENT errors have been reported in this bug. I have the same error as the original first post.

pip3 install esphome==2024.4.0

(Sorry, the editor isn't letting me insert a code block?!)

cat >recirc.yaml <<'EOF' esphome: name: "recirculation-pump" comment: "Hot water recirculation pump" area: "Garage"

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

wifi: ssid: "REDACTED" password: "REDACTED"

fallback hotspot in case wifi connection fails

ap: ssid: "recirculation-pump" password: "REDACTED"

api: # Home Assistant API password: "REDACTED" ota: password: "REDACTED"

logger: switch:

  • platform: gpio id: relay restore_mode: ALWAYS_OFF pin: number: GPIO0

    inverted: true

  • platform: template name: "Hot water recirculation pump; on, 100s, off" turn_on_action:
    • switch.turn_on: relay
    • delay: 10s # 100s
    • switch.turn_off: relay EOF

env LANG=C.UTF-8 esphome -s device /dev/ttyACM0 run recirc.yaml

INFO ESPHome 2024.4.0 INFO Reading configuration recirc.yaml... INFO Generating C++ source... INFO Compiling app... Processing recirculation-pump (board: rpipicow; framework: arduino; platform: https://github.com/maxgerhardt/platform-raspberrypi.git)

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

  • framework-arduinopico @ 1.30702.0 (3.7.2)
  • 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 Dependency Graph |-- WiFi @ 1.0.0 |-- LEAmDNS @ 1.2 |-- Updater @ 1.0 |-- MD5Builder @ 1.0.0 |-- lwIP-Ethernet @ 1 |-- lwIP_CYW43 @ 1 |-- SPI @ 1.0 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 RAM: [=== ] 28.1% (used 73588 bytes from 262144 bytes) Flash: [==== ] 44.0% (used 459928 bytes from 1044480 bytes) Building .pioenvs/recirculation-pump/firmware.bin.signed ========================= [SUCCESS] Took 3.66 seconds ========================= INFO Successfully compiled program. Found multiple options for uploading, please choose one: [1] /dev/ttyACM0 (Board in FS mode - Board CDC) [2] Over The Air (recirculation-pump.local) (number): 1 Processing recirculation-pump (board: rpipicow; framework: arduino; platform: https://github.com/maxgerhardt/platform-raspberrypi.git)

    Configuring upload protocol... AVAILABLE: blackmagic, cmsis-dap, jlink, pico-debug, picoprobe, picotool, raspberrypi-swd CURRENT: upload_protocol = picotool Looking for upload port...

Auto-detected: /dev/ttyACM0 Forcing reset using 1200bps open/close on port /dev/ttyACM0 Uploading .pioenvs/recirculation-pump/firmware.elf rp2040load 1.0.1 - compiled with go1.15.8 ..................... *** [upload] Error 1 ========================= [FAILED] Took 13.28 seconds =========================

Running on Ubuntu 22.04.4 LTS

My main complaint is that there's no log for me to inspect; no hint as to what failed.

leftsock commented 4 months ago

WORKAROUND: hold down button, plug in, mount as drive, copy .esphome/build/recirculation-pump/.pioenvs/recirculation-pump/firmware.uf2 to PicoW, unmount, and that works for the very first install. Once that works, I can use OTA. Note that update via USB still fails, but for a different reason.

... Loading into Flash: [==============================] 100% *** [nobuild] Source.pioenvs/recirculation-pump/firmware.bin.signed' not found, needed by target nobuild'. ========================== [FAILED] Took 9.93 seconds ==========================

Since OTA works, I'm not pursuing this further.