A minimalist, hardware-encrypted email client and terminal designed specifically for the M5Stack Cardputer ADV (ESP32-S3). This firmware transforms your handheld portable terminal into a standalone, secure communicator capable of sending and receiving emails over SSL/TLS without relying on a smartphone or cloud proxy.
- 🔒 Application-Level AES-128 Encryption: Your Wi-Fi passwords and Email App Passwords are never stored in plain text. They are encrypted using an onboard AES-128 block cipher before being written to the ESP32's Non-Volatile Storage (NVS). Even if the flash memory is physically dumped, your credentials remain secure.
- 📬 Bidirectional Communication (SMTP & IMAP): * Compose & Send: Draft multi-line emails and transmit them securely over SSL/TLS (Port 465/587).
- Inbox Reader: Fetch, read, and scroll through your last most recent email directly on the screen. (Due To Limitations with libarary and my ability to be bothered currently can only fetch 1 email)
- ⚡ Instant Provider Presets: Switch between Gmail, Outlook / Office365, Yahoo Mail, and Custom Server configurations with a single keystroke (
FN + P). - 🎨 Flicker-Free UI: Built using
M5Canvasmemory sprites for clean, instant frame pushes with zero screen tearing. Features a Gmail-inspired color palette with active visual field indicators. - 🔄 Multi-Firmware Compatible: Because it uses application-level encryption rather than system-wide eFuse flash locking, this firmware is 100% compatible with bootloaders like M5Launcher.
- M5Stack Cardputer ADV (ESP32-S3 Microcontroller with integrated mechanical keyboard and ST7789 display).
- Wi-Fi connection with Internet access (Note: Ensure your network does not block outgoing Port
465/587or incoming Port993).
Open the Arduino IDE, go to Tools > Manage Libraries..., and search for/install the following:
M5Cardputerby M5StackM5Unifiedby M5StackESP Mail Clientby Mobizt (Ensure you install all dependencies when prompted)
To avoid Sketch too big compilation errors caused by the heavy SSL/TLS and cryptography libraries, you must allocate sufficient Flash memory:
- Select Board: Tools > Board > esp32 > M5Cardputer (or ESP32S3 Dev Module).
- Select Partition Scheme: Tools > Partition Scheme > "8M with spiffs (3MB APP/1.5MB SPIFFS)" (or any scheme that provides at least 3MB APP space).
Before uploading the sketch, open sketch.ino and locate the encryption key array around Line 15. Change these 16 hexadecimal values to your own secret key:
// Change these 16 hex bytes to your own private random sequence!
const unsigned char AES_KEY[16] = {
0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6,
0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C
};
Connect your Cardputer via USB-C and click Upload.
Because modern email providers block standard passwords for third-party apps, you must use an App Password.
- Enable 2-Step Verification on your Google Account.
- Go to your Google App Passwords Page.
- Generate a new password for "Mail / Custom Device".
- Copy the 16-character code (remove any spaces).
- Boot up the device. It will start in the Configuration (Settings) view.
- Press
FN + Puntil your provider preset appears in the top right corner (e.g.,Preset: Gmail). This automatically configures your SMTP and IMAP servers and ports. - Use
TABto cycle through the input fields and enter:
- WiFi SSID & WiFi Pass
- My Name: (Your display name, e.g., Randell)
- My Email: (Your full email address)
- App Pass: (The 16-character code generated in Step A)
- Press
FN + Sto encrypt your credentials, save them to memory, sync the NTP atomic clock, and connect to Wi-Fi. Notice the status change toConnected!.
The interface is entirely keyboard-driven. Use these shortcuts to navigate the terminal efficiently:
| Shortcut | Action | Description |
|---|---|---|
OPT |
Cycle Views | Seamlessly switch between Compose |
DEL |
Backspace | Delete the character to the left of the cursor in the active field. |
| Shortcut | Action | Description |
|---|---|---|
TAB |
Next Field | Move typing focus down to the next configuration option. |
FN + P |
Provider Preset | Cycle auto-fill configurations: Gmail |
FN + S |
Save & Connect | Encrypt passwords, write to NVS, sync time via NTP, and connect to Wi-Fi. |
| Shortcut | Action | Description |
|---|---|---|
TAB |
Switch Field | Cycle focus between To:, Sub: (Subject), and Body. |
ENTER |
Next Field / New Line | Move to the next field (in To/Sub) or insert a line break (in Body). |
FN + ENTER |
SEND EMAIL | Transmit message over SSL/TLS and clear draft buffer upon success. |
| Shortcut | Action | Description |
|---|---|---|
FN + R |
Fetch Mail | Connect to IMAP server and download the 10 latest messages. |
TAB |
Next Message | Cycle through loaded emails ([1/10] through [10/10]). |
; (Semicolon) |
Scroll Up | Scroll the message body text up by one line. |
. (Period) |
Scroll Down | Scroll the message body text down by one line. |
-
IMAP Fail!orErr: LOGIN failed: -
Ensure you are using a 16-character App Password, not your regular login password.
-
Check that IMAP is enabled in your webmail settings (In Gmail: Settings > Forwarding and POP/IMAP > Enable IMAP).
-
Err: Certificateor Connection Rejections: -
SSL/TLS requires an accurate system clock. When you press
FN + S, give the device 3–5 seconds to synchronize withpool.ntp.orgbefore attempting to fetch or send email. -
Can send email, but Inbox refresh hangs:
-
Some strict corporate, university, or public Wi-Fi networks block incoming Port
993. Try connecting to a personal mobile hotspot or home Wi-Fi network.
This project is open-source and available under the MIT License.
Disclaimer: This tool is intended for educational and personal communication purposes. Always ensure your AES keys are kept private and never commit your unencrypted Wi-Fi or email passwords to public repositories.