How to communicate with MicroMod WiFi Function Board - ESP32?

Ahah, very helpful to know that loading a sketch overwites the firmware, thanks. That explains why the ESP32 responded to “AT+GMR” request a few weeks back, before I uploaded a sketch. I even posted my success on this forum. If you look at My previous post you’ll see the sketch I used at the time, via Serial2. But that sketch doesn’t work now.

Thanks also for confirming the port from ESP32 to teensy is Serial2. I wonder what Serial1 is?

Perhaps if explain what I’m trying to achieve … I’ve got the ZED-F9P in F0 slot working well, and I’ve connected to it using u-center, which has an in-built “NTRIP Client” that I have feeding RTCM3 correction data from a government service provider to the ZED-F9P GNSS through the USB-C port, and I regularly get RTK lock and very high accuracy. So that’s all working great good.

But I will be using the GNSS on a bike=, so no PC available. My plan is to run an NTRIP Client on my mobile and feed RTCM3 data by Bluetooth to the ESP32 in F1 on the Micromod assembly.

My initial plan (Option A) was to echo all data received on bluetooth to the teensy (over Serial2) and then have the Teensy echo it on to the ZED-F9P via Serial1 on the teensy.

But after using u-center’s client I’ve realised I may be able to simply connect the ESP32 USB-C to the ZED-F9P USB-C and have the RTCM3 data sent by that path (Option B) .
I did try this today but I haven’t succeeded yet (due to other problems with the Lefebure NTRIP Client App on my mobile).

Meanwhile I also tried you’re two sketches, running one on ESP32 and one on the teensy processor, but i still get no responses. Your sketches are similar in principle to sketches I have been using to echo bluetooth Serial between to the USB-C on ESP32, and vice versa.
I’ve attached that sketch below. You’ll see it also tries to send data to the teensy (via OUTPort).
The echo to USB-C works, but to OUTport doesn’t. I wonder why? Even if I get OPTION B working I would still like to get ESP32 comms to teensy working.

Lastly, if I need to reflash the ESP32 with the original firmware, how would I do that?

thanks in advance…

/* from Random Nerd Tutorial: https://randomnerdtutorials.com/esp32-bluetooth-classic-arduino-ide/ 

Run on the MicroMod ESP32-WROOM-32 module, as follows:
  - Compile for 'ESP32 Dev Module' 
  - Upload via the USB-C port on the ESP32
  - press Reset (or Boot) during dots (.....) to complete flashing

Echos commands received on Bluetooth Serial to the USB-C Serial port (Serial), and 
vice versa, and to Micromod teensy processor (Serial1/2 ? )

*/

#include <Streaming.h>

#include "BluetoothSerial.h"

#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig`
#endif

BluetoothSerial BT;

#define OUTport Serial2             // ESP32 port to MM Teensy processor  

void setup() {
  Serial.begin(115200); 
  while (!Serial && millis() < 1000);
  Serial << "\n\n====== ESP32_echo_BT.D ======\n";
  Serial << " * Opening OUTport: ";
  OUTport.begin(115200); 
  while (!OUTport && millis() < 1000);
  if (OUTport)  Serial << "OK\n";
  else          Serial << "** BAD **\n"; 
  Serial << " * Initialise BT on 'ESP32_MM': ";
  BT.begin("ESP32_MM");                                               //Bluetooth device name
  if (BT) Serial << "OK\n";
  else   {Serial << "FAILED ** program HALTED **\n"; while(true){}; }
  Serial << "\t--- setup done ---\n";
  }

void loop() {
// Echo data from  ESP32 Serial Monitor (USB_C) to Bluetooth Serial, and teensy
  if (Serial.available())  {
    char c = Serial.read();
    BT.write(c); 
    OUTport.write(c);             // also copy to teensy 
    }
// Echo data from to Bluetooth Serial to ESP32 Serial Monitor (USB_C), and teensy
  if ( BT.available()) {
    char b = BT.read(); 
    Serial.write(b); 
    OUTport.write(b);             // also copy to teensy
    }
  //delay(20);
  }