I often have two Arduino connected to a PC at the same time to do master-slave communications. When using only one IDE or two IDE, they often get messed up about the type of boards and the connection ports. Is this a common issue with the current IDE? What can be done to avoid these problems while waiting for a fix? I tried to have only one board connected at a time but plugging and unplugging is another annoying issue.
Even now I have selected the correct board and port, the IDE gave me this error. Then, after unplugging, plugging, etc., erro disappeared.
A serial exception error occurred: Cannot configure port, something went wrong. Original message: OSError(22, 'A device which does not exist was specified.', None, 433)
Note: This error originates from pySerial. It is likely not a problem with esptool, but with the hardware connection or drivers.
For troubleshooting steps visit: Troubleshooting - ESP32 - — esptool latest documentation
Currently I am working on a 4 node CAN network with ESP8266, Nano and UNO on the bus. I am using Linux Cinnamon with 8 work spaces.
One thing I do is have each program announce what it is and its path at reset.
The process I use is to open a workspace, load the IDE, open the program folder, Load the editor, load the code, connect the processor then open the terminal of the IDE, if it connects I get the hello message, if not I check in the tools menu what port it is connected to then select that. With Geany I load the editor then drag the sketch to it, this keeps it from pulling it from another window, that way I can have as many editors open as I like. Yes you must set the IDE for external editor. Bummer it will sometimes also set the other IDE to that what ever mode you set..
I then go to the next workspace and repeat the process three more times. If the IDE crashes, happens a lot if a ;}] is missed, I close it and then reload it, it normally comes up with the correct program and USB port. The other ports are already committed to the other boards and IDEs. Sometimes it decides to use a different USB, then simply go to tools and change it.
I now have additional windows available for web searching etc. For me this is easier then using several machines which I have available.
Hopefully this helps. I have no clue if you can do this on windoz. I am using the 1.8.18 or 1.8.19 IDEs.
I follow these steps: 1. Open an IDE from Start button of WIN. 2. Conect only one UNOR3-1 with PC. 3. Check the COM Port assigned to the UNOR3-1 and record. 4. Open another IDE from Start button of WIN. 5. Connect the 2nd UNOR3-2 with PC. 6. Check the COM Port assigned to the UNOR3-2 and record it. It should be different from UNOR3-1.
7. If you have still problem, goto the Device Manager and check the COM Ports allocated to the UNOs.
You operating system enumerates the USB ports. So your operating system might change the port.
One reason why the port might change is because you connect your board to another USB port of the computer. There might be other reasons, I don't know. So if you have problems with serial ports that change you will have to look at the operating system level what is happening, not at the IDE.
I'm using Windows. If I take a clone Nano with CH340, the COM port depends on the physical USB port that I use.
If I take an official Uno (with 16U2 serial-to-usb converter) the COM port stays the same regardless of the physical USB port used.
The reason is that the 16U2 can uniquely identify itself to the operating system and Windows can use this. Once Windows has assigned a COM port based on certain parameters it can always assign the same COM port; it might be the driver that allows this.
In Windows device manager I can see the following for one Uno
The number at the end is the hardware ID (10 bytes, 20 characters) that is unique for each 16U2.
The CH340 IC and/or CH340 driver does not seem to have that hardware ID and Windows makes one up based on the physical port (note the changing last digit).
For Linux I think that the process is slightly different. As far as I remember, the first board that will be connected/detected will always be /dev/ttyACM0 or /dev/ttyUSB0. @gilshultz might be able to confirm.
I can't help you with that; I don't use ESP32 boards. Maybe enabling verbose output during upload in combination with what your operating system does can shine some light on that.
Not knowing which exact board you are using also does not help
I can't remember the details, but Bill at DroneBot Workshop c overed the two different open IDEs on a send rcv sketch setup. The only memory I have of it is that the IDE is started in a 'special' way. I am fairly certain that the way you are doing it will not work reliably. I am on a Mac and somewhere have a note about how to do that, but I have no idea where and therefore can't help further.
Thanks. The way I usually do is to click the Search area on the task bar of Windows 11. Usually Arduiono IDE shows up and I just select it. Once opened, I make sure the board and port are correct. Then compile and upload.
Next, from the existing IDE, I open another program, check to make sure that the board and the port are correct. Then compile and upload.
Sometimes even connecting to one device has problem. For example, today I connected an Adafruit Feather ESP32-S3 2MB PSRAM to my PC. The Arduino IDE auto detected it on COM23 but when I tried to compile and upload, it keeps giving me:
A fatal error occurred: Could not open COM23, the port is busy or doesn't exist.
(Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31))
esptool v5.1.0
Serial port COM23:
Failed uploading: uploading error: exit status 2
Changing cable and port do not help. Have been working on it for three hours already. Any way to fix this?
I have wasted many many hours the past few months to deal with these connection issues. Are the problems mentioned in this thread due to :
ESP32-S3
Adafruit's Feather ESP32-S3
Arduino IDE
Windows OS and device manager
Others (Please state)
If I move the development from Windows to Linux or Mac OS which is also Linux, will I be able to avoid all these connection issues?
Linux? At least two command line tools, lsusb and dmesg.
I suggest that you enable verbose output during upload and disable verbose output during compilation, perform an upload and post the results here (please don't forget to use code tags). I'm not familiar with this board and therefore might not be able to help further but this might shine some light on the problem and might help others to help you.
That depends on the cause of the problem.
BTW, Mac OS is not Linux; there are similarities but MacOS is based on BSD (if I recall correctly).
MacOS. It may have something similar, but I don't see it, and I almost never have an issue uploading. When I do it's because a second copy of the IDE is open and the Serial Monitor is making the port busy.
I don't know what you see on Win, but on my Mac, if it doesn't connect automatically, when I open the port selector, there are only 3 choices. One is always debug, one is Bluetooth, and the 3rd is the USB port I select.
When I hear about Win port issues, it sounds like the person is 'messing' with the device manager, and that is a tricky area of Win to mess with. What I don't hear about very often is if they have clicked the box to display (forget the wording) the 'Hidden' devices. This is a common cause of issues because Win will have 'ghost' connections. The next time you have an issue, check that out. I am NOT saying that is the only issue, Device Manager is the very worst part of Win.
Plugged the Feather ESP32-S3 into another usb-c port of my PC running Windows 11. Tools-Port showed "COM 23". Then, under Serial ports, COM3 and COM5 only. Pressed BOOT on the board and while holding it, pressed and released Reset. Then released BOOT. Tools-Port still showed "COM 23" but under Serial ports, "COM22 (ESP32 Family Device)", COM3 and COM5 are listed. Then, error again. Here is the output:
Sketch uses 374371 bytes (12%) of program storage space. Maximum is 2883584 bytes.
Global variables use 43448 bytes (13%) of dynamic memory, leaving 284232 bytes for local variables. Maximum is 327680 bytes.
Waiting for upload port...
No upload port found, using COM23 as fallback
"C:\Users\user1\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\5.1.0/esptool.exe" --chip esp32s3 --port "COM23" --baud 921600 --before default-reset --after hard-reset write-flash -z --flash-mode keep --flash-freq keep --flash-size keep 0x0 "C:\Users\user1\AppData\Local\arduino\sketches\497720B9F40199E2E3484C77CA55FB2E/test_read_sensor.ino.bootloader.bin" 0x8000 "C:\Users\user1\AppData\Local\arduino\sketches\497720B9F40199E2E3484C77CA55FB2E/test_read_sensor.ino.partitions.bin" 0xe000 "C:\Users\user1\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.5/tools/partitions/boot_app0.bin" 0x10000 "C:\Users\user1\AppData\Local\arduino\sketches\497720B9F40199E2E3484C77CA55FB2E/test_read_sensor.ino.bin" 0x2d0000 "C:\Users\user1\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.5/variants/adafruit_feather_esp32s3/tinyuf2.bin"
A fatal error occurred: Could not open COM23, the port is busy or doesn't exist.
(could not open port 'COM23': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2))
Hint: Check if the port is correct and ESP connected
esptool v5.1.0
Serial port COM23:
Failed uploading: uploading error: exit status 2
I am not sure if this is related but whenever I tried to do a factory reset of the Feather (under both Windows and MacOS), after dragging the UF2 to the board's icon, half way it gave me an error (see attachment). It seemed to have failed but sometimes I could reset the board.
The fact that it says COM23 on the left (that is the last selected port) and com22 on the roight (that is what you should now select) can be confusing. Ignore the left, onlhy the right matters.
I am very confused about the DFU references for an esp32. I have never encountered those kinds of messages on any board other than the newer boards.
I think Adafruit should be the best source to answer as it is their product. Problem is: There are several administrators. Except for one person, the rest are all very helpful and they can always get my issue fixed quickly. It has happened several times. Whenever that person picked up my thread, nothing got resolved and the rest of the administrators don't participate. He just asked some questions and pointed to some unhelpful links. One time he even told me to ask this forum about their product! He did that to other users as well.
I just had a look at the Factory Reset link. It looks very straightforward. I almost NEVER use drag-and-drop. You could have a flaky mouse, or if a trackpad ,even worse. Use standard Ctrl-C to copy and Ctl-V to put the copy where you want. This way, there is no 'halfway.'
I googled the error as instructed and also looked at the other error messages, but I'm really not understanding what is going on
I have dozens of esp boards, and not only have I never done a factory reset, but I didn't even know such a thing existed.
I suspect this is where you will end up if the Factory Reset fails. Read carefully and follow the instructions verbatim.
All I can suggest is to follow the instructions TO THE WORD. Do NOT guess or 'interpret', just act like a robot.
Good luck.
p.s. You should have started a new topic for this problem; it is not about multiple Arduinos.