Skip to content

Rayquaza01/picotron-remote-terminal

Repository files navigation

Picotron Remote Terminal

Remotely control Picotron from the host

Installation

Install the server in Picotron:

# from inside picotron

load -u #prt
save /appdata/system/util/prt.p64

This will install the PRT cartridge, which will listen for commands from prt-server.

(Optional) Install the host script:

# from inside picotron

# use the location of wherever you saved the prt cart
cp /appdata/system/util/prt.p64/exports/appdata/system/util/host.lua /appdata/system/util

This will install the host command, which can be used run commands from the host inside of Picotron.

(Optional) Install as a PUSH module

# from inside picotron

# use the location of wherever you saved the prt cart
cp /appdata/system/util/prt.p64/exports/appdata/system/terminal/prt.lua /appdata/system/terminal

If you are using PUSH, you can integrate PRT directly into the terminal. The push module adds a shell command (prt) that can be used instead of the cart. When using PRT as a PUSH module, command output will be displayed in the terminal window.

Supported commands are start, stop, restart, status.

Usage

Controlling Picotron From Host

To control Picotron from host, open the PRT cart inside of Picotron. You can then issue a command by sending a command to the port 7426 (PICO)

Examples:

  • echo -n "<command>" | nc -N localhost 7426
  • echo -n "<command>" > /dev/tcp/localhost/7426 (bash)
  • nc localhost 7426 (to get an interactive terminal)

You can create a simple script to act as a wrapper:

#!/usr/bin/env bash
echo "$@" > /dev/tcp/localhost/7426

Then, you can send commands using prt <command>

Tips:

  • The load command can be used to load a cartridge.
  • You can load a folder or a cartridge.
  • The run command can be used to run the currently loaded cartridge.
  • You can start a cart with its exact path.
  • You can build or extract a cart with cp.
  • You can change directories with cd, though it may be better to use absolute paths.

Controlling the Host From Picotron

To control the host from Picotron, start prt-server on the host.

Install prt-server from npm:

npm install -g picotron-remote-terminal

Or build from source:

git clone https://github.com/Rayquaza01/picotron-remote-terminal/
cd picotron-remote-terminal
npm install
npm run build
npm install -g .

You can then issue commands by running host <COMMAND> from Picotron.

Tips:

  • Only non-interactive commands work.
  • Only characters that can be displayed in Picotron work (so emojis, nerd fonts, ANSI codes, etc. won't display correctly).
  • The commands are run with the same PWD as the Picotron terminal where you ran them.
  • Relative paths work for accessing the Picotron drive, but absolute paths are used according to the host system.
  • You can't run commands when inside of a virtual path (such as /ram, /system, or inside of a .p64).
  • You can use pipelines.

About

Remotely control Picotron from the host

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published