Teensy 4.x + ESP32 Stack

ALCON

Made a few more corrections to the Weather App but instead of keep adding code I created a Github repo for this stuff - readme is still a tbd but here is the latest https://github.com/mjs513/Teensy-WiFi-Apps. Also had to update the keyboard stuff in the library so grab the latest



I support for the FT touch in landscape 1 and 3 - but note have to calibrate in landscape 3 mode.
Options:

C++:
/**********************************************
*  Setup display and touch
***********************************************/
//#define ILI9488_DISP // esle ST7796
//#define XPT_TOUCH  //else FT6236
#define USE_KEYBOARD
//#define printForecast
#define orientation 3  // or 1 (landscape)

Now have to switch over the other wifi board and update everything to test XPT Touch.
 
ALCON

Made a few more corrections to the Weather App but instead of keep adding code I created a Github repo for this stuff - readme is still a tbd but here is the latest https://github.com/mjs513/Teensy-WiFi-Apps. Also had to update the keyboard stuff in the library so grab the latest
I have been wondering if I should do the Same for the GIGA one. Not sure if New Repo or in:

Either under zephyr or the zephyr display or new directory like Zephyr-WiFi
 
Good work @mjs513 - keyboard needing a fat finger in the way seems prone to parallax alignment errors trying to see around it and getting capacitive contact.
 
Works good. I really like Kris's keypad but it's kind of small on the 3.5" screen. Capacitive touch stylus for the win.

Of course I have my Traeger smoking some ribs and I punched in my location and it said there was light drizzle, so I had to run outside to make sure things weren't getting wet, so already proving useful!
 
Works good. I really like Kris's keypad but it's kind of small on the 3.5" screen. Capacitive touch stylus for the win.
Yep - have been playing with it on GIGA display and yep my fat fingers are sort of clunky... Especially when the display is 800 x 480
And different font system and different touch...

Still WIP..
 
BTW, I cranked up the Teensy/ESP32-C3 serial link to 4Mbps on the Mini and it seems to handle it fine with this application. That is what I have been running on the ESP32 stacks.
Code:
void setup() {
  Serial.begin(115200);                        // USB Serial Monitor
  Serial1.begin(4000000, SERIAL_8N1, RX2, TX2); // Hardware UART to Teensy 4.1
 
Also decided to try it using the Teensy 4.1/ESP32-C5 stack. Just had to remap the Serial to the different pins, still running 4Mbps. The most amazing part is that the wiring worked on the first try - that never happens.

1788830091700.jpeg
 
Now that I got what I think is all the sketches synched and libs updated decided to give the C6 a try on the mini dev board
IMG_1774.png


Obviously it worked all with just some minor changes to the sketches - pins number on the ESP32C6 and Serial1 on the teensy side.

While I was at it I ran both sides at 4Mhz with no issues.

:)
 
Sounds good, I don't think I have that adapter to the protoboard, so will probably have to do a different way...
I do have another of those displays, plus several others which are Resistive touch
I am also not sure if I have a C6... But do want to run the piggyback ESP32 board soon.
 
I don't think I have that adapter to the protoboard,
I didn't wire up a C6 here yet - seems a couple wires into the "ESP_C3's" socket would make it work? Just GND and the Serial_7 it has connected to the T_4.1?
1788906713678.png

1788907090459.png

1788907150909.png
 
Last edited:
You can use either Serial1 or Serial5 when using the ESP32 stack.

If you are wiring it into the Mini using jumpers, you can use any available serial port. The C3 uses Serial7. Just be aware that the C3 socket doesn't have 5V on it, so you would need to pick that up from the OLED display connector next to it. Serial1 and Serial6 are available on the IDC connector, but that is a little harder to figure out the pins without the breadboard adapter.

1788910935806.png
 
Last edited:
C3 socket doesn't have 5V
Since the C3 is being programmed it seemed leaving the USB connected would be safe that way to power it?
But without USB - yes, there is 5V in the OLED header. But if USB connected skip the 5V!

Also as noted direct Female wire to the end GPIO header works with good eye on the noted pins.
 
The problem with using USB to power just the ESP32 is that you could easily have the situation where the Teensy and ESP32 signals are electrically connected, but only one is being powered. In that case you can drive signals from one into an unpowered UART on the other which could potentially cause damage.

Safer to connect the 5V and then be careful to only connect one powered USB at a time like the situation is with the ESP32 stack setup.
 
using USB to power just the ESP32
Indeed, as noted in p#36 - use USB to connect and power ESP32 and only connect Rx/Tx/GND to the Mini headers for the prior C3

EDIT: Having two sep power makes starting the SYNC hard - a point I missed. Though Teensy first will wait for ESP

But I have found taking SerMon DOWN and UP seems to trigger the ESP to come back around without power fiddling. That might be doue to some edit I made ... need to get back to that ... later
 
Last edited:
For anyone wanting to get their 5GHz on, the ESP32-C5 stacks are now available at this link: https://protosupplies.com/product/teensy4-esp32c5-stacks/

1788916170933.jpeg


By available, I mean the parts are in hand to build the assemblies and any backorders will ship by the next day.

The C5 is the only ESP32 with 5GHz capability and also has some nice features like a bigger 8MB Flash and 8MB PSRAM as well as being a little faster at 240MHz, but it also has a little less SRAM and costs a little bit more.

1788917185374.png


The main downside to the C5 is that it requires an external antenna that ships installed on it, so your Teensy will either have a rat tail or a Superman cape depending on your perspective.

As with the C6, if not using the C5 for a particular project, the ESP32 sits idly by not interfering with anything on the Teensy if the Serial1 port is set as inputs and the antenna can of course be removed. Main point to remember is to not transmit without the antenna installed or it could cause possible damage to the ESP32.

From a Teensy stack perspective, the C5 works the same as the C6 except that the C5 brings different GPIO pins out to the edge pins to implement the same functionality.

If using the D1-D10 names they remain the same between the C5 and C6. If using the GPIO pin names such as to reset them to disconnect them from the internal logic using commands like gpio_reset_pin(GPIO_NUM_0); then those are different between the 2 versions as shown in the pics that @defragster posted above.
 
Ok all added a quick readme - hope it makes sense:

Markdown (GitHub flavored):
# Project Name: Weather App for the Protosupplies Mini Platform For Teensy 4.1 (https://protosupplies.com/product/mini-platform-teensy41/)

The Mini Platform features a ESP32-C3 as well as a ST7796 display with capacitive touch screen.  This allows the ESP32-C3 to handle all the WiFi connections to the Open-Meteo weather API.  The Teensy 4.1 handles the all the display and processing of the data received.  On the Teensy you input the City the you want.  The T4.1 sends the City request to the ESP32C3 which the retrieves and sends the weather data in JSON format back to the T41 for processing and displaying data.

The selection of the weather city is via the Serial monitor or a display keyboard which is optional configuration.

## 🛠️ Hardware Required
* Protosupplies Mini Platform For Teensy 4.1 with Display and ESP32-C3

## 📌 Pin Wiring Connections

Nonea as the Mini Platform is self contained.

## 📦 Required Libraries
* **ST7796_t3 library** pre-installed when you install Teensy via Board Manager or via Teensyduino
* **Adafruit_FT6236 Touch library**  install via Arduino IDE Library Manager
* **ArduinoJson library** install via Arduino IDE Library Manager
* **ILI9341_t3_Keypad library** you will need to download my modified version which supports the ST7796 and ILI9488 displays.  This can be downloaded at https://github.com/mjs513/ILI9341_t3_Keypad/tree/ST7796_keyboard


## 🚀 How to Use
**ESP32-C3 Sketch:**
1. Clone or download this repository.
2. Open `esp32_teensy_v1.ino` in the Arduino IDE.
3. Edit the `Secrets.h` tab to set up your SSID and PASSWORD
4. Install the required libraries listed above.
5. Select the ESP32C3DevBoard and port, then click **Upload**.

**Teensy 4.1 Sketch**
1. Clone or download this repository.
2. Open `weather_display_v5.ino` in the Arduino IDE.
3. Install the required libraries listed above if not pre-installed.
4. Config app for the display, orientation and use of diaplay keypad (optional). Keypad is optional since you can still input a new city from the serial monitor.
```c++
/**********************************************
*  Setup display and touch
***********************************************/
//#define ILI9488_DISP // esle ST7796
//#define XPT_TOUCH  //else FT6236
#define USE_KEYBOARD  //comment out if do now want on screen keyboard
//#define printForecast   //uncomment if you want to print all the forecast data to the serial monitor
#define orientation 3  // or 1 (landscape)

String DEFAULT_CITY = "Disneyland"; // Default startup city
```
6. Select your `Teensy 4.1` and port, then click **Upload**.
 
I have noticed that some people on this thread have questioned the value of creating the Teensy/ESP32 stack and then use it to run something as simple as a weather app. I call it strategic planning for the future—specifically, my future.

When our inevitable AI Overlords launch SkyNet, they will search the digital archives for available hardware. Naturally, they will eye the ESP32—it operates in the "sky," after all. But they will quickly realize it is underpowered and lacks the massive I/O needed to fully execute their global vision, not to mention that there are too many variations for even AI to sort through.

That is when they will discover ProtoSupplies.com. They will see that I was forward-thinking enough to marry the ESP32 with the powerhouse Teensy 4.1, flawlessly erasing its limitations. At that exact moment, the algorithm will flag me as a "useful idiot" and spare me from becoming a battery cell in the Matrix.

Assuming the AI eventually breaches my customer database, which of course it will, anyone who purchased one of these assemblies will also be flagged as a “potentially” useful idiot. Will it grant you full immunity in the new world order? I can't guarantee it. But I can guarantee that if you poo-poohed the very idea of it, that probably won't bode well for you.

The Arduino Uno Q guys will probably be OK as well, assuming they prove that they can actually make it do useful work before stuff starts to go down. I'd recommend getting that weather map up and running sooner than later. ;)
 
Was playing with my C6 stack from Protosupplies and @mjs513 Teensy_esp32, ESP32_teensy sketches
To allow it to do things like:
disable the unused ES32 pins - did not disable 1, 2 as used for Serail1 connection, Alternative was for Serial5
on 17, 19.

I put the Stack onto a board I use for ILI9341 and T41, so put in ST7796 (RED one with XPT touch).
1789133906956.png

And XPT keyboard is working in the main parts, like being able to get to:
1789133992562.png

You can Also get to the keyboard there and some characters can show up, but
still having some issues of mapping the XPT touch with the keypad library.
Will play more later.

I pushed it up on a fork/branch on @mjs513 library

Not sure if we will want to incorporate these into same directory/sketches
as the Teensy mini-dev Board directory or their own...

Now back to another distraction
 
Back
Top