Skip to content

Getting Set up

Brendon Telman edited this page Dec 16, 2019 · 3 revisions

Setup

Robot and API Key

When the app is started, and permissions have been accepted (API > 23), a setup screen will pop up with settings that can be changed. Going into the connection section will bring you to an area where the API Key and channel ID can be pasted in.

Given that the API key is huge, there are a few options that can be used.

  1. Use this python script to paste in the api key and channel name (Requires ADB). https://github.com/remotv/controller-for-android/blob/master/scripts/api-token-pusher.py . Make sure that the app is not running and there is only one android device connected! This was made for python 3, and may cause issues on python 2 that will not be addressed

  2. remotely connect to the device using https://github.com/Genymobile/scrcpy to paste it in (Requires ADB, but should be bundled with it)

  3. Log into the site on the phone, copy the key, and go back to the app and paste it in

User Configurable Settings

  • API Key

  • Channel Id or Channel name (Will default to first channel if not set)

  • Robot Hardware switch

  • Camera Hardware switch

  • Camera settings such as resolution, bitrate, orientation, and front/back camera

  • Enable Microphone Toggle

  • Text to speech toggle

  • Bluetooth device setup

Running the robot

To make the robot operational and connected:

  1. If building from source, click build and run to deploy to phone in Android Studio (Play button)
  2. Open App if not opened already
  3. Configure robot settings
  4. Accept permissions if they pop up. They only pop up if relevant to settings selections
  5. Hit POWER - Button will be disabled until fully connected
  6. Robot will now be connected to website. POWER button will be green

Supported Commands

https://github.com/remotv/controller-for-android/wiki/Commands

Ways to stop the robot:

  • A notification will appear that states that the app is active. Use the "Terminate App" Button to kill the app from anywhere

  • Hit the app's POWER button again when it is green to disable

  • Swipe app away from recents

  • typing .estop in the chat. Will send a stop command to the hardware then kill the app forcibly

Connection Options

  • Bluetooth Classic (less than 4.0 guaranteed), HC04 would work. Please pair the bluetooth device in settings first, then setup in this app

  • USB Serial (Not working on Android Things 1.0.3 rpi3) (https://github.com/felHR85/UsbSerial#devices-supported)

  • RemoBroadcaster. Sends a system broadcast that other apps can see and intercept. Allows for building an external app that works with Remo.TV Controller for Android. Please view the list of apps known to support this here

App Permissions

Location

Needed for bluetooth device scanning. Not requested or used otherwise

Camera

Needed to stream the camera. Only requested if camera is enabled in settings

Microphone

Needed to stream the microphone. Only requested if the mic is enabled in settings

Toubleshooting

https://github.com/remotv/controller-for-android/wiki/Troubleshooting

FFmpeg Customization

In the camera app settings under advanced, there exist options to change values in ffmpeg to make it work differently.

Smart replacement of options to prevent hardcoding

Putting any of the following in the command fields except for filter options will be replaced with dynamic variables

  • ${height} : will be replaced by height from settings
  • ${width} : will be replaced by width from settings
  • ${resolution} : will be replaced by resolution from settings, same as ${width}x${height}
  • ${framerate} : will be replaced by the app's framerate variable, which is usually 30
  • ${bitrate} : will be replaced by video bitrate from settings
  • ${inputStream} : stream that receives the camera frames. Usually just -
  • ${endpoint} : endpoint that the video will stream to. No need to put this in output options at the end, since that is already done
  • ${bitrateflags} : Flags for bitrate, by default it replaces it with -b ${bitrate}k -minrate ${bitrate}k -maxrate ${bitrate}k -bufsize ${bitrate/1.5}k"

For filter options, ${internal} will be replaced by the app filters, which by default is what handles the video orientation changes.

To reset to default settings, clear the field and hit submit. It will then replace it back with the stock command

Devices supported

  • SaberTooth Motor Controllers (Simplified Serial), 9600 BAUD
  • Arduino via raw commands (f, b, l, r, stop, etc), 9600 BAUD, USB or Bluetooth Classic
  • Any device that has the same protocol as SaberTooth
  • Lego Mindstorms NXT (JoystickDriver or equivalent. Most commonly used with older FIRST Tech Challenge robots that ran RobotC and Labview)

This software uses code of FFmpeg licensed under the LGPLv2.1 and its source can be downloaded here