Prerequisites

Before starting, make sure you have the following:

  1. A control module set up, connected to the internet, and running the phosphobot server. Learn how to set up your control module.
  2. An ngrok account. Sign up here (or use an alternative like Cloudflare Tunnel).
  3. The ngrok CLI installed on your device. Download it here

1. Authenticate ngrok

To use ngrok, you need to authenticate your account. Open a terminal and run the following command:

ngrok authtoken YOUR_AUTH_TOKEN

Replace YOUR_AUTH_TOKEN with the token provided in your ngrok dashboard.

2. Create an ngrok Tunnel for Your Local Server

  1. Turn on your control module and ensure your phosphobot server is running.

  2. SSH into your phosphobot. By default, the password is password123

ssh phosphobot@phosphobot.local
  1. Run the following command to create a tunnel:

    ngrok http 80
    

    This command tells ngrok to forward traffic from the internet to your local server running on port 80.

  2. Once the tunnel is active, ngrok will display a forwarding URL in the terminal, such as:

    Forwarding  https://abc123.ngrok.io -> http://localhost:80
    

    This URL is publicly accessible from anywhere in the world and will remain active while the ngrok tunnel is running. Turn off the control module to stop the tunnel.

3. Access Your Teleoperation App Remotely

  1. Copy the ngrok https:// URL displayed in your terminal (e.g., https://abc123.ngrok.io).
  2. Share this URL with users who need remote access to your teleoperation app.
  3. Open the URL in a browser to access the Admin panel.
  4. In the Meta Quest app, go to Settings and enter the ngrok URL to connect.
Ensure your local server remains running while the ngrok tunnel is active. Closing the server will break the connection.

4. Secure Your Tunnel

By default, ngrok tunnels are public, meaning anyone with the URL can control your robot and access datasets.

To secure your tunnel:

  1. Add basic authentication Run the following command to require a username and password to access the tunnel:

    ngrok http 80 --auth "username:password"
    

    Replace username and password with your desired credentials.

  2. Alternatively, you can restrict access to specific IP addresses.

    • Go to the ngrok dashboard
    • Use the IP restrictions feature in the dashboard.

5. Monitor Traffic (Optional)

Ngrok provides a web interface for inspecting traffic and requests. To access it:

  1. Open your browser and go to http://localhost:4040.
  2. Here, you can view detailed logs of incoming requests and responses.

What’s Next?

Now that your teleoperation app is accessible remotely, you can:

  • Share the ngrok URL with collaborators for real-time teleoperation.
  • Record datasets remotely and upload them to your Hugging Face account.
  • Train AI models using the data collected from remote sessions.

Train Your First AI Model

Learn how to use your recorded datasets to train your first AI model.