IDE 2.x doesn't recognize port of Mega 2560, IDE 1.x does

I'm using Win10 and the latest Arduino IDE 2.0.0 release. My MEGA2560 board mounts on COM17, but I'm only offered COM3 and COM4 as options to connect. Closing and opening IDE 1.8.13 works fine and offers COM17, connects, and downloads the sketch as expected. The new IDE 2.0 simply doesn't recognize my MEGA2560 on COM17, which means I can't use it. Back to 1.8 . . .

Hi @cmarciales. I'm sorry you weren't able to use Arduino IDE 2.x. If you ever decide to give it another try and still have this problem, please make a post on the forum and we'll try to help you get it working.

I'm all for using the new IDE. I love the editor, board manager, library manager, all the new stuff. How do I go about reporting stuff that I find? Like this? Where in the forum? When I did a search, this thread was very close to the same except @jayrabe is using Linux and I'm on Win10. Should I just go to the top of the forum and throw the question in the bucket?

The forum is the best place for less structured feedback, requests for assistance, and discussion about Arduino IDE 2.x.

Formal bug reports and feature requests can be submitted directly to the Arduino IDE developers via the issue tracker here:

https://github.com/arduino/arduino-ide/issues/new/choose

I try to act as somewhat of a "bridge" between the forum and the issue tracker, submitting reports of problems or potential enhancements identified via the forum discussions, while also cross-referencing the relevant information from the issue tracker in the forum discussions in order to make that information readily available to the forum community.

It depends on the subject matter. This forum category is dedicated to Arduino IDE 2.x-specific subjects. For any subjects which are not specific to Arduino IDE 2.x (even if you happen to be using Arduino IDE 2.x incidentally), other forum categories will be more suitable.

If you open a forum category, you should see an "About the ___ category" topic at the top of the page. This topic will provide a short description of the purpose of the category in case it isn't clear from the category name alone.

It is, but I think in this case it will be easier to handle in a dedicated topic. You can see from the recent discussion in that other thread we identified a Linux-specific application as the cause of the problem. Your problem is surely not identical, even if it has similar symptoms.


So, lets see if we can get to the investigation.

I think the best thing to check now is whether the low level serial-discovery tool used by the Arduino IDE 2.x to find ports is behaving and able to see the port of your board. Arduino IDE 1.x does not use this tool, so it is possible that tool may be the location of the problem, rather than something in the Arduino IDE 2.x codebase which only displays the list of ports it is given by the serial-discovery tool.

I'll provide the instructions here:

:exclamation: NOTE: These instructions will not solve the problem. They are only intended to possibly gather some more information about the problem, which might provide a clue that leads to a solution.

During all this, keep an eye out for anything that doesn't match the expected behavior as described at each step.

  1. Open the following folder in Windows "File Explorer":
    C:\Users\<username>\AppData\Local\Arduino15\packages\builtin\tools\serial-discovery
    
    Note that the AppData folder is hidden by default in "File Explorer". You can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
  2. The serial-discovery folder will contain a subfolder for each of the versions of serial-discovery which are installed on your computer.
    For example:
    serial-discovery/
    ├── 1.3.0/
    ├── 1.3.0-rc1/
    └── 1.3.2/
    
  3. Hold the Shift key while clicking the right hand button on the mouse on the folder with the highest version (1.3.2 in the example above).
  4. From the context menu, click "Open PowerShell window here".
    PowerShell will now open.
  5. Type the following command:
    serial-discovery
    
  6. Press the Enter key.
    serial-discovery will now start. There won't be any obvious sign of this other than that there is no longer a command prompt at the cursor in the terminal.
  7. Type the following command:
    HELLO 1 "arduino-cli 0.20.2"
    
  8. Press the Enter key.
    You should now see a response printed exactly like this:
    {
      "eventType": "hello",
      "protocolVersion": 1,
      "message": "OK"
    }
    
  9. Unplug your Arduino board from your computer if you have it plugged in.
  10. Type the following command:
    START_SYNC
    
  11. Press the Enter key.
    You should now see a response printed exactly like this:
    {
      "eventType": "start_sync",
      "message": "OK"
    }
    
    You might also see some additional objects in the output depending on which serial ports are available on your computer.
  12. Plug your Arduino board into your computer.
    You should now see a response printed that looks something like this:
    {
      "eventType": "add",
      "port": {
        "address": "COM42",
        "label": "COM42",
        "protocol": "serial",
        "protocolLabel": "Serial Port (USB)",
        "properties": {
          "pid": "0x804e",
          "vid": "0x2341",
          "serialNumber": "EBEABFD6514D32364E202020FF10181E"
        }
      }
    }
    
    This is only an example of what you might see. The output will be different depending on the board you connected.
  13. Unplug your Arduino board from your computer.
    You should now see a response printed that looks something like this:
    {
      "eventType": "remove",
      "port": {
        "address": "COM42",
        "protocol": "serial"
      }
    }
    
    This is only an example of what you might see. The address field value should be the same as the "add" event you saw when you plugged the board in.

You should continue to see the same results if you repeat steps (12) and (13).

Once you are done with your experiments with the "serial-discovery" tool, follow these instructions to exit:

  1. Type the following command:
    STOP
    
  2. Press the Enter key.
    You should now see a response printed exactly like this:
    {
      "eventType": "stop",
      "message": "OK"
    }
    
  3. Type the following command:
    QUIT
    
  4. Press the Enter key.
    You should now see a response printed exactly like this:
    {
      "eventType": "quit",
      "message": "OK"
    }
    
    You should now be back at the shell command line.

Wow! Thanks for your excellent reply! You've got the patience of a saint.

I followed your described steps, and here is the PS dialog:

PS C:\Users\C40761\AppData\Local\Arduino15\packages\builtin\tools\serial-discovery\1.3.2> .\serial-discovery.exe
HELLO 1 "arduino-cli 0.20.2"
{
  "eventType": "hello",
  "message": "OK",
  "protocolVersion": 1
}
START_SYNC
{
  "eventType": "start_sync",
  "message": "OK"
}
{
  "eventType": "add",
  "port": {
    "address": "COM4",
    "label": "COM4",
    "protocol": "serial",
    "protocolLabel": "Serial Port (USB)",
    "properties": {
      "pid": "0x0150",
      "serialNumber": "000H4J166310",
      "vid": "0x04F9"
    }
  }
}
{
  "eventType": "add",
  "port": {
    "address": "COM3",
    "label": "COM3",
    "protocol": "serial",
    "protocolLabel": "Serial Port",
    "properties": {}
  }
}
                     // I plugged in my board at this point
{
  "eventType": "add",
  "port": {
    "address": "COM17",
    "label": "COM17",
    "protocol": "serial",
    "protocolLabel": "Serial Port (USB)",
    "properties": {
      "pid": "0x7523",
      "serialNumber": "",
      "vid": "0x1A86"
    }
  }
}
                     // . . . and here I unplugged it
{
  "eventType": "remove",
  "port": {
    "address": "COM17",
    "protocol": "serial"
  }
}
STOP
{
  "eventType": "stop",
  "message": "OK"
}
QUIT
{
  "eventType": "quit",
  "message": "OK"
}
PS C:\Users\C40761\AppData\Local\Arduino15\packages\builtin\tools\serial-discovery\1.3.2>  

OK. At this point, I opened IDE 2.0 to get a screenshot of how COM17 doesn't show up and only shows COM3 and COM4. But of course, it does show up:
image

In my defense, since COM17 wasn't showing up in the port dialog of IDE 2.0, I switched to IDE 1.8, where it showed up and worked perfectly. I even tried a couple of times back and forth, looking in my device manager (and confirming that all 3 ports were listed) but IDE 2.0 never showed COM17. Today it works just fine, and I haven't even rebooted.

I don't know if I shook something loose when exercising the serial-discovery tool, but it's working now. I even downloaded code to the board without any issues. MS Windows never ceases to amaze me.

I'm sorry I bothered you but I'm grateful it's working. :slight_smile:

As someone who has done a ton of beta testing of Arduino IDE and other software, I am all too familiar with this phenomenon, where the bug disappears the moment you try to reproduce it. For a regular user, this is actually a good thing even if not so satisfying as identifying the cause of the previous misbehavior. But for a beta tester it is very frustrating because I actually want to encounter bugs, investigate them, then submit a formal report to the developers, but that investigation is very difficult to do when the bug disappears into thin air!

Anyway, I'm just glad it is working for you now. Thanks for taking the time to post an update with your findings. Please let us know if you experience the problem again.

Regards,
Per

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