Teensy serial to ESP for WiFi?

karl101

Member
Hello

I have a Teensy 4.1 doing things and I want to add a WiFi connection over serial so I can send data to a web server, I have a WeMos D1 Mini to do this.

Previously I have used small ESP-015 modules, but have run out.

So my question is, what do I need to load onto my WeMos D1 Mini to have it work as a wifi dongle on the serial port of a teensy?

On the Teensy I would be expecting to use
Code:
#include <WiFiEsp.h>
#include <WiFiEspUdp.h>

WiFiEspUDP Udp;
WiFiEspClient client;

void setup() {
  Serial.println("Connecting to WiFi on Serial3...");
  Serial3.begin(115200);
  while (!Serial3) {
    ;
  }
  delay(500);
  WiFi.init(&Serial3);
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present");
    digitalWrite(GRN_LED, HIGH);
    while (true);
  }
  delay(500);
}
... etc ...

Google keeps pointing to pages saying how to use the serial port on the ESP, or some fancy bridge system

Thanks
Karl
 
Here’s another approach: use Teensy 4.1’s wired Ethernet (may I suggest the QNEthernet library) and then plug that into a little wireless bridge configured for your network. You’ll need to get and assemble an Ethernet kit, however.

For the serial port approach, you could use SLIP (example library: SLIPStream) to relay either UDP packets or raw Ethernet frames, but that requires software on the ESP side to do that. Then, on the Teensy side, you could either process/send the UDP packets (I’ve done this approach for OSC control), or, if you’re relaying raw Ethernet frames, you could adapt a local IP stack (eg. lwIP) to process those. These are non-trivial things to do, however (the raw frames approach being the much harder one).

Other than that, maybe an Adafruit AirLift would do the job nicely. I haven’t looked closely, but maybe the software the powers that is downloadable and you could put it on your own ESP32 device. Communication is over SPI.
 
Back
Top