Skip to main content

How to refresh the WebOS developer token for LG WebOS

How to refresh your LG webOS developer token using a curl command. There are two primary methods to do this: using a community-built automation service (recommended) or making a direct, but less reliable, API call to LG's servers.

Method 1: Use a "Set and Forget" Automation Service (Recommended)

The most reliable way to keep your developer session active is by using a community-created web service that securely stores your token and automatically refreshes it. This "set and forget" approach means you only need to submit your token once.

The service is available through the Homebrew Channel as the Auto Dev Token Refresh app or can be accessed directly via a curl command.

Here is the curl command to submit your token to the refresh service:

curl -X POST -d "key=YOUR_TOKEN_HERE&action=add" https://lg.pirate.vodka/
How to Find YOUR_TOKEN_HERE

The session token is a long string of characters stored on your TV. To retrieve it, you must connect to your TV using SSH (Secure Shell).

  1. Enable SSH: Ensure SSH is enabled in the Developer Mode app on your TV.
  2. Connect via SSH: Use an SSH client (like Terminal on macOS/Linux or PuTTY on Windows) to connect to your TV's IP address.
  3. Retrieve the Token: Once connected, run the following command to display your token :
cat /var/luna/preferences/devmode_enabled
  1. Use the Token: Copy the output from that command and replace YOUR_TOKEN_HERE in the curl command above.

Once you run the curl command, the service will handle the periodic refreshes for you.

Method 2: Direct API Call to LG's Server (Unreliable)

You can also attempt to refresh the session by sending a GET request directly to LG's developer endpoint. However, this method is not recommended as many users report that it often returns a success message without actually resetting the session timer on the TV.

If you wish to try it, use the following curl command, replacing YOUR_TOKEN_HERE with the session token you retrieved using the steps above.

Unreliable curl command:
curl "https://developer.lge.com/secure/ResetDevModeSession.dev?sessionToken=YOUR_TOKEN_HERE"

This command, if it works, simply resets the timer once. You would need to automate this command using a tool like cron to run it periodically before the session expires. Due to its unreliability, the first method is the preferred solution within the webOS community. <span style="display:none"