Log in

View Full Version : Android Driver Station


raystubbs
25-04-2014, 10:53
Has anyone written a FRC Driverstation app for Android yet?
I've just written one, all that lacks is testing. Wondering if anyone else has done the same.

m1506m
25-04-2014, 22:17
Hey keep us updated on this. I read about the I driver station app, and would love to see the android version. I'll help beta test if you'd like.

pyroslev
26-04-2014, 09:09
Like to Beta test it as well. Since seeing the RobotOpen and Sasquatch system in use, curious to try any new gen DS software.
That and I've got 4 Android devices across the spectrum.

SRaymond
26-04-2014, 11:34
If a beta tester is needed i have two Android 4 devices, tablet and phone

raystubbs
26-04-2014, 11:53
I should be able to test it on Monday, April 28, if all works as expected I will send the apk file.

Fletch1373
27-04-2014, 12:37
Has anyone written a FRC Driverstation app for Android yet?
I've just written one, all that lacks is testing. Wondering if anyone else has done the same.

Is this open-source? I'd love to get involved in it. I have 2 android 4.x devices(tablet and phone), so I can help test and/or develop.

raystubbs
29-04-2014, 11:00
I found a bug I need to fix, after that I could send you the source code if you'd like. One of the main problems I've had is the video streaming. Android is supposed to support rtsp mp4 video streaming but I haven't got it to work.

The bug I am currently working on is android's permissions and network restrictions, my code works running in a java VM on PC (both Windows and Linux), however androids permissions and limits are killing me. I hope to have this fixed in a few days.

404'd
01-05-2014, 13:55
I found a bug I need to fix, after that I could send you the source code if you'd like. One of the main problems I've had is the video streaming. Android is supposed to support rtsp mp4 video streaming but I haven't got it to work.

The bug I am currently working on is android's permissions and network restrictions, my code works running in a java VM on PC (both Windows and Linux), however androids permissions and limits are killing me. I hope to have this fixed in a few days.

Please keep us updated on this, I'm also interested and can help test.

GBilletdeaux930
01-05-2014, 15:15
I found a bug I need to fix, after that I could send you the source code if you'd like. One of the main problems I've had is the video streaming. Android is supposed to support rtsp mp4 video streaming but I haven't got it to work.

The bug I am currently working on is android's permissions and network restrictions, my code works running in a java VM on PC (both Windows and Linux), however androids permissions and limits are killing me. I hope to have this fixed in a few days.

If you open source this we can help you out with some of these issues. There are a lot of experienced devs on CD that would be willing to help. I don't know how much experience you have so I apologize if I underestimate you, but if you need help getting the code somewhere the community can contribute, PM me and I'll help you out.

dmaciel10123
05-05-2014, 09:58
16977 screenshot of my device info. Willing to help in any way possible.

raystubbs
08-05-2014, 13:05
I got it to work, now I'll make some UIs for your different screen sizes then release the apk (hopefully tomorrow).

m1506m
08-05-2014, 15:31
Cool, your awesome.

m1506m
08-05-2014, 20:56
Our team is having our end of season banquet this weekend. Would be cool to show it off there.

SRaymond
08-05-2014, 23:10
I have a Droid Razr HD phone and Nexus 7 gen 1 Tablet if that helps for the sizing

lgphoneeric
09-05-2014, 17:41
I have many android devices if you want more testing help

raystubbs
10-05-2014, 20:05
So the app is here http://slideme.org/application/androiddriverstation01?id=frc.arialassist2014.andr oiddriverstation01 but I'm not sure you'll be3 able to download it yet, so I'm setting up a github repository to be quicker, I'll post a link when finished. Please remember that:

1. This is my first android app, so don't laugh.

2. This is just a prototype, so the UIs will not be very nice and there will probably be a lot of bugs because of the junky design of the code.

Also, the buttons were not working so I changed some code and haven't been able to test it because I don't have access to a robot, so if you test it, please let me know if they work or not.

raystubbs
10-05-2014, 20:39
So the app is here http://slideme.org/application/androiddriverstation01?id=frc.arialassist2014.andr oiddriverstation01 but I'm not sure you'll be3 able to download it yet, so I'm setting up a github repository to be quicker, I'll post a link when finished. Please remember that:

1. This is my first android app, so don't laugh.

2. This is just a prototype, so the UIs will not be very nice and there will probably be a lot of bugs because of the junky design of the code.

Also, the buttons were not working so I changed some code and haven't been able to test it because I don't have access to a robot, so if you test it, please let me know if they work or not.
So here is the repository link https://github.com/raystubbs/Android-Driverstation, please let me know what works and what does not.

lucas.alvarez96
10-05-2014, 21:46
The app opens in my phone with no problems! (Moto G) I'll try it out on the robot whenever I get the chance. Are you planning on uploading the source to the repo?

dmaciel10123
10-05-2014, 21:56
App opens fine, but I'm not seeing anywhere for me to be able to configure any settings. How do we connect it to our robot?

lucas.alvarez96
10-05-2014, 21:59
I'd suppose you'd just connect to the robot's network and enable...

dmaciel10123
10-05-2014, 22:46
I'd suppose you'd just connect to the robot's network and enable...

The robot is set to a specific ip, 10.xx.xx.2, where xxxx is the team number. On a local network, devices cannot communicate unless the share a root ip, so the control device needs to be set to 10.xx.xx.y, where y is any number 1-the Max number the bridge allows. This allows the controller and robot to communicate. The driver station provided by FIRST does this for you when you enter your team number. So either the app would have to have a preset team number that it sets the phone to and you simply adjust the ip the robot is on, or you change the ip of the controller to fit.

lucas.alvarez96
10-05-2014, 22:49
:ahh:
Long time since I last opened the DS...my bad

raystubbs
10-05-2014, 23:21
The robot is set to a specific ip, 10.xx.xx.2, where xxxx is the team number. On a local network, devices cannot communicate unless the share a root ip, so the control device needs to be set to 10.xx.xx.y, where y is any number 1-the Max number the bridge allows. This allows the controller and robot to communicate. The driver station provided by FIRST does this for you when you enter your team number. So either the app would have to have a preset team number that it sets the phone to and you simply adjust the ip the robot is on, or you change the ip of the controller to fit.

I made my app so that all you have to do is configure the IP of the driverstation and the app will derive the CRIO's IP from that, so first go to the device's wifi settings and long-click the robot access point. Next enable static IP and set it to 10.xx.yy.6, set the netmask to 255.255.255.0 and thats it.

dmaciel10123
10-05-2014, 23:26
I made my app so that all you have to do is configure the IP of the driverstation and the app will derive the CRIO's IP from that, so first go to the device's wifi settings and long-click the robot access point. Next enable static IP and set it to 10.xx.yy.6, set the netmask to 255.255.255.0 and thats it.

Ah, alright. Awesome. Thanks! I'll probably try it on Monday. That's when I'll next get my hands on a robot. I'm assuming the Joystick would be on USB 1 and the axes would be 1 and 2?

raystubbs
10-05-2014, 23:44
I'm assuming the Joystick would be on USB 1 and the axes would be 1 and 2

That's right, also if there is an error don't forget that android exits an app with the back button, pushing home would just pause the app, so if you need to restart the app exit it with the back button.

raystubbs
10-05-2014, 23:47
The app opens in my phone with no problems! (Moto G) I'll try it out on the robot whenever I get the chance. Are you planning on uploading the source to the repo?

Sorry for the lack of code, in debugging the app I let the code get REALLY unorganized, to give me some time to organize and document it, then I will release it. I don't know how long this will take, since it depends on the time I have to work on it and how busy I am.

dmaciel10123
11-05-2014, 10:00
That's right, also if there is an error don't forget that android exits an app with the back button, pushing home would just pause the app, so if you need to restart the app exit it with the back button.

Alright. I'm gonna try it on a simple drivetrain before anything serious. I'll post the results as soon as I have them.

raystubbs
12-05-2014, 12:50
I just tested it, the buttons still don't work sorry. I'll work on this.

Andrew Rudolph
12-05-2014, 18:52
This is shaping up nicely, it'd be awesome if it eventually gets support for a bluetooth or usb controllers so it could be used for driver practice with real sticks.

lgphoneeric
12-05-2014, 19:37
I just tried it on our competition robot and it worked right away. The only thing I would like to see added would be a second joystick because with a mecanum drive like we have, I can't rotate without it. Very nice app though!

dmaciel10123
12-05-2014, 21:11
Tried it on our bot from last year, worked great except for difficulty turning. I think a second joystick on the screen would be great so we could use drive modes that require two.

Chiller
12-05-2014, 22:26
Tried it on our bot from last year, worked great except for difficulty turning. I think a second joystick on the screen would be great so we could use drive modes that require two.

I am actually working on bluetooth control but I was just going to have two phones connect so you could have two people controlling the robot!

raystubbs
13-05-2014, 10:13
I'm rewriting the app with a more readable structure, when I'm finished I'll open source it and anyone can help add those extra features. Also you may have noticed how empty the ui is on large devices, once I get video working I want to put it in the background of the driving view.

raystubbs
15-05-2014, 16:38
I added another joystick and got the buttons to work, but I'm not sure if it uploaded correctly so let me know if it is the same as before. Here is the link so you don't have to go back: https://github.com/raystubbs/Android-Driverstation


Also I haven't tested the second joystick since we don't have tank drive on or robot, so let me know if that works.

m1506m
15-05-2014, 16:53
Getting a, there is a problem parsing the package, error when trying to install.

cad321
15-05-2014, 17:00
Getting a, there is a problem parsing the package, error when trying to install.

I too am getting the error.

m1506m
15-05-2014, 17:10
Btw, thanks again for your work on this, and for sharing with the CD community.

markmcgary
15-05-2014, 17:19
I too am getting the error.

Is an older version already installed? If so, uninstall the old and then install the new.

Uniwersel
15-05-2014, 17:36
Is an older version already installed? If so, uninstall the old and then install the new.

I tried doing this, still getting the same exact error.

raystubbs
15-05-2014, 18:11
Getting a, there is a problem parsing the package, error when trying to install.

Sorry about this, I forgot to change the version number before compiling the app so I tried doing it manually. This is probably what caused the error. I'll recompile it and re-upload it as soon as I can (I don't always have internet access at home so that might be tomorow at school or it might be tonight), I'll post whenever this happens to let you know.

raystubbs
16-05-2014, 00:08
Sorry about this, I forgot to change the version number before compiling the app so I tried doing it manually. This is probably what caused the error. I'll recompile it and re-upload it as soon as I can (I don't always have internet access at home so that might be tomorrow at school or it might be tonight), I'll post whenever this happens to let you know.

I re-uploaded the app, but I'm still learning how to use git, so I may have made a mistake in the upload, let me know if I have please. Here is the link: https://github.com/raystubbs/Android-Driverstation/tree/master

MDAWG25
16-05-2014, 00:11
I re-uploaded the app, but I'm still learning how to use git, so I may have made a mistake in the upload, let me know if I have please. Here is the link: https://github.com/raystubbs/Android-Driverstation/tree/master

I can confirm it installs, and runs, on Android 4.4.2 Kitkat. Phone model: HTC One XL

Great job on the app, by the way.

MDAWG25
16-05-2014, 00:21
As I can only offer suggestions, I have no experience with Android apps, offer a settings page to setup joystick configuration. So instead of two separate joysticks, one joystick with 2 axes. (like an xbox controller)

raystubbs
16-05-2014, 09:58
As I can only offer suggestions, I have no experience with Android apps, offer a settings page to setup joystick configuration. So instead of two separate joysticks, one joystick with 2 axes. (like an xbox controller)

Thanks, thats a good suggestion, I should have thought of it since that is how all of the other joysticks work.

guniv
16-05-2014, 10:10
Going to try and test this out later. You should look into adding support for controllers. Would mean we still have full control but don't have to haul a laptop around.

raystubbs
16-05-2014, 13:20
Going to try and test this out later. You should look into adding support for controllers. Would mean we still have full control but don't have to haul a laptop around.

I did a little research on adding support for a physical joystick, it seems pretty easy but you need an OTG cable. I just ordered one, so hopefully by the end of summer vacation (August) the app will support a physical joystick.

Andrew Rudolph
16-05-2014, 13:41
Another temporary solution for controllers is using the sixaxis app,
https://play.google.com/store/apps/details?id=com.dancingpixelstudios.sixaxiscontroll er

This allows you to define areas that correlate to button presses on a six-axis PS3 controller, of course you have to root the device and you have to use a six-axis so if you can get OTG cable support it would be epic.

raystubbs
16-05-2014, 13:57
Another temporary solution for controllers is using the sixaxis app,
https://play.google.com/store/apps/details?id=com.dancingpixelstudios.sixaxiscontroll er

This allows you to define areas that correlate to button presses on a six-axis PS3 controller, of course you have to root the device and you have to use a six-axis so if you can get OTG cable support it would be epic.

Thanks for the info, it could prove useful, however I am developing on a Kindle Fire 2nd gen. (which doesn't have Bluetooth) and haven't gotten around to figuring out how to root it. Also I would like the app to be available to those who do not want to root their device.

Joel Glidden
16-05-2014, 14:01
What about a Bluetooth interface for a PS3 controller or Wiimote? I know these things have been done on the Android platform already. I wonder if there's any open source code to pull from.

raystubbs
16-05-2014, 14:05
What about a Bluetooth interface for a PS3 controller or Wiimote? I know these things have been done on the Android platform already. I wonder if there's any open source code to pull from.

It would be awsome to eventually add support for these devices, but really I'm not that good a programmer yet, this is actually my first android app, and I've never worked with bluetooth before. Hopfully when I open source the app some of you at CD can help me out with some of this.

guniv
16-05-2014, 22:02
I did a little research on adding support for a physical joystick, it seems pretty easy but you need an OTG cable. I just ordered one, so hopefully by the end of summer vacation (August) the app will support a physical joystick.

OTG cables are absolutely awesome, I can transfer photos from my DSLR to my tablet and post to our team's FB page in a minute.

I was thinking more Nvidia Shield, though, which was given away to many teams for free at Champs as I understand it. Big market for you there. I own one personally and it'd be awesome to control the robot from it. For now I can use the Shield's gamepad mapper to use it which should work just as well.

There's a lot of potential here. Looking forward to seeing where this goes.

raystubbs
16-05-2014, 22:31
OTG cables are absolutely awesome, I can transfer photos from my DSLR to my tablet and post to our team's FB page in a minute.

I was thinking more Nvidia Shield, though, which was given away to many teams for free at Champs as I understand it. Big market for you there. I own one personally and it'd be awesome to control the robot from it. For now I can use the Shield's gamepad mapper to use it which should work just as well.

There's a lot of potential here. Looking forward to seeing where this goes.

I cannot guaranty it since I know nothing about the Shield, but I just looked it up and if I'm guessing correctly and if the Shield runs android, than the same code to add support for an external joystick will also work perfectly for the Shield joystick.

guniv
17-05-2014, 18:29
I cannot guaranty it since I know nothing about the Shield, but I just looked it up and if I'm guessing correctly and if the Shield runs android, than the same code to add support for an external joystick will also work perfectly for the Shield joystick.

Awesome.

Today we took two of our robots down to a large fair for kids and let them check out the robots. Our smaller robot that was just a chassis was controlled by your app the entire day from my Shield. I wasn't there as I had another robotics thing going on a short distance away, but I heard of no problems with it. Makes it easy for us to do this since we don't have to haul a laptop around, and even has better battery.

raystubbs
18-05-2014, 18:20
I added a bit of code for external joystick or Shield joystick support, completely untested as I have no joystick nor any means to connect a joystick to my device. If the code works it will only support the joysticks and not the buttons. I kind of doubt that this will work, but please let me know if it does.
Same link: https://github.com/raystubbs/Android-Driverstation.

raystubbs
20-05-2014, 13:15
Anyone who has tried this app please PM me with your device model, OS version, and any comments, complaints, or recomendations. I would like to know which devices the app works on and how well it works. Thanks.:confused:

raystubbs
21-05-2014, 08:33
Sorry, in the previous version of the app the buttons did not work on a normal sized phone screen. Please don't use this version, it is pretty unpredictable. I fixed the error and uploaded the app to the same repo.

raystubbs
22-05-2014, 17:14
I just worked out the last major bug in the open source version, I opened up a new repository. It has all of my code and the binary file. Let pe know if the binary doesn't work, I just copied and pasted the UI's from the prototype version so they may have bugs.

Note: Though the UI on larger screens has a video switch, it does not do anything yet. If anyone wants to help on this project, getting the video to work would be great.

Spok
22-05-2014, 22:28
I tried both of the versions, and I'm having trouble installing the .apk onto my devices. I also have not had any previous versions of this app. I have a Samsung Galaxy S4 running Android 4.4.2 and I get an error in parsing the package. Do you have any suggestions?

raystubbs
23-05-2014, 09:51
I tried both of the versions, and I'm having trouble installing the .apk onto my devices. I also have not had any previous versions of this app. I have a Samsung Galaxy S4 running Android 4.4.2 and I get an error in parsing the package. Do you have any suggestions?

You get a parsing error on both versions? Others have installed it on their galaxys. Do you have "Allow applications from unknown sources" enabled? This needs to be enabled if it is not.

dmaciel10123
23-05-2014, 10:32
With the newest version (from both repos) the app crashes when I try to launch it.

Here's the log from the Binary from the Source repo:
05-23 10:35:48.082 E/AndroidRuntime(4855): java.lang.RuntimeException: Unable to resume activity {com.example.driverstation/com.example.driverstation.MainActivity}: java.lang.NumberFormatException: Invalid int: "30-80"

Also, I downloaded the source and am going to look at getting the video feed working for you.

raystubbs
23-05-2014, 11:03
With the newest version (from both repos) the app crashes when I try to launch it.

Here's the log from the Binary from the Source repo:
05-23 10:35:48.082 E/AndroidRuntime(4855): java.lang.RuntimeException: Unable to resume activity {com.example.driverstation/com.example.driverstation.MainActivity}: java.lang.NumberFormatException: Invalid int: "30-80"

Also, I downloaded the source and am going to look at getting the video feed working for you.

Thanks for letting me know, this should be easy to fix.

raystubbs
23-05-2014, 11:33
With the newest version (from both repos) the app crashes when I try to launch it.

Here's the log from the Binary from the Source repo:
05-23 10:35:48.082 E/AndroidRuntime(4855): java.lang.RuntimeException: Unable to resume activity {com.example.driverstation/com.example.driverstation.MainActivity}: java.lang.NumberFormatException: Invalid int: "30-80"

Also, I downloaded the source and am going to look at getting the video feed working for you.


I don't get this error, could you try re-installing the app. Sorry, I don't know what else to do since I can't work on a problem I don't have. On second thought, what type of device do you have? If it is a problem with the UI that it could be specific to the screen-size. I will launch the app on an emulator of a smaller screen and see what I can find out.

raystubbs
23-05-2014, 11:40
I don't get this error, could you try re-installing the app. Sorry, I don't know what else to do since I can't work on a problem I don't have. On second thought, what type of device do you have, if it is a problem with the UI that it could be specific to the screen-size. I will launch the app on an emulator of a smaller screen and see what I can find out.

I tried the app on and emulator and it works fine. I'm actually baffled by this error being in both apps since in the second one I don't have any integers or any code that used integers. But in the first version I can see where this error could come from, but since I don't get the error I can't investigate.

Maybe it is a version error, try uninstalling the app, and re-downloading it maybe? If you do this I would suggest redownloading the second app (Android-FRC-Driverstation).

dmaciel10123
23-05-2014, 11:40
I don't get this error, could you try re-installing the app. Sorry, I don't know what else to do since I can't work on a problem I don't have. On second thought, what type of device do you have, if it is a problem with the UI that it could be specific to the screen-size. I will launch the app on an emulator of a smaller screen and see what I can find out.

I'll reinstall again and check for any errors. I have a Samsung Galaxy S3.

Edit: I think it may be because of the network I'm connected to. The IP I was assigned had 3 characters in the 3rd portion of the IP. I changed my network settings and it was able to start normal.

raystubbs
23-05-2014, 12:24
I'll reinstall again and check for any errors. I have a Samsung Galaxy S3.

Edit: I think it may be because of the network I'm connected to. The IP I was assigned had 3 characters in the 3rd portion of the IP. I changed my network settings and it was able to start normal.

O, yea, that would do it, it's strange to have characters in an ipv4 IP (I didn't anticipate it), I have only ever heard of them in ipv6 and mac addresses.

dmaciel10123
23-05-2014, 14:25
O, yea, that would do it, it's strange to have characters in an ipv4 IP (I didn't anticipate it), I have only ever heard of them in ipv6 and mac addresses.

Sorry not characters, integers. The IP was xx.xx.xxx.xx instead of xx.xx.xx.xx. The three integers being in the 3rd quarter of the IP messed it up.

Also, I was messing around and added some simple code that may be able to display video but I can't test it yet because I don't have a robot or IP camera. I'll test it probably tomorrow at BattleCry.

raystubbs
23-05-2014, 14:38
Sorry not characters, integers. The IP was xx.xx.xxx.xx instead of xx.xx.xx.xx. The three integers being in the 3rd quarter of the IP messed it up.

Also, I was messing around and added some simple code that may be able to display video but I can't test it yet because I don't have a robot or IP camera. I'll test it probably tomorrow at BattleCry.

Could you upload the code to the repo please? I have access to a robot right now and could test the code.

dmaciel10123
23-05-2014, 15:11
Could you upload the code to the repo please? I have access to a robot right now and could test the code.

Sure. Give me a few minutes so I can get my hands on a computer. I've been using my phone all day.

Edit: wow okay whoops. I dun goofed. Just tried opening it with the code I added and it crashed immediately. I'll keep working on it.

raystubbs
23-05-2014, 15:44
Sure. Give me a few minutes so I can get my hands on a computer. I've been using my phone all day.

Edit: wow okay whoops. I dun goofed. Just tried opening it with the code I added and it crashed immediately. I'll keep working on it.

Are you using VideoView? What I've tried is:


video = (VideoView)findViewById(R.id.video);

// Set uriString to "rtsp://10.xx.yy.11/axis-media/media.3gp"
String uriString = "rtsp://" + "10." + Integer.toString((addr & 0xff0000)>>16) //"rtsp://10.xx.yy.11/axis-media/media.3gp"
+"."+ Integer.toString((addr & 0xff00)>>8) + ".11/" + "axis-media/media.3gp";

video.setVideoURI(Uri.parse(uriString));
video.requestFocus();
video.start();


Nothing happens for a while, but then a dialog comes up and says that it can't play the video.

dmaciel10123
23-05-2014, 16:11
Are you using VideoView? What I've tried is:


video = (VideoView)findViewById(R.id.video);

// Set uriString to "rtsp://10.xx.yy.11/axis-media/media.3gp"
String uriString = "rtsp://" + "10." + Integer.toString((addr & 0xff0000)>>16) //"rtsp://10.xx.yy.11/axis-media/media.3gp"
+"."+ Integer.toString((addr & 0xff00)>>8) + ".11/" + "axis-media/media.3gp";

video.setVideoURI(Uri.parse(uriString));
video.requestFocus();
video.start();


Nothing happens for a while, but then a dialog comes up and says that it can't play the video.

I'm actually trying to load the image that the Axis Camera saves at image.jpg and set it as the background at about 30 fps

raystubbs
23-05-2014, 16:18
What is the full uri (path) of the image file? I thought of using the image before. I knew the axis had one I just didn't know where it was.

dmaciel10123
23-05-2014, 16:33
I'm pretty sure it's just http://10.xx.xx.11/image.jpg
I may be wrong, but I do have a code that theoretically will work. I just can't test it yet. I uploaded the code to a forked repo at https://github.com/crazyman10123/Andrid-FRC-Driverstation
I didn't upload a new binary, just the code.

raystubbs
23-05-2014, 16:54
I'm pretty sure it's just http://10.xx.xx.11/image.jpg
I may be wrong, but I do have a code that theoretically will work. I just can't test it yet. I uploaded the code to a forked repo at https://github.com/crazyman10123/Andrid-FRC-Driverstation
I didn't upload a new binary, just the code.

Thanks, I'll try this when I get a chance, I no longer have access to our robot.

I do have a question though, does it work to put your code in the start() method of a thread? I have only ever put code in the run() method.

dmaciel10123
23-05-2014, 17:04
I probably should change it to the run() method because the way it is right now, start() would never end. I wasn't even paying attention to that haha thanks.

Edit: I fixed the start/run methods, and uploaded the changes to the repo. I'll also be trying it tomorrow at BattleCry when I have access to our bot.

Dr.Gusta
23-05-2014, 19:16
I have a Galaxy S4 and I don't have the option to set my subnet mask and it is asking me for a lot more information. Like Default Gateway, DNS, etc when I try to set up a static IP as instructed.

Ben Wolsieffer
23-05-2014, 19:35
I got it installed on my tablet (an HP Touchpad running CyanogenMod), and the layout looks fine. I haven't been able to test it on our bot yet since we were busy packing for BattleCry :).

Dr.Gusta
23-05-2014, 20:05
I have a Galaxy S4 and I don't have the option to set my subnet mask and it is asking me for a lot more information. Like Default Gateway, DNS, etc when I try to set up a static IP as instructed.

Okay so I got this figured out and got connected to the robot but the controls are unresponsive. When I enable the robot in the app the compressor comes on so I know something is happening but I can not control the robot at all. The status light also never tells me the robot is enabled.

raystubbs
23-05-2014, 20:55
Okay so I got this figured out and got connected to the robot but the controls are unresponsive. When I enable the robot in the app the compressor comes on so I know something is happening but I can not control the robot at all. The status light also never tells me the robot is enabled.

When did you download the app? It has been changed quite a bit since the first upload. If anyone else has a problem like this please let us know.

Edit: Also, if the robot was not enabled than the compressor would not work would it?

Dr.Gusta
23-05-2014, 21:04
I am running the most up to date version and the compressor does not come on until I hit enable but nothing else works.

raystubbs
23-05-2014, 21:09
I am running the most up to date version and the compressor does not come on until I hit enable but nothing else works.

I'll look into it, it is strange that it wouldn't work, I was just using it. Are you using a phone or tablet? Large (5-7"), normal (3-4"), or small (<3")?

Dr.Gusta
23-05-2014, 21:46
I'll look into it, it is strange that it wouldn't work, I was just using it. Are you using a phone or tablet? Large (5-7"), normal (3-4"), or small (<3")?

I am using a Galaxy S4

raystubbs
23-05-2014, 23:12
I am using a Galaxy S4

OK, I'll see what I can find out, but I let out for summer vacation today and am going home to Mexico, so I will not have access to a robot.

dmaciel10123
24-05-2014, 05:57
OK, I'll see what I can find out, but I let out for summer vacation today and am going home to Mexico, so I will not have access to a robot.

I'll have access to a robot for the weekend if you need me to take a look at anything

raystubbs
24-05-2014, 14:29
I'll have access to a robot for the weekend if you need me to take a look at anything

I would appreciate if you could see what you can find out about Dr.Gusta's problem, you have a galaxy right? If the app works on your phone than there is no reason why it should not work on his. Thanks for all the help you have given.

I found out something about the video, it may not work, but if you would like to try it:

On the example of video code in one of my previous posts I made the URI as:
"rtsp://10.xx.yy.11/axis-media/media.3gp"

It should have been :
"rtsp://10.xx.yy.11:554/axis-media/media.3gp?videocodec=h264"

In the second URI I added the :554 after the IP address and at the end I added ?videocodec=h264 which is not necessary except for choosing the video settings, it is unneeded for the default settings.

raystubbs
24-05-2014, 15:06
I added code to support physical joysticks and buttons if anyone wants to try it out, I have no idea if it will work, have not tested it at all.

dmaciel10123
24-05-2014, 23:01
I'll see what I can do tomorrow, sorry. Didn't have much spare time today haha. Also, I found where the single image is saved, it's at http://10.xx.xx.11/axis-cgi/jpg/image.cgi so I modified my code to load from that with the default settings at about 30 FPS, so I'll see if that works tomorrow as well. I may need to work on a way to get the regular image rather than the CGI page, though, so I've been looking at various JPEG Decoder tutorials trying to find out what to do.

raystubbs
25-05-2014, 00:28
I'll see what I can do tomorrow, sorry. Didn't have much spare time today haha. Also, I found where the single image is saved, it's at http://10.xx.xx.11/axis-cgi/jpg/image.cgi so I modified my code to load from that with the default settings at about 30 FPS, so I'll see if that works tomorrow as well. I may need to work on a way to get the regular image rather than the CGI page, though, so I've been looking at various JPEG Decoder tutorials trying to find out what to do.

Thanks.
I was messing with the camera a while ago and found another image file at http://10.xx.xx.11/jpg/image.jpg for if the other doesn't work.

dmaciel10123
25-05-2014, 07:17
Oh, thanks haha. I wrote some code that should be able to get the image from the CGI page, but if it doesn't work (and for some reason I feel like it won't) I'll just switch it over to use the URL you found.

dmaciel10123
25-05-2014, 19:30
Okay, so, I tried the app today after we got eliminated and everything worked: joysticks and buttons. I still haven't gotten the image to show but I am continuing to work on it and hope to have it working soon.

raystubbs
25-05-2014, 22:54
Okay, so, I tried the app today after we got eliminated and everything worked: joysticks and buttons. I still haven't gotten the image to show but I am continuing to work on it and hope to have it working soon.

It's good that everything still works. Any idea why Dr.Gusta's didn't work? I have no idea.

Chiller
25-05-2014, 23:07
It's good that everything still works. Any idea why Dr.Gusta's didn't work? I have no idea.

With my iPhone version I have had it where the robot code gets initialized but the run code does not and also the RSL does not signal that it is enabled.

It was because the timing on sending the packets was off, it has to be exactly 0.02 seconds.

raystubbs
26-05-2014, 09:31
With my iPhone version I have had it where the robot code gets initialized but the run code does not and also the RSL does not signal that it is enabled.

It was because the timing on sending the packets was off, it has to be exactly 0.02 seconds.

Thanks for the information, I'll try to fix this.

raystubbs
26-05-2014, 09:33
I got the video to work, I used dmaciel10123's idea to get it to work, it may not be very fast, I have no idea how it will work since I have only tested it on an emulator. Feedback is appreciated.

Ben Wolsieffer
27-05-2014, 21:20
I submitted a pull request that should make it easier to allow people to work on your code. It adds a .gitignore file that ignores the Eclipse build directory and auto-generated files. This makes it so only changes to code and other important files actually show up in the commit so people do not need to merge in a bunch of minor changes each time you push to the repo.

I hope you consider this. Thanks, Ben.

jpkelly26
27-05-2014, 22:08
This is sweet! Thanks.

Installed successfully on Samsung Galaxy SIII running Android 4.3 and on a Motorola Xoom tablet running Android 4.1.2. Next step, get access to our robot!

guniv
28-05-2014, 16:50
Now that the iOS app (https://itunes.apple.com/us/app/driver-station/id870615825?ls=1&mt=8) is out, maybe work with them and see how they got features working? You guys are competing in different markets, so collaboration would help a lot. They've gotten video working on their end, apparently. Gonna have some team members pick up the app (our school is 1:1 tech on iPads) and see what they think.

guniv
09-06-2014, 10:03
This thread is quite dead. Ray's GitHub seems to be taken down as well.
In any case, I used this app with my Nvidia Shield and it's built in Gamepad Mapper this weekend at a carnival we were at this weekend, and drove around one of our stripped down chassis. I was also able to hand off the Shield to other people and let them drive, like the kid in this video (https://www.youtube.com/watch?v=6hFhmqs2YsI&feature=youtu.be).

dmaciel10123
09-06-2014, 10:29
This thread is quite dead. Ray's GitHub seems to be taken down as well.
In any case, I used this app with my Nvidia Shield and it's built in Gamepad Mapper this weekend at a carnival we were at this weekend, and drove around one of our stripped down chassis. I was also able to hand off the Shield to other people and let them drive, like the kid in this video (https://www.youtube.com/watch?v=6hFhmqs2YsI&feature=youtu.be).


The GitHub is still up, it's just at a different repo now.
https://github.com/raystubbs/Andrid-FRC-Driverstation

guniv
09-06-2014, 10:36
The GitHub is still up, it's just at a different repo now.
https://github.com/raystubbs/Andrid-FRC-Driverstation

Oh! My bad. Thanks!

Chiller
09-06-2014, 16:44
Now that the iOS app (https://itunes.apple.com/us/app/driver-station/id870615825?ls=1&mt=8) is out, maybe work with them and see how they got features working? You guys are competing in different markets, so collaboration would help a lot. They've gotten video working on their end, apparently. Gonna have some team members pick up the app (our school is 1:1 tech on iPads) and see what they think.

Just released the native iPad version so make sure you update!

Chiller
09-06-2014, 16:47
I got the video to work, I used dmaciel10123's idea to get it to work, it may not be very fast, I have no idea how it will work since I have only tested it on an emulator. Feedback is appreciated.

I just use a simple html document that loads the feed and if it times out then it displays a message, all with jQuery

Just load the html file into a string and replace {jquery} with the contents of a jquery library file and also replace {te} and {am} with teamNum / 100, teamNum % 100, and also replace width and height with the web views width and height and wallah!


<html>
<head>
<script type="text/javascript">{jquery}</script>

<script type="text/javascript">
var timeout;

$(function() {
$("#errordiv").click(reload);
$("#stream").click(reload);

reload();
});

function reload()
{
$("#error").text("Loading Camera...");

$("#stream").attr("src", "http://10.{te}.{am}.11/mjpg/video.mjpg?resolution=640x480&fps=30");

timeout = setTimeout(function() {
//Cam did not load

$("#error").html("Error Loading Camera<br/>Tap to Refresh");

$("#stream").css({"display":"none"});
$("#errordiv").css({"display":"block"});
}, 4000);

$("#stream").load(function() {
$("#stream").css({"display":"block"});
$("#errordiv").css({"display":"none"});

clearTimeout(timeout);
}).error(function() {
$("#error").html("Error Loading Camera<br/>Tap to Refresh");

$("#stream").css({"display":"none"});
$("#errordiv").css({"display":"block"});

clearTimeout(timeout);
});
}
</script>
</head>
<body style="padding: 0; margin: 0;">
<div id="errordiv" style="display: none; background: lightgray; height: 100%; text-align: center;">
<label id="error" style="position: relative; top: 40%;">Tap to refresh camera</label>
</div>

<img id="stream" width="{width}" height="{height}"/>
</body>
</html>

m1506m
09-06-2014, 19:59
Tried the app out tonight, I am able to connect and enable, but since we are set up for cheesy drive, and not tank, I can only go forward and backward. And after about a minute the connection turns off and I loose connection.

DavisC
21-06-2014, 12:07
After connecting to the Robot wifi and launching the app, does the app handle everything necessary with IP addresses (in other words, should it just work out of the box like that?)

guniv
21-06-2014, 13:13
After connecting to the Robot wifi and launching the app, does the app handle everything necessary with IP addresses (in other words, should it just work out of the box like that?)

We've had to go in through Android's Wi-Fi settings and set the static IP ourselves.

raystubbs
23-06-2014, 20:59
Sorry for all the problems, some of them may have been caused by bandwidth taken by the video, which I haven't tested. I only have a kindle fire to test with and it worked perfect before I added the video code. I'm not in the U.S right now and don't have access to any robots. I will try to buy another device by the beginning of the school year, so I'll be able to debug for another device.

Reminder: This is an open source project, a pretty easy project, and my first android app. So anyone interested in trying their hand at android development this would be a good place to start.

tanogirl
29-06-2014, 23:15
This might be a stupid question... but is there a trick to installing it? I have an Asus MemoPad and could get it to install but the app wouldn't open.

dmaciel10123
29-06-2014, 23:51
This might be a stupid question... but is there a trick to installing it? I have an Asus MemoPad and could get it to install but the app wouldn't open.
Is it crashing or just not opening at all?

MatthewC529
30-06-2014, 01:57
This might be a stupid question... but is there a trick to installing it? I have an Asus MemoPad and could get it to install but the app wouldn't open.

Hmm thats interesting. There is really no way to get Log information in this case which is a problem... maybe I will try to create a Pull Request to get a logging system in place for issues like this.

If you can try running it and get LogCat information that would be awesome. It will report the exception if there is one and five us the exact processes leading up to and after the exception as well as the Stack Trace.

guniv
30-06-2014, 04:15
It may have something to do with his Android version. That sounds like an old device that prooooobably isn't supported very well.

Now that Android Wear watches are out, someone should make this app for it :D

dmaciel10123
30-06-2014, 05:37
It may have something to do with his Android version. That sounds like an old device that prooooobably isn't supported very well.

Now that Android Wear watches are out, someone should make this app for it :D
It could be the version or the IP. When I was trying to get the camera working the app wouldn't open if the IP had more than 2 numbers in a segment (ie 192.168.1.70) because of the way the all sets the team number from the IP. All depends on the way it's acting when they try to open it.

If they were able to install it though I don't think it's the android version.

tanogirl
30-06-2014, 07:04
Its not the device, its less than 6 months old and running Jelly Bean- could that be the problem? And this is what I get when I try to open it 17136.

dmaciel10123
30-06-2014, 09:44
Its not the device, its less than 6 months old and running Jelly Bean- could that be the problem? And this is what I get when I try to open it 17136.

Did you change the IP on your device before opening it? Go into the WiFi settings and long tap the network you're on. Tap on modify network and then check the "show advanced settings" option. Then change the IP Settings from "DHCP" to "Manual" or "Static", and change the IP to 10.12.34.6 and the subnet mask or gateway to 255.255.255.0

This may solve the crash but you'll lose Internet connectivity until you put the network back into DHCP mode.

To use it on a robot you'd change the 1234 in the IP to your team number, ie 10.35.25.6 for my team.

tanogirl
30-06-2014, 12:00
Ohhh that was it! Got it open and it looks great! Can't wait to try it with one of our bots!

MatthewC529
30-06-2014, 16:09
It may have something to do with his Android version. That sounds like an old device that prooooobably isn't supported very well.

Now that Android Wear watches are out, someone should make this app for it :D

Just to make this clear, the program as it is now is listed as supporting a Minimum API Level of 14. This means it will support Ice Cream Sandwich and Above. As it stands now, until it is changed because it can be even further lowered, devices that still run Honeycomb and Lower can NOT run the program. The Target SDK is 18 (Jelly Bean 4.3) but it should support anything between Ice Cream Sandwich and Android L.

Just making this clear since this means the App will (and there is nothing in the code to prevent it from doing so, Eclipse would let you know that) run on any Jelly Bean device.

raystubbs
01-07-2014, 10:14
Just so that everybody knows, there is code in the app so support joysticks, it should work with any joystick that you manage to connect to your device including OTG and bluetooth. This feature is untested, so I would appreciate feedback if you try any kind of joystick.

raystubbs
06-07-2014, 15:09
Hmm thats interesting. There is really no way to get Log information in this case which is a problem... maybe I will try to create a Pull Request to get a logging system in place for issues like this.

If you can try running it and get LogCat information that would be awesome. It will report the exception if there is one and five us the exact processes leading up to and after the exception as well as the Stack Trace.

I now this is an older post, but just so people know there is an app on the android market called ´aLogcat´ that does allow you to get log info.

raystubbs
06-07-2014, 15:17
Hmm thats interesting. There is really no way to get Log information in this case which is a problem... maybe I will try to create a Pull Request to get a logging system in place for issues like this.

If you can try running it and get LogCat information that would be awesome. It will report the exception if there is one and five us the exact processes leading up to and after the exception as well as the Stack Trace.

I know this is an older post, but just so people know there is an app on the android market called ´aLogcat´ that does allow you to get log info.

raystubbs
06-07-2014, 16:31
Hmm thats interesting. There is really no way to get Log information in this case which is a problem... maybe I will try to create a Pull Request to get a logging system in place for issues like this.

If you can try running it and get LogCat information that would be awesome. It will report the exception if there is one and five us the exact processes leading up to and after the exception as well as the Stack Trace.

I know this is an older post, but just so people know there is an app on the android market called ´aLogcat´ that does allow you to get log info.

MatthewC529
07-07-2014, 19:02
I know this is an older post, but just so people know there is an app on the android market called ´aLogcat´ that does allow you to get log info.

Alternatives include CatLog, Logcat Extreme, Log Viewer and so on. Plenty of apps to this. Thanks for adding that on!

It wouldn't hurt to have a logging utility built in to the app though no? As an easily retrievable log file? A simple endeavor using Log4j. I have also been looking into the best way to retrieve a video feed, automatically changing and reverting the IP and keeping track of the Team Number between application instances. Just to make it more convenient without having to have people dig through the Network Settings to run it on their phone, it would simply be more convenient to have the app do it for you with sufficient permissions.

raystubbs
10-07-2014, 09:18
Alternatives include CatLog, Logcat Extreme, Log Viewer and so on. Plenty of apps to this. Thanks for adding that on!

It wouldn't hurt to have a logging utility built in to the app though no? As an easily retrievable log file? A simple endeavor using Log4j. I have also been looking into the best way to retrieve a video feed, automatically changing and reverting the IP and keeping track of the Team Number between application instances. Just to make it more convenient without having to have people dig through the Network Settings to run it on their phone, it would simply be more convenient to have the app do it for you with sufficient permissions.

Yes, I've figured out all of this except efficient video. I just haven't taken the time to implement the features. This app was designed to be functional and light, but not super convinient. It was more a test run than anything. Right now I'm working on whan I want to be the final implementation of the app. One of the main complaints with the current one seems to be that it is not compatible with all drive systems. So on this other implementation I am going to add the other requested features, but also I'm adding a 'drag and drop' interface to customize the layout of the controls.

raystubbs
20-07-2014, 01:23
Published the app on google play to make it easier to download.

https://play.google.com/store/apps/details?id=littlebot2014.driverstation_lite