Hello. I'm trying to add my Nano RP2040 as a device in the Arduino Cloud. This has failed for me in the same way on two different computers (Windows 10 and Windows 11).
The first time on both computers it finds the device. It allows me to name it, then tries to continue setup. After a few times it fails.
Any other time I try to add the device it says it could not find any Arduino device.
Every time I try to add, the Arduino agent pops up multiple dialogs saying "We are about to install some drviers needed to use Arudino...". After I click yes to continue, the agent debug console outputs the following:
{
"DownloadStatus": "Pending",
"Msg": "post_install.bat"
}
{
"DownloadStatus": "Error",
"Msg": "exec: \"post_install.bat\": cannot run executable found relative to current directory"
}
I've tried restarting and re-installing the Arduino agent multiple times but it's the same problem. Any ideas?
Thank you.
Hi @bizarrobull . Please try this troubleshooting procedure and then report your results in a reply on this forum thread:
This procedure is not intended to solve the problem. The purpose is to gather more information.
Open the Windows Device Manager .
Select View > Devices by type from the Device Manager menus.
Open the "View " menu.
If there is a ✓ to the left of the "Show hidden devices " menu item, click on "Show hidden devices " to disable it.
Disconnect the USB cable of the Arduino board from your computer.
Take note of the contents of the "Other devices " and "Ports (COM & LPT) " sections of the Device Manager tree.
Connect the Arduino board to your computer with a USB cable.
Select Action > Scan for hardware changes " from the Device Manager menus.
Did you see any new device appear in the Device Manager tree after doing this? If so, please tell us where it is located in the tree and what it is named.
You can repeat steps 5-8 multiple times if you are not sure.
bizarrobull:
Every time I try to add, the Arduino agent pops up multiple dialogs saying "We are about to install some drviers needed to use Arudino...". After I click yes to continue, the agent debug console outputs the following:
This is a known bug:
opened 08:49AM - 20 Nov 23 UTC
os: windows
type: imperfection
### Describe the problem
I have been facing a persistent bug with the Create … Agent driver for some time now. Whenever I open an Arduino Cloud tab on my browser, a pop-up window for driver installation appears randomly. Clicking either 'Yes' or 'No' doesn't seem to do anything but more pop-ups keep appearing while the IoT Cloud tab remains open.
I have already installed the latest Create Agent release 1.3.5.

### To reproduce
It is a bit difficult to reproduce the problem since, for example, in my case, I have a laptop and a fixed PC, both with Windows 10 and the same version of Arduino Create Agent (1.3.5) installed but the problem only occurs on my laptop.
### Expected behavior
The problem is that even if I click "yes" or "no", nothing happens and the driver installation window keeps popping up infinitely as long as I keep a Web Editor or IoT Cloud tab open.
### Arduino Create Agent version
1.3.5
### Operating system
Windows
### Operating system version
10 Home
### Browser
Google Chrome
### Browser version
119.0.6045.160 (Build oficial) (64 bits)
### Additional context
#### Additional reports
- https://github.com/arduino/arduino-create-agent/issues/856#issuecomment-1873421951
- https://forum.arduino.cc/t/arduino-iot-cloud-install-window-spam-do-not-see-anything-new-being-installed/1184049/1
- https://forum.arduino.cc/t/arduino-iot-cloud-install-window-spam-do-not-see-anything-new-being-installed/1184049/6
- https://forum.arduino.cc/t/drivers-popups-and-more-popups/1178392/1
- https://forum.arduino.cc/t/drivers-popups-and-more-popups/1178392/2
- https://forum.arduino.cc/t/drivers-popups-and-more-popups/1178392/3
- https://forum.arduino.cc/t/repeated-requests-to-install-arduino-genuino-drivers/1208020
- https://forum.arduino.cc/t/ota-on-generic-eps8266-dont-work-and-some-other-questions/1215450
- https://forum.arduino.cc/t/create-agent-not-working/1217578/6
- https://forum.arduino.cc/t/arduino-create-agent-unable-to-install-drivers/1219335
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-create-agent/issues?q=)
- [X] I verified the problem still occurs when using the latest version
- [X] My report contains all necessary details
The bug has already been fixed:
arduino:main ← per1234:fix-post-install
opened 05:26AM - 04 Feb 24 UTC
### Background
#### Tool Dependency Installation
**Arduino Create Agent** … performs installation and updates of the tool dependencies required for direct communication between the local machine and the target board.
It might be necessary to execute some sort of installation process in addition to placing the files from the tool archive on the user's hard drive. This capability is provided by a "post-install script" system. If a post-install script file (`post_install.bat` on Windows, `post_install.sh` other host operating systems) is found in the tool installation, **Arduino Create Agent** automatically executes it as part of the tool installation operation.
One of the tool dependencies is `arduino:windows-drivers`, which provides the Windows device drivers for the official Arduino boards. This tool contains a post-install script that installs the drivers from the tool archive. It is essential for this script to be executed as the presence of the driver files alone doesn't have any effect.
#### Go `exec` Package
From the Go 1.19 release, the behavior of the `exec` package was changed to make it more secure:
https://pkg.go.dev/os/exec#hdr-Executables_in_the_current_directory
> as of Go 1.19, this package will not resolve a program using an implicit or explicit path entry relative to the current directory. That is, if you run exec.LookPath("go"), it will not successfully return ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. Instead, if the usual path algorithms would result in that answer, these functions return an error err satisfying errors.Is(err, ErrDot).
### Problem
The code that executes the post-install script on Windows depended on the previous permissive behavior of the `exec` package. Ever since the version of Go used to build **Arduino Create Agent** was updated to 1.19 (https://github.com/arduino/arduino-create-agent/pull/744), the script has not been executed.
This means **Arduino Create Agent** never installed the drivers from the `arduino:windows-drivers` tool on the machines who weren't using it before the [1.3.0 release](https://github.com/arduino/arduino-create-agent/tree/1.3.0).
The failure to execute the post-install script results in **Arduino Create Agent** attempting installation of the `arduino:windows-drivers` tool on every Arduino Cloud session. Even if the user is not impacted by the lack of drivers (either because it is not required for their board, or because they installed the drivers via some other mechanism), they will still be annoyed and confused by the frequent appearance of [the "**Installing drivers**" dialog](https://github.com/arduino/arduino-create-agent/blob/6aa81834ef7d0113a1be1d9039fe7b35fa471c8c/tools/download.go#L234) that is produced by **Arduino Create Agent**'s post-install script execution code.
#### Demonstration
1. Start a build of **Arduino Create Agent** that does not contain the patch proposed here on a Windows machine.
1. Open the **Arduino Create Agent** "Debug Console".
1. Type the following [command](https://github.com/arduino/arduino-create-agent/wiki/How-to-use-the-agent#download-a-tool) into the input field on the bottom of the Debug Console web page:
```text
downloadtool windows-drivers 1.8.0 arduino replace
```
**ⓘ** This specific command is used to force an installation of the `arduino:windows-drivers` tool even if you already have the latest version installed.
1. Wait for the "**Installing drivers**" dialog to open.
1. Click the "**Yes**" button in the dialog.
🐛 Arduino Create Agent does not execute the `post_install.bat` batch file. You can see the cause in the Arduino Create Agent debug console:
```text
{
"DownloadStatus": "Error",
"Msg": "exec: \"post_install.bat\": cannot run executable found relative to current directory"
}
```
### Additional Context
I planned to add test coverage for [`github.com/arduino/arduino-create-agent/tools.Tools.installDrivers`](https://github.com/arduino/arduino-create-agent/blob/6aa81834ef7d0113a1be1d9039fe7b35fa471c8c/tools/download.go#L223) in order to avoid another such regression in the future. However, this is challenging to do for Windows due to [the "**Installing drivers**" dialog](https://github.com/arduino/arduino-create-agent/blob/6aa81834ef7d0113a1be1d9039fe7b35fa471c8c/tools/download.go#L234). It seems it would be necessary to mock [`github.com/arduino/arduino-create-agent/tools.MessageBox`](https://github.com/arduino/arduino-create-agent/blob/6aa81834ef7d0113a1be1d9039fe7b35fa471c8c/tools/shell_windows.go#L30), which would require selecting a mocking framework for the project.
---
I chose the approach that followed the system previously established in the code. A more elegant solution would be possible through the use of the the [`github.com/arduino/go-paths-helper` module](https://github.com/arduino/go-paths-helper), which is already used elsewhere in the project. However, I feel that should be done as part of comprehensive migration to using the module for all path-related operations, which is out of scope for this PR.
---
I didn't have time to investigate it, but it is possible this will fix https://github.com/arduino/arduino-create-agent/issues/856.
---
Originally reported at:
- https://forum.arduino.cc/t/initial-configuration-of-board-failing/1207822
- https://forum.arduino.cc/t/arduino-rp2040-cloud-setup/1219617
But the fix was made after the time of the latest release of Arduino Create Agent so this is why you still see those dialogs and the error message in the Debug Console.
But this bug is completely unrelated to the problem you are having with your Nano RP2040 Connect . The drivers Arduino Create Agent tried to install are for other Arduino boards and are irrelevant to the user of a Nano RP2040 Connect board so the functionality is just the same with or without the drivers installed. Please just ignore this message in the Debug Console and click the "Yes " button in the "Installing drivers " dialogs when they appear.
Thank you for the response.
With the board disconnected, device manager does not show any "Other devices" listed. The are no "Ports (COM & LPT)" listed either.
I connect the Arduino board and I now see "USB Serial Device (COM7)" listed under "Ports (COM & LPT)".
Action->Scan for hardware changes didn't add any new devices that I can see.
I tried to add the device again and it still failed (which we expected). But I notice in Device Manager, the port is gone but now there is "Other devices" showing "RP2 Boot". There is a yellow triangle with an exclamation mark over the device icon.
There is also a "Portable Devices" listing a "RPI-RP2".
When I disconnect the board again, both of those disappear.
I'm not sure if that is helpful.
I was able to get it working.
From the offline Arudino IDE I tried to connect to the board. It said:
Unknown FQBN: platform arduino:mbed_nano is not installed. Could not connect to COM7 serial port.
It then prompted me to install the Mbed OS core for Nano boards. I installed v4.1.1.
After that was installed I went back to add a device on the Arduino cloud. This time it was successful!
2 Likes
system
Closed
August 13, 2024, 3:15pm
6
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.