Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
v1.5.1
Browse files Browse the repository at this point in the history
#### New in v1.5.1

1. Add support to nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense, Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, etc.
  • Loading branch information
khoih-prog authored Apr 22, 2020
1 parent 49390cd commit a3075af
Show file tree
Hide file tree
Showing 43 changed files with 782 additions and 140 deletions.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/WiFiNINA_Generic.svg)](http://github.com/khoih-prog/WiFiNINA_Generic/issues)

#### New in v1.5.1

1. Add support to nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense, Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, etc.

#### New in v1.5.0

1. The original [Arduino WiFiNINA library](http://www.arduino.cc/en/Reference/WiFiNINA) only supports very limited boards, such as: the Arduino MKR WiFi 1010, Arduino MKR VIDOR 4000 and Arduino UNO WiFi Rev.2. This library is based on and modified from [Arduino WiFiNINA library](http://www.arduino.cc/en/Reference/WiFiNINA) to provide support for many more boards, such as SAM DUE, SAMD21, SAMD51, Teensy, AVR Mega, STM32, etc.
Expand All @@ -22,6 +26,7 @@ With this library you can instantiate Servers, Clients and send/receive UDP pack
5. [`Arduino SAMD core 1.8.5 or later`](https://www.arduino.cc/en/Guide/ArduinoM0) for SAMD ARM Cortex-M0+ boards
6. [`Adafruit SAMD core 1.5.11 or later`](https://www.adafruit.com/) for SAMD ARM Cortex-M0+ and M4 boards (Nano 33 IoT, etc.)
7. [`Arduino Core for STM32 v1.8.0 or later`](https://github.com/khoih-prog/Arduino_Core_STM32) for STM32 boards
8. [`Adafruit nRF52 v0.19.0 or later`](www.adafruit.com) for nRF52 boards such as AdaFruit Feather nRF52840 Express, etc.


## Quick Start
Expand Down Expand Up @@ -55,6 +60,29 @@ See examples :
15. [WiFiWebClientRepeating](examples/WiFiWebClientRepeating)
16. [WiFiWebServer](examples/WiFiWebServer)

#### Important notes

Please change the pin-to-pin connection in `WiFiNINA_Pinout_Generic.h` to match actual connection

For example

```
#elif ( defined(NRF52840_FEATHER) || defined(NRF52832_FEATHER) || defined(NRF52_SERIES) || defined(ARDUINO_NRF52_ADAFRUIT) )
#warning You have to modify pin usage accoring to actual connection for NRF528XX
// To define pin out for WiFiNINA here
//#define PINS_COUNT (60u)
//NINA
#define NINA_GPIO0 (26u) //26
#define NINA_RESETN (27u)
#define NINA_ACK (28u)
#define SPIWIFI_SS 24 //PIN_SPI1_SS //24
#define SPIWIFI_ACK 28 //NINA_ACK //28
#define SPIWIFI_RESET 27 //NINA_RESETN //27
```


#### Sample Code

Expand Down Expand Up @@ -191,13 +219,18 @@ Sometimes, the library will only work if you update the `WiFiNINA module/shield`
1. Add support to many more boards still not working
#### New in v1.5.1
1. Add support to nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense, Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, etc.
#### New in v1.5.0
1. The original [Arduino WiFiNINA library](http://www.arduino.cc/en/Reference/WiFiNINA) only supports very limited boards, such as: the Arduino MKR WiFi 1010, Arduino MKR VIDOR 4000 and Arduino UNO WiFi Rev.2. This library is based on and modified from [Arduino WiFiNINA library](http://www.arduino.cc/en/Reference/WiFiNINA) to provide support for many more boards, such as SAM DUE, SAMD21, SAMD51, Teensy, AVR Mega, STM32, etc.
### Contributions and thanks
1. Based on and modified from [Arduino WiFiNINA library](http://www.arduino.cc/en/Reference/WiFiNINA)
1. Forked from [Arduino WiFiNINA library](http://www.arduino.cc/en/Reference/WiFiNINA)
2. Thanks to [Miguel Alexandre Wisintainer](https://github.com/tcpipchip) for initiating, inspriring, working with and testing. See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1)
### Contributing
Expand Down
35 changes: 33 additions & 2 deletions examples/AP_SimpleWebServer/AP_SimpleWebServer.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
/****************************************************************************************************************************
AP_SimpleWebServer.ino
WiFi Web Server LED Blink
A simple web server that lets you blink an LED via the web.
Expand All @@ -14,8 +15,38 @@
created 25 Nov 2012
by Tom Igoe
adapted to WiFi AP by Adafruit
*/
Based on and modified from WiFiNINA libarary https://www.arduino.cc/en/Reference/WiFiNINA
to support other boards besides Nano-33 IoT, MKRWIFI1010, MKRVIDOR4000, etc.
Built by Khoi Hoang https://github.com/khoih-prog/ESP8266_AT_WebServer
Licensed under MIT license
Version: 1.5.1
Copyright (c) 2018 Arduino SA. All rights reserved.
Copyright (c) 2011-2014 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version Modified By Date Comments
------- ----------- ---------- -----------
1.5.0 K Hoang 27/03/2020 Initial coding to support other boards besides Nano-33 IoT, MKRWIFI1010, MKRVIDOR4000, etc.
such as Arduino Mega, Teensy, SAMD21, SAMD51, STM32, etc
1.5.1 K Hoang 22/04/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense,
Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, etc.
*****************************************************************************************************************************/
#include <SPI.h>
#include <WiFiNINA_Generic.h>

Expand Down
72 changes: 52 additions & 20 deletions examples/ConnectNoEncryption/ConnectNoEncryption.ino
Original file line number Diff line number Diff line change
@@ -1,14 +1,46 @@
/*
This example connects to an unencrypted Wifi network.
Then it prints the MAC address of the board,
the IP address obtained, and other network details.
created 13 July 2010
by dlf (Metodo2 srl)
modified 31 May 2012
by Tom Igoe
*/
/****************************************************************************************************************************
ConnectNoEncryption.ino
This example connects to an unencrypted Wifi network.
Then it prints the MAC address of the board,
the IP address obtained, and other network details.
created 13 July 2010
by dlf (Metodo2 srl)
modified 31 May 2012
by Tom Igoe
Based on and modified from WiFiNINA libarary https://www.arduino.cc/en/Reference/WiFiNINA
to support other boards besides Nano-33 IoT, MKRWIFI1010, MKRVIDOR4000, etc.
Built by Khoi Hoang https://github.com/khoih-prog/ESP8266_AT_WebServer
Licensed under MIT license
Version: 1.5.1
Copyright (c) 2018 Arduino SA. All rights reserved.
Copyright (c) 2011-2014 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version Modified By Date Comments
------- ----------- ---------- -----------
1.5.0 K Hoang 27/03/2020 Initial coding to support other boards besides Nano-33 IoT, MKRWIFI1010, MKRVIDOR4000, etc.
such as Arduino Mega, Teensy, SAMD21, SAMD51, STM32, etc
1.5.1 K Hoang 22/04/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense,
Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, etc.
*****************************************************************************************************************************/
#include <SPI.h>
#include <WiFiNINA_Generic.h>

Expand Down Expand Up @@ -37,7 +69,7 @@ void setup()
}

// attempt to connect to Wifi network:
while (status != WL_CONNECTED)
while (status != WL_CONNECTED)
{
Serial.print("Attempting to connect to open SSID: ");
Serial.println(ssid);
Expand All @@ -53,14 +85,14 @@ void setup()
printWifiData();
}

void loop()
void loop()
{
// check the network connection once every 10 seconds:
delay(10000);
printCurrentNet();
}

void printWifiData()
void printWifiData()
{
// print your board's IP address:
IPAddress ip = WiFi.localIP();
Expand All @@ -85,7 +117,7 @@ void printWifiData()
Serial.println(gateway);
}

void printCurrentNet()
void printCurrentNet()
{
// print the SSID of the network you're attached to:
Serial.print("SSID: ");
Expand All @@ -108,17 +140,17 @@ void printCurrentNet()
Serial.println(encryption, HEX);
}

void printMacAddress(byte mac[])
void printMacAddress(byte mac[])
{
for (int i = 5; i >= 0; i--)
for (int i = 5; i >= 0; i--)
{
if (mac[i] < 16)
if (mac[i] < 16)
{
Serial.print("0");
}
Serial.print(mac[i], HEX);
if (i > 0)

if (i > 0)
{
Serial.print(":");
}
Expand Down
36 changes: 34 additions & 2 deletions examples/ConnectWithWEP/ConnectWithWEP.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
/****************************************************************************************************************************
ConnectWithWEP.ino
This example connects to a WEP-encrypted Wifi network.
Then it prints the MAC address of the Wifi module,
Expand All @@ -18,7 +19,38 @@
by dlf (Metodo2 srl)
modified 31 May 2012
by Tom Igoe
*/
Based on and modified from WiFiNINA libarary https://www.arduino.cc/en/Reference/WiFiNINA
to support other boards besides Nano-33 IoT, MKRWIFI1010, MKRVIDOR4000, etc.
Built by Khoi Hoang https://github.com/khoih-prog/ESP8266_AT_WebServer
Licensed under MIT license
Version: 1.5.1
Copyright (c) 2018 Arduino SA. All rights reserved.
Copyright (c) 2011-2014 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version Modified By Date Comments
------- ----------- ---------- -----------
1.5.0 K Hoang 27/03/2020 Initial coding to support other boards besides Nano-33 IoT, MKRWIFI1010, MKRVIDOR4000, etc.
such as Arduino Mega, Teensy, SAMD21, SAMD51, STM32, etc
1.5.1 K Hoang 22/04/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense,
Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, etc.
*****************************************************************************************************************************/
#include <SPI.h>
#include <WiFiNINA_Generic.h>

Expand Down
36 changes: 34 additions & 2 deletions examples/ConnectWithWPA/ConnectWithWPA.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
/****************************************************************************************************************************
ConnectWithWPA.ino
This example connects to an unencrypted Wifi network.
Then it prints the MAC address of the Wifi module,
Expand All @@ -8,7 +9,38 @@
by dlf (Metodo2 srl)
modified 31 May 2012
by Tom Igoe
*/
Based on and modified from WiFiNINA libarary https://www.arduino.cc/en/Reference/WiFiNINA
to support other boards besides Nano-33 IoT, MKRWIFI1010, MKRVIDOR4000, etc.
Built by Khoi Hoang https://github.com/khoih-prog/ESP8266_AT_WebServer
Licensed under MIT license
Version: 1.5.1
Copyright (c) 2018 Arduino SA. All rights reserved.
Copyright (c) 2011-2014 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version Modified By Date Comments
------- ----------- ---------- -----------
1.5.0 K Hoang 27/03/2020 Initial coding to support other boards besides Nano-33 IoT, MKRWIFI1010, MKRVIDOR4000, etc.
such as Arduino Mega, Teensy, SAMD21, SAMD51, STM32, etc
1.5.1 K Hoang 22/04/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense,
Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, etc.
*****************************************************************************************************************************/
#include <SPI.h>
#include <WiFiNINA_Generic.h>

Expand Down
39 changes: 36 additions & 3 deletions examples/ConnectWithWPA2Enterprise/ConnectWithWPA2Enterprise.ino
Original file line number Diff line number Diff line change
@@ -1,10 +1,43 @@
/*
/****************************************************************************************************************************
ConnectWithWPA2Enterprise.ino
This example connects to an WPA2 Enterprise WiFi network.
Then it prints the MAC address of the WiFi module,
the IP address obtained, and other network details.
Based on ConnectWithWPA.ino by dlf (Metodo2 srl) and Tom Igoe
*/
Based on and modified from WiFiNINA libarary https://www.arduino.cc/en/Reference/WiFiNINA
to support other boards besides Nano-33 IoT, MKRWIFI1010, MKRVIDOR4000, etc.
Built by Khoi Hoang https://github.com/khoih-prog/ESP8266_AT_WebServer
Licensed under MIT license
Version: 1.5.1
Copyright (c) 2018 Arduino SA. All rights reserved.
Copyright (c) 2011-2014 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version Modified By Date Comments
------- ----------- ---------- -----------
1.5.0 K Hoang 27/03/2020 Initial coding to support other boards besides Nano-33 IoT, MKRWIFI1010, MKRVIDOR4000, etc.
such as Arduino Mega, Teensy, SAMD21, SAMD51, STM32, etc
1.5.1 K Hoang 22/04/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense,
Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, etc.
*****************************************************************************************************************************/
#include <SPI.h>
#include <WiFiNINA_Generic.h>

Expand Down Expand Up @@ -35,7 +68,7 @@ void setup()
}

// attempt to connect to Wifi network:
while (status != WL_CONNECTED)
while (status != WL_CONNECTED)
{
Serial.print("Attempting to connect to WPA SSID: ");
Serial.println(ssid);
Expand Down
Loading

0 comments on commit a3075af

Please sign in to comment.