ADB tool to configure STBs

ADB tool to configure STBs

1. What is it?

The ADB (Android Debug Bridge) tool is a command-line utility that allows developers to communicate with and control Android devices from a computer, enabling tasks such as app installation, system debugging, and accessing device logs. It is widely used for development and troubleshooting in Android environments. This tool is however not available on the non-Android OS devices like Samsung and LG smart TVs.

2. How it works?

The ADB tool works by establishing a connection between a computer and an Android device over the network. Once connected, ADB allows the user to send commands from the computer to the Android device.

To view a list of all available commands and get help, simply type the following in the terminal:

adb

You can also Google for help, since this is a widely known Android tool.

 

Note: We use and recommend the RSTB tool, which is easier. ADB is used only in certain cases where rstb tool fails or command not available. RSTB tool guide is here.

Mostly used ADB commands with examples

1 Get log of STB

This command works only by inserting certain IP or MAC, you can’t use ALL command for that.

With the ADB tool, we can connect to only one device at a time, which is why we always execute a disconnect command to ensure we’ve properly disconnected from any previous devices before connecting to a new one.

Commands (use IP of your STB):

adb disconnect adb connect 192.168.200.10:7771 adb logcat

Result: Shows the lines of log.

Tip 1: You can search for a certain word in log:

adb logcat | grep http

Tip 2: If you want to know on which UDP channel is stb:

adb logcat | grep udp

Result: It will filter out from log only this word UDP and you can see which is the last UDP set.

 


2 Set resolution on stb

For STB models with the s805 chipset, the maximum supported resolution is 720p, so no further adjustments are necessary. However, for STB models with the s905 chipset, you can choose between different resolutions, including 1080p.

  • Check what resolution on stb:

rstb 192.168.200.10 get gfx
  • Check density on stb:

rstb 192.168.200.10 get density

 

  • Set resolution 1080p

rstb 192.168.200.10 set gfx 1920x1080
  • Set density for resolution 1080p:

rstb 192.168.200.10 set density 240

 

  • Set resolution 72p

rstb 192.168.200.10 set gfx 1280x720
  • Set density for resolution 720p:

rstb 192.168.200.10 set density 160

 

3 Set rover server link

Default Rover server is set to rover.nevron.tv. Rover server can be IP or domain name. By default, they connect to local rover on your server. This is more for cloud customers.

adb format

adb shell setprop persist.rover.server [rover dns]

adb sample:

adb shell setprop persist.rover.server rover.nevron.tv

4 Move or simulate remote buttons on screen

On STB, you can also simulate keystrokes on remote. When the user presses key OK on TV remote, it sends a key code to STB. This same key code we can send over rstb command, which means we can navigate with sending right key codes.

Example is key code to press button RIGHT:

adb disconnect adb connect 192.168.200.10:7771 adb shell input keyevent 22

Other key codes:

Enter Key - 66
UP - 19
Down - 20
Home - 3
Left - 21
Right - 22
vol up - 24
vol down - 25
back key - 4

mute - 164

Send text - text "sometext"

Usually we use this keys with a combination of screenshot and logcat, so we can check what content is set on a certain screen without any other local help. Sometimes the marketing team needs screenshots for promotional purposes.

5 Checking and changing STB sound level

STB has its own sound scale, that cannot be changed with a remote, if you are using rs232.

There are two ways to change the STB sound level while using rs232 :

  1. rstb STB_IP sendkey, as mentioned in the previous section

  2. ADB tool settings:

adb disconnect adb connect STB_IP:7771 adb shell settings list system

Under volume_music you can see the current setting, this one has it set to 11. The scale should be 1-15.

To change the volume to 100% , use:

adb shell settings put system volume_music_hdmi 15

If you see volume_music_hdmi=0 then the STB is not getting any volume over the HDMI.

6 Changing orientation of the web player

You can change orientation of the screen on a device. Use the command to rotate, then reboot the device. Don’t forget to prepare the content in the new orientation also. You can switch between “portrait” and “landscape” orientation.

adb disconnect adb connect 192.168.200.10:7771 adb shell setprop persist.nevron.webp.rotate portrait adb reboot

 

If that command doesn’t work, write to support email. There are other commands available, or manually rotate for a certain degree. The TV might be mounted upside down, so the screen needs to be rotated manually by degrees. Also, some OS versions have the orientation locked in deeper level. On STB this needs to be set: Settings -> Display -> Screen Rotation -> original

You can try to set orientation on the deeper level in OS:

adb disconnect adb connect 192.168.200.10:7771 adb shell set prop:persist.sys.app.rotation auto adb shell setprop persist.nevron.webp.rotate portrait adb reboot

 

If this doesn’t work, then rotate by degrees (0. 90, 180, 270). In case you see the picture upside down, use this:

adb disconnect adb connect 192.168.200.10:7771 adb shell settings put system user_rotation 1

Additional info:

To use these, the rotation needs to be set to auto.

adb shell settings put system user_rotation 0 adb shell settings put system user_rotation 1 adb shell settings put system user_rotation 2 adb shell settings put system user_rotation 3 adb shell settings delete system user_rotation

Reaction depends on persist.nevron.webp.rotate:
auto: all 4 work as expected (0, 90, 180, 270 deg. rotation)
portrait: only 1 and 3 work (90 and 270 deg. rotation)
landscape: only 0 and 2 work (0 and 180 deg. rotation)
setting is applied immediately, no reboot is needed

 

7 Open Rover screen with the ADB:

adb shell monkey -p com.nevron.tvcloud -c android.intent.category.LAUNCHER 1

 

8 Get what webplayer app type you installed

We have more types of the Webplayer app: standalone or release version

adb disconnect adb connect 192.168.200.10:7771 adb shell pm dump com.nevron.iptv.webplayer | grep HOME

Result: With standalone app version there is no first line - Category…

image-20240902-144030.png

9 Change the player

You can change the player between “amlogic” and “android”. When android is set, it uses the MediaApi as its in OS.

adb shell setprop persist.nevron.play.mode amlogic

 

10 Get the FW version

Check the FW on the stb:

adb disconnect adb connect 192.168.200.10:7771 adb shell getprop ro.build.display.id

or

adb shell getprop ro.build.version.incremental

 

11 Get the app versions

Get the app versions on the STB.

adb disconnect adb connect 192.168.200.10:7771 adb shell getprop persist.nevron.iptv.version

Those apps are our old TSA and IPTV apps, before the Webplayer app.

adb disconnect adb connect 192.168.200.10:7771 adb shell getprop persist.nevron.iptv.version adb shell getprop persist.nevron.tsa.version

 

12 ADB tool on the server

Check, stop, start, see devices active on the server over the ADB tool:

adb adb kill-server adb start-server adb devices

 

13 Set overscan on the STB

You can configure overscan on the Set-Top Box (STB) to adjust how much the picture is shifted from the edges of the screen. This adjustment is useful for fine-tuning the display to fit your screen correctly.

The parameters follow this order: Left, Top, Right, Bottom

Example:

adb disconnect adb connect 192.168.200.10:7771 adb shell wm overscan 10,5,10,5

 

14 Set timezone on STB

You can set timezone on STB with the command:

adb disconnect adb connect 192.168.200.10:7771 adb shell setprop persist.sys.timezone"Europe/Belgrade"

 

15 Access to Android setting screen

You can open the Android settings with the command:

adb disconnect adb connect 192.168.200.10:7771 adb shell am start -a android.settings.SETTINGS

 

16 Disable CEC on STB

You can disable CEC from the STB:

adb disconnect adb connect 192.168.200.10:7771 adb shell settings put global hdmi_control_enabled 0 adb reboot

You can disable it also from the STB: 1590 za settings -> Apps -> See all apps -> Droid Settings -> Open -> HDMI CEC. Disable One key play

 

17 Check traffic on the STB

You can check the traffic on the STB and see if the switch has properly set it’s IGMP query.

Commands:

adb disconnect adb connect 192.168.200.10:7771 adb shell su tcpdump -i eth0 udp

If you see many different udp streams running, means switch is not properly set and causing STB to freeze on TV channels. The channels jam the STB. If you see only one stream running, then the switch setting is fine.

Related content