I can successfully run some code on my Genuine MKR WIFI 1010 board using the WiFiNINA library. This code works successfully (publishing to an mqtt broker) When I try to upload that same code onto my Uno R4 WIFI it gives me an error. I read up that the proper wifi library to use is the WiFiS3 library. Got it.
I run the same code, swapping out only the libraries and I get an error (It can't publish to the broker, error code references "Connection rejected for rejected client ID")
I slim the code down to the basics and I think it results to this section:
WiFiClient wifiClient;
MqttClient mqttClient(wifiClient);
What does WiFiClient do for me here? Is there a parallel in the WiFis3 library?
UPDATE: I used the code from this example changing only the wifi library from WiFiNINA to WiFiS3 and it failed to connect to the mqtt server (error code 2). The serial monitor confirms that the device connected successfully to my wifi network. There's something different about these libraries such that they are not interchangeable.