knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.78k stars 1.46k forks source link

Compatibility With New Arduino Uno R4 WiFi Board #1016

Closed woolseyj closed 10 months ago

woolseyj commented 1 year ago

I have been enjoying using this library on an Arduino Uno WiFi Rev2 board. Thank you.

However, while trying out this library on a newly purchased Arduino Uno R4 WiFi board, I am getting quite a few "error: 'strnlen' was not declared in this scope" errors from within the PubSubClient library and the IDE suggests using 'strlen' as an alternative.

Do you have any suggestions on how I can resolve this error?

Your help would be greatly appreciated.

woolseyj commented 1 year ago

FYI, I added an issue to the ArduinoCore-renesas and an issue to the uno-r4-library-compatibility repositories.

Willy9512 commented 11 months ago

I am having the exact same issue. Have you found a solution?

woolseyj commented 11 months ago

No, I am just using the Arduino Uno WiFi Rev2 board for now.

tony2feathers commented 11 months ago

I made a fork of PubSubClient which addresses these issues. I have tested it and have managed to get it to connect to my wifi and connect to the test.mosquitto.org mqtt broker. I am having problems with my local broker for some reason, and I'm unsure what the cause is, but the new forked library works as far as I can tell. https://github.com/tony2feathers/pubsubclient_UnoR4

woolseyj commented 10 months ago

The issue was resolved in the ArduinoCore-renesas library. The PubSubClient library is now working properly with the Arduino R4 WiFi board.