Arduino UNO R4 WIFI firmware updater

Hi,

I have purchased this boad and a Nextion 3,5 inch display.
I tried all kind of things to get this working, struggeling with the serial.
Solved that, but now I run into an issue with my project.

I have an old Arduino Uno R3 here as well and my simple project is running fine.
Switching to my R4 Wifi it is not working at all.
I search the Internet but nothing found.

Then I tried update the firmware with IDE 2.2.1, but that shows: Installation failed, please try again

Also the unor4wifi-update-windows bat file update fails. P

Please help

Welcome to the forum

Please post your full sketch, using code tags when you do. and explain what does not work. What, if any, external components are attached to the Uno ? Do any of them apart from the Serial monitor use the Serial interface by any chance ?

Hi,

Please find my code here.
It is a sample code that can be found here extenderd with a pressure sensor: https://github.com/itead/ITEADLIB_Arduino_Nextion/tree/master/examples/CompNumber


#include "Nextion.h"

SoftwareSerial HMISerial(5, 6);

const float  OffSet = 0.524 ;

float V, P;

void n0PopCallback(void *ptr);
void b0PopCallback(void *ptr);
void b1PopCallback(void *ptr);

/*
 * Declare a number object [page id:0,component id:2, component name: "n0"]. 
 */
NexNumber n0 = NexNumber(0, 2, "n0");

/*
 * Declare a button object [page id:0,component id:1, component name: "b0"]. 
 */
NexButton b0 = NexButton(0, 1, "b0");

/*
 * Declare a button object [page id:0,component id:3, component name: "b1"]. 
 */
NexButton b1 = NexButton(0, 3, "b1");

/*
 * Declare a number object [page id:0,component id:4, component name: "x0"]. 
 */
NexNumber x0 = NexNumber(0, 4, "x0");

/*
 * Declare a number object [page id:0,component id:5, component name: "z0"]. 
 */
NexGauge z0 = NexGauge(0, 5, "z0");


char buffer[100] = {0};


/*
 * Register object n0, b0, b1, x0, to the touch event list.  
 */
NexTouch *nex_listen_list[] = 
{
    &n0,
    &b0,
    &b1,
    NULL
};

/*
 * number component pop callback function. 
 */
void n0PopCallback(void *ptr)
{
    dbSerialPrintln("n0PopCallback");
    n0.setValue(50);
}

/*
 * Button0 component pop callback function.
 * In this example,the value of the number component will plus one every time when button0 is released.
 */
void b0PopCallback(void *ptr)
{
    uint32_t number;
    
    dbSerialPrintln("b0PopCallback");

    n0.getValue(&number);
    
    number += 1;
    
    n0.setValue(number);
}

/*
 * Button1 component pop callback function.
 * In this example,the value of the number component will minus one every time when button1 is released.
 */
void b1PopCallback(void *ptr)
{
     uint32_t number;
    
    dbSerialPrintln("b1PopCallback");

    n0.getValue(&number);
    
    number -= 1;
    
    n0.setValue(number);
}

void setup(void)
{
    /* Set the baudrate which is for debug and communicate with Nextion screen. */
    nexInit();

    /* Register the pop event callback function of the current number component. */
    n0.attachPop(n0PopCallback);

    /* Register the pop event callback function of the current button0 component. */
    b0.attachPop(b0PopCallback);

    /* Register the pop event callback function of the current button1 component. */
    b1.attachPop(b1PopCallback);

    dbSerialPrintln("setup done");
}

void loop(void)
{
    /*
     * When a pop or push event occured every time, 
     * the corresponding component[right page id and component id] in touch event list will be asked.
     */

       //Connect sensor to Analog 0
      V = analogRead(0) * 5.00 / 1024;     //Sensor output voltage
      P = (V - OffSet) * 250;             //Calculate water pressure

    x0.setValue(P);
    z0.setValue(P*10);
    delay(500);

    nexLoop(nex_listen_list);
}



I also had problems with the firmware updater. It consistently failed to install 0.3.0.

I then installed 0.2.1, success on the first attempt.

Then I tried to install 0.3.0 again, success at first attempt.

Hope this helps.
-jz-

The sketch will not compile for me

Using library Nextion at version 2.0.2 in folder: C:\Users\Bob2\Documents\Arduino\libraries\Nextion 
Using library SoftwareSerial at version 1.0 in folder: C:\Users\Bob2\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.4\libraries\SoftwareSerial 
exit status 1

Compilation error: 'NexNumber' does not name a type

Unrelated to the above error, but why are you creating an instance of SoftwareSerial that is not used. Note that the Uno R4 has a second hardware UART on pins 0 and 1 that could be used without interference with the Serial monitor or uploading sketches ?

Tried using pins 0 and 1 for days but no result.
I'm no expert so I will try anything that I find on the internet. Tried many examples with different libraries, but nothing worked so far.

I found this in the documentation.

UNO-like Mainboards

If your board has only one hardware serial, such as UNO, you should disable dbSerial and redirect nexSerial to Serial(Refer to section:Serial configuration).

By the way I got it to update the firmware 3.0.3 , but now I cannot upload any code with IDE.
This is taking me too much time so I will return it for a Arduino Nano 33 IOT.

In what way did you try to use it ? In the sketch that you posted you create an object named HMISerial but then don't appear to use it

Hi @biarritz

Please try this:

  1. Unplug the USB cable of the UNO R4 WiFi from your computer.
  2. Plug the USB cable of the UNO R4 WiFi back into your computer.
  3. Try uploading again.

After you perform a firmware update, the UNO R4 WiFi is left in a state where you can't properly upload to it. You must power cycle the board by unplugging and the replugging it in order to put it back in the normal state where you can upload again.

I tried every example with Arduino Uno in combination with Nextion display that I could find.

Ok tried that already, but now I can upload code again.
Still did not fix my issue, so returning the board.

When you tried using pins 0 and 1 for the serial connection did you use Serial as the name of the serial object as in Serial.begin(115200); or did you use the correct name, which is Serial1, as in Serial1.begin(115200); ?

Note that is NOT the same as any examples that you found using the classic Uno

I had this issue also, had success after reading this. I tried the other USBC port on my laptop. Worked first time. I recommend anyone with this issue to try another cable or port.

1 Like

@MarcusK1, thank you for your feedback!

Interference with Serial Monitor is one likely cause for Firmware Updater failure. See
How to update ESP32-S3 firmware (after install of platform 1.0.4)

Disconnecting and reconnecting USB and checking the cable is also recommended.

1 Like

Hey guys just saw this now after getting Mr R4 wifi today, Same issues. Couldn't update the firmware no matter what method I tried, including direct ESP flash. Not sure if our causes are the same however the fix that worked for me was going through all updates in ascending order in Arduino IDE update tool.

NOTE: be sure to turn off and on completely the arduino after doing any updates before uploading a sketch, I read that apparently uploading sketches while esp32 is in update mode can break the bootloader.

Hope this helps someone.

I had an issue with loading the 3.0.3 software onto my UNO R4 WiFi but it has now loaded using the new web interface released yesterday.

1 Like

dunno which web interface you mean, but I still can not update my Uno r4 Wifi. Really annoying, always get the message that installation failed whatever version I choose. In the IDE, any other tool doesnt even start.

Update: Its crazy but I found the solution: it really is the open Serial Monitor. Question - how long can it take to fix such a big deal like that???

1 Like

Its happen to me, close Serial Monitor and upgrade will we make.

I could not get my board to update but when I logged onto this the update worked. I had failed using the IDE and also with the previous version of the web editor.