Skip to content

Commit 9676cfe

Browse files
committed
Initial changes to support u-blox NINA-W102 with Arduino firmware
1 parent 755bf82 commit 9676cfe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1392
-309
lines changed

README.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
= WiFi Library for Arduino =
1+
= WiFi1010 Library for Arduino =
22

3-
With the Arduino WiFi Shield, this library allows an Arduino board to connect to the internet.
3+
Enables network connection (local and Internet) with the Arduino MKR WiFi 1010, Arduino MKR VIDOR 4000 and Arduino UNO WiFi Rev.2.
4+
5+
With this library you can instantiate Servers, Clients and send/receive UDP packets through WiFi. The board can connect either to open or encrypted networks (WEP, WPA). The IP address can be assigned statically or through a DHCP. The library can also manage DNS.
46

57
For more information about this library please visit us at
6-
http://www.arduino.cc/en/Reference/WiFi
8+
http://www.arduino.cc/en/Reference/WiFi1010
79

810
== License ==
911

12+
Copyright (C) 2018 Arduino AG (http://www.arduino.cc/)
1013
Copyright (c) 2011-2014 Arduino LLC. All right reserved.
1114
Copyright (C) 2006-2008, Atmel Corporation All rights reserved.
1215
Copyright (c) 2001-2004 Swedish Institute of Computer Science.

examples/ConnectNoEncryption/ConnectNoEncryption.ino

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@
44
Then it prints the MAC address of the Wifi shield,
55
the IP address obtained, and other network details.
66
7-
Circuit:
8-
* WiFi shield attached
9-
107
created 13 July 2010
118
by dlf (Metodo2 srl)
129
modified 31 May 2012
1310
by Tom Igoe
1411
*/
1512
#include <SPI.h>
16-
#include <WiFi.h>
13+
#include <WiFi1010.h>
1714

18-
char ssid[] = "yourNetwork"; // the name of your network
15+
#include "arduino_secrets.h"
16+
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
17+
char ssid[] = SECRET_SSID; // your network SSID (name)
1918
int status = WL_IDLE_STATUS; // the Wifi radio's status
2019

2120
void setup() {
@@ -24,16 +23,15 @@ void setup() {
2423
while (!Serial) {
2524
; // wait for serial port to connect. Needed for native USB port only
2625
}
27-
28-
// check for the presence of the shield:
29-
if (WiFi.status() == WL_NO_SHIELD) {
30-
Serial.println("WiFi shield not present");
31-
// don't continue:
26+
// check for the WiFi module:
27+
if (WiFi.status() == WL_NO_MODULE) {
28+
Serial.println("Communication with WiFi module failed!");
29+
// don't continue
3230
while (true);
3331
}
3432

3533
String fv = WiFi.firmwareVersion();
36-
if (fv != "1.1.0") {
34+
if (fv != "1.0.0") {
3735
Serial.println("Please upgrade the firmware");
3836
}
3937

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#define SECRET_SSID ""

examples/ConnectWithWEP/ConnectWithWEP.ino

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
33
This example connects to a WEP-encrypted Wifi network.
4-
Then it prints the MAC address of the Wifi shield,
4+
Then it prints the MAC address of the Wifi module,
55
the IP address obtained, and other network details.
66
77
If you use 40-bit WEP, you need a key that is 10 characters long,
@@ -14,19 +14,18 @@
1414
D0D0DEADF00DABBADEAFBEADED will work because it's 26 characters,
1515
all in the 0-9, A-F range.
1616
17-
Circuit:
18-
* WiFi shield attached
19-
2017
created 13 July 2010
2118
by dlf (Metodo2 srl)
2219
modified 31 May 2012
2320
by Tom Igoe
2421
*/
2522
#include <SPI.h>
26-
#include <WiFi.h>
23+
#include <WiFi1010.h>
2724

28-
char ssid[] = "yourNetwork"; // your network SSID (name)
29-
char key[] = "D0D0DEADF00DABBADEAFBEADED"; // your network key
25+
#include "arduino_secrets.h"
26+
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
27+
char ssid[] = SECRET_SSID; // your network SSID (name)
28+
char pass[] = SECRET_PASS; // your network password (use for WPA, or use as key for WEP)
3029
int keyIndex = 0; // your network key Index number
3130
int status = WL_IDLE_STATUS; // the Wifi radio's status
3231

@@ -37,23 +36,23 @@ void setup() {
3736
; // wait for serial port to connect. Needed for native USB port only
3837
}
3938

40-
// check for the presence of the shield:
41-
if (WiFi.status() == WL_NO_SHIELD) {
42-
Serial.println("WiFi shield not present");
43-
// don't continue:
39+
// check for the WiFi module:
40+
if (WiFi.status() == WL_NO_MODULE) {
41+
Serial.println("Communication with WiFi module failed!");
42+
// don't continue
4443
while (true);
4544
}
4645

4746
String fv = WiFi.firmwareVersion();
48-
if (fv != "1.1.0") {
47+
if (fv != "1.0.0") {
4948
Serial.println("Please upgrade the firmware");
5049
}
5150

5251
// attempt to connect to Wifi network:
5352
while (status != WL_CONNECTED) {
5453
Serial.print("Attempting to connect to WEP network, SSID: ");
5554
Serial.println(ssid);
56-
status = WiFi.begin(ssid, keyIndex, key);
55+
status = WiFi.begin(ssid, keyIndex, pass);
5756

5857
// wait 10 seconds for connection:
5958
delay(10000);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#define SECRET_SSID ""
2+
#define SECRET_PASS ""

examples/ConnectWithWPA/ConnectWithWPA.ino

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
/*
22
33
This example connects to an unencrypted Wifi network.
4-
Then it prints the MAC address of the Wifi shield,
4+
Then it prints the MAC address of the Wifi module,
55
the IP address obtained, and other network details.
66
7-
Circuit:
8-
* WiFi shield attached
9-
107
created 13 July 2010
118
by dlf (Metodo2 srl)
129
modified 31 May 2012
1310
by Tom Igoe
1411
*/
1512
#include <SPI.h>
16-
#include <WiFi.h>
13+
#include <WiFi1010.h>
1714

18-
char ssid[] = "yourNetwork"; // your network SSID (name)
19-
char pass[] = "secretPassword"; // your network password
15+
#include "arduino_secrets.h"
16+
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
17+
char ssid[] = SECRET_SSID; // your network SSID (name)
18+
char pass[] = SECRET_PASS; // your network password (use for WPA, or use as key for WEP)
2019
int status = WL_IDLE_STATUS; // the Wifi radio's status
2120

2221
void setup() {
@@ -26,15 +25,15 @@ void setup() {
2625
; // wait for serial port to connect. Needed for native USB port only
2726
}
2827

29-
// check for the presence of the shield:
30-
if (WiFi.status() == WL_NO_SHIELD) {
31-
Serial.println("WiFi shield not present");
32-
// don't continue:
28+
// check for the WiFi module:
29+
if (WiFi.status() == WL_NO_MODULE) {
30+
Serial.println("Communication with WiFi module failed!");
31+
// don't continue
3332
while (true);
3433
}
3534

3635
String fv = WiFi.firmwareVersion();
37-
if (fv != "1.1.0") {
36+
if (fv != "1.0.0") {
3837
Serial.println("Please upgrade the firmware");
3938
}
4039

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#define SECRET_SSID ""
2+
#define SECRET_PASS ""

examples/ScanNetworks/ScanNetworks.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
33
This example prints the Wifi shield's MAC address, and
4-
scans for available Wifi networks using the Wifi shield.
4+
scans for available Wifi networks using the Wifi module.
55
Every ten seconds, it scans again. It doesn't actually
66
connect to any network, so no encryption scheme is specified.
77
@@ -16,7 +16,7 @@
1616

1717

1818
#include <SPI.h>
19-
#include <WiFi.h>
19+
#include <WiFi1010.h>
2020

2121
void setup() {
2222
//Initialize serial and wait for port to open:
@@ -25,15 +25,15 @@ void setup() {
2525
; // wait for serial port to connect. Needed for native USB port only
2626
}
2727

28-
// check for the presence of the shield:
29-
if (WiFi.status() == WL_NO_SHIELD) {
30-
Serial.println("WiFi shield not present");
31-
// don't continue:
28+
// check for the WiFi module:
29+
if (WiFi.status() == WL_NO_MODULE) {
30+
Serial.println("Communication with WiFi module failed!");
31+
// don't continue
3232
while (true);
3333
}
3434

3535
String fv = WiFi.firmwareVersion();
36-
if (fv != "1.1.0") {
36+
if (fv != "1.0.0") {
3737
Serial.println("Please upgrade the firmware");
3838
}
3939

examples/SimpleWebServerWiFi/SimpleWebServerWiFi.ino

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
WiFi Web Server LED Blink
33
44
A simple web server that lets you blink an LED via the web.
5-
This sketch will print the IP address of your WiFi Shield (once connected)
5+
This sketch will print the IP address of your WiFi module (once connected)
66
to the Serial monitor. From there, you can open that address in a web browser
77
to turn on and off the LED on pin 9.
88
9-
If the IP address of your shield is yourAddress:
9+
If the IP address of your board is yourAddress:
1010
http://yourAddress/H turns the LED on
1111
http://yourAddress/L turns it off
1212
@@ -21,10 +21,12 @@
2121
by Tom Igoe
2222
*/
2323
#include <SPI.h>
24-
#include <WiFi.h>
24+
#include <WiFi1010.h>
2525

26-
char ssid[] = "yourNetwork"; // your network SSID (name)
27-
char pass[] = "secretPassword"; // your network password
26+
#include "arduino_secrets.h"
27+
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
28+
char ssid[] = SECRET_SSID; // your network SSID (name)
29+
char pass[] = SECRET_PASS; // your network password (use for WPA, or use as key for WEP)
2830
int keyIndex = 0; // your network key Index number (needed only for WEP)
2931

3032
int status = WL_IDLE_STATUS;
@@ -34,14 +36,15 @@ void setup() {
3436
Serial.begin(9600); // initialize serial communication
3537
pinMode(9, OUTPUT); // set the LED pin mode
3638

37-
// check for the presence of the shield:
38-
if (WiFi.status() == WL_NO_SHIELD) {
39-
Serial.println("WiFi shield not present");
40-
while (true); // don't continue
39+
// check for the WiFi module:
40+
if (WiFi.status() == WL_NO_MODULE) {
41+
Serial.println("Communication with WiFi module failed!");
42+
// don't continue
43+
while (true);
4144
}
4245

4346
String fv = WiFi.firmwareVersion();
44-
if (fv != "1.1.0") {
47+
if (fv != "1.0.0") {
4548
Serial.println("Please upgrade the firmware");
4649
}
4750

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#define SECRET_SSID ""
2+
#define SECRET_PASS ""

0 commit comments

Comments
 (0)