## Buttons
There are three buttons
![T-Beam SUPREME](../img/20260212_182225_Thu.png)

![](../img/20260212_182300_Thu.png)

Listed in order from Antenna to USB port:
1) RESET
2) POWER
3) BOOT
  ![](../img/20260212_184521_Thu.png) 

## RESET
The RESET button only needs to be depressed for less than 1 second.  Doing so will cause the unit to reboot.  If you have a "screen" monitor on the USB device, it will be disconnected.  A good way to capture boot posting messages from within the unit is to have your command in a console ready to execute by depressing the RETURN key and you depress RETURN immediately after you depress the unit's RESET button, possibly allowing 1/2 second to allow kernel to recognize the new USB device, i.e. /dev/ttyACM0
## POWER
If your unit is powered OFF, simply depress the POWER button will start the unit.  If the unit is powered ON, then depressing the POWER button and holding it down for 6 second will cause the unit to power down.  The OLED display will go dark when the unit has successfully been powered down.

## BOOT
A) TODO: what happens when unit is powered ON and you depress BOOT?
B) TODO: what happens when unit is powered OFF and you depress BOOT?
C) To upload new binary image: depress the BOOT button and hold down, then while holding down the BOOT button disconnect the USB line and then reconnect the USB line and then lift up on the BOOT button.  This sequence will cause the unit to await an upload of an image over USB to be stored in its FLASH memory.  You can place the unit in this mode and then several minutes later perform the upload from your console, the unit will duly await an upload session.  See further how to flash a new image in the section "Flashing Binary".  Note: although the uploader may state it is trying to reset after successful installation of the new image, it seems that software attempt does not work and you have to manually depress the unit's RESET button to force a RESET.  Remember, if you want to see the boot's posting, you should have your terminal ready to run "screen" so you capture the initial postings after you click RESET.
# Button Protocol For Uploading New Image
Pushing BOOT when the unit is currently running will not do anything.  You have to shut the unit down first.  So:
1) Depress POWER button for 6 seconds
2) Depress BOOT button and while depressed, click RESET button
3) Lift up BOOT button
The unit is now waiting for the serial console so commence an upload.  You are not time restricted, so you can go through the above 3 steps and then 5 minutes later proceed with an upload in the command console.

# Exercises
These are progressve tests you can run to confirm how to access the unit's functionality and validate your workbench.  Each exercise has it's own README.md

Exercise 00: 00_usb_radio_check

Exercise 01: ASCII ping-pong over LoRa (serial only).  Using two units, each sends a message to the other and you monitor both units through two screen consoles.

Exercise 02: Add OLED display

Exercise 03: Add SD logging

Exercise 04: Replace ASCII payload with microR packets

Exercise 05: SD provisioning with identity.bin, peer list, beacon

Exercise 06: RTC check (PCF8563) read/set and persistence validation

Exercise 07: SD startup watcher library harness with hot-insert detection

Exercise 08: SystemStartup package scaffold (shared begin/update API)

Each exercise is self-contained:

  its own platformio.ini
  its own src/main.cpp
  its own README.md with exact commands

To clean:

	pio run -t clean

Nuclear option:

     rm -rf .pio

Rebuild:

     pio run -e node_a

     pio run -e node_b

## Upload existing firmware (will not recompile if unchanged)
### Upload node A (set your port)
pio run -e node_a -t upload --upload-port /dev/ttyACM0

### Upload node B
pio run -e node_b -t upload --upload-port /dev/ttyACM1

To monitor both:

	screen /dev/ttyACM0 115200
	screen /dev/ttyACM1 115200

Attach antennas (transmitting without antenna will cause power feedback and likely destroy your circuits)
Keep boards at least ~30 cm apart so you don’t desense the receivers.

shared board pin headers in one place: 
  shared/
    boards/
      tbeam-s3-core_pins.h

# Features
## SD Card
You can read and write to SD cards that are FAT formatted.  (Can they be Linux formatted?)
## Real Time Clock ("RTC")
## Microphone


# Creating Automatic Recognition by udev

## Find the unique ID.  
This assumes that your device is being assigned to ACM0 when you connect it with your workstation.

jlpoole@jp ~ $ udevadm info -a -n /dev/ttyACM0 | nl| grep serial
    67      ATTRS{product}=="USB JTAG/serial debug unit"
    72      ATTRS{serial}=="48:CA:43:5A:8C:74"
   282      ATTRS{serial}=="0000:00:1a.7"
jlpoole@jp ~ $ 

The 6 token value delimited by colons is the unique ID.

## Adding a UDEV rule
Create a udev rule modeled after the ones below:

    /etc/udev/rules.d/99-ttyt-tbeam.rules

Sample content for devices that will be named AMY-GUY

# 99-ttyt-tbeam.rules
# LilyGO T-Beam SUPREME (ESP32-S3 USB JTAG/serial debug unit)
# Create stable symlinks: /dev/ttytAMY, /dev/ttytBOB, ...

SUBSYSTEM=="tty", ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", ATTRS{serial}=="48:CA:43:5B:BF:68", MODE:="0660", GROUP:="dialout",SYMLINK+="ttytAMY"
SUBSYSTEM=="tty", ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", ATTRS{serial}=="48:CA:43:5A:93:DC", MODE:="0660", GROUP:="dialout",SYMLINK+="ttytBOB"
SUBSYSTEM=="tty", ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", ATTRS{serial}=="48:CA:43:5A:91:44", MODE:="0660", GROUP:="dialout",SYMLINK+="ttytCY"
SUBSYSTEM=="tty", ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", ATTRS{serial}=="48:CA:43:5A:93:A0", MODE:="0660", GROUP:="dialout",SYMLINK+="ttytDAN"
SUBSYSTEM=="tty", ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", ATTRS{serial}=="48:CA:43:5A:90:D0", MODE:="0660", GROUP:="dialout",SYMLINK+="ttytED"

Then:

    sudo udevadm control --reload-rules
    sudo udevadm trigger --subsystem-match=tty

Sanity check command when a device is plugged in:

     udevadm info -a -n /dev/ttyACM0 | less

## Example Walk-through
Here's a complete walk-thru

jlpoole@jp ~ $ date; udevadm info -a -n /dev/ttyACM0 | nl| grep serial
Fri Apr  3 10:54:25 PDT 2026
    67      ATTRS{product}=="USB JTAG/serial debug unit"
    72      ATTRS{serial}=="48:CA:43:5A:40:E0"
   282      ATTRS{serial}=="0000:00:1a.7"
jlpoole@jp ~ $ # GUY=48:CA:43:5A:40:E0
jlpoole@jp ~ $ sudo nano /etc/udev/rules.d/99-ttyt-tbeam.rules 
jlpoole@jp ~ $      sudo udevadm control --reload-rules
jlpoole@jp ~ $     sudo udevadm trigger --subsystem-match=tty
jlpoole@jp ~ $ ls /dev/ttyt*
/dev/ttytGUY
jlpoole@jp ~ $ 





Xtras:
To customize your system so when the unit is attached, it will have the same name, e.g. /dev/ttytBOB:

You'll need the id, use this when the unit is plugged in:
     pio device list |grep -A3


