We need to log all bidirectional communication between AuxCtrl and /dev/ttyS3 (GD32) without breaking timing.
# Check if socat is available
which socat
# Create virtual serial port pair and log everything
socat -d -d \
pty,raw,echo=0,link=/tmp/vserial \
open:/dev/ttyS3,b115200,raw,echo=0 \
2>&1 | tee /tmp/serial.log &
# Then modify AuxCtrl to use /tmp/vserial instead of /dev/ttyS3
# Or create symlink:
mv /dev/ttyS3 /dev/ttyS3.real
ln -s /tmp/vserial /dev/ttyS3Enable kernel UART debugging:
# Enable UART driver debug output
echo 8 > /proc/sys/kernel/printk
dmesg -w | grep -i 'uart\|ttyS3' > /tmp/uart_kernel.log &
# This will log kernel-level UART eventsSince we can't easily intercept the port, we can:
- Decompile AuxCtrl
- Find the open("/dev/ttyS3") call
- Patch it to open a different device
- Use our MITM on the patched version
Physical approach:
- Connect logic analyzer to UART TX/RX lines
- Capture at 115200 baud
- Tools: PulseView, sigrok
The AuxCtrl logs already show high-level protocol info:
# Monitor logs in real-time
tail -f /mnt/UDISK/log/AuxCtrl.temp &
# Trigger actions (press buttons, start cleaning, etc.)
# Correlate log entries with actionsGiven the constraints:
- No Python on device
- No socat (likely)
- strace breaks timing
- Complex PTY creation in Rust
Best option: Analyze AuxCtrl logs + GPIO monitoring
We already have:
- GPIO monitor showing reset pulses
- AuxCtrl logs showing sleep states, commands
- Understanding of packet format from reverse engineering
- TX (AuxCtrl → GD32) - We can capture with strace on write() briefly or our Rust test programs
- RX (GD32 → AuxCtrl) - Likely minimal or none (one-way protocol suspected)
- State tracking - AuxCtrl logs show "Sleep state", "lost count", etc.
-
Test if GD32 sends responses at all:
- Use our
simple_testprogram - Add read support to GD32Connection
- Try reading after each command
- Use our
-
Capture specific sequences:
- Boot sequence (already partially known)
- Return-to-dock (GPIO captured)
- Button presses
- Error conditions
-
Document protocol fully based on:
- Reverse engineering (already done)
- Log correlation
- GPIO timing
- Our test results
For this vacuum robot project, bidirectional logging may not be necessary because:
- Protocol appears to be primarily one-way (A33 → GD32)
- GD32 responses are reflected in GPIO state changes (gpio-39)
- AuxCtrl logs show high-level state ("Sleep state 0/1", "lost count", etc.)
- We've already reverse-engineered the packet format
Recommendation: Focus on understanding the GD32 wakeup mechanism and sleep state management rather than capturing every byte, since we already know the command format.