Sketch not compililng even after applying suggestted fix

Hello.

Following this thread, which was closed, I am trying to compile this code for the sender device:

but I'm getting the same error mentioned in the above thread.

In file included from /home/psysc0rpi0n/Arduino/libraries/WiFiNINA/src/WiFiStorage.h:23,
from /home/psysc0rpi0n/Arduino/libraries/WiFiNINA/src/WiFi.h:38,
from /home/psysc0rpi0n/Arduino/libraries/WiFiNINA/src/WiFiNINA.h:23,
                 from /home/psysc0rpi0n/Arduino/esp8266/mqtt/mqtt.ino:2:
/home/psysc0rpi0n/Arduino/libraries/WiFiNINA/src/utility/wifi_drv.h: At global scope:
/home/psysc0rpi0n/Arduino/libraries/WiFiNINA/src/utility/wifi_drv.h:293:12: error: 'PinStatus' does not name a type
  293 |     static PinStatus digitalRead(uint8_t pin);
      |            ^~~~~~~~~~

I installed Arduino SAMD Boards (Version 1.8.3) library as suggested in the solution of the above thread but I still get the same error after installing that boards libraries.

What else can I do to fix the error?
Notes:
I'm using Arduino Nano and an ESP8266 board and I'm getting this error.

Your topic was MOVED to its current forum category as it is more suitable than the original

It has nothing to do with Installation and Troubleshooting the IDE which is the forum category that you posted it in

In that case, updating the SAMD Board files will achieve nothing as far as I can see because neither of your processors use a SAMD chip

Line 293 of the file that is causing the error is

    static PinStatus digitalRead(uint8_t pin);

which basically defines the digitalRead function to return a value in the pinStatus enum rather than an int value as is normal

As an experiment, copy line 293 of /home/psysc0rpi0n/Arduino/libraries/WiFiNINA/src/utility/wifi_drv.h, comment out one of them and change the remaining one to

    static int digitalRead(uint8_t pin);

Do the same with line 1063 of /home/psysc0rpi0n/Arduino/libraries/WiFiNINA/src/utility/wifi_drv.h which is the matching function definition

As long as you copy and comment the original lines in the files you can revert back should you need to or you could reinstall theWiFiNINA library

The code that gives thr error is for a board with 4809 processor as used on the Nano Every and the Uno WiFi Rev2.

If you are porting the code from the "Arduino UNO WiFi Rev2" to the ESP8266 you should probably remove the "WiFiNINA" library and instead use the "ESP8266WiFi" library or some library compatible with your hardware.

I'm not sure this changes anything but I made a mistake in the 1st post. I meant I was using an Arduino Uno R3 an not a Nano. Sorry for that.

Apparently, I cannot use this WiFiNINA library for the Arduino Uno R3, right? If this is the case, I'll have to restart the project with new code!

You can't use ANY "WiFi" library on an Arduino UNO R3 until you add WiFi hardware (like a WiFi Shield). The library you use depends on the WiFi hardware you install.

Yes, I know. I should have been more explicit in my first topic.
I'm using an Arduino Uno R3 and an ESP8266 based board (bought from China).
I have already found an example code and I already compiled it and uploaded it.
However, I'm not sure it is working as expected. I would guess it is not because I was expecting to see some messages in the Serial monitor and all I can see is info I didn't even requested. Probably some info from the MQTT libraries.

This is the example code I'm using:

But all I see in the Serial monitor is this:

Shouldn't I be able to see the Serial.println() messages present in the setup and loop functions?

Edit 1;
The only thing being printed, if I'm not mistaken is an empty space that is scrolling the bottom bar infinitely to the right, if you know what I mean!

Edit 2;
Nevermind, somehow it is working now with the example I just mentioned!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.