Hi,
I'm testing the Arduino + WiFi module, and the error "Error compiling for board Arduino/Genuino Uno." came out.
I included all libraries asked. need help?
//// #include <SPI.h>
#include <WiFiNINA.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_gfx.h>
#define greenLED 8
#define redLED 9
#define OLED_WIDTH 128 //// define the OLED size
#define OLED_HEIGHTH 64
#define OLED_ADDR 0x3C //// set the OLED address, if don't know, use I2C Scaner
Adafruit_SSD1306 display(OLED_WIDTH, OLED_HEIGHTH); //// LED SCREEN
//// use 'Adafruit_SSD1306' to create 'display' with these parameters().
char ssid[] = "test"; //// parameter need by WIFI, ID=test
char pass[] = ""; //// WIFI no password
//// int keyIndex = 0;
int status = WL_IDLE_STATUS; //// create variable "status" to indicated status of WIFI
//// WiFiServer server(80);
String google = "www.google.com";
String salesforce = "www.salesforce.com";
IPAddress localServer(172, 16, 42, 5);
int googleResult;
int salesforceResult;
int serverResult;
int gatewayResult;
//// String readString;
void setup() {
pinMode(greenLED, OUTPUT);
pinMode(redLED, OUTPUT);
Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR);
while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to Network named: ");
Serial.println(ssid);
status = WiFi.begin(ssid, pass);
delay(10000);
}
//// server.begin();
String ssid = WiFi.SSID();
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
IPAddress ip = WiFi.localIP();
IPAddress gateway = WiFi.gatewayIP();
IPAddress subnet = WiFi.subnetMask();
display.clearDisplay();
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.println("Net Tester");
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 17);
display.print("SSID: ");
display.println(ssid);
display.print("IP: ");
display.println(ip);
display.print("Subnet: ");
display.println(subnet);
display.print("Gateway: ");
display.println(gateway);
display.display();
delay(5000);
}
void loop() {
IPAddress gateway = WiFi.gatewayIP();
googleResult = WiFi.ping(google);
salesforceResult = WiFi.ping(salesforce);
serverResult = WiFi.ping(localServer);
gatewayResult = WiFi.ping(gateway);
long counter = millis();
display.clearDisplay();
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.println("Net Tester");
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 17);
display.print("Gateway: ");
display.println(gatewayResult);
display.print("Local Server: ");
display.println(serverResult);
display.print("Google: ");
display.println(googleResult);
display.print("Salesforce: ");
display.println(salesforceResult);
display.println(counter);
display.display();
if (gatewayResult < 0 || serverResult < 0 || googleResult < 0 || salesforceResult < 0) {
digitalWrite(greenLED, LOW);
digitalWrite(redLED, HIGH);
} else {
digitalWrite(greenLED, HIGH);
digitalWrite(redLED, LOW);
}
delay(5000);
}
ERROR:
Arduino: 1.6.12 (Windows 7), Board: "Arduino/Genuino Uno"
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp: In static member function 'static void SpiDrv::begin()':
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp:87:24: error: 'PINS_COUNT' was not declared in this scope
if (SLAVERESET > PINS_COUNT) {
^
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp:97:15: error: 'NINA_GPIO0' was not declared in this scope
pinMode(NINA_GPIO0, OUTPUT);
^
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp: In static member function 'static int SpiDrv::available()':
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp:581:25: error: 'NINA_GPIO0' was not declared in this scope
return (digitalRead(NINA_GPIO0) != LOW);
^
Multiple libraries were found for "Adafruit_GFX.h"
Used: C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\Adafruit_BusIO-master
Not used: C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\Adafruit-GFX-Library-master
Not used: C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\Adafruit-GFX-Library-master
Not used: C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\Adafruit-GFX-Library-master
Not used: C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\Adafruit-GFX-Library-master
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Please tell us exactly which "WiFi module" you're testing.
laoadam:
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp:87:24: error: 'PINS_COUNT' was not declared in this scope
if (SLAVERESET > PINS_COUNT) {
^
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp:97:15: error: 'NINA_GPIO0' was not declared in this scope
pinMode(NINA_GPIO0, OUTPUT);
^
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp: In static member function 'static int SpiDrv::available()':
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp:581:25: error: 'NINA_GPIO0' was not declared in this scope
return (digitalRead(NINA_GPIO0) != LOW);
^
These are the error messages you need to focus on
laoadam:
Multiple libraries were found for "Adafruit_GFX.h"
Used: C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\Adafruit_BusIO-master
Not used: C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\Adafruit-GFX-Library-master
Not used: C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\Adafruit-GFX-Library-master
Not used: C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\Adafruit-GFX-Library-master
Not used: C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\Adafruit-GFX-Library-master
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
The "Multiple libraries were found for..." messages are only helpful information. As long as the correct library is being used, you can ignore them. In this case, they are actually not so helpful because you're using an extremely outdated version of the Arduino IDE, which had a bug that caused spurious "Multiple libraries were found for..." messages. So you might consider upgrading to the modern IDE version. But that still won't fix your real error messages, so I suggest we focus on figuring out what you're trying to accomplish with this WiFi thing first before worrying too much about the multiple libraries situation.
pert:
Please tell us exactly which "WiFi module" you're testing.
These are the error messages you need to focus on
The "Multiple libraries were found for..." messages are only helpful information. As long as the correct library is being used, you can ignore them. In this case, they are actually not so helpful because you're using an extremely outdated version of the Arduino IDE, which had a bug that caused spurious "Multiple libraries were found for..." messages. So you might consider upgrading to the modern IDE version. But that still won't fix your real error messages, so I suggest we focus on figuring out what you're trying to accomplish with this WiFi thing first before worrying too much about the multiple libraries situation.
Thank you.
I attached the board in the first post because I don't know how to attache picture in the reply;
I'll update my software and manage the library.
Best
OK, that is a "WeMos/LOLIN D1". So we now know there are several serious problems with what you're trying to accomplish:
The first is that this is not an Uno!!! It might have the shape of an Uno, but other than that it is very different because it uses the ESP8266 microcontroller instead of the Uno's ATmega328P. So you should not select Tools > Board > Arduino Uno when using this board. Instead, you need to install the ESP8266 boards platform by following these instructions:
pert:
OK, that is a "WeMos/LOLIN D1". So we now know there are several serious problems with what you're trying to accomplish:
The first is that this is not an Uno!!! It might have the shape of an Uno, but other than that it is very different because it uses the ESP8266 microcontroller instead of the Uno's ATmega328P. So you should not select Tools > Board > Arduino Uno when using this board. Instead, you need to install the ESP8266 boards platform by following these instructions: https://github.com/esp8266/arduino#installing-with-boards-manager
Thank you.
I did by your instruction, made some progress.
some new errors came out, need help please.
Arduino: 1.8.13 (Windows 7), Board: "WeMos D1 R1, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp: In static member function 'static void SpiDrv::begin()':
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp:87:24: error: 'PINS_COUNT' was not declared in this scope
if (SLAVERESET > PINS_COUNT) {
^
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp:97:15: error: 'NINA_GPIO0' was not declared in this scope
pinMode(NINA_GPIO0, OUTPUT);
^
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp: In static member function 'static int SpiDrv::available()':
C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp:581:25: error: 'NINA_GPIO0' was not declared in this scope
return (digitalRead(NINA_GPIO0) != LOW);
^
Multiple libraries were found for "Adafruit_GFX.h"
Used: C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\Adafruit_BusIO-master
Not used: C:\Users\HUA.DELLV-PC\Documents\Arduino\libraries\Adafruit-GFX-Library-master
exit status 1
Error compiling for board WeMos D1 R1.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.