I have a MM Main Double board, with Teensy Processor, ZED-F9P GNSS Function board (in F0 slot) and ESP32-WROOM Function Board (in F1).
After studying all the schematics and pin-out it seems there is no Serial (Tx/Rx) channel to the ESP32. The ZED-F9P is working fine via Teensy Serial (Serial0) but AFAIK there is no way to communicate with the ESP32, i.e. there is no Serial1 or Serial2 from Teensy to ESP32.
On the off chance that the docs might be wrong, I tried to connect to ESP32 using Serial, then then Serial1 and then Serial 2. None would respond to “AT+GMR” command.
It seems there is no Serial path fron teensy to ESP32. That would make it impossible to use. Is this correct ?
I need to be proven wrong !
With some good help on the Teensy Forum I’ve manged to resolve this puzzle. This may be useful for others, so here’s what I found:
The numbering and labelling is all a bit of a nightmare but below is my detailed summary for the serial connection path to a Sparkfun ESP32-WROOM-32 board in F1 slot in Micromod land.
Curiously even though the serial path originates from [AD_B1_07/AD_B1_06] on the Teensy MMod processor (which normally maps to Serial4 on a standard T4.1) it is on Serial2 on the Micromod Teensy!
General Config
MMod Main Double Board with:
Processor: T4.1
F0: ZED-F9P GNSS (on Serial1)
F1: ESP32-WROOM-32 WiFi/Bluetooth (on Serial2)
Connections T4.1 ↔ ESP32
MMod Teensy 4.1 pins: K10/J12 (RX1/16/A2,TX1/17/A3) [AD_B1_07/AD_B1_06] Serial2 to
MMod on processor pins: 20/22 (RX1/16/A2,TX1/17/A3) [RX2/TX2] to
MMod Main Double pins: 20/22 (RX2-PROCESSOR,TX2-PROCESSOR) [RX2/TX2] to
MMod for F1 pins: 13/15 (RX2-PROCESSOR,TX2-PROCESSOR) [TX/RX] to
MMod on ESP32 pins: 13/15 (17/TX,16/RX) to
ESP32-WROOM-32 pins: 28/27 (17/TX,16/RX) [IO17/IO16]
References:
MMod Standard pins: 20/22 (UART_RX2/UART_RT2)
Standard T4.1 pins: 16/17 (A2/A3) [AD_B1_07/AD_B1_06] RX4/TX4 = Serial4
And I just proved this all with this Sketch:
// use Serial1 for ESP8285 onb T4.1 dev board
// use Serial2 for ESP32 on Micromod board in F1 slot
#include <Streaming.h>
void setup() {
while (!Serial && millis() < 1000);
Serial << "\n\n============= ESP32_test =============\n";
Serial << " * Open Serial2 to Micromod ESP32 ...\n";
Serial2.begin(115200); // ESP8285 + ESP32
while (!Serial2 && millis() < 1000);
Serial << " * Check ESP comms:\n\n";
delay(500);
Serial2.println("AT+GMR"); // NB: SerialX << "AT+GMR\n"; doesn't work
if(recFind("OK", 5000)){ // scan for "OK" from Serial 2, up to 5 secs
Serial << "\n\n * Success\n";
}
else {
Serial << "\n\n *** FAILED ***\n";
}
Serial2.flush();
delay(1000);
Serial << "---------- done ----------\n";
}
void loop() {}
// Search serial RX buffer for the text provided. Fails if not
// found before expiry of timeout period. Returns true if found.
bool recFind(String target, uint32_t timeout){
String rdBuff = "";
unsigned long startMillis = millis();
while (millis() - startMillis < timeout){
while (Serial2.available() > 0){
char rdChar = Serial2.read();
rdBuff += rdChar;
Serial.write(rdChar);
if (rdBuff.indexOf(target) != -1) {break;}
}
if (rdBuff.indexOf(target) != -1) {break; }
}
if (rdBuff.indexOf(target) != -1){return true; }
else {return false;}
}