android code to run on robots via LetsRobot api
- Version 3.2 or higher. May not be buildable on lower versions
The most stable code in the repo. Can be used for testing and is known to work
The latest code, mostly stable, but might have issues. Sometimes this code may not be buildable
-
Setup to be capable of running on Android 4.1 (API 16) or higher. Some devices may run into issues, so feel free to report them
-
Android Things not tested
-
Raspberry PI not tested
When the app is started, and permissions have been accepted (API > 23), a setup screen will pop up with settings that can be changed. RobotID is the only id required to get it connected to the API.
-
RobotID
-
Enable Camera Toggle
-
CameraID (Disabled if enable camera is false)
-
Camera Password (Disabled if enable camera is false)
-
Resolution (Disabled if enable camera is false)
-
Enable Microphone Toggle
-
Text to speech toggle
-
Error reporting toggle (Disabled for now)
-
Fake black screen to save power (Not really needed that much now that the screen can be turned off)
-
Bluetooth device setup
-
Scanning a QR Code that was exported with this app.
- Click build and run to deploy to phone (Play button)
- Open App if not opened already
- Accept permissions if they pop up
- Configure robot settings
- Hit POWER - Button will be disabled until fully connected
- Robot will now be connected to letsrobot website. POWER button will be green
Only the owner can use this. Turns on table top mode, not allowing 'f' and 'b' commands, but allows everything else. Not case sensitive
On: '.table on'
Off: '.table off'
Only the owner can use this. Disables all commands, even for the owner.
Disable: '.motors off' Enable: '.motors on'
Only the owner can use this. '.battery level'
Robot says the phone battery level 'Internal battery 80%'
'.locale en-US' Sets the locale of the TTS (System TTS Only)
Language must be installed for it to speak using it. This only changes the accent, and does not translate.
-
A notification will appear that states that the app is active. Use the "Terminate App" Button to kill the app from anywhere
-
Hit the POWER button again when it is green to disable
-
Swipe app away from recents
Needed for bluetooth device scanning. Not requested or used otherwise
Needed to stream the camera. Only requested if camera is enabled in settings
Needed to stream the microphone. Only requested if the mic is enabled in settings
Required on some devices for importing a QR Code from a photo on the device. Only requested when that feature is used
Reload the robot page on LetsRobot.tv
Also check that the robotId, cameraId, and cameraPass match with the site. If your camera password on the site is empty, your password is "hello"
Check the phone's internet connection
-
Check the phone's internet connection.
-
Connection may be too slow or connected to a WiFi router with no internet.
-
Also could potentially be a site issue, but most of the time it would be internet related
This only applies to Android 6.0 and above
- Go to the app settings and turn battery optimization off for this app
Make a class that extends and implements methods of Component
Then add to the Builder's externalComponents list
See PlayAudioComponentExample.kt See MainRobotController.kt for an example of CustomComponentExample being added
- 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)
- 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)
Errors do not get reported at the moment
-
Battery optimization has to be disabled if OS version is 6.0 or above if you want to turn the screen off on the phone.
-
Currently no code to use a USB webcam. Also currently not sure if the Raspberry Pi with camera functions as is
-
BluetoothClassic currently not hooked up to handle input from the connected device. It can output to it just fine
Feel free to add your device to this list if you have tested it via a pull request
-
Casio G'zOne CA-201L (4.1.2 JellyBean). Tested with 512kbps bitrate and bluetooth. Might not support USB OTG
-
ZTE Speed (4.4 Kitkat), might not be fast enough on high bitrates, some weird bluetooth issues possible (#45)
-
Motorola Moto Z (8.0.0 Oreo)
-
Galaxy S4 (5.0.1 Lollipop)
-
Pixel 2 XL (9 Pie)
-
Samsung Galaxy J5 (tested with 768x432, 512kb/s)
This software uses code of FFmpeg licensed under the LGPLv2.1 and its source can be downloaded here