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.
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
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.
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.
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!