Ports not recognized by Arduino IDE on Windows 7

2.1.1 does not recognise ports

Neither does 2.1.0

Hi @dsteward.

Background

The list of serial ports shown in Arduino IDE is provided by a helper tool named "serial-discovery". Arduino IDE automatically updates the installed serial-discovery tool when a new version is available.

We recently released version 1.4.2 and 1.4.3 of serial-discovery. Compatibility with Windows 7 (and I presume Windows 8.1 as well) was lost in version 1.4.2 and newer of serial-discovery. This version panics when ran on a Windows 7 machine:

fatal error: bcryptprimitives.dll not found
runtime: panic before malloc heap initialized

runtime stack:
runtime.throw({0x13fb1b5ec?, 0x13fc0ce20?})
        /usr/local/go/src/runtime/panic.go:1094 +0x4d fp=0x38f9c0 sp=0x38f990 pc=0x13fa402cd
runtime.loadOptionalSyscalls()
        /usr/local/go/src/runtime/os_windows.go:268 +0x27f fp=0x38fa00 sp=0x38f9c0 pc=0x13fa08b5f
runtime.osinit()
        /usr/local/go/src/runtime/os_windows.go:477 +0x3d fp=0x38fa60 sp=0x38fa00 pc=0x13fa091dd
runtime.rt0_go()
        /usr/local/go/src/runtime/asm_amd64.s:348 +0x137 fp=0x38fa68 sp=0x38fa60 pc=0x13fa452f7

An equivalent loss of Windows 7 compatibility occurred in version 1.0.10 of the mdns-discovery tool that discovers "network" protocol ports.

The loss of Windows 7 compatibility is the expected result of us upgrading the version of the Go programming language we use for this project. We do not provide support for the obsolete Windows 7, so we will not take action to restore compatibility.

Solution

I'll provide instructions you can follow to configure your computer to persistently use the last Windows 7 compatible versions of serial-discovery and mdns-discovery below:

A. Preparation

  1. Select File > Quit from the Arduino IDE menus if it is running.
    All Arduino IDE windows will close.

B. Create persistent installation of serial-discovery

  1. Click the following link to open the release page of the last compatible version of serial-discovery:
    Release v1.4.1 · arduino/serial-discovery · GitHub

  2. Click the "serial-discovery_v1.4.1_Windows_64bit.zip" download link you will see under the "Assets" section of the release page.
    A file download will start in your web browser.

  3. Extract the downloaded file.

  4. Create a folder named 99.99.99 in the folder at the following path on your hard drive:

    C:\Users\<username>\AppData\packages\builtin\tools\serial-discovery
    
    C:\Users\<username>\AppData\Local\Arduino15\packages\builtin\tools\serial-discovery
    

    (where <username> is your Windows username)

    • :red_exclamation_mark: If looking for it with your file manager or command line, note that the AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
  5. Copy the serial-discovery.exe file from the folder you extracted at step 3 of these instructions into the 99.99.99 folder you created.

C. Create persistent installation of mdns-discovery

  1. Click the following link to open the release page of the last compatible version of mdns-discovery:
    Release v1.0.9 · arduino/mdns-discovery · GitHub

  2. Click the "mdns-discovery_v1.0.9_Windows_64bit.zip" download link you will see under the "Assets" section of the release page.
    A file download will start in your web browser.

  3. Extract the downloaded file.

  4. Create a folder named 99.99.99 in the folder at the following path on your hard drive:

    C:\Users\<username>\AppData\packages\builtin\tools\mdns-discovery
    
    C:\Users\<username>\AppData\Local\Arduino15\packages\builtin\tools\mdns-discovery
    

    (where <username> is your Windows username)

    • :red_exclamation_mark: If looking for it with your file manager or command line, note that the AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
  5. Copy the mdns-discovery.exe file from the folder you extracted at step 3 of these instructions into the 99.99.99 folder you created.

D. Verification

Verify that you have created the following folder structure:

C:\Users\<username>\AppData\Local\
├── Arduino15\
│   ├── packages\
│   │   ├── builtin\
│   │   │   └── tools\
│   │   │       ├── mdns-discovery\
│   │   │       │   ├── 99.99.99\
│   │   │       │   │   └── mdns-discovery.exe
│   │   │       │   ...
│   │   │       └── serial-discovery\
│   │   │           ├── 99.99.99\
│   │   │           │   └── serial-discovery.exe
│   │   │           ...
│   │   ...
│   ...
...

(where <username> is your Windows username)

Now start Arduino IDE. You should see the expected list of serial ports.

Additional context

Arduino IDE uses the folder name to determine the version of the installed tool. This information is used in determining whether to install an update. If it finds that the newest installed version has a lower version number than the available version of the tool, it will automatically install the newer version.

Normally that auto update behavior is a good thing because we want to use the latest versions of software in order to benefit from fixes and enhancements made by the developers. However, in this specific case Windows 7 users do not want updates of these tools because the update will not be compatible, and so an update would only cause the problem of Arduino IDE not discovering ports to come back.

The reason for naming the folders of the manual installations of the compatible version of serial-discovery and mdns-discovery 99.99.99 is to prevent these updates. This version number was arbitrarily chosen as being a very high version that will never be surpassed by the real version numbers of releases of serial-discovery and mdns-discovery. So this tricks Arduino IDE into thinking that the installations of the compatible versions are always the newest available versions, and therefore that it does not need to install new releases of the tools.

Thank you very much, that solved the missing ports on IDE 2.1.0

You are welcome. I'm glad it is working now.

Regards, Per

Do you mean
C:\Users\<username>\AppData\packages\builtin\tools\mdns-discovery (does not exist on my W7x64 system) or
C:\Users\<username>\AppData\Local\Arduino15\packages\builtin\tools\serial-discovery ?

Thanks for the correction @Etienne_74. I apologize for any confusion caused by the incorrect path in my instructions.

The correct paths:

C:\Users\<username>\AppData\Local\Arduino15\packages\builtin\tools\serial-discovery
C:\Users\<username>\AppData\Local\Arduino15\packages\builtin\tools\mdns-discovery

Because it's really important that a program whose purpose is to discover serial ports have access to a crypto library. Sigh.

To be clear, the incompatibility is fundamental to the Go programming language, not something specific to the serial-discovery/mdns-discovery projects. You will get the same panic even if you try to run an executable built by a recent version of Go from even the absolute bare minimum Go program:

package main

func main() {}