So it looks like I just had to wait long enough for the first super-long-concatenated serial print to make it and then it starts working normally.
I have restarted it a few times so it's not that issue where it hasn't fully reset yet from when it was last plugged into a USB.
Teensy code
Code:
#define ESPSERIAL Serial5
void setupEspSerial()
{
ESPSERIAL.begin(115200);
}
void setup()
{
setupEspSerial();
}
loop()
{
ESPSERIAL.print("esp");
delay(1000);
}
ESP01 code
Code:
// using library https://github.com/gilmaimon/ArduinoWebsockets
#include <ArduinoWebsockets.h>
#include <ESP8266WiFi.h>
using namespace websockets;
WebsocketsServer socketServer;
bool clientActive = false;
void connectToWiFi()
{
WiFi.begin("SSID", "PASS");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.println("Waiting for connection");
}
Serial.println("Connected!");
Serial.println("Starting socket server...");
socketServer.listen(80);
}
void clearSerial()
{
while (Serial.available())
{
Serial.read();
}
}
void setup()
{
Serial.begin(115200);
connectToWiFi();
}
void loop()
{
if (!clientActive)
{
auto client = socketServer.accept();
clientActive = true;
for (int i = 0; i < 1000; i++) // 1 second ESP to Web client connection poll
{
if (client.available())
{
auto msg = client.readBlocking();
if (msg.data().length() > 0)
{
Serial.print(msg.data());
}
if (Serial.available() > 0)
{
client.send(Serial.readString());
}
}
delay(1);
}
client.close();
clientActive = false;
}
delay(50);
}
Hmm I do have the connected junk in there

Sorry for this crappy schematic