Stabilized logging to SD Card, disciplined time, and web fetch & erase

This commit is contained in:
John Poole 2026-04-06 11:38:06 -07:00
commit e28ebe5b17
15 changed files with 1536 additions and 510 deletions

View file

@ -92,3 +92,71 @@ shared board pin headers in one place:
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