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

Commit 2f98435

Browse files
authored
v1.8.14-6 to fix bug and add support to Teensy 4.x
### Releases v1.8.14-6 1. Add support to `Teensy 4.x` using `Adafruit Airlift Featherwing Co-Processor` 2. Fix `WiFiStorageFile.flush()` linker error in some platform. Check [Flush method not implemented #22](#22) 3. Update `Packages' Patches`
1 parent 122a121 commit 2f98435

33 files changed

+181
-87
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Arduino IDE version: 1.8.19
3131
Arduino-mbed RP2040 v3.1.1
3232
NANO_RP2040_CONNECT Module
3333
OS: Ubuntu 20.04 LTS
34-
Linux xy-Inspiron-3593 5.13.0-41-generic #46~20.04.1-Ubuntu SMP Wed Apr 20 13:16:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
34+
Linux xy-Inspiron-3593 5.15.0-41-generic #44~20.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3535
3636
Context:
3737
I encountered an endless loop while trying to connect to Local WiFi.

README.md

+41-40
Large diffs are not rendered by default.

changelog.md

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Releases v1.8.14-6](#releases-v1814-6)
16+
* [Releases v1.8.14-5](#releases-v1814-5)
1517
* [Releases v1.8.14-4](#releases-v1814-4)
1618
* [Releases v1.8.14-3](#releases-v1814-3)
1719
* [Releases v1.8.14-2](#releases-v1814-2)
@@ -40,6 +42,12 @@
4042

4143
## Changelog
4244

45+
### Releases v1.8.14-6
46+
47+
1. Add support to `Teensy 4.x` using `Adafruit Airlift Featherwing Co-Processor`
48+
2. Fix `WiFiStorageFile.flush()` linker error in some platform. Check [Flush method not implemented #22](https://github.com/khoih-prog/WiFiNINA_Generic/issues/22)
49+
3. Update `Packages' Patches`
50+
4351
### Releases v1.8.14-5
4452

4553
1. Fix bug causing data lost when sending large files. Check [Thread: Teensy 4.1 - Adafruit Airlift Featherwing Co-Processor FTP Server not opening Port 21](https://forum.pjrc.com/threads/70062-Teensy-4-1-Adafruit-Airlift-Featherwing-Co-Processor-FTP-Server-not-opening-Port-21?p=306507&viewfull=1#post306507). This is just a kludge for temporary use, waiting for better and final fix, dealing with SPI driver, from Arduino.

library.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "WiFiNINA_Generic",
3-
"version": "1.8.14-5",
3+
"version": "1.8.14-6",
44
"keywords": "wifi, wi-fi, WiFiNINA, NINA-B302-ublox, W101, W102, shield, Teensy, SAM DUE, SAMD, STM32, nRF52, rpi-pico, rp2040, Credentials, Manager, nano-rp2040-connect, raspberry-pi-pico, mega, 32u4",
55
"description": "Enables network connection (local and Internet) and WiFiStorage for SAM DUE, SAMD21, SAMD51, Teensy, AVR (328P, 32u4, 16u4, etc.), Mega, STM32F/L/H/G/WB/MP1, nRF52, NINA_B302_ublox, NINA_B112_ublox, RP2040-based boards, etc. in addition to Arduino MKR WiFi 1010, Arduino MKR VIDOR 4000, Arduino UNO WiFi Rev.2, Nano 33 IoT, Nano RP2040 Connect",
66
"authors": [

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=WiFiNINA_Generic
2-
version=1.8.14-5
2+
version=1.8.14-6
33
author=Arduino, Khoi Hoang <[email protected]>
44
maintainer=Khoi Hoang <[email protected]>
55
sentence=Enables network connection (local and Internet) and WiFiStorage for SAM DUE, SAMD21, SAMD51, Teensy, AVR (328P, 32u4, 16u4, etc.), Mega, STM32F/L/H/G/WB/MP1, nRF52, NINA_B302_ublox, NINA_B112_ublox, RP2040-based boards, etc. in addition to Arduino MKR WiFi 1010, Arduino MKR VIDOR 4000, Arduino UNO WiFi Rev.2, Nano 33 IoT, Nano RP2040 Connect

platformio/platformio.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ lib_ldf_mode = chain+
5454

5555
lib_deps =
5656
; PlatformIO 4.x
57-
; WiFiMulti_Generic@>=1.1.1
57+
; WiFiMulti_Generic@>=1.2.2
5858

5959
; PlatformIO 5.x
60-
khoih-prog/WiFiMulti_Generic@>=1.1.1
60+
khoih-prog/WiFiMulti_Generic@>=1.2.2
6161

6262
build_flags =
6363
; set your debug output (default=Serial)

src/WiFiClient_Generic.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
License along with this library; if not, write to the Free Software
2525
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2626
27-
Version: 1.8.14-5
27+
Version: 1.8.14-6
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -37,6 +37,7 @@
3737
1.8.14-3 K Hoang 31/12/2021 Fix issue with UDP for Nano_RP2040_Connect using arduino-pico core
3838
1.8.14-4 K Hoang 01/05/2022 Fix bugs by using some PRs from original WiFiNINA. Add WiFiMulti-related examples
3939
1.8.14-5 K Hoang 23/05/2022 Fix bug causing data lost when sending large files
40+
1.8.14-6 K Hoang 17/08/2022 Add support to Teensy 4.x using WiFiNINA AirLift. Fix minor bug
4041
***********************************************************************************************************************************/
4142

4243
#define _WIFININA_LOGLEVEL_ 1

src/WiFiClient_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
License along with this library; if not, write to the Free Software
2525
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2626
27-
Version: 1.8.14-5
27+
Version: 1.8.14-6
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -37,6 +37,7 @@
3737
1.8.14-3 K Hoang 31/12/2021 Fix issue with UDP for Nano_RP2040_Connect using arduino-pico core
3838
1.8.14-4 K Hoang 01/05/2022 Fix bugs by using some PRs from original WiFiNINA. Add WiFiMulti-related examples
3939
1.8.14-5 K Hoang 23/05/2022 Fix bug causing data lost when sending large files
40+
1.8.14-6 K Hoang 17/08/2022 Add support to Teensy 4.x using WiFiNINA AirLift. Fix minor bug
4041
***********************************************************************************************************************************/
4142

4243
#pragma once

src/WiFiNINA_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
License along with this library; if not, write to the Free Software
2525
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2626
27-
Version: 1.8.14-5
27+
Version: 1.8.14-6
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -37,6 +37,7 @@
3737
1.8.14-3 K Hoang 31/12/2021 Fix issue with UDP for Nano_RP2040_Connect using arduino-pico core
3838
1.8.14-4 K Hoang 01/05/2022 Fix bugs by using some PRs from original WiFiNINA. Add WiFiMulti-related examples
3939
1.8.14-5 K Hoang 23/05/2022 Fix bug causing data lost when sending large files
40+
1.8.14-6 K Hoang 17/08/2022 Add support to Teensy 4.x using WiFiNINA AirLift. Fix minor bug
4041
***********************************************************************************************************************************/
4142

4243
#pragma once

src/WiFiNINA_Pinout_Generic.h

+12-10
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
License along with this library; if not, write to the Free Software
2525
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2626
27-
Version: 1.8.14-5
27+
Version: 1.8.14-6
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -37,6 +37,7 @@
3737
1.8.14-3 K Hoang 31/12/2021 Fix issue with UDP for Nano_RP2040_Connect using arduino-pico core
3838
1.8.14-4 K Hoang 01/05/2022 Fix bugs by using some PRs from original WiFiNINA. Add WiFiMulti-related examples
3939
1.8.14-5 K Hoang 23/05/2022 Fix bug causing data lost when sending large files
40+
1.8.14-6 K Hoang 17/08/2022 Add support to Teensy 4.x using WiFiNINA AirLift. Fix minor bug
4041
***********************************************************************************************************************************/
4142

4243
#pragma once
@@ -367,16 +368,17 @@
367368

368369
#if defined(__IMXRT1062__)
369370
// For Teensy 4.0
370-
#warning You have to modify pin usage according to actual connection for Teensy 4.0
371+
#warning You have to modify pin usage according to actual connection for Teensy 4.0/4.1
371372
#define PINS_COUNT (60u)
372-
//NINA
373-
#define NINA_GPIO0 (6u) //6
374-
#define NINA_RESETN (2u)
375-
#define NINA_ACK (5u)
376-
377-
#define SPIWIFI_SS 10 //PIN_SPI1_SS //10
378-
#define SPIWIFI_ACK 5 //NINA_ACK //5
379-
#define SPIWIFI_RESET 2 //NINA_RESETN //7
373+
// T4.1 SPI pin defs for WiFiNINA AirLift.
374+
#define NINA_GPIO0 (255u) //6
375+
#define NINA_RESETN (6u)
376+
#define NINA_ACK (9u)
377+
378+
// T4.1 SPI pin defs for WiFiNINA AirLift.
379+
#define SPIWIFI_SS 5 //PIN_SPI1_SS //10
380+
#define SPIWIFI_ACK 9 //NINA_ACK //7
381+
#define SPIWIFI_RESET 6 //NINA_RESETN //5
380382

381383
#elif ( defined(__MKL26Z64__) || defined(ARDUINO_ARCH_AVR) )
382384

src/WiFiSSLClient_Generic.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
License along with this library; if not, write to the Free Software
2525
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2626
27-
Version: 1.8.14-5
27+
Version: 1.8.14-6
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -37,6 +37,7 @@
3737
1.8.14-3 K Hoang 31/12/2021 Fix issue with UDP for Nano_RP2040_Connect using arduino-pico core
3838
1.8.14-4 K Hoang 01/05/2022 Fix bugs by using some PRs from original WiFiNINA. Add WiFiMulti-related examples
3939
1.8.14-5 K Hoang 23/05/2022 Fix bug causing data lost when sending large files
40+
1.8.14-6 K Hoang 17/08/2022 Add support to Teensy 4.x using WiFiNINA AirLift. Fix minor bug
4041
***********************************************************************************************************************************/
4142

4243
#include "WiFiSSLClient_Generic.h"

src/WiFiSSLClient_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
License along with this library; if not, write to the Free Software
2525
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2626
27-
Version: 1.8.14-5
27+
Version: 1.8.14-6
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -37,6 +37,7 @@
3737
1.8.14-3 K Hoang 31/12/2021 Fix issue with UDP for Nano_RP2040_Connect using arduino-pico core
3838
1.8.14-4 K Hoang 01/05/2022 Fix bugs by using some PRs from original WiFiNINA. Add WiFiMulti-related examples
3939
1.8.14-5 K Hoang 23/05/2022 Fix bug causing data lost when sending large files
40+
1.8.14-6 K Hoang 17/08/2022 Add support to Teensy 4.x using WiFiNINA AirLift. Fix minor bug
4041
***********************************************************************************************************************************/
4142

4243
#pragma once

src/WiFiServer_Generic.cpp

+60-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
License along with this library; if not, write to the Free Software
2525
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2626
27-
Version: 1.8.14-5
27+
Version: 1.8.14-6
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -37,12 +37,13 @@
3737
1.8.14-3 K Hoang 31/12/2021 Fix issue with UDP for Nano_RP2040_Connect using arduino-pico core
3838
1.8.14-4 K Hoang 01/05/2022 Fix bugs by using some PRs from original WiFiNINA. Add WiFiMulti-related examples
3939
1.8.14-5 K Hoang 23/05/2022 Fix bug causing data lost when sending large files
40+
1.8.14-6 K Hoang 17/08/2022 Add support to Teensy 4.x using WiFiNINA AirLift. Fix minor bug
4041
***********************************************************************************************************************************/
4142

4243
#include <string.h>
4344
#include "utility/server_drv.h"
4445

45-
#define _WIFININA_LOGLEVEL_ 1
46+
#define _WIFININA_LOGLEVEL_ 3
4647

4748
extern "C"
4849
{
@@ -195,6 +196,8 @@ size_t WiFiServer::write(uint8_t b)
195196
return write(&b, 1);
196197
}
197198

199+
#if 1
200+
198201
size_t WiFiServer::write(const uint8_t *buffer, size_t size)
199202
{
200203
if (size == 0)
@@ -205,9 +208,26 @@ size_t WiFiServer::write(const uint8_t *buffer, size_t size)
205208

206209
size_t written = ServerDrv::sendData(_sock, buffer, size);
207210

211+
uint8_t timesResent = 0;
212+
213+
while ( (written != size) && (timesResent++ < 100) )
214+
{
215+
// Don't use too short delay so that NINA has some time to recover
216+
// The fix is considered as kludge, and the correct place to fix is in ServerDrv::sendData()
217+
delay(100);
218+
219+
written += ServerDrv::sendData(_sock, buffer + written, size - written);
220+
}
221+
222+
NN_LOGINFO1("WiFiServer::write: loopSend => written = ", written);
223+
NN_LOGINFO1("WiFiServer::write: loopSend => timesResent = ", timesResent);
224+
208225
if (!written)
209226
{
210227
setWriteError();
228+
229+
NN_LOGERROR("WiFiServer::write: !written error");
230+
211231
return 0;
212232
}
213233

@@ -217,5 +237,43 @@ size_t WiFiServer::write(const uint8_t *buffer, size_t size)
217237
return 0;
218238
}
219239

240+
if (written == size)
241+
{
242+
NN_LOGINFO1("WiFiServer::write: OK, written = ", written);
243+
}
244+
else
245+
{
246+
NN_LOGERROR3("WiFiServer::write: Not OK, size = ", size, ", written = ", written);
247+
}
248+
220249
return written;
221250
}
251+
252+
#else
253+
254+
size_t WiFiServer::write(const uint8_t *buffer, size_t size)
255+
{
256+
if (size == 0)
257+
{
258+
setWriteError();
259+
return 0;
260+
}
261+
262+
size_t written = ServerDrv::sendData(_sock, buffer, size);
263+
264+
if (!written)
265+
{
266+
setWriteError();
267+
return 0;
268+
}
269+
270+
if (!ServerDrv::checkDataSent(_sock))
271+
{
272+
setWriteError();
273+
return 0;
274+
}
275+
276+
return written;
277+
}
278+
279+
#endif

src/WiFiServer_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
License along with this library; if not, write to the Free Software
2525
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2626
27-
Version: 1.8.14-5
27+
Version: 1.8.14-6
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -37,6 +37,7 @@
3737
1.8.14-3 K Hoang 31/12/2021 Fix issue with UDP for Nano_RP2040_Connect using arduino-pico core
3838
1.8.14-4 K Hoang 01/05/2022 Fix bugs by using some PRs from original WiFiNINA. Add WiFiMulti-related examples
3939
1.8.14-5 K Hoang 23/05/2022 Fix bug causing data lost when sending large files
40+
1.8.14-6 K Hoang 17/08/2022 Add support to Teensy 4.x using WiFiNINA AirLift. Fix minor bug
4041
***********************************************************************************************************************************/
4142

4243
#pragma once

src/WiFiStorage_Generic.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
License along with this library; if not, write to the Free Software
2525
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2626
27-
Version: 1.8.14-5
27+
Version: 1.8.14-6
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -37,6 +37,7 @@
3737
1.8.14-3 K Hoang 31/12/2021 Fix issue with UDP for Nano_RP2040_Connect using arduino-pico core
3838
1.8.14-4 K Hoang 01/05/2022 Fix bugs by using some PRs from original WiFiNINA. Add WiFiMulti-related examples
3939
1.8.14-5 K Hoang 23/05/2022 Fix bug causing data lost when sending large files
40+
1.8.14-6 K Hoang 17/08/2022 Add support to Teensy 4.x using WiFiNINA AirLift. Fix minor bug
4041
***********************************************************************************************************************************/
4142

4243
#include "WiFiStorage_Generic.h"

src/WiFiStorage_Generic.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
License along with this library; if not, write to the Free Software
2525
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2626
27-
Version: 1.8.14-5
27+
Version: 1.8.14-6
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -37,6 +37,7 @@
3737
1.8.14-3 K Hoang 31/12/2021 Fix issue with UDP for Nano_RP2040_Connect using arduino-pico core
3838
1.8.14-4 K Hoang 01/05/2022 Fix bugs by using some PRs from original WiFiNINA. Add WiFiMulti-related examples
3939
1.8.14-5 K Hoang 23/05/2022 Fix bug causing data lost when sending large files
40+
1.8.14-6 K Hoang 17/08/2022 Add support to Teensy 4.x using WiFiNINA AirLift. Fix minor bug
4041
***********************************************************************************************************************************/
4142

4243
#pragma once
@@ -212,7 +213,7 @@ class WiFiStorageFile
212213
WiFiStorage.remove(filename);
213214
}
214215

215-
void flush();
216+
void flush() { };
216217

217218
void close()
218219
{

src/WiFiUdp_Generic.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
License along with this library; if not, write to the Free Software
2525
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2626
27-
Version: 1.8.14-5
27+
Version: 1.8.14-6
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -37,6 +37,7 @@
3737
1.8.14-3 K Hoang 31/12/2021 Fix issue with UDP for Nano_RP2040_Connect using arduino-pico core
3838
1.8.14-4 K Hoang 01/05/2022 Fix bugs by using some PRs from original WiFiNINA. Add WiFiMulti-related examples
3939
1.8.14-5 K Hoang 23/05/2022 Fix bug causing data lost when sending large files
40+
1.8.14-6 K Hoang 17/08/2022 Add support to Teensy 4.x using WiFiNINA AirLift. Fix minor bug
4041
***********************************************************************************************************************************/
4142

4243
#include <string.h>

src/WiFiUdp_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
License along with this library; if not, write to the Free Software
2525
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2626
27-
Version: 1.8.14-5
27+
Version: 1.8.14-6
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -37,6 +37,7 @@
3737
1.8.14-3 K Hoang 31/12/2021 Fix issue with UDP for Nano_RP2040_Connect using arduino-pico core
3838
1.8.14-4 K Hoang 01/05/2022 Fix bugs by using some PRs from original WiFiNINA. Add WiFiMulti-related examples
3939
1.8.14-5 K Hoang 23/05/2022 Fix bug causing data lost when sending large files
40+
1.8.14-6 K Hoang 17/08/2022 Add support to Teensy 4.x using WiFiNINA AirLift. Fix minor bug
4041
***********************************************************************************************************************************/
4142

4243
#pragma once

0 commit comments

Comments
 (0)