I am having a problem using the ArduinoAllPins and Arduino PWM drivers with my Arduino Uno R4. Everything works fine when using an Uno R3 or Mega. The following error messages appear: “Logger1: Driver has exception, Exception: Port ‘COM’ with ID ‘COM6’ does not respond. Check port properties…”
and
“Python Error: Traceback (most recent call last): File “MeasClasses.py”, line 3169, in wrapper; File “C:\ProgramData\SweepMe!\Devices\DC_51_1606_Logger-Arduino_AllPins\Logger-Arduino_AllPins\main.py”, line 140, in initialize self.port.read(); File “pysweepme\Ports.py”, line 638, in read; File “pysweepme\Ports.py”, line 1181, in read_internal; Exception: Port ‘COM’ with ID ‘COM6’ does not respond. Check port properties, e.g. timeout, EOL,.. via Port → PortManager → COM”
Is the problem known and is there a simple solution?
the error is not known yet, but it should be possible to locate the issue.
First of all, I guess that you have transferred the .ino file to your Uno R4 so that it is running the same “firmware” like the UNO R3 or Mega.
In the source code of the driver
you can see that the driver directly starts with reading a message from the Arduino without and prior message sent.
This is because we create the .ino files such that they send a “wakeup” message during their setup() function:
This is needed because, Arduino are resetted whenevery the COM port is opened. This can take 1-2 seconds. In this time, the Arduino will not receive any message. Thus, SweepMe! cannot send any message during this time. One solution would have been that the driver uses a try-except in a while loop to see when the Arduino responds first time and then continues with the normal operation. The simpler solution was to let the Arduino send a message to indicate it is ready to go.
The driver uses a timeout of 3 seconds:
This should be typically enough time to receive the wakeup message.
However, it could be that your Arduino takes a bit longer to wakeup. In this case you could create a custom version of the driver and change the timeout to a higher value.
Another test would be to use the Serial Monitor of the Arduino IDE to see whether you the wakeup message popping up after some (if you use same baudrate and terminator character).
If you cannot see the message in the Serial Monitor something would be strange.
You can also use the Serial Monitor to send a message like “R1D” to read the first digital pin.
So, best would be to try debugging it first with the Serial Monitor and once you see a communication you can back to the SweepMe! driver and check why the COM port does not respond.
so your 2. point means that you can send R0A to Uno R3 and Uno R4 and both respond with the correct answer, but only Uno R3 shows the wake up message in the Serial monitor? I guess you can provoke the wake up message for the UNO R4 by resetting it with a button while still running the Serial Monitor.
I did some further research: Even though both devices are Arduino Uno, the R4 comes with a 32bit microprocessor instead of the ATmega328P. This induces quite some changes. So far, reopening a COM port was resetting the Arduino and the setup() function of the ino file was starting again. This seems to have changed. It looks like that this is related to the DTR signal of the COM port that is connected to the reset for UNO R3 but not for a Uno R4.
Here is what AI explained to me:
Why R3 auto‑resets and R4 doesn’t
UNO R3: Opening the serial port makes the host toggle DTR/RTS. On the board there’s a 0.1 µF cap from DTR to RESET, which converts that level change into a short reset pulse. Result: the MCU resets and your setup() runs again. [astroscopic.com]
UNO R4 (Minima/WiFi): USB is handled inside the RA4M1 (native USB). There’s no DTR‑to‑RESET pulse path, so opening the COM port does not reset the MCU. Multiple Arduino staff/community replies also indicate there isn’t a built‑in switch to “restore” R3‑style auto‑reset on connect. [forum.arduino.cc]
How to solve your problem?
A first question would be whether we like to keep compatibility of the ino file and SweepMe! driver for all UNO versions.
Of course one could figure out with a while-loop and try-except whether the UNO R4 is already setup, but it also means that we do not know whether the R4 just had a fresh reset or was already running a task beforehand. For the Arduino AllPins driver this does probably not matter much, but for other Arduino SweepMe! drivers like the one for stepper motors, it could be more important to reset the device once to start with a well-defined system configuration of the Arduino.
I think one can change from waiting for wake up message to while loop with try-except. This will keep the status quo for UNO R3 and allows to use the SweepMe! driver also with UNO R4. For each driver, we then need to check whether an additional reset-functionality must be implemented.