Appearance
Remote Development Environment
Leave the boards and cables at the office and take the Mac home. The next firmware build need not move the whole bench: compilation can happen elsewhere, while the debug front-end machine keeps control of USB and serial. A phone can join for check-ins, but flashing commands still run on the host physically connected to the board.
This is the setup I use. Addresses, ports and versions describe this environment, not universal defaults. These services belong on the WireGuard network, not on public-facing ports.
Move the developer, not the board
Each node peers with the cloud; cloud-side ip_forward relays traffic between nodes. Adding a device changes only that device and the cloud, not every existing machine.
| Task | Route | Entry point |
|---|---|---|
| Shell and file transfers | Local adb client → debug front-end machine's adb server | adb -H 10.8.0.6 shell |
| MCU logs and console | ser2net raw TCP | socket://10.8.0.6:400x |
| Flash an image | Transfer the artifact, then execute over SSH | rsync + ssh |
| Open the board web UI | Run adb forward on the debug front-end machine | http://<front-end IP>:18080 |
ADB uses its standard client/server split; the board-side adbd is unchanged. Local adb shell on the debug front-end machine and remote adb -H share one server. Concurrent log reads are fine; transferring files while someone reboots the board is not. Keep client and server versions close; both were 28.0.2 in the original setup.
Where does each step of a remote flash run?
First identify the machine. The build server vms and debug front-end machine vmt both have the hostname olicca-vm, so the terminal prompt is not enough. Use the WireGuard IP and machine inventory. The debug front-end machine is 10.8.0.6, referred to below as the front-end IP.
bash
ping -c 2 10.8.0.6
ssh olicca@10.8.0.6 'echo OK'
adb -H 10.8.0.6 devicesOnce connected, build and transfer locally, then lock and flash on the resource host. The recorded link had about 130ms RTT, so I did not map flashing USB back to the client. This was not a usbip performance test.
The flash command depends on the platform; it is not interchangeable between boards. The board lock is also a local utility, not a system command. If board-lock <board-id> <owner> <task> fails, it reports the owner. Check board-status rather than stealing the lock, then use board-unlock <board-id> when finished.
Directories under /tmp/boards/*.lock/ record owner, task and timestamp and are cleared on host reboot. This coordinates cooperating users; it does not replace checking whether a flash process is still running.
Why not RFC2217 for serial?
With ser2net 4.3.4, an abnormal disconnect left TCP connections accepted but no negotiation bytes sent. Raw TCP stayed stable through 15 rapid connect/disconnect cycles. It cannot change baud rates from the client, which is acceptable for these fixed-rate ports. This finding is limited to that version and test.
| Port | Serial connection | Baud rate |
|---|---|---|
| 4000 | S100P MCU-COM | 921600 |
| 4001 | S100P Main-COM | 921600 |
| 4002 | RV1126B AP (Linux) | 1500000 |
| 4003 | RV1126B MCU (RT-Thread) | 1500000 |
python
import serial
s = serial.serial_for_url("socket://10.8.0.6:4002", timeout=2)It worked yesterday. What should you check first?
Do not start by restarting every service. Network reachability, an active service and USB enumeration are different facts. Check them in order to avoid interrupting someone else.
| Symptom | Check first | Cause or remedy in this setup |
|---|---|---|
ping fails | Local WireGuard and cloud handshake | Restore the network before touching the board |
| Ping works, SSH fails | Address, key and SSH service | Repair passwordless SSH configuration |
| Empty adb device list | Board power and USB passthrough on the debug front-end machine | Ask for an on-site check, not a blind adb restart |
CH340 connected but no /dev/ttyUSB0 | Kernel log mentions of brltty | Remove the grabbing service on the development host, then reconnect |
| ser2net active, port not listening | Was serial enumerated at startup? | USB appeared after service startup; restart recovered it, then a udev rule was added |
| adb-server stuck activating | Port 5037 owner | An old adb -a nodaemon was still running; identify and stop it |
| Remote adb breaks after an update | Both adb versions | Align versions and reconnect |
Mac adb -H ... forward reports more than one | Whether this matches the recorded adb 1.0.41 case | -s failed there; run forward locally on vmt instead |
Appendix — onboarding, direct connections and session sync
Give each device a stable identity
machines.tsv stores IDs, IPs and roles, with the authoritative copy in cloud-side /srv/mesh/. The local mesh-whoami utility identifies a host by its WireGuard IP. Recorded addresses end in .1 for cloud, .4 for the build server, .6 for the debug front-end machine, .10 for Mac and .100 for phone, all in 10.8.0.0/24. The build server's hypervisor is .2 and is usually offline.
When onboarding an iPhone in September 2026, I generated keys and client configuration, added its public-key peer to cloud-side wg0.conf, and hot-loaded with wg syncconf. The phone imported a PNG QR code. Keep private-key configurations at mode 0600 and out of git. Register the device after confirming handshake and ping; terminal ASCII QR codes had been clipped.
Use direct connections when the board comes home
With the board attached locally, use adb devices on the Mac. CH340/341 names under /dev/cu.wchusbserial* can change on USB re-enumeration; baud rate and prompt are more reliable identifiers.
| Board / console | Baud rate | Identifier |
|---|---|---|
| RV1126B AP | 1500000 | root@ATK-DLRV1126B-MCU720:/# |
| RV1126B MCU | 1500000 | msh /> |
| S100P AP | 921600 | ubuntu login: |
| S100P MCU | 921600 | No shell, boot log only |
Recorded S100P fastboot entry: send one Ctrl+C(0x03) every roughly 100ms on the AP serial port to interrupt zero-delay autoboot. At Hobot$, enter fastboot 0. Sending every 10ms flooded the U-Boot input buffer instead.
Synced files do not make a board safe for concurrent writes
Shared tasks reach the build server through syncthing. A watcher runs a runbook for fixed procedures or starts an Agent when judgment is needed, then writes back done/failed. Sessions use one folder per project, with the same folder_id and different local paths. projects.tsv records those mappings; cloud-side ignoreDelete retains the archive.
The cloud also hosts session browsing on 8080, a task center on 8090 and a 09:30 daily-report job for use inside WireGuard; nginx separately serves the public site and toolchain downloads. These are conveniences, not prerequisites for remote serial or ADB. A full build-server disk once suspended every sync folder, so check free space when sync stalls.