Error when updating the connectivity module firmware on UNO R4 WiFi

My R4 Wifi board reports that the firmware is 0.2.1
As I'm having some trouble trying to get a web server (port 80) and web socket server (port 81) running simultaneously I thought upgrading the radio firmware to the current 0.4.1 version is a good place to start.

I've tried using the option in the IDE. I can connect but the process fails with a generic error about not being able to update the firmware. I've searched these forums and found the hint about ensuring the Serial Monitor is closed. For good measure I also built a blank application (to make sure the wifi module is not being used by the board) and flashed that onto the board. None of this made an difference. I tried shorting the boot pin but that just meant the board could not be enumerated by the IDE.

So I decided to follow the instructions using the downloadable script.
I can download and unzip the file on my Ubuntu host machine. I then open a terminal into that directory and run

./update.sh

I'm prompted to select the port (/dev/ttyACM0) and get the following output

david@LonServer:~/Downloads/unor4wifi-update-linux$ ./update.sh
Start flashing firmware
[2024-06-22T22:12:27Z INFO ] 🚀 A new version of espflash is available: v3.1.0
[2024-06-22T22:12:27Z INFO ] Serial port: '/dev/ttyACM0'
[2024-06-22T22:12:27Z INFO ] Connecting...
[2024-06-22T22:12:27Z INFO ] Unable to connect, retrying with extra delay...
[2024-06-22T22:12:27Z INFO ] Unable to connect, retrying with default delay...
[2024-06-22T22:12:27Z INFO ] Unable to connect, retrying with extra delay...
[2024-06-22T22:12:27Z INFO ] Unable to connect, retrying with default delay...
[2024-06-22T22:12:27Z INFO ] Unable to connect, retrying with extra delay...
[2024-06-22T22:12:27Z INFO ] Unable to connect, retrying with default delay...
[2024-06-22T22:12:27Z INFO ] Unable to connect, retrying with extra delay...
Error: espflash::connection_failed

  × Error while connecting to device
  ╰─▶ Failed to connect to the device
  help: Ensure that the device is connected and the reset and boot pins are
        not being held down

Typing lsusb shows

Bus 001 Device 034: ID 2341:1002 Arduino SA UNO WiFi R4 CMSIS-DAP

and sudo dmesg shows

[267429.067540] usb 1-5: new full-speed USB device number 34 using xhci_hcd
[267429.221343] usb 1-5: New USB device found, idVendor=2341, idProduct=1002, bcdDevice= 1.00
[267429.221361] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[267429.221370] usb 1-5: Product: UNO WiFi R4 CMSIS-DAP
[267429.221376] usb 1-5: Manufacturer: Arduino
[267429.221382] usb 1-5: SerialNumber: 34B7DA5E4DB0
[267429.226788] hid-generic 0003:2341:1002.0013: hiddev2,hidraw4: USB HID v1.11 Device [Arduino UNO WiFi R4 CMSIS-DAP] on usb-0000:00:14.0-5/input0
[267429.228582] cdc_acm 1-5:1.1: ttyACM0: USB ACM device

Some more information ...

The board is currently running version 0.2.1. I've tried upgrading to 0.3.0 (in case it needs to only upgrade one step at a time) as well as 0.4.1 with no difference.

Clicking Install shows a message "installing firmware" with a spinner, and the two orange lights on the board flash a few times.

After about 30 seconds the spinner stops, the message now shows an error in red "Installation failed. Please try again."

Hmmm, retried using the direct flash instructions at the end of this page and it now reports 0.4.1

So success !!!

2 Likes

im running off the same tutorial as you and for some reason it wont go beyond "connecting" before going back to disconnected, did you ever run into this issue? I can get the Javascript to flip but it seems like the websocket isn't connecting; do you have to change this line?
ws = new WebSocket("ws://" + window.location.host + ":81");

What version of the firmware is the wifi connectivity module running ?

0.4.1 or whatever the most recent one is, i updated this morning; fyi you cant have the serial monitor open when you update it

Continued in the original thread - this one concerns problems updating the firmware.

I just plugged my Uno R4 in, with IDE closed and ran the .bat file in the 0.4.1firmware update directly from the unzipped folder in my downloads folder.
Note the option to select will say ESP32 or something like that (not Uno R4) and the port number won't be what you might be expecting from whatever it was in the Arduino IDE (mine is COM 5 in the Arduino IDE, COM 7 when running the downloaded update)

What problem are you describing here, the original problem I reported has been tagged with a solution.

1 Like