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

espota.py: error: option -p: invalid integer value: '{upload.port.properties.port}' #740

Closed
JAndrassy opened this issue Jan 5, 2022 · 11 comments · Fixed by #1335
Closed
Assignees
Labels
conclusion: resolved Issue was resolved topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@JAndrassy
Copy link

JAndrassy commented Jan 5, 2022

network upload with esp8266 and esp32 core doesn't have upload.port.properties.port property evaluated from network port discovery

IDE 2

.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3" -I "/home/duro/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/espota.py" -i "192.168.1.113" -p "{upload.port.properties.port}" "--auth=a" -f "/tmp/arduino-sketch-41571935C07681B86282A62DC15FAFF8/Blink.ino.bin"
Usage: espota.py [options]

espota.py: error: option -p: invalid integer value: '{upload.port.properties.port}'
Upload error: Failed uploading: uploading error: exit status 2

IDE 1

.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I /home/duro/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/espota.py -i 192.168.1.113 -p 8266 --auth= -f /tmp/arduino_build_169908/Blink.ino.bin

@JAndrassy JAndrassy added the type: imperfection Perceived defect in any part of project label Jan 5, 2022
@per1234 per1234 added the topic: CLI Related to Arduino CLI label Jan 5, 2022
@JAndrassy
Copy link
Author

the mdns record is

= wlp58s0 IPv4 esp8266-f0e0c7                                _arduino._tcp        local
   hostname = [esp8266-f0e0c7.local]
   address = [192.168.1.113]
   port = [8266]
   txt = ["tcp_check=no" "ssh_upload=no" "board="ESP8266_WEMOS_D1MINILITE"" "auth_upload=no"]

since auth_upload is not read too, IDE 2 opens the password dialog. IDE 1 doesn't ask for password.

@silvanocerza
Copy link
Contributor

@JAndrassy by any chance have you tested with the Arduino CLI too? This could probably be an issue with it.

@JAndrassy
Copy link
Author

@JAndrassy by any chance have you tested with the Arduino CLI too? This could probably be an issue with it.

with CLI (bundled with IDE) it works. the port is provided. (but asks for password too)

juraj@nuc:~/arduino-ide_2.0.0-rc3_Linux_64bit/resources/app/node_modules/arduino-ide-extension/build$ ./arduino-cli upload /home/juraj/Documents/Arduino/BasicOTA -p 192.168.1.113 -l network -b esp8266:esp8266:d1_mini_lite -v
Uploading to specified board using network protocol requires the following info:
Password: 
"/home/juraj/.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3" -I "/home/juraj/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/espota.py" -i "192.168.1.113" -p "8266" "--auth=a" -f "/tmp/arduino-sketch-5ABD2AC4C1A55FCE95C4A36C8699AE33/BasicOTA.ino.bin"
Uploading...........................................................................................................................................................................................................................

@octoplayer2
Copy link

I have found the same issue under Windows 64; again the CLI workaround works.
I have not yet set a password on the board, and CLI demands one. Entering gives Authentication Fail, but entering a dummy password Authenticates.
BTW, would fixing the Port declaration issue to allow IP format also address #770, to allow empty Port numbers?

@octoplayer2
Copy link

Any sign of a fix for this? - I was using the CLI workaround, but when I upgraded to CLI 0.21 the OTA authenticates, but then says it cannot get a response from the device.. So I have reverted to 1.18.16, as I need the OTA.

@me-no-dev
Copy link

Issue is that Port properties are being lost in the IDE, because in between the code it has been mapped to a different Port structure that does not even have properties object (the one that holds network port and so on).
Here is an example of what config is given to upload:

{
    "wrappers_": {
        "1": {
            "wrappers_": null,
            "arrayIndexOffset_": -1,
            "array": [
                1
            ],
            "pivot_": 1.7976931348623157e+308,
            "convertedPrimitiveFields_": {
            }
        },
        "4": {
            "wrappers_": {
                "5": {
                    "arr_": [

                    ],
                    "valueCtor_": null,
                    "map_": {
                    },
                    "arrClean": true
                }
            },
            "arrayIndexOffset_": -1,
            "array": [
                "192.168.254.153",
                "esp32-7cdfa1e00e58 at 192.168.254.153",
                "network",
                "Network Port",
                [

                ]
            ],
            "pivot_": 1.7976931348623157e+308,
            "convertedPrimitiveFields_": {
            }
        }
    },
    "arrayIndexOffset_": -1,
    "array": [
        [
            1
        ],
        "espressif:esp32:esp32s3:PSRAM=disabled,FlashMode=qio,FlashSize=4M,LoopCore=1,EventsCore=1,USBMode=hwcdc,CDCOnBoot=default,MSCOnBoot=default,DFUOnBoot=default,UploadMode=default,PartitionScheme=default,CPUFreq=240,UploadSpeed=921600,DebugLevel=debug",
        "/Users/ficeto/Documents/Arduino2/BasicOTA",
        [
            "192.168.254.153",
            "esp32-7cdfa1e00e58 at 192.168.254.153",
            "network",
            "Network Port",
            [

            ]
        ],
        true,
        true
    ],
    "pivot_": 1.7976931348623157e+308,
    "convertedPrimitiveFields_": {
    }
}

CLI in a mean time gives the following boards to the IDE:

[
  {
    "port": {
      "address": "192.168.254.153",
      "label": "esp32-7cdfa1e00e58 at 192.168.254.153",
      "protocol": "network",
      "protocol_label": "Network Port",
      "properties": {
        ".": "esp32s3",
        "auth_upload": "no",
        "board": "esp32s3",
        "hostname": "esp32-7cdfa1e00e58.local.",
        "port": "3232",
        "ssh_upload": "no",
        "tcp_check": "no"
      }
    }
  },
  {
    "port": {
      "address": "/dev/cu.Bluetooth-Incoming-Port",
      "label": "/dev/cu.Bluetooth-Incoming-Port",
      "protocol": "serial",
      "protocol_label": "Serial Port"
    }
  },
  {
    "port": {
      "address": "/dev/cu.usbserial-1124110",
      "label": "/dev/cu.usbserial-1124110",
      "protocol": "serial",
      "protocol_label": "Serial Port (USB)",
      "properties": {
        "pid": "0xEA60",
        "serialNumber": "44b562375972ea118b553a1dcf25bb41",
        "vid": "0x10C4"
      }
    }
  },
  {
    "port": {
      "address": "/dev/cu.SLAB_USBtoUART",
      "label": "/dev/cu.SLAB_USBtoUART",
      "protocol": "serial",
      "protocol_label": "Serial Port (USB)",
      "properties": {
        "pid": "0xEA60",
        "serialNumber": "44b562375972ea118b553a1dcf25bb41",
        "vid": "0x10C4"
      }
    }
  }
]

The "bad" Port class interface is here: https://github.com/arduino/arduino-ide/blob/main/arduino-ide-extension/src/common/protocol/boards-service.ts#L145 It is part of CoreService.Upload.Options which is given to doUpload here: https://github.com/arduino/arduino-ide/blob/main/arduino-ide-extension/src/node/core-service-impl.ts#L130

I just could not trace how/where it was turned into that offending Port interface and lost all properties.

@per1234 per1234 assigned AlbyIanna and unassigned silvanocerza Apr 2, 2022
@per1234 per1234 added the topic: code Related to content of the project itself label Apr 2, 2022
me-no-dev added a commit to espressif/arduino-esp32 that referenced this issue Apr 4, 2022
OTA is not yet working properly on the new IDE. Info: arduino/arduino-ide#740 (comment)
@per1234
Copy link
Contributor

per1234 commented Aug 17, 2022

I can still reproduce the issue with 2.0.0-rc9.2-snapshot-9e2b73a and esp8266 platform version 3.0.2

@kittaakos kittaakos self-assigned this Aug 17, 2022
kittaakos pushed a commit that referenced this issue Aug 23, 2022
Signed-off-by: Akos Kitta <[email protected]>

Closes #740

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Aug 24, 2022
Signed-off-by: Akos Kitta <[email protected]>

Closes #740

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Aug 24, 2022
kittaakos pushed a commit that referenced this issue Aug 25, 2022
@per1234 per1234 added the conclusion: resolved Issue was resolved label Aug 25, 2022
@bartgrefte
Copy link

bartgrefte commented Mar 7, 2024

@per1234 Is earlephilhower/arduino-pico#1728 (comment) the same as this? I'm running into this as well, see the comment after that. Arduino IDE 2.3.2

edit: Downgrade to 1.8.13 and problem is gone.

@zeroalphagit
Copy link

Any fix for this its happening for me on Arduino IDE 2.3.2 and esp8266 when attempting to do OTA upload

espota.py: error: option -p: invalid integer value: '{upload.port.properties.port}'

@JAndrassy
Copy link
Author

JAndrassy commented Apr 5, 2024

@zeroalphagit with what version of the esp8266 platform?

@zeroalphagit
Copy link

@zeroalphagit with what version of the esp8266 platform?

I am using: Arduino IDE 2.3.2 with ESP8266 3.1.2 Library.

I'm getting the same error (espota.py: error: option -p: invalid integer value: '{upload.port.properties.port}') on an older nodemcu (esp8266) and a newer Wemos D1 mini with ESP8266EX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants