Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Problems with AirLift BitsyWing
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Problems with AirLift BitsyWing

by adafruitguy on Mon Jul 27, 2020 5:49 pm

I am unable to get two AirLift BitsyWings working with either a ItsyBitsy nRF52840 or ItsyBitsy M0.

Running....
Arduino 1.8.13, with Adafruit WiFiNINA


IMG_6687.jpeg
side by side
IMG_6687.jpeg (227.08 KiB) Viewed 80 times


IMG_6686.jpeg
IMG_6686.jpeg (194.78 KiB) Viewed 78 times


I have tried the adafruit scan network example...

Code: Select all | TOGGLE FULL SIZE
/*

 This example  prints the board's MAC address, and
 scans for available Wifi networks using the NINA module.
 Every ten seconds, it scans again. It doesn't actually
 connect to any network, so no encryption scheme is specified.

 Circuit:
 * Board with NINA firmware on it (In this case its an Adafruit AirLift)

 created 13 July 2010
 by dlf (Metodo2 srl)
 modified 21 Junn 2012
 by Tom Igoe and Jaymes Dec
 */


#include <SPI.h>
#include <WiFiNINA.h>

// Configure the pins used for the ESP32 connection
#if defined(ADAFRUIT_FEATHER_M4_EXPRESS) || \
  defined(ADAFRUIT_FEATHER_M0_EXPRESS) || \
  defined(ARDUINO_AVR_FEATHER32U4) || \
  defined(ARDUINO_NRF52840_FEATHER) || \
  defined(ADAFRUIT_ITSYBITSY_M0_EXPRESS) || \
  defined(ADAFRUIT_ITSYBITSY_M4_EXPRESS) || \
  defined(ARDUINO_AVR_ITSYBITSY32U4_3V)
  // Configure the pins used for the ESP32 connection
  #define SPIWIFI       SPI  // The SPI port
  #define SPIWIFI_SS    13   // Chip select pin
  #define ESP32_RESETN  12   // Reset pin
  #define SPIWIFI_ACK   11   // a.k.a BUSY or READY pin
  #define ESP32_GPIO0   -1
#elif defined(ARDUINO_AVR_FEATHER328P)
  #define SPIWIFI       SPI  // The SPI port
  #define SPIWIFI_SS     4   // Chip select pin
  #define ESP32_RESETN   3   // Reset pin
  #define SPIWIFI_ACK    2   // a.k.a BUSY or READY pin
  #define ESP32_GPIO0   -1
#elif defined(TEENSYDUINO)
  #define SPIWIFI       SPI  // The SPI port
  #define SPIWIFI_SS     5   // Chip select pin
  #define ESP32_RESETN   6   // Reset pin
  #define SPIWIFI_ACK    9   // a.k.a BUSY or READY pin
  #define ESP32_GPIO0   -1
#elif defined(ARDUINO_NRF52832_FEATHER )
  #define SPIWIFI       SPI  // The SPI port
  #define SPIWIFI_SS    16   // Chip select pin
  #define ESP32_RESETN  15   // Reset pin
  #define SPIWIFI_ACK    7   // a.k.a BUSY or READY pin
  #define ESP32_GPIO0   -1
#elif !defined(SPIWIFI_SS)   // if the wifi definition isnt in the board variant
  // Don't change the names of these #define's! they match the variant ones
  #define SPIWIFI       SPI
  #define SPIWIFI_SS    10   // Chip select pin
  #define SPIWIFI_ACK    7   // a.k.a BUSY or READY pin
  #define ESP32_RESETN   5   // Reset pin
  #define ESP32_GPIO0   -1   // Not connected
#endif


void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  Serial.println("WiFi Scanning test");

  // Set up the pins!
  WiFi.setPins(SPIWIFI_SS, SPIWIFI_ACK, ESP32_RESETN, ESP32_GPIO0, &SPIWIFI);

  // check for the WiFi module:
  while (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    delay(1000);
  }
  String fv = WiFi.firmwareVersion();
  Serial.println(fv);
  if (fv < "1.0.0") {
    Serial.println("Please upgrade the firmware");
    while (1) delay(10);
  }
  Serial.println("Firmware OK");

  // print your MAC address:
  byte mac[6];
  WiFi.macAddress(mac);
  Serial.print("MAC: ");
  printMacAddress(mac);
}

void loop() {
  // scan for existing networks:
  Serial.println("Scanning available networks...");
  listNetworks();
  delay(10000);
}

void listNetworks() {
  // scan for nearby networks:
  Serial.println("** Scan Networks **");
  int numSsid = WiFi.scanNetworks();
  if (numSsid == -1) {
    Serial.println("Couldn't get a wifi connection");
    while (true);
  }

  // print the list of networks seen:
  Serial.print("number of available networks:");
  Serial.println(numSsid);

  // print the network number and name for each network found:
  for (int thisNet = 0; thisNet < numSsid; thisNet++) {
    Serial.print(thisNet);
    Serial.print(") ");
    Serial.print(WiFi.SSID(thisNet));
    Serial.print("\tSignal: ");
    Serial.print(WiFi.RSSI(thisNet));
    Serial.print(" dBm");
    Serial.print("\tEncryption: ");
    printEncryptionType(WiFi.encryptionType(thisNet));
  }
}

void printEncryptionType(int thisType) {
  // read the encryption type and print out the name:
  switch (thisType) {
    case ENC_TYPE_WEP:
      Serial.println("WEP");
      break;
    case ENC_TYPE_TKIP:
      Serial.println("WPA");
      break;
    case ENC_TYPE_CCMP:
      Serial.println("WPA2");
      break;
    case ENC_TYPE_NONE:
      Serial.println("None");
      break;
    case ENC_TYPE_AUTO:
      Serial.println("Auto");
      break;
    case ENC_TYPE_UNKNOWN:
    default:
      Serial.println("Unknown");
      break;
  }
}


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


and I get...

17:29:12.349 -> WiFi Scanning test
17:33:02.351 -> Communication with WiFi module failed!
17:33:02.532 -> Communication with WiFi module failed!
17:33:05.381 -> Communication with WiFi module failed!
17:33:06.407 -> Communication with WiFi module failed!
17:39:06.751 -> WiFi Scanning test
17:39:22.573 -> Communication with WiFi module failed!


On both the M0 and the nRF52840 Itsy BitsyWing with either of the Airlifts

as well as the checkfirmwareversion sketch...

Code: Select all | TOGGLE FULL SIZE
/*
 * This example check if the firmware loaded on the NINA module
 * is updated.
 *
 * Circuit:
 * - Board with NINA module (Arduino MKR WiFi 1010, MKR VIDOR 4000 and UNO WiFi Rev.2)
 *
 * Created 17 October 2018 by Riccardo Rosario Rizzo
 * This code is in the public domain.
 */
#include <SPI.h>
#include <WiFiNINA.h>

void setup() {
  // Initialize serial
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // Print a welcome message
  Serial.println("WiFiNINA firmware check.");
  Serial.println();

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

  // Print firmware version on the module
  String fv = WiFi.firmwareVersion();
  String latestFv;
  Serial.print("Firmware version installed: ");
  Serial.println(fv);

  latestFv = WIFI_FIRMWARE_LATEST_VERSION;

  // Print required firmware version
  Serial.print("Latest firmware version available : ");
  Serial.println(latestFv);

  // Check if the latest version is installed
  Serial.println();
  if (fv >= latestFv) {
    Serial.println("Check result: PASSED");
  } else {
    Serial.println("Check result: NOT PASSED");
    Serial.println(" - The firmware version on the module do not match the");
    Serial.println("   version required by the library, you may experience");
    Serial.println("   issues or failures.");
  }
}

void loop() {
  // do nothing
}


which produces no results....

17:46:10.819 -> WiFiNINA firmware check.
17:46:10.819 ->

adafruitguy
 
Posts: 92
Joined: Sat Jun 07, 2014 7:52 am

Re: Problems with AirLift BitsyWing

by adafruit_support_carter on Mon Jul 27, 2020 6:06 pm

Make sure you are using the Adafruit version of the WiFiNINA library:
https://learn.adafruit.com/adafruit-air ... or/arduino

The example from that library includes the necessary pin assignments:
https://github.com/adafruit/WiFiNINA/bl ... tworks.ino

adafruit_support_carter
 
Posts: 16919
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problems with AirLift BitsyWing

by adafruitguy on Mon Jul 27, 2020 6:23 pm

I manually deleted the Arduino WiFiNINA, restarted and manually installed the Adafruit WiFiNINA before submitting my issue.

Is there a way to confirm its using the correct WiFiNINA?

adafruitguy
 
Posts: 92
Joined: Sat Jun 07, 2014 7:52 am

Re: Problems with AirLift BitsyWing

by adafruit_support_carter on Mon Jul 27, 2020 6:28 pm

If you open the example via the Arduino IDE, via the menu navigation shown here:
https://learn.adafruit.com/adafruit-air ... -3038712-6
does it have the #defines for the pins as shown in the Adafruit repo example linked above?

adafruit_support_carter
 
Posts: 16919
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problems with AirLift BitsyWing

by adafruitguy on Mon Jul 27, 2020 7:57 pm

You bet, they are there in my original post sketch.

I've manually removed WiFiNINA, re-downloaded the Adafruit WiFiNINA, and reinstalled.

~ % cd Documents/Arduino/libraries/

libraries % ls -lg | grep WiFiNINA
drwxr-xr-x@ 9 staff 288 Feb 5 09:53 WiFiNINA

WiFiNINA % ls -gl
total 32
-rw-r--r--@ 1 staff 1071 Feb 5 09:53 CHANGELOG
-rw-r--r--@ 1 staff 1556 Feb 5 09:53 README.adoc
drwxr-xr-x@ 19 staff 608 Feb 5 09:53 examples
-rw-r--r--@ 1 staff 1188 Feb 5 09:53 keywords.txt
-rw-r--r--@ 1 staff 600 Feb 5 09:53 library.properties
drwxr-xr-x@ 14 staff 448 Feb 5 09:53 src

No luck.

The reason I asked about identifying it, was since the way it's sporked it looked like WiFiNINA 1.4.0...

Screen Shot 2020-07-27 at 7.24.12 PM.png
Screen Shot 2020-07-27 at 7.24.12 PM.png (383.69 KiB) Viewed 69 times

adafruitguy
 
Posts: 92
Joined: Sat Jun 07, 2014 7:52 am

Re: Problems with AirLift BitsyWing

by adafruitguy on Mon Jul 27, 2020 8:09 pm

CircuitPython can see the AirLift just fine...

Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit ItsyBitsy nRF52840 Express with nRF52840


code.py...

Code: Select all | TOGGLE FULL SIZE
import board
import busio
from digitalio import DigitalInOut

from adafruit_esp32spi import adafruit_esp32spi

print("ESP32 SPI hardware test")

esp32_cs = DigitalInOut(board.D13)
esp32_reset = DigitalInOut(board.D12)
esp32_ready = DigitalInOut(board.D11)

spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)

if esp.status == adafruit_esp32spi.WL_IDLE_STATUS:
    print("ESP32 found and in idle mode")
print("Firmware vers.", esp.firmware_version)
print("MAC addr:", [hex(i) for i in esp.MAC_address])

for ap in esp.scan_networks():
    print("\t%s\t\tRSSI: %d" % (str(ap['ssid'], 'utf-8'), ap['rssi']))

print("Done!")


Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
ESP32 SPI hardware test
ESP32 found and in idle mode
Firmware vers. bytearray(b'1.2.2\x00')
MAC addr: ['0x10', '0xf7', '0x85', '0x12', '0xcf', '0xa4']
NetTest RSSI: -44
Zone RSSI: -46
NetTest RSSI: -52
Zone RSSI: -52
NetTest RSSI: -84
Zone RSSI: -84
NetTest RSSI: -87
Zone RSSI: -87
Done!



Press any key to enter the REPL. Use CTRL-D to reload.

adafruitguy
 
Posts: 92
Joined: Sat Jun 07, 2014 7:52 am

Re: Problems with AirLift BitsyWing

by adafruit_support_carter on Mon Jul 27, 2020 8:23 pm

I'm not seeing the #defines for the pins in the sketch you included above. Specifically, lines 21-60:
https://github.com/adafruit/WiFiNINA/bl ... no#L21-L60

adafruit_support_carter
 
Posts: 16919
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problems with AirLift BitsyWing

by adafruitguy on Mon Jul 27, 2020 8:37 pm

I agree, it's not in the "check firmware example". I guess that example isn't updated in this library.

But it looks all there in the scan network example that I posted above, right?

Screen Shot 2020-07-27 at 8.25.31 PM.jpeg
Screen Shot 2020-07-27 at 8.25.31 PM.jpeg (143.67 KiB) Viewed 62 times

adafruitguy
 
Posts: 92
Joined: Sat Jun 07, 2014 7:52 am

Re: Problems with AirLift BitsyWing

by adafruitguy on Mon Jul 27, 2020 9:12 pm

When I comment out all the "if defined" logic from the Adafruit library "ScanNetworks" example sketch and explicitly define the ItsyBitsy M0 and ItsyBitsy nRF52840 pins...

Code: Select all | TOGGLE FULL SIZE
  #define SPIWIFI       SPI  // The SPI port
  #define SPIWIFI_SS     13   // Chip select pin
  #define ESP32_RESETN   12   // Reset pin
  #define SPIWIFI_ACK    11   // a.k.a BUSY or READY pin
  #define ESP32_GPIO0   -1 


Things are now working...

21:01:00.160 -> WiFi Scanning test
21:01:00.935 -> 1.2.2
21:01:00.935 -> Firmware OK
21:01:00.935 -> MAC: A4:CF:12:85:F7:10
21:01:00.935 -> Scanning available networks...
21:01:00.935 -> ** Scan Networks **
21:01:03.163 -> WiFi Scanning test
21:01:03.943 -> 1.2.2
21:01:03.943 -> Firmware OK
21:01:03.943 -> MAC: A4:CF:12:85:F7:10
21:01:03.943 -> Scanning available networks...
21:01:03.943 -> ** Scan Networks **
21:01:08.604 -> number of available networks:8
21:01:08.604 -> 0) NetTest Signal: -51 dBm Encryption: WPA2
21:01:08.604 -> 1) Zone Signal: -51 dBm Encryption: WPA2
21:01:08.604 -> 2) Zone Signal: -55 dBm Encryption: WPA2
21:01:08.604 -> 3) NetTest Signal: -56 dBm Encryption: WPA2
21:01:08.604 -> 4) NetTest Signal: -78 dBm Encryption: WPA2
21:01:08.604 -> 5) Zone Signal: -78 dBm Encryption: WPA2
21:01:08.604 -> 6) Zone Signal: -81 dBm Encryption: WPA2
21:01:08.604 -> 7) NetTest Signal: -81 dBm Encryption: WPA2

adafruitguy
 
Posts: 92
Joined: Sat Jun 07, 2014 7:52 am

Re: Problems with AirLift BitsyWing

by adafruitguy on Tue Jul 28, 2020 6:49 am

@adafruit_support_carter you are saying that I need to explicitly declare my board, before the #if statement, correct?

Code: Select all | TOGGLE FULL SIZE
#define ADAFRUIT_ITSYBITSY_M0_EXPRESS


This declaration isn't modeled in the example sketch. And, for some crazy reason I thought it was looking at my board selection in the Arduino IDE.

Got it now. Thank you!

adafruitguy
 
Posts: 92
Joined: Sat Jun 07, 2014 7:52 am

Re: Problems with AirLift BitsyWing

by adafruit_support_carter on Tue Jul 28, 2020 10:58 am

Ack! Sorry, OK, now I'm seeing.

I think there's an issue with the #defines. The Itsy NRF52840 is missing and the Itsy M0 is wrong.
[EDIT] to be clear - i think this is an issue on our side

Try running this sketch to verify. It simply prints the pins the actually get #define'd. Run this for both the M0 and the NRF52840 and see what you get:
Code: Select all | TOGGLE FULL SIZE
#include <SPI.h>
#include <WiFiNINA.h>

// Configure the pins used for the ESP32 connection
#if defined(ADAFRUIT_FEATHER_M4_EXPRESS) || \
  defined(ADAFRUIT_FEATHER_M0_EXPRESS) || \
  defined(ARDUINO_AVR_FEATHER32U4) || \
  defined(ARDUINO_NRF52840_FEATHER) || \
  defined(ADAFRUIT_ITSYBITSY_M0_EXPRESS) || \
  defined(ADAFRUIT_ITSYBITSY_M4_EXPRESS) || \
  defined(ARDUINO_AVR_ITSYBITSY32U4_3V)
  // Configure the pins used for the ESP32 connection
  #define SPIWIFI       SPI  // The SPI port
  #define SPIWIFI_SS    13   // Chip select pin
  #define ESP32_RESETN  12   // Reset pin
  #define SPIWIFI_ACK   11   // a.k.a BUSY or READY pin
  #define ESP32_GPIO0   -1
#elif defined(ARDUINO_AVR_FEATHER328P)
  #define SPIWIFI       SPI  // The SPI port
  #define SPIWIFI_SS     4   // Chip select pin
  #define ESP32_RESETN   3   // Reset pin
  #define SPIWIFI_ACK    2   // a.k.a BUSY or READY pin
  #define ESP32_GPIO0   -1
#elif defined(TEENSYDUINO)
  #define SPIWIFI       SPI  // The SPI port
  #define SPIWIFI_SS     5   // Chip select pin
  #define ESP32_RESETN   6   // Reset pin
  #define SPIWIFI_ACK    9   // a.k.a BUSY or READY pin
  #define ESP32_GPIO0   -1
#elif defined(ARDUINO_NRF52832_FEATHER )
  #define SPIWIFI       SPI  // The SPI port
  #define SPIWIFI_SS    16   // Chip select pin
  #define ESP32_RESETN  15   // Reset pin
  #define SPIWIFI_ACK    7   // a.k.a BUSY or READY pin
  #define ESP32_GPIO0   -1
#elif !defined(SPIWIFI_SS)   // if the wifi definition isnt in the board variant
  // Don't change the names of these #define's! they match the variant ones
  #define SPIWIFI       SPI
  #define SPIWIFI_SS    10   // Chip select pin
  #define SPIWIFI_ACK    7   // a.k.a BUSY or READY pin
  #define ESP32_RESETN   5   // Reset pin
  #define ESP32_GPIO0   -1   // Not connected
#endif


void setup() {
  Serial.begin(9600);
  while (!Serial);

  Serial.println("WiFi Scanning test");

  Serial.print("SPIWIFI_SS = "); Serial.println(SPIWIFI_SS);
  Serial.print("ESP32_RESETN = "); Serial.println(ESP32_RESETN);
  Serial.print("SPIWIFI_ACK = "); Serial.println(SPIWIFI_ACK);
  Serial.print("ESP32_GPIO0 = "); Serial.println(ESP32_GPIO0);
}

void loop() {
}

adafruit_support_carter
 
Posts: 16919
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problems with AirLift BitsyWing

by adafruitguy on Tue Jul 28, 2020 12:09 pm

Looks like they are both defaulting to the 'else if not defined'...

Code: Select all | TOGGLE FULL SIZE
#elif !defined(SPIWIFI_SS)   // if the wifi definition isnt in the board variant


ItsyBitsy nRF52840

11:35:27.768 -> WiFi Scanning test
11:35:27.768 -> SPIWIFI_SS = 10
11:35:27.768 -> ESP32_RESETN = 5
11:35:27.768 -> SPIWIFI_ACK = 7
11:35:27.768 -> ESP32_GPIO0 = -1


ItsyBitsy M0

11:37:07.508 -> WiFi Scanning test
11:37:07.508 -> SPIWIFI_SS = 10
11:37:07.508 -> ESP32_RESETN = 5
11:37:07.508 -> SPIWIFI_ACK = 7
11:37:07.508 -> ESP32_GPIO0 = -1

adafruitguy
 
Posts: 92
Joined: Sat Jun 07, 2014 7:52 am

Re: Problems with AirLift BitsyWing

by adafruit_support_carter on Tue Jul 28, 2020 12:12 pm

Thanks. I'm seeing the same thing.

Looks like issues are turned off for that repo. I'll pass this on internally.

adafruit_support_carter
 
Posts: 16919
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problems with AirLift BitsyWing

by adafruitguy on Tue Jul 28, 2020 2:56 pm

Thank you.

adafruitguy
 
Posts: 92
Joined: Sat Jun 07, 2014 7:52 am

Re: Problems with AirLift BitsyWing

by brubell on Wed Jul 29, 2020 11:51 am

Hi adafruitguy,

I've made the related changes over on this pull request (https://github.com/adafruit/WiFiNINA/pull/6) and tested against hardware. Could you try the code included in the pull request?

brubell
 
Posts: 1043
Joined: Fri Jul 17, 2015 10:33 pm

Please be positive and constructive with your questions and comments.