'hostnameOTA' in Network ports is not shown

Network ports are usually shown with 'hostnameOTA at 192.168.2.100' if developer sets 'hostnameOTA' in the code.
But now, even though I've set it and it is working well with showing the full name of network port in v1.8.16, this v2.0 rc doesn't show the 'hostnameOTA' part.

and network upload works in IDE 2.0 for you?

Hi @byunggeun.

Current situation

This deficiency was reported here:

Arduino's developers decided this feature will no longer be supported:

Closing this issue as we won't do it.

Recent versions of the mdns-discovery was returning ports that must not have been returned including those not supporting Arduino OTA. i.e. Printers, laptops and similar.

After arduino/mdns-discovery#23 is merged unsupported ports won't be shown anymore in the IDE.

Comparison

I think the situation is more clear from this demonstration:

I have three network ports:

Here is the resulting Tools > Port menu in Arduino IDE 1.8.19:

image

Here is the resulting Tools > Port menu in Arduino IDE 2.x:

image

Here is the "Board Selector" menu in Arduino IDE 2.x:

image

Here is the "Select other board and port..." dialog with "☐ Show all ports" unchecked:

Here it is with "🗹 Show all ports" checked:

image

And here is the raw data from Arduino CLI that generates all this:

$ arduino-cli board list --format json
[
  {
    "port": {
      "address": "/dev/ttyS4",
      "label": "/dev/ttyS4",
      "protocol": "serial",
      "protocol_label": "Serial Port"
    }
  },
  {
    "port": {
      "address": "192.168.254.14",
      "label": "myesp8266 at 192.168.254.14",
      "protocol": "network",
      "protocol_label": "Network Port",
      "properties": {
        ".": "\\\"ESP8266_WEMOS_D1MINI\\\"",
        "auth_upload": "no",
        "board": "\\\"ESP8266_WEMOS_D1MINI\\\"",
        "hostname": "myesp8266.local.",
        "port": "8266",
        "ssh_upload": "no",
        "tcp_check": "no"
      }
    }
  },
  {
    "matching_boards": [
      {
        "name": "Node32s",
        "fqbn": "esp32:esp32:node32s"
      }
    ],
    "port": {
      "address": "192.168.254.18",
      "label": "esp32-b4e62dbf693d at 192.168.254.18",
      "protocol": "network",
      "protocol_label": "Network Port",
      "properties": {
        ".": "node32s",
        "auth_upload": "no",
        "board": "node32s",
        "hostname": "esp32-b4e62dbf693d.local.",
        "port": "3232",
        "ssh_upload": "no",
        "tcp_check": "no"
      }
    }
  },
  {
    "matching_boards": [
      {
        "name": "Arduino MKR1000",
        "fqbn": "arduino:samd:mkr1000"
      }
    ],
    "port": {
      "address": "192.168.254.19",
      "label": "Arduino at 192.168.254.19",
      "protocol": "network",
      "protocol_label": "Network Port",
      "properties": {
        ".": "mkr1000",
        "auth_upload": "yes",
        "board": "mkr1000",
        "hostname": "Arduino.local.",
        "port": "65280",
        "ssh_upload": "no",
        "tcp_check": "no"
      }
    }
  }
]

Conclusion

So, in all except one case, the Arduino IDE 2.x port listing for the ESP8266 is definitely worse than the Arduino IDE 1.x port listing. However, notice that the ESP32 and MKR1000 are identified.

So the loss of the host name labeling does not mean that network ports are now only listed as IP addresses. They are labeled in a different way now. I think that it is possible to improve this situation by correctly configuring the ESP8266 platform.

Notice this ugly thing in the properties object of the ESP8266 network port:

"properties": {
  ".": "\\\"ESP8266_WEMOS_D1MINI\\\"",
  "auth_upload": "no",
  "board": "\\\"ESP8266_WEMOS_D1MINI\\\"",

Arduino IDE 2.x has a kind of neat feature where you can select both the board and port at the same time from the "Board Selector" menu, so if I click this:

image

It is the equivalent of selecting both Tools > Board > ESP32 Arduino > Node32s and Tools > Port > 192.168.254.18 (Node32s).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.