I don’t think PIO remote is laid out for your Peer-to-peer and no-internet usecase. PIO Agents (aka server) and PIO clients (aka the one running
pio remote run to execute a command on a remote machine) communicate via the PIO cloud, or more precisely, via
remote.platformio.org as a middle-man broker. Also refer to the technology diagram. That’s also the main point why it works ‘out-of-the-box’ without port forwarding or other shenanigans between the agent and the client – just a connection to a public broker is needed.
So, with no internet access, you cannot connect to the serves for account managing and remote agent managing. If you allow these services however, you have a standard PIO remote use case. The agent is started on your server / PC where the devices are physically connected to, and clients can connect from everywhere given they use the same PIO account.
I’m not sure if you can just duplicate the needed services (
remote.platformio.org) on your own private server instance and change the PIO code to use your URLs instead – @ivankravets, would that be possible, is that part open source?