-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
#740, #1331 Use port properties #1335
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, please break the changes into two PRs:
- Fix espota.py: error: option -p: invalid integer value: '{upload.port.properties.port}' #740
- Add label to network ports
My impression is that the first is an essential fix for a problem specific to the Arduino IDE 2.x code base (since the bug does not occur when uploading to these boards via Arduino CLI).
My impression is that the second is a purely cosmetic improvement that is being done in a hacky way with the intention of eventually being removed.
Since the two are so distinct, I would prefer to test and evaluate each separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this does not fix #740 for me:
Using 2.0.0-rc9.2.snapshot-7908674 (tester build for 6cae53b) to upload to a network port of an ESP8266 board fails with the same error:
"C:\Users\per\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3" -I "C:\Users\per\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2/tools/espota.py" -i "192.168.254.130" -p "{upload.port.properties.port}" "--auth=adsg" -f "C:\Users\per\AppData\Local\Temp\arduino-sketch-C6FD83427A9EBA5E20435BABAB642981/esp8266.ino.bin"
Usage: espota.py [options]
espota.py: error: option -p: invalid integer value: '{upload.port.properties.port}'
Failed uploading: uploading error: exit status 2
After further investigation, I found that #740 now only occurs when uploading a sketch that was associated with the port while using a previous version of the Arduino IDE. To reproduce
Additional contextInstead of the port selection flip flop described in steps 11-12 above, I was also able to resolve the issue by deleting the "User Data Folder" and restarting the IDE: Windows
(e.g., Linux
macOS
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Describe the problem
The cc.arduino.cli.commands.v1.Port
message of the Arduino CLI gRPC interface contains two fields used for primary identifiers of a port:
address
- identifier for machineslabel
- identifier for humans
🐛 Unlike the "Board Selector" menu and "Select Other Board and Port" dialog, which use the human identifier label
field value, the address
field value is used in the Tools > Port menu.
To reproduce
- Create a port that has a
label
field value different from theaddress
field value.
I believe the two are always the same for serial ports, so this will be most easily accomplished with a network port, where theaddress
value will be an IP address alone like "192.168.254.127
", while thelabel
value will typically have a form like "esp32-b4e62dbf693d at 192.168.254.127
". - Open the "Board Selector" menu.
🙂 Thelabel
field value is used.
- Select "Select other board and port..." from the "Board Selector" menu.
🙂 Thelabel
field value is used in the "PORTS" menu.
- Open the Tools > Port menu.
🐛 The address
field value is used in the Tools > Port menu.
Expected behavior
The label
field value is used in the Tools > Port menu.
Arduino IDE version
2.0.0-rc9.2.snapshot-7908674 (tester build for 6cae53b)
Operating system
Windows, Linux
Operating system version
Windows 10, Linux 20.04
Additional context
Arduino IDE 1.x uses the label
field value in the Tools > Port menu:
The Tools > Port menu is explicitly mentioned in the original issue #567, indicating to me that the expectation was for the label
field value to be used in that menu.
Even though the pluggable discovery system does provide a very nice board identification capability, I am not aware of any boards platforms other than "Arduino SAMD (32-bits ARM Cortex-M0+) Boards" (arduino/ArduinoCore-samd#648) that are using this capability currently.
This means that the network ports of those board will not have the "(<board name>)" suffix added to identified ports in the Tools > Port menu, making the prefix provided by the label
field value especially important.
Signed-off-by: Akos Kitta <[email protected]> Closes #740
Signed-off-by: Akos Kitta <[email protected]>
- for the boards dropdown, and - for the `Tools` > `Port` menu. Closes #1331 Signed-off-by: Akos Kitta <[email protected]>
Both issues should be fixed now. Please check again. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified this fixes #567, #1331, and #740 (including under the specific case I reported in my previous review: #1335 (review)).
Thanks for your excellent work on this Akos!
Motivation
To show the
hostname
of thenetwork
port in the boards dropdown andTools
>Ports
menu (#1331)To fix the upload caused by missing port
properties
(#740)Change description
id
from thePort
type. It can be derived from theaddress
andprotocol
.Unknown
i18n string.getAttacheBoards
/getAvailablePorts
service APIs.addressLabel
instead of theaddress
in the boards dropdown andTools
>Ports
menu. (Only the IP address is shown for unrecognized network boards #1331)properties
on thePort
type. (espota.py: error: option -p: invalid integer value: '{upload.port.properties.port}' #740)Port#properties
for the upload. (espota.py: error: option -p: invalid integer value: '{upload.port.properties.port}' #740)Port
type.DetectedPort
.Other information
Closes #1331
Closes #740
Reviewer checklist