This is an old revision of the document!


Xiaomi Mi Box S 4K (AndroidTV 9) with Kodi and Netflix

The Xiaomi Mi Box S 4K is an inexpensive Android TV box. It's hardware is not as powerful as the Mecool KM9 Pro Deluxe with a similar price tag, but what sets it apart is that the Mi Box S is a Netflix approved device, which allows to stream Netflix in full HD or 4K. This Box is excellent, runs fast and stable, and features a Bluetooth Voice enabled Remote. It cannot be controlled with an IR remote and it does not have an Ethernet port. Read Harmony Remote and Network Access how to deal with these limitations. Read Mecool KM9 Pro (AndroidTV 9) with Kodi and Netflix for installation and setup instructions of the Meecool box.

Hardware

  • Xiaomi Mi Box S (aka Box), RAM: 2GB, ROM: 8GB (only 5.5GB usable for apps), USB2.
  • Logitech Harmony Companion (aka Harmony) which controls TV, Amp, and media player.
  • Logitech K400+ Keyboard (aka Keyboard) which allows comfortable text imput.
  • USB 2.0 hub with Ethernet from UGREEN for the Xiaomi Mi Box S, which allows stable 100 Mbps up- and download speed.

Setup

  • Settings → Device Preferences → Screen saver: set When to start: 30 minutes, Screen saver: Backdrop, Put device to sleep: 12 hours
  • Settings → Device Preferences → Language: set Language to English (United States) or German (Switzerland)
  • Settings → Accounts & sign-in: sign in to your Google account
  • Settings → Device Preferences → About: System update to the latest Android 9 build (update to Android 9 if the box is shipped with Android 8.1)
  • Settings → Device Preferences → Date & Time: set Automatic date & time, time zone and Use 24-hour format
  • Settings → Apps → View Phone Media: disable notifications
  • Settings → Device Preferences → About: Enable Developer Mode by clicking 8 times Build
  • Connect to the device with Android Debug Bridge
  • Map keys as explained in Button Mapper
  • Pair the device with the Harmony Remote

Installation

Button Mapper Setup

To improve usability and user experience of the system remap some of the keys of the Logitech Harmony Remote and the Logitech Keyboard. Note that the Mi Box S bluetooth remote is compatible with the NVIDIA Shield remote, which we will use when setting up the Harmony Remote.

  1. Enable USB debugging in Settings –> Device Preferences –> Developer options and select Revoke USB debugging authorizations
  2. Open Button Mapper App on your device and select + Add Buttons. Press any button, for example the keyboard “F10” key we will remap later, and select the added key with the remote. Now select Customize and try to assign an Action or an Advanced command. Button Mapper will now take you through downloading a setup program for Windows or Mac. This setup program also includes adb.exe, which can be used to enable the necessary permissions on the device.
  3. You can enable the permissions with a USB connection:
    1. connect the Box with a USB-A to USB-A cable to your computer
    2. confirm the connection to the computer on the device
    3. run “ButtonMapperSetup.exe” on your computer and check the textbox to make sure the device is connected
    4. click “Grant WRITE_SECURE_SETTINGS permission” and Exit
  4. If the USB connection does not work, or if the box is not near your computer, run the commands manually:
    1. make sure the Box is connected to the same network as your computer. If you are connecting to a box where the ethernet connection is established through a USB to Ethernet hub (like the Xiaomi Mi Box) make sure to connect through wifi, as the bridge will not work once you enable USB debugging to connect with adb.
    2. open a shell (Command Prompt) on your computer and change to the folder “tools” inside the “ButtonMapperSetup” install folder
    3. enter the following commands within the shell
      adb connect <IP address>
      adb shell pm grant flar2.homebutton android.permission.WRITE_SECURE_SETTINGS
      adb disconnect
      exit
    4. you might need to confirm the connection to the computer on the device after the adb connect command
    5. you might get an error message “error: more than one device/emulator” if an Android emulator such as BlueStacks is installed on your computer
    6. either terminate the emulator (or other device), or issue the following commands to list the devices connected and find and specify the model number in the shell command
      adb connect <IP address>
      adb devices -l
      adb -s model:MIBOX4 shell pm grant flar2.homebutton android.permission.WRITE_SECURE_SETTINGS
      adb disconnect
      exit
    7. remember to connect to the Mi Box S through wireless, as the USB hub with Ethernet cannot be used when “Developper Options” are activ
    8. you might need to reboot the box when reconnecting a USB to Ethernet hub
  5. Disable USB debugging in Settings –> Device Preferences –> Developer options
  6. The Box does not need to be rooted, but you will need the Pro version of the app which costs $2 in the app store.
  7. Firefox TV is supported on Fire TV only, but runs without problems on Android TV 9. It requires a “menu” key to pin websites (bookmarks), which is not available on the Box Remote or the Keyboard. Map the “menu” key (keycode: 82) to the NVIDIA Shield's “mute” button (see Harmony Remote below), and to the Keyboard's “F10” key. This allows to invoke “menu” through the Harmony Remote's “menu” button, and through the Keyboard's “F10” key.
  8. The “menu” key is now also available in other apps such as Kodi and is equivalent to a long press of the OK button on the Box Remote and the Harmony Remote (long press of the OK button is not recognized in the Firefox TV app).
  9. Map the “screenshot” action to the double pressed “F10” key for the Keyboard, which allows to take a screenshot when pressing F10 twice. Helpful for creating a user manual for your family members.
  10. Map the “power-dialog” action to the long pressed NVIDIA Shield's “record” button, which allows to invoke the power dialog for rebooting the shield device.

Games

  • To install games you will USB stick to extend the limited device memory of the Xiaomi Mi Box S. Select one with USB 3.0 or 3.1 specification and decent transfer speed, which will allow faster memory read/write speeds even though the Xiaomi has only USB 2.0 built in. Move the games to the extended device memory, but no other apps, doing so allows you to disconnect the USB stick when you don't need it for game play.

Network Access

The Xiaomi Mi Box S does not have an Ethernet port, which I prefer to be able to access my internal LAN without exposure to WIFI. Android on the Mi Box S will recognize a USB to Ethernet converter, I use a USB hub with Ethernet from UGREEN, USB 2.0 is sufficient. This not only adds the network port, but also 3 USB connectors so you don't need to unplug the adapter when plugging in a USB stick. Disable WIFI on the Mi Box S.