Cannot perform port reset: TOUCH: error during reset: opening port at 1200bps: Invalid serial port UNO R4

I'm new to using the UNO R4, I started using it with a load cell and the Arduino IDE 2.2.1 and tryed to connect it to the ioT Cloud. While I was using it in the IDE it all went correctly, but when I started with the Cloud the board woult be marked as offline and the code wouldn´t upload; I started investigating and this site helped me:

Later the board would not get recognized again in the cloud but it marked that it needed a firmware update but it couldn´t update it automatically with the cloud, I tried to update it with the IDE using this link:

With the IDE option it also would not update as it said that the update could not be installed

After that I tried running the espflash directly as it said in the second link I added, it didn't work either.
Then I tried using the updater script as the same link also said, it didn't work aither and showed this:

I also tried uninstalling the COM port as the board always get detected in the COM5 port even after pressing and releasing twice quickly the reset button.

Right now if I gave up on trying to use the Cloud and even in the IDE when I try to upload any code it shows this error always:

This is the code I was using:

#include <HID.h>
#include "HX711.h"

const int DOUT=A1;
const int CLK=A0;

float calibrating;
const float realWeight = 0.180;
float sum_calibrating;
float REAL_calibrating;

HX711 scale;
void setup() {
  Serial.begin(9600);
  scale.begin(DOUT, CLK);
  sum_calibrating = 0;
  Serial.print("Lectura del valor del ADC:t");
  Serial.println(scale.read());
  Serial.println("No ponga ningún objeto sobre la scale");
  Serial.println("Destarando...");
  scale.set_scale(); //La escala por defecto es 1
  scale.tare(20);  //El peso actual es considerado Tara.
  Serial.println("Coloque un peso conocido:");
}

void loop() {
 if(Serial.available()){
    char activate = Serial.read();
    if(activate == 'a'){
      CalibrationFactor();
      Serial.println("DONE WITH CALIBRATION FACTOR");
    }
    else{
      Serial.println("Waiting for weight");
      delay(1000);
    }
  }

  
}

void CalibrationFactor(){
  for (int i=0; i<=10; i++){
    //Read the weight cell
    Serial.print("Valor de lectura: t");
    Serial.print(scale.get_value(10),0);
    //Get Calibration Factor
    calibrating = (scale.read())/realWeight;
    Serial.print(" Calibration Factor: ");
    Serial.print(calibrating);

    //Get REAL Calibration Factor
    sum_calibrating = sum_calibrating + calibrating;
    REAL_calibrating = sum_calibrating/i;
  
    Serial.print(" REAL Calibration Factor: ");
    Serial.println(REAL_calibrating);
    delay(100);
  }
}

Does anyone know how to fix this?

Thanks in advance

1 Like

Hi @hzhs

Could you please confirm if you are using the new version of the Web Editor for IoT Cloud or the old version?

I recommend trying to update the firmware of the board again using the Firmware Updater in the Arduino IDE. After the update process is complete, disconnect and reconnect the board. If this doesn't work, try pressing the RST button twice after following the previous steps and uploading a blink sketch to the board.

Let me know if this resolves the issue or if you need further assistance.

Hi,
I understand it is the new version of the Web Editor for IoT Cloud; it looks like this:


When I try to update via Web Editor it displays this message:

When I try the IDE it keeps displaying the same "Installation failed" message even after pressing twice the RST button
It won´t allow to upload any other code and shows the same error every time:

Hello @hzhs apologies if you are already doing so but please make sure you re-select the port for the board prior to uploading after pressing the reset twice. Usually, after the reset, it will connect to a different port number even if the cable was not unplugged.
Let me know if this does not change the error.

Hello,
it does not change the error and even if I check the port, it keeps connecting to the same port.

1 Like

I have the same problem, but ONLY on my two desktop systems with all my arduinos/rp (R4, MKR WIFI 1010, and RP2040 Connect). They all work great on my W10 laptop (Acer F5) and my W11 laptop (Spectre 360).

The laptops are Intel based, and the desktops are both AMD based with ASRock motherboards. Starting to think it may be AMD or ASRock related.

Might have been caused by missing administrator rights or not having allowed during post install when installing R4 platform.

I was programming the board with an W11 laptop (Omen 16) and at the beginning it would work, it was after the Arduino Cloud Editor marked that it needed a firmware update thatit stopped working and does not accept the updates any via.

Hi @hzhs. Are you still experiencing this problem?

The cause of the upload failure from the Arduino IDE screenshot in your post #3 is that you have COM5 selected, but there is no COM5 serial port on your computer:

image

If you connect your UNO R4 WiFi board to your computer with the USB cable and then open the Tools > Port menu in Arduino IDE, do you see a port listed there that is labeled as "(Arduino UNO R4 WiFi)"?