rpynx v0.1.0pre-release

Importer

Upload over FTP

Send a game to the Switch over Wi-Fi with sphaira's FTP server, without taking out the SD card.

Source docs/IMPORTER.md
On this page

The window’s Switch over Wi-Fi (FTP) target and --out ftp://HOST:PORT both use the FTP server in sphaira, a homebrew menu for the Switch. rpynx does not have its own FTP server yet; one is planned for the Transfer milestone.

Before you start

  1. Turn on the FTP server in sphaira. It is anonymous, on port 5000 unless you set another.
  2. Note the address sphaira shows, for example 192.168.1.20:5000. It comes from your router, so it can change.
  3. Keep the Switch in sphaira. The server stops while the rpynx loader or a game runs.

/ on that server is the SD card. The importer uses only Python’s ftplib.

bash
python3 importer/rsl_import.py ~/Games/MyGame.zip --out ftp://192.168.1.20:5000

How an upload works

The upload never leaves a half-copied game where the loader can see it:

  1. If games/<id> exists and Replace (--replace) is off, nothing is sent.
  2. Every file goes to the hidden folder games/.uploading-<id>/, with manifest.json last. The loader skips names that start with a dot. A .uploading-<id> left by an earlier upload is removed first; it never holds saves.
  3. On Cancel, a lost connection or any error, .uploading-<id> is removed over a new connection, and the Switch is as it was. If that fails too, the next upload removes it.
  4. Then it is renamed into place: the old games/<id> becomes games/.old-<id>, .uploading-<id> becomes games/<id>, the old game/saves/ and any pictures chosen before are moved into the new folder, and .old-<id> is deleted.
  5. If a rename in step 4 fails, the error names both folders. A leftover .old-<id> may hold saves, so the next upload of that game refuses until it is moved or deleted by hand.

switch/renpy-loader/saves/ is never touched. Unlike an SD card export, which only swaps game/ and manifest.json, an upload replaces the whole games/<id>/ folder.

Speed

Uploads of thousands of small files run at about 1–2 MB/s, one file at a time. The status line shows how much of a large file is sent, and Cancel stops within the current file.

note

A USB transfer is planned after Milestone 7 (libnx usbComms on the Switch, libusb on the desktop), for tens of MB/s. MTP is not planned: macOS has no MTP support, and an MTP responder such as haze is GPL, which would make the MIT loader GPL.

↑↓ move↵ openesc close