Network error on factory reset OUYAs

My own OUYA API server has been running since november last year. The game data files have been worked on: Previously missing games were added, wrong developer UUIDs fixed. Many of the games got product data, so that purchases can be restored now and games stuck in demo mode unlock to the full version now.

All went nicely until end of january, people with factory reset OUYAs came into the chat and asked for help because they could not get past the network configuration screen. All they got were the following error messages:

Unable to connect

Please check your Internet connection and try again.

and

Cannot establish a connection with the OUYA Servers. To turn on Wi-Fi, unplug your Ethernet cable and proceed. To retry ethernet, please check your connection and then unplug and re-plug your cable.

Unabe to connect Cannot establish a connection with the OUYA Servers.

The culprit

Luckily I own two OUYAs, so I did a factory reset on the development machine and tried the setup myself: It failed with the same error messages as reported.

The initial setup is managed by OUYAOOBE.apk, the Out Of the Box Experience application. I read the decompiled sources and soon found the culprit, ConnectivityChecker.java:

public Void doInBackground(Void... params) {
    Socket socket = null;
    boolean reachable = false;
    try {
        Socket socket2 = new Socket("devs.ouya.tv", 80);
        reachable = true;
        if (socket2 != null) {
            try {
                socket2.close();
                Socket socket3 = socket2;
            } catch (IOException e) {
                Socket socket4 = socket2;
            }
        }
    } catch (UnknownHostException, IOException e2) {
        // error handling
    }
    setResult(reachable);
    return null;
}

So OUYA's setup application has a hard-coded check to devs.ouya.tv, which was the name of the API server - and it does not use the ouya config override file ouya_config.properties. The DNS record still exists:

$ dig devs.ouya.tv
devs.ouya.tv.		60	IN	CNAME	tokyo-6663.herokussl.com.

But the host that the domain was aliased to does not exist anymore:

$ dig +short tokyo-6663.herokussl.com
$

Apparently Razer's Heroku contract was cancelled or not renewed, and the box that served the redirect from devs.ouya.tv to razer.com was shutdown forever.

The solution

It is possible to get past the network selection screen by letting the OUYA think that devs.ouya.tv still exists, and let it point to some IP address that has a HTTP and HTTPS server running.

Choose one of the following options:

1. Modify the internet router's DNS server

  1. Open your internet router's web interface and change the DNS server temporarily to 178.254.13.17.
  2. Finish the OUYA setup including registration.
  3. Change the router's DNS server setting back to the previous setting or the one provided by the ISP - otherwise you cannot open most web pages anymore.

2. Modify the OUYA DNS server

Summary: Temporarily change the OUYA's network configuration to use 178.254.13.17 as DNS server.

Wifi

  1. Connect to your Wi-Fi network. The OUYA shows "It seems we're unable to connect to the OUYA servers at the moment".
  2. Press Y to open the network settings.
  3. Select the connected Wifi network, and long press the green O button until the context menu appears. Select "Modify network".
  4. Activate "Show advanced options".
  5. Change the "IP settings" from "DHCP" to "Static".
  6. Change the "DNS 1" address to 178.254.13.17.
  7. Close the network settings and press O to continue.
  8. If you get a popup "Unable to connect", create the configuration file and reboot the OUYA.
  9. Once you registered and see the OUYA main menu, go to Manage -> Network Settings and change the network settings back to DHCP.

OUYA OOBE Wifi network selection OUYA OOBE Wifi server error OUYA OOBE Wifi configuration OUYA OOBE Wifi context menu

Ethernet

  1. The OUYA setup shows the network information (IP Address, Subnet mask, ...) and the message "Cannot establish a connection with the OUYA Servers."
  2. Write down the three addresses: IP Address, Subnet Mask, Router.
  3. Press Y to open the network settings. If , then configure the ethernet or wifi device.
  4. Change the "Connection Type" from "DHCP" to "Static IP".
  5. Manually enter the "IP address", "Netmask" and "Router".
  6. Change the "DNS address" address to 178.254.13.17.
  7. Save & close the network settings and press O to continue.
  8. If you get a popup "Unable to connect", create the configuration file and reboot the OUYA.
  9. Once you registered and see the OUYA main menu, go to Manage -> Network Settings and change the network settings back to DHCP.

OUYA OOBE Ethernet information OUYA OOBE Ethernet configuration OUYA OOBE Ethernet settings OUYA OOBE Ethernet IP address OUYA OOBE All static settings OUYA OOBE Custom DNS server

3. DNS mapping in your router

Some routers allow you to add own domain-name-to-IP-mappings. If your router is one of them, add a mapping for hostname devs.ouya.tv, status.ouya.tv and ouya-updates.s3.amazonaws.com to the IP of my server: 178.254.13.17.

4. Modify OUYA's /system/etc/hosts file

Each computer has a file /etc/hosts that allows you to define DNS mappings. On Android, that file is located at /system/etc/hosts.

This method will surely work, but takes the most steps. You need to have the "Android Debug Bridge" (adb) command line tool installed on your PC. Have a look at Cyanogen Mod CM11 and the Ouya, it has installation instructions for adb on windows.

  1. On your PC, run adb shell
  2. Type su to become the root user
  3. Make the system partition writable:
    mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
  4. Use my server instead of the original one by modifying the hosts file:
    echo "178.254.13.17 devs.ouya.tv status.ouya.tv ouya-updates.s3.amazonaws.com" >> /system/etc/hosts

The connectivity check should work now without rebooting.

Unable to connect

If you still get the "Unable to connect" error, then you are missing the ouya_config.properties file.

Update 2023-04-03

Because I am moving to a new server, the IP address changed from 83.169.45.222 to 178.254.13.17.

Written by Christian Weiske.

Comments? Please send an e-mail.