o
odinpkg.dev
packages / library / playdate-nettest

playdate-nettest

f67e1f2library

No description provided.

No license · updated 3 months ago

Playdate WiFi RTT Test

Measures round-trip TCP latency from a Playdate to a server. Displays per-frame RTT on screen. Used to validate networking viability for real-time multiplayer on Playdate hardware.

What it does

Connects to a TCP echo server, sends 8-byte ping packets (timestamp + last RTT), measures round-trip time. Displays RTT in milliseconds on the Playdate screen.

Results

On local WiFi (2014-era router, moderate interference):

  • Min: 32ms
  • Avg: 46ms
  • Typical: 32-33ms (75% of samples)

RTT clusters at 33ms intervals due to the Playdate's frame-quantized TCP polling at 30fps. Actual network latency is under 10ms — the 33ms floor is the polling interval.

Setup

Prerequisites

brew install odin arm-none-eabi-gcc python3

Download the Playdate SDK and set PLAYDATE_SDK_PATH.

Clone with bindings

git clone https://github.com/samuelmueller-dev/playdate-nettest.git
cd playdate-nettest
mkdir -p libs
git clone https://github.com/samuelmueller-dev/odin-playdate.git libs/odin-playdate

Build

./build.sh

Deploy

# Connect Playdate via USB, put in Data Disk mode
cp -R build/out/nettest.pdx /Volumes/PLAYDATE/Games/

Configure server IP

Edit src/main.odin and replace YOUR_SERVER_IP with your machine's local IP:

NET_SERVER :: "192.168.1.100"  // ← your machine's IP

Find your IP with ifconfig (macOS/Linux) or ipconfig (Windows).

Run the echo server

On the machine you set as NET_SERVER:

python3 echo_server.py

The server listens on port 9000, echoes all data back, and logs per-ping RTT with a summary on disconnect.

Files

File Purpose
src/main.odin Playdate app — connects, pings, displays RTT
echo_server.py TCP echo server with RTT logging
build.sh ARM cross-compilation pipeline
tools/device_stubs/ C runtime stubs for freestanding ARM