WiFiS3 library support for WiFiSSLClient

Does the WiFiS3 library for the UNO R4 WiFi support an SSL client connection?

[EDIT]

I subsequently discovered it does. What's needed is:

#include "WiFiSSLClient.h"

However, I can't connect to the api.purpleair.com server:

WiFiSSLClient client;
client.connect( "api.purpleair.com", 443 );

The connect fails.

Connection to "www.google.com", as in the WiFiClientSSL example, also fails.

I haven't tested on my end but if you upgrade the firmware of the esp32 this issue can get solved. Here you can find the instructions Release Release 0.2.0 · arduino/uno-r4-wifi-usb-bridge · GitHub

I'm able to get the ESP32-S3 into bootloader mode by shorting ESP_BOOT to GND. I found the flash image (S3.bin). But I cannot find the espflash tool for Windows.

Don

Hi @donblake. I'll provide detailed instructions you can follow to update the firmware:

  1. Unplug any non-essential USB devices from your computer.
  2. Connect the UNO R4 WiFi board to your computer with the USB cable.
  3. Open the release page for the latest version of the firmware in your web browser:
    https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/latest
  4. Click the "unor4wifi-update-windows.zip" download link under the "Assets" section of the release page:
  5. Wait for the download to finish.
  6. Unzip the downloaded file.
  7. Double click on the update.bat file that is in the unzipped folder.
    A terminal window will open.
  8. The terminal window might now show a list of the serial ports present on your computer.
    For example:
    Start flashing firmware
    [2023-07-11T06:39:09Z INFO ] Detected 2 serial ports
    [2023-07-11T06:39:09Z INFO ] Ports which match a known common dev board are highlighted
    [2023-07-11T06:39:09Z INFO ] Please select a port
    ❯ COM1
      COM43 - USB Serial Device (COM43)
    
    If so, use the key on your keyboard to select the port of the UNO R4 WiFi board from the list, and then press the Enter key.
  9. The terminal window will now show the following prompt:
    ? Remember this serial port for future use? (y/n) ›
    
    Press the N key on your keyboard.
  10. The flashing process should now start. Wait for it to finish, as indicated by output that looks something like this:
    Chip type:         esp32s3 (revision v0.1)
    Crystal frequency: 40MHz
    Flash size:        8MB
    Features:          WiFi, BLE
    MAC address:       dc:54:75:c4:c6:54
    [00:00:15] [========================================]     689/689     0x0
    Press any key to continue . . .
    
  11. Press any key on your keyboard.
    The terminal window will now close.
  12. Disconnect the USB cable of the UNO R4 WiFi board from your computer.
  13. Connect the UNO R4 WiFi board to your computer with the USB cable again.

Please let me know if you have any questions or problems while following those instructions.

1 Like

Thank you ptillisch! I was able to update the esp32 firmware which fixed the WiFiSSLClient connect problem.

Don

You are welcome. I'm glad it is working now.

Regards,
Per

1 Like

Hi @ptillisch. Thanks for these steps. I did them but unfortunately click "Y" in step 9. Now stuck on port 15 but board actually on 13. I suspect this is causing the problem with board not connecting to IoT cloud (stays offline)...

Error I get is: ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-up.iot.arduino.cc:8884 uno r4 wifi
Could not connect to [configured wifi]

Is there a way to redo the steps but choose "N" on step 9 or to reboot the firmware update and start afresh?

PS: deleted everything and started afresh on IoT Cloud with the Blink Template and now getting this error if it helps determine what might be wrong:

I'm very new to arduino and microcontrollers in general.

Thank you.

Hi @ntukt I've mada a test and template importing should work on the UNO R4, do you have a serial monitor open by any chance? Can you retry after closing all the IDE instances?

Is there a way to redo the steps but choose "N" on step 9 or to reboot the firmware update and start afresh?

delete the unor4wifi-update-windows folder and unzip a new one should do the trick.

hi @pennam Thank you for your response. I'm going to go through all the steps again. I've closed all instances for IDE (desktop version) and quit the Arduino Create Agent. I've deleted all the cloud devices, things, and sketches (web editor) in the cloud and signed out. I've also deleted the unor4wifi-update-windows folder and will update firmware afresh.

I'm going to retry setting up the device on IoT cloud with simple operation to control LED_BUILTIN with a switch widget. I'll share all steps as I encounter them to see if that helps troubleshoot.

For the serial monitor, I'll share outputs from the online Serial Monitor. Is this the one? Or need me to do something on desktop IDE?

Thanks

@ntukt there is no need to share the serial monitor output, you only have to make sure that is closed otherwise the template upload procedure will fail with the error you have reported above.

Noted @pennam.

I went through the steps and device was recognized on serial port com13:
"Arduino Uno R4 Wifi Found... An Arduino R4 Wifi has been detected on port COM13 and ready to be configured"

image

BUT, when I flash firmware again - the operation does not give me an option to select Port COM13 instead is "fixed" on serial port COM15. Which I think is the result of the first time I ran the firmware and chose "Y" when asked if "remember the serial port for future use".

Is this an issue? Is there anything I can do about this? Do I just continue?

Thanks

@ntukt t This is not an issue! COM port are different for board detection and firmware update. You can go on and create your Thing!

Great. I'll continue with the steps and keep you posted.

Seems like the main issue with device not going online was IoT cloud didn't add the WiFiS3 library. Added it and now device online and appears to be working.

1 Like

Hello i followed the guide but i think that, just like @ntukt, i choosed y instead of n on step 9 and now when i connect my arduino r4 it shows on port 5 as esp32s3 not arduino r4 on port 3. How do i undone it?

Hi, i tried to redo the procedure but it doesn't work for me, it says that the R4 isn't connected.

Anyway, what happened to me is that the UNO switched to the ESP32S3 and now i don't know how to go back