B4R Question Arduino MKR WiFi 1010... Hating it. Help please.

Tronak

Member
Licensed User
Longtime User
Hi. I was excited when I found an Arduino board featuring WiFi without external shells. I used the ESP8266 before, and worked, but I (erroneously) supposed that this one would be easier. I have included the libraries needed for using the WiFi (SPI.h and WiFiNINA.h), but the B4R says that cannot find WiFiNINA. Maybe my problem is I don't know where to place the libraries, but after four days of cursing and yelling I am starting to feel frustrated. Does anyone know how to put this nice piece of... technology to work? If so, please help me.

This is some basic code to use the libraries...

B4X:
#if C
#include <SPI.h>
#include <WiFiNINA.h)

void sConn() {
  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }

  // attempt to connect to Wifi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
    delay(10000);
  }

b4r_main::_bConnected = True;
}
#End if

...And this is what i get:

B4X:
Alternatives for WiFiNINA.h): []
ResolveLibrary(WiFiNINA.h))
  -> candidates: []
b4r_main.cpp:24:22: error: missing terminating > character
 #include <WiFiNINA.h)
                      ^
b4r_main.cpp:24:10: error: WiFiNINA.h): No such file or directory
 #include <WiFiNINA.h)
Multiple libraries were found for "SPI.h"
          ^
compilation terminated.
 Used: C:\Users\Tronak\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.4\libraries\SPI
exit status 1
 

Tronak

Member
Licensed User
Longtime User
Uh... You are right. That fixes the problem. Thank you for your help, and for being polite enough to not make the appropriate comment for that kind of error.

OK. Now I hate myself, but my relationship with the MKR WiFi 1010 is not getting better. Is there any way to use the existing libraries in B4R to control the connection to WiFi?
 
Upvote 0
Top