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

Airlift FeatherWing & Feather M0 basic proto issue
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Airlift FeatherWing & Feather M0 basic proto issue

by realabsurdity on Sat Sep 21, 2019 5:43 pm

I'm working with an Airlift FeatherWing attached to the Feather M0 basic proto. My Arduino sketch is essentially the same as the Adafruit IO Example: adafruitio_14_neopixel sketch except I'm using a 24 pixel ring instead of the default number of pixels in the sketch. It doesn't seem worth it to post my code, in fact, because I've used that exact sketch to test and the behavior is the same.

The problem is that when the Airlift is connected to the Feather M0 it only connects to WiFi about 10% of the time. I've tried it with and without my 24 neo pixel ring attached, different numbers of pixels initialized, with and without a lipo battery attached and the connectivity is spotty no matter what I do.

I've repeatedly gone back to the scanNetwork example sketch included with the WiFiNINA library and it behaves the exact same way. To eliminate some possibilities I attached the Airlift wing to my Feather 328p and ran the scanNetworks sketch and it worked great, and consistently. Obviously I can't switch to that board with Adafruit IO so I've been testing the WiFi on the Feather 328p and then switching back to the Feather M0 and occasionally it works on the M0 and always it works on the 328p. With the scanNetworks test it simply says "Communication with WiFi module failed!" suggesting a problem with the SPI communication on the M0. I even wrote a little sketch to test digital and analog write on pins 13, 12, and 11 in case they were not soldered well enough to the headers and could not see a problem with them. Every time I will plug it back into the 328p, it will connect and scans networks fine and less than half the time it will work again on the M0 when I switch it back.

So I'm totally stuck and need some advice. It seems to me that there is something wrong with the M0 board, or maybe the M0 and the Airlift are very close to peak power consumption so the WiFi is browning out. I just can't seem to track it down. All of the boards are less than a month old. I did also notice one other strange thing about the M0 in Arduino IDE. It has a tendency to replicate the COM port over and over again in the tools\port menu. I even attached a picture just because I've never seen that behavior before.

Any ideas from support about what might be causing these intermittent connectivity issues?

port-weirdness.png
port-weirdness.png (165.85 KiB) Viewed 223 times

realabsurdity
 
Posts: 10
Joined: Tue Jan 12, 2016 8:17 pm

Re: Airlift FeatherWing & Feather M0 basic proto issue

by realabsurdity on Sun Sep 22, 2019 4:40 pm

So I definitely think this is a faulty hardware issue with the Feather M0.

I remembered that I had a Feather HUZZAH in an older project and pulled it out to test my code. It worked perfectly, connecting to io.adafruit.com with little delay. I've since been able to tweak and update my code several times with no issues.

Would it be possible to request a hardware replacement on the Feather M0? I chose it for myself and a class I'm teaching for its more abundant GPIO (especially analogIn) pins.

Thanks!

realabsurdity
 
Posts: 10
Joined: Tue Jan 12, 2016 8:17 pm

Re: Airlift FeatherWing & Feather M0 basic proto issue

by H1ghS0c on Fri Jan 17, 2020 6:26 pm

I am having a similar issue. Using the Adafruit Feather M0 with RFM69 Packet Radio and the Adafruit AirLift FeatherWing - ESP32 WiFi Co-Processor, I cannot seem to connect to the AirLift board at all. The serial terminal continually prints "Communication with WiFi module failed!" I have followed the AirLift guide to set up the Feather M0 using the Arduino (not CircuitPython). I have installed the WiFiNINA library from https://github.com/adafruit/WiFiNINA/archive/master.zip. I uploaded the Scan Networks example sketch as shown in the screenshot. I have verified that the board selected in the IDE is the Adafruit Feather M0. The code compiles and uploads just fine as well. I made sure the following defines were used in the sketch:

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


With only the AirLift plugged in (AirLift sits directly on top of the M0 via headers (no wiring)). I used a logic analyzer to capture the SPI transfer with the chip select attached to pin 13 and took a screenshot of the first communications being sent to the AirLift (attached). The M0 seems to be sending a 0xC0 0x0A with no reply from the AirLift board. Any suggestions would be greatly appreciated.

As a side note, I plugged in the miniTFT feather wing by itself and successfully ran the example code with it.
Attachments
WiFiNINA ScanNetworks Screen.png
WiFiNINA ScanNetworks Screen.png (45.8 KiB) Viewed 113 times
Logic Analyzer Screenshot.png
Screenshot of the communications to the AirLift board via SPI with CS on pin 13
Logic Analyzer Screenshot.png (99.82 KiB) Viewed 113 times

H1ghS0c
 
Posts: 5
Joined: Tue Mar 31, 2009 4:34 pm

Re: Airlift FeatherWing & Feather M0 basic proto issue

by H1ghS0c on Sun Jan 19, 2020 3:26 pm

OK, after a little more testing I have found that the SPI clock is working at 4MHz instead of 8 like the AirLift tutorial states that it should be. I can see clearly in the library that it should be setting it to 8MHz (Arduino\libraries\WiFiNINA-master\src\utility\spi_drv.cpp Line 138). I am using the WiFiNINA library version=1.3.0. I also checked the compiler output to see what libraries are actually used:

Code: Select all | TOGGLE FULL SIZE
Using library SPI at version 1.0 in folder: C:\Users\Admin\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.5.9\libraries\SPI
Using library Adafruit_ZeroDMA at version 1.0.4 in folder: C:\Users\Admin\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.5.9\libraries\Adafruit_ZeroDMA
Using library WiFiNINA-master at version 1.3.0 in folder: C:\Users\Admin\Documents\Arduino\libraries\WiFiNINA-master


I cut out all of the extra stuff from the scan_networks sketch down to the bare minimum to simply test the connection as shown below and I cannot get any connection from the Feather M0 to the AirLift wing. I have also included another screenshot of the SPI bus during the status request. One screenshot shows the initial command and the other is a screenshot that is zoomed out to show additional data that is being sent from the AirLift after the command.

Code: Select all | TOGGLE FULL SIZE
#include <SPI.h>
#include <WiFiNINA.h>

#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

void setup() {
  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);
  }

}

void loop() {

}
Attachments
SPI Comm getStatus.png
SPI Comm getStatus.png (99.46 KiB) Viewed 103 times
SPI Comm status Command.png
SPI Comm status Command.png (102.33 KiB) Viewed 103 times

H1ghS0c
 
Posts: 5
Joined: Tue Mar 31, 2009 4:34 pm

Re: Airlift FeatherWing & Feather M0 basic proto issue

by adafruit_support_mike on Mon Jan 20, 2020 4:06 am

Feathers with a built-in packet radio module have that board's CS pin pulled low by default.

If you want to use any other SPI device, you have to set pin 8 (the radio module's CS pin) high before talking to the other SPI device, and low again before talking to the radio module.

adafruit_support_mike
 
Posts: 61442
Joined: Thu Feb 11, 2010 2:51 pm

Re: Airlift FeatherWing & Feather M0 basic proto issue

by H1ghS0c on Mon Jan 20, 2020 11:33 am

Thanks [adafruit_support_mike]. That worked perfectly. I put a digitalWrite in before and after the calls to the AirLift (example shown below) and I can see the local networks, MAC and the firmware version in the serial output.

Code: Select all | TOGGLE FULL SIZE
  digitalWrite(8, HIGH);
  int numSsid = WiFi.scanNetworks();
  digitalWrite(8, LOW);

H1ghS0c
 
Posts: 5
Joined: Tue Mar 31, 2009 4:34 pm

Re: Airlift FeatherWing & Feather M0 basic proto issue

by adafruit_support_mike on Tue Jan 21, 2020 1:31 am

Glad to hear that got things working. Happy hacking!

adafruit_support_mike
 
Posts: 61442
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.