@wwatson
Was just going through that myself and just trying to fake it out but then getting other issues. Going to revert to what you did and give it a try.
SD opened!
NOT ANONYMOUS
esp8266
Command Old: 0 Transfer Old: 0 Data Old: 0
Command : 1 Transfer : 0 Data : 0
Ftp server waiting for connection on port 21
Command Old: 1 Transfer Old: 0 Data Old: 0
Command : 2 Transfer : 0 Data : 0
enum ftpCmd { FTP_Stop = 0, // In this stage, stop any connection
FTP_Init, // initialize some variables
FTP_Client, // wait for client connection
FTP_User, // wait for user name
FTP_Pass, // wait for user password
FTP_Cmd }; // answers to commands
The WiFiNINA Library is still buggy and is slowed to accept good PRs.
I don't have the same hardware to test, but think FTPServer has issue with current version of WiFiNINA.
Check Using WIFI-NINA with FtpServer; no accept() and PR added server.accept() #204
Try using @JAndrassy forked WiFiNINA at WiFiNINA with server_accept with the updated NINA_W102.zip in post #31
SD opened!
>>>>>>>>>>>>>>> _callback 0 1 1
CONNECTED
>>>>>>>>>>>>>>> _callback 1 1 1
DISCONNECTED
>>>>>>>>>>>>>>> _callback 0 1 1
CONNECTED
>>>>>>>>>>>>>>> _callback 1 1 1
DISCONNECTED
>>>>>>>>>>>>>>> _callback 0 1 1
CONNECTED
WiFiNINA firmware check.
Firmware version installed: 1.2.2
Latest firmware version available : 1.2.1
Check result: PASSED
The WiFiNINA Library is still buggy and is slowed to accept good PRs.
I don't have the same hardware to test, but think FTPServer has issue with current version of WiFiNINA.
Check Using WIFI-NINA with FtpServer; no accept() and PR added server.accept() #204
Try using @JAndrassy forked WiFiNINA at WiFiNINA with server_accept with the updated NINA_W102.zip in post #31
#elif ( defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE) || defined(ADAFRUIT_PYBADGE_AIRLIFT_M4) )
#warning ADAFRUIT_METRO_M4_AIRLIFT_LITE or ADAFRUIT_PYBADGE_AIRLIFT_M4 are OK to use
#elif ( defined(ADAFRUIT_MATRIXPORTAL_M4_EXPRESS) )
#warning You have to modify pin usage according to actual connection for SAMD51 ADAFRUIT_MATRIXPORTAL_M4_EXPRESS
// To define pin out for WiFiNINA here
//#define PINS_COUNT (60u)
//NINA
#define NINA_GPIO0 ESP32_GPIO0
#define NINA_RESETN ESP32_RESETN
#define NINA_ACK SPIWIFI_ACK
#define SPIWIFI_SS 33
#define SPIWIFI_ACK 31
#define SPIWIFI_RESET ESP32_RESETN
I ran out of time this weekend to do anymore with this. I checked the version of NINA on the Adafruit Airlift FeatherWIng I have. It is version 1.2.2. I also have an Adafruit ESP32 WROOM that I loaded up with NINA firmware from Adafruit. So far it won't connect to the T4.1. I am not sure if the pinouts on both boards are the same. Next chance I get I will load it up with NINA_W102 and try to get it to work.
Thanks for the info
@mjs513 - Beat me to it
Just pushed up a branch (accept) that adds that function to the adafruit library if interested: https://github.com/mjs513/WiFiNINA/tree/accept
Just pushed up a branch (accept) that adds that function to the adafruit library if interested: https://github.com/mjs513/WiFiNINA/tree/accept
### Releases v1.8.14-4
1. Fix bugs by using some unmerged PRs from original WiFiNINA, such as:
- [WiFi.config - setting defaults as the Ethernet library #219](https://github.com/arduino-libraries/WiFiNINA/pull/219)
- [Fix WiFiClient watchdog usage #211](https://github.com/arduino-libraries/WiFiNINA/pull/211)
- [Watchdog trigger changes #208](https://github.com/arduino-libraries/WiFiNINA/pull/208)
- [added server.accept() #204](https://github.com/arduino-libraries/WiFiNINA/pull/204)
- [Fix PinStatus error on some platforms #185](https://github.com/arduino-libraries/WiFiNINA/pull/185)
2. Add many WiFiMulti-related examples in [WiFiMulti](https://github.com/khoih-prog/WiFiNINA_Generic/tree/master/examples/WiFiMulti)
3. Update examples
4. Update `Packages' Patches`
wwatson,
You certainly have gotten farther than I have. I will make the changes you made and see what effect that has on my project and let you know the results.
Thanks for helping out with this project. I've been stuck at this point for over 6 months. - I'm an idiot!
just to be clear. no official firmware build has support for server.accept(). My PR from January is not merged yet in the Arduino/nina-fw repository. The change in WiFiNINA library will not work without new firmware build with accept() support for the AirLift
I updated the firmware from Arduino IDE with the Nina firmware updater from the Tools menu (with some existing fw version replaced with the patched version).
esptool.py over the SerialNINAPassthrough sketch in the main MCU worked too.
NinaSerial has to be the Serial interface wired to the esp32 Serial0 pins.
NINA_GPIO0 has to be the pin wired to io 0 of the esp32 and
NINA_RESETN should be the pin number of the pin wired to esp32 reset.
other option is not use other MCU and the sketch, but to use a 'FTDI' and put the esp32 into flashing mode manually (io 0 low at reset)
https://forum.arduino.cc/t/ublox-nina-minimum-pins/576351/2
Sorry was distracted trying different options so the only option that hasn't been tried is what you just suggested, acutally 2, try different processor and use a FTDI and put it in manually. As Kurt mentioned just doesn't talk through the T4. But now off to do a few other things not computer related.
/* USB to Serial - Teensy becomes a USB to Serial converter
http://dorkbotpdx.org/blog/paul/teensy_as_benito_at_57600_baud
You must select Serial from the "Tools > USB Type" menu
This example code is in the public domain.
*/
// set this to the hardware serial port you wish to use
#define HWSERIAL Serial1
unsigned long baud = 115200;
const int reset_pin = 2;
const int led_pin = 13;
const int ESP32_BUSY_PIN = 5; // a.k.a BUSY or READY pin
const int ESP32_GPIO0_pin = 6;
const int ESP32_CS_PIN = 10;
void setup()
{
pinMode(led_pin, OUTPUT);
digitalWrite(led_pin, LOW);
pinMode(ESP32_CS_PIN, OUTPUT);
digitalWrite(ESP32_CS_PIN, LOW);
pinMode(reset_pin, OUTPUT);
digitalWrite(reset_pin, HIGH);
pinMode(ESP32_GPIO0_pin, INPUT_PULLDOWN);
digitalWrite(ESP32_GPIO0_pin, HIGH);
pinMode(ESP32_BUSY_PIN, INPUT_PULLDOWN);
while(!Serial && millis() < 3000) ; // wait for serial port.
// Serial.begin(baud); // USB, communication to PC or Mac
HWSERIAL.begin(baud); // communication to hardware serial
// See if we can get into some form of bootloader. Let see if dual button like:
EchoSerToUSB(0);
//digitalWrite(ESP32_GPIO0_pin, LOW);
//delay(250);
//EchoSerToUSB(1);
digitalWrite(reset_pin, LOW);
delay(250);
EchoSerToUSB(2);
digitalWrite(reset_pin, HIGH);
delay(250);
digitalWrite(reset_pin, LOW);
delay(250);
EchoSerToUSB(2);
digitalWrite(reset_pin, HIGH);
delay(250);
EchoSerToUSB(3);
//digitalWrite(ESP32_GPIO0_pin, HIGH);
}
long led_on_time=0;
byte buffer[512];
unsigned char prev_dtr = 0;
void loop()
{
unsigned char dtr;
int rd, wr, n;
// check if any data has arrived on the USB virtual serial port
rd = Serial.available();
if (rd > 0) {
// check if the hardware serial port is ready to transmit
wr = HWSERIAL.availableForWrite();
if (wr > 0) {
// compute how much data to move, the smallest
// of rd, wr and the buffer size
if (rd > wr) rd = wr;
if (rd > sizeof(buffer)) rd = sizeof(buffer);
// read data from the USB port
n = Serial.readBytes((char *)buffer, rd);
// write it to the hardware serial port
HWSERIAL.write(buffer, n);
// turn on the LED to indicate activity
digitalWrite(led_pin, HIGH);
led_on_time = millis();
}
}
// check if any data has arrived on the hardware serial port
rd = HWSERIAL.available();
if (rd > 0) {
// check if the USB virtual serial port is ready to transmit
wr = Serial.availableForWrite();
if (wr > 0) {
// compute how much data to move, the smallest
// of rd, wr and the buffer size
if (rd > wr) rd = wr;
if (rd > sizeof(buffer)) rd = sizeof(buffer);
// read data from the hardware serial port
n = HWSERIAL.readBytes((char *)buffer, rd);
// write it to the USB port
Serial.write(buffer, n);
// turn on the LED to indicate activity
digitalWrite(led_pin, HIGH);
led_on_time = millis();
}
}
#if 0
// check if the USB virtual serial port has raised DTR
dtr = Serial.dtr();
if (dtr && !prev_dtr) {
digitalWrite(reset_pin, LOW);
delayMicroseconds(250);
digitalWrite(reset_pin, HIGH);
}
prev_dtr = dtr;
#endif
// if the LED has been left on without more activity, turn it off
if (millis() - led_on_time > 3) {
digitalWrite(led_pin, LOW);
}
// check if the USB virtual serial wants a new baud rate
if (Serial.baud() != baud) {
baud = Serial.baud();
if (baud == 57600) {
// This ugly hack is necessary for talking
// to the arduino bootloader, which actually
// communicates at 58824 baud (+2.1% error).
// Teensyduino will configure the UART for
// the closest baud rate, which is 57143
// baud (-0.8% error). Serial communication
// can tolerate about 2.5% error, so the
// combined error is too large. Simply
// setting the baud rate to the same as
// arduino's actual baud rate works.
HWSERIAL.begin(58824);
} else {
HWSERIAL.begin(baud);
}
}
}
void EchoSerToUSB(uint8_t trace_num) {
int rd, wr, n;
// check if any data has arrived on the hardware serial port
rd = HWSERIAL.available();
if (rd > 0) {
Serial.printf("@@%u %d\n", trace_num, rd);
// check if the USB virtual serial port is ready to transmit
wr = Serial.availableForWrite();
if (wr > 0) {
// compute how much data to move, the smallest
// of rd, wr and the buffer size
if (rd > wr) rd = wr;
if (rd > sizeof(buffer)) rd = sizeof(buffer);
// read data from the hardware serial port
n = HWSERIAL.readBytes((char *)buffer, rd);
// write it to the USB port
Serial.write(buffer, n);
// turn on the LED to indicate activity
digitalWrite(led_pin, HIGH);
led_on_time = millis();
}
}
}
@@2 63
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x12 (@@3 63
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x12
C:\Users\kurte>esptool.py --port COM61 --before no_reset --baud 115200 write_flash 0 downloads\NINA_W102-1.7.4.bin
esptool.py v3.3
Serial port COM61
WARNING: Pre-connection option "no_reset" was selected. Connection may fail if the chip is not in bootloader or flasher stub mode.
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: a4:cf:12:61:95:60
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x0011afff...
Compressed 1159168 bytes to 633594...
Wrote 1159168 bytes (633594 compressed) at 0x00000000 in 56.4 seconds (effective 164.3 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Start WiFiNINA CheckFirmwareVersion on TEENSY 4.1/4.0
WiFiNINA_Generic v1.8.14-4
Firmware version installed: 1.7.4
Latest firmware version available : 1.4.8
Check result: PASSED