Skip to content

Commit b28dd5d

Browse files
committed
Add support for Arduino MKR WiFi 1010
The board uses the U-Blox WiFi NINA chip which has an ESP32 inside running NINA firmware. The SAMD21 is connected to the U-Blox chip via SPI. The WiFININA library is used to communicate between the U-Blox chip and the SAMD21. Other boards use the same U-Blox chip such as the MKR Vidor 4000 and the Uno WiFi Rev2. Additional changes will be required to support those boards.
1 parent 2ad7d26 commit b28dd5d

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

Boards.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ writePort(port, value, bitmask): Write an 8 bit port.
261261
#define PIN_TO_SERVO(p) ((p) - 2)
262262

263263

264-
// Arduino/Genuino MKR1000
265-
#elif defined(ARDUINO_SAMD_MKR1000)
264+
// Arduino/Genuino MKR1000 or MKR1010
265+
#elif defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_MKRWIFI1010)
266266
#define TOTAL_ANALOG_PINS 7
267267
#define TOTAL_PINS 22 // 8 digital + 3 spi + 2 i2c + 2 uart + 7 analog
268268
#define IS_PIN_DIGITAL(p) ((p) >= 0 && (p) <= 21)

examples/StandardFirmataWiFi/StandardFirmataWiFi.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
- Arduino WiFi Shield (or clone)
3838
- Arduino WiFi Shield 101
3939
- Arduino MKR1000 board
40+
- Arduino MKRWIFI1010 board
4041
- ESP8266 WiFi board compatible with ESP8266 Arduino core
4142
4243
Follow the instructions in the wifiConfig.h file (wifiConfig.h tab in Arduino IDE) to
@@ -929,6 +930,8 @@ void initTransport()
929930
DEBUG_PRINTLN( "using the ESP8266 WiFi library." );
930931
#elif defined(HUZZAH_WIFI)
931932
DEBUG_PRINTLN( "using the HUZZAH WiFi library." );
933+
#elif defined(WIFI_NINA)
934+
DEBUG_PRINTLN( "using the WiFi NINA library." );
932935
//else should never happen here as error-checking in wifiConfig.h will catch this
933936
#endif //defined(WIFI_101)
934937

examples/StandardFirmataWiFi/wifiConfig.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,41 @@
102102
* For HUZZAH with ESP8266 use ESP8266_WIFI.
103103
*/
104104

105+
/*
106+
* OPTION E: Configure for Arduino MKR WiFi 1010 and maybe other WiFiNINA boards.
107+
*
108+
* This will configure StandardFirmataWiFi to use the WiFiNINA library, which works with the
109+
* boards that have the U-Blox NINA chip built in (such as the MKR1010).
110+
* It is compatible with 802.11 2.4GHz B/G/N networks.
111+
*
112+
* If you are using the MKR1010 board, continue on to STEP 2. If you are using WiFiNINA add-on
113+
* boards, follow the instructions below.
114+
*
115+
* To enable for WiFiNINA add-on boards, uncomment the #define WIFI_NINA below.
116+
* TBD: Adafruit AirLyft boards are based on the WiFiNINA firmware so may work here.
117+
*
118+
* IMPORTANT: You must have the WiFI NINA library installed. To easily install this library, open
119+
* the library manager via: Arduino IDE Menus: Sketch > Include Library > Manage Libraries > filter
120+
* search for "WiFiNINA" > Select the result and click 'install'
121+
*/
122+
//#define WIFI_NINA
123+
124+
//do not modify the following 15 lines
125+
#if defined(ARDUINO_SAMD_MKRWIFI1010) && !defined(WIFI_NINA)
126+
// automatically include if compiling for MRKWIFI1010
127+
#define WIFI_NINA
128+
#endif
129+
#ifdef WIFI_NINA
130+
#include <WiFiNINA.h>
131+
#include "utility/WiFiClientStream.h"
132+
#include "utility/WiFiServerStream.h"
133+
#ifdef WIFI_LIB_INCLUDED
134+
#define MULTIPLE_WIFI_LIB_INCLUDES
135+
#else
136+
#define WIFI_LIB_INCLUDED
137+
#endif
138+
#endif
139+
105140
//------------------------------
106141
// TODO
107142
//------------------------------

0 commit comments

Comments
 (0)