SerialESPPassthrough ESP32 Airlift doesn't echo

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
richardf
 
Posts: 44
Joined: Tue Feb 14, 2012 4:35 pm

SerialESPPassthrough ESP32 Airlift doesn't echo

Post by richardf »

I hook up my processor (Teensy) to Adafruit AirLift.

I can connect and interact with server.

My problem is SerialESPPassthrough doesn't echo back the data I send it from Serial1.
On startup, Teensy Serial1 receives text report from AirLift (e.g., rst:0x1 (POWERON_RESET),boot:0x12

yet, when I enter data to Teensy through Serial Monitor, the AirLift does not echo this data back.
I have tried on two systems so I know the wiring is correct and processors function.

Code: Select all

  #define SerialESP32   Serial1
  #define SPIWIFI       SPI  // The SPI port

// my wiring
  #define SPIWIFI_SS     10   // Chip select pin
  #define ESP32_RESETN   41   // Reset pin
  #define SPIWIFI_ACK    9   // a.k.a BUSY or READY pin
  #define ESP32_GPIO0   40
  
I have Serial 1 wired 
Teensy pin 0 (rx1) to TXO
Teensy pin 1 (tx1) to RXI

I receive chars entered from Serial Monitor and send them to the Airlift; however, outside of during boot, no chars come back from the AirLift.

void loop() {
// send data to AirLift
  while (Serial.available()) {
      char c = Serial.read();
      Serial.println(c);
     SerialESP32.write();
  }
  // get data from AirLift
  while (SerialESP32.available()) {  // BESIDES BOOT, NO DATA AVAILABLE
    Serial.write(SerialESP32.read());
  }
}
This indicates to me that the AirLift is not handling data on its RXI pin. Any suggestions?

thanks,
Richie

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: SerialESPPassthrough ESP32 Airlift doesn't echo

Post by mikeysklar »

Hi Richie,

Which model of the Airlift are you using with your Teensy? Is it the FeatherWing or Breakout board?

Can you post the full code and a photo of your setup?

User avatar
richardf
 
Posts: 44
Joined: Tue Feb 14, 2012 4:35 pm

Re: SerialESPPassthrough ESP32 Airlift doesn't echo

Post by richardf »

esp serial tester schematic.jpg
esp serial tester schematic.jpg (1009.9 KiB) Viewed 247 times
esp serial tester photo.jpg
esp serial tester photo.jpg (995.57 KiB) Viewed 247 times
On power-on reset esp sends. This indicates the Tx0 is functioning:
etsJul29201912:21:46 rst:0x1(POWERON_RESET),boot:0x2(D

Typing“abcd” reports:
Serial sent:a
Serial sent:b
Serial sent:c
Serial sent:d
Serial sent:<10>

Yet esp does not send any response. I have double checked each wire and have tried software
on two identical units so I am confident wiring is correct.
I can connect to internet and download/upload data to my web site database using these units.
I just can't get SerialESPPassthrough to work.

Source code running on Teensy 4.1 taken from SerialESPPassthrough.ino:
unsigned long baud = 115200;

#define SerialESP32 Serial1
#define SPIWIFI SPI // The SPI port
#define SPIWIFI_SS 10 // Chip select pin
#define ESP32_RESETN 41 // Reset pin
#define SPIWIFI_ACK 9 // a.k.a BUSY or READY pin
#define ESP32_GPIO0 39

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

delay(1000);
SerialESP32.begin(baud);

pinMode(SPIWIFI_SS, OUTPUT);
pinMode(ESP32_GPIO0, OUTPUT);
pinMode(ESP32_RESETN, OUTPUT);

// manually put the ESP32 in upload mode
digitalWrite(ESP32_GPIO0, LOW);

digitalWrite(ESP32_RESETN, LOW);
delay(100);
digitalWrite(ESP32_RESETN, HIGH);
delay(100);
}

void loop() {
char c;
while (Serial.available()) {
c = Serial.read();
SerialESP32.write(c);
if (c==10) Serial.printf("Serial sent:<10>\n");
else Serial.printf("Serial sent:%c\n",c);
}

while (SerialESP32.available()) {
c = SerialESP32.read();
Serial.println(c);
// Serial.printf("esp sent:%d = %c\n",SerialESP32.available(),c);
}
}

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: SerialESPPassthrough ESP32 Airlift doesn't echo

Post by mikeysklar »

I understand the issue.

The RXI and TX0 pins on the AirLift breakout are for uploading new firmware and using in bluetooth mode. These pins are to be left disconnected in WiFi mode.
RXI & TXO - Serial data in and Serial data out, used for bootloading new firmware, and for communication when in BLE mode. Leave disconnected if not using BLE or when not uploading new WiFi firmware to the AirLift (which is a rare occurrence).
https://learn.adafruit.com/adafruit-air ... ut/pinouts
Screen Shot 2021-11-29 at 2.45.57 PM.png
Screen Shot 2021-11-29 at 2.45.57 PM.png (378.02 KiB) Viewed 223 times

User avatar
richardf
 
Posts: 44
Joined: Tue Feb 14, 2012 4:35 pm

Re: SerialESPPassthrough ESP32 Airlift doesn't echo

Post by richardf »

thanks but your response makes no sense.
You are correct that in Wifi mode, the Serial TXo and Rxi have no effect.
My Wifi mode works fine without the Serial TXo and Rxi .

However, in order to program the device using SerialESPPassthrough, you MUST
use these serial lines as shown in the description.

RIchard

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: SerialESPPassthrough ESP32 Airlift doesn't echo

Post by mikeysklar »

I agree with you that RXi and TXo are used for updating the bootloader on the AirLift ESP32 breakout.

The guide suggests changing the pinouts to match your variant. Have you tried using the TEENSYDUINO pins?

Code: Select all

#elif defined(TEENSYDUINO)
  #define SerialESP32   Serial1
  #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
  #define NEOPIXEL_PIN   8
Are you actually trying to upgrade the nina-fw?

User avatar
richardf
 
Posts: 44
Joined: Tue Feb 14, 2012 4:35 pm

Re: SerialESPPassthrough ESP32 Airlift doesn't echo

Post by richardf »

My pins, as seen in my source code and schematic reflect the teensy pins. Trying to update certificate and maybe utilize Bluetooth. I know airlift transmits data to teensy across Serial1. Either teensy output on serial1 not received properly It is wired correctly. Or airlift not responding to teensy output as expected.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: SerialESPPassthrough ESP32 Airlift doesn't echo

Post by mikeysklar »

@richardf,

I see two options.

1) You can try the recommended pinouts we define for the Teensy 4.0/4.1. This was added to the code in August 2020.

https://github.com/adafruit/WiFiNINA/pull/4

2) You can try not using our library. This one has explicit support for the Airlift breakout and Teensy 4.1. It might help with certificate upload.

https://github.com/khoih-prog/WiFiNINA_Generic

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”