Android client with basic support for PS3 controller

Firmware/software/electronics/mechanics
derf
Expert
Posts: 163
Joined: Fri May 31, 2013 12:17 am
Location: Germany

Re: Android client with basic support for PS3 controller

Post by derf »

@Surrender
Yes, attaching/detaching the CrazyRadio does not work reliably yet. I'm working on it. :roll:
In the meantime force-closing the app and plugging in the CrazyRadio while the app is not started should work.
Surrender
Expert
Posts: 100
Joined: Tue May 14, 2013 8:31 pm
Location: Austria

Re: Android client with basic support for PS3 controller

Post by Surrender »

Thanks for this information, I will try it when I'm back @ home.
I attached the CrazyRadio only when I started the program before :D
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Android client with basic support for PS3 controller

Post by tobias »

@derf
I have now given you write access to the Android repository. Have fun ;)
derf
Expert
Posts: 163
Joined: Fri May 31, 2013 12:17 am
Location: Germany

Re: Android client with basic support for PS3 controller

Post by derf »

@tobias
Thanks. I will try to push my changes to the official repo in the next days.
Unfortunately there seems to be no easy way to move and merge (!) the issues from my fork to the original repo.
I guess I have to kindly ask DesTinY to re-create them. ;)

I'm currently trying to get the firmware-based channel scanning working, but I'm stuck.
Here is what I gathered from the wiki (http://wiki.bitcraze.se/projects:crazyradio:protocol) and crazyradio.py:
-Initiate scan with START_SCAN_CHANNELS as a vendor request with a USB "control transfer"
-Get the channels with GET_SCAN_CHANNELS as a vendor request with a USB "control transfer"

In Android/Java code it would look something like this, I guess.

Code: Select all

byte[] packet = new byte[2];
packet[0] = (byte) 255;
            
byte [] rdata = new byte[64];
mConnection.controlTransfer(0x40, 0x21, 0, 125, packet, packet.length, 1000);
mConnection.controlTransfer(0xC0, 0x21, 0, 0, rdata, rdata.length, 1000);
I'm probably missing something very simple, but rdata is not filled (all zeros).
Can you shed some light on this?
derf
Expert
Posts: 163
Joined: Fri May 31, 2013 12:17 am
Location: Germany

Re: Android client with basic support for PS3 controller

Post by derf »

In other news, here is a new version of my Crazyflie Android client fork:
=> https://bitbucket.org/fredg02/crazyflie ... -07-03.apk

Changelog:
-Connecting/disconnecting the Crazyradio is more reliable now.
-Implemented "slow" client radio scan (no firmware scan yet)
-> It finds only the first available Crazyflie at the moment. (Who has more than one Crazyflie anyway? ;) )

Please report any issues in the official Crazflie Android client issue tracker:
=> https://bitbucket.org/bitcraze/crazyfli ... ent/issues
DesTinY
Member
Posts: 97
Joined: Sat Feb 09, 2013 5:18 pm
Location: Bünde, Germany

Re: Android client with basic support for PS3 controller

Post by DesTinY »

derf wrote: I guess I have to kindly ask DesTinY to re-create them. ;)
Yes, sure i can do it! The resolved ones, too? (For the record.)

In my opinion the CF App is almost ready to publish it easier for all the other CF users. Have you thought about to publish it to the Android Store as FreeApp.
Maybe the bitcraze Team can do this, with an Dev account at Google!?

Anyway, really good work derf!
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Android client with basic support for PS3 controller

Post by marcus »

DesTinY wrote: In my opinion the CF App is almost ready to publish it easier for all the other CF users. Have you thought about to publish it to the Android Store as FreeApp.
Maybe the bitcraze Team can do this, with an Dev account at Google!?
I agree that it would be the easiest. We will get a bitcraze dev account so the app can be published.

Great work derf! I still haven't tried it yet since I don't have an Android device with USB OTG/HOST anymore :-( I used to run the old client on my Samsung S2 but I don't have it anymore...
derf
Expert
Posts: 163
Joined: Fri May 31, 2013 12:17 am
Location: Germany

Re: Android client with basic support for PS3 controller

Post by derf »

@DesTinY & marcus
Yes, I think the app is getting closer to being useable. ;)

I'd still like to implement and test a few things (versioning, updating, etc.) before publishing it to Google Play.
While it's definitely cool and convenient to have it in the store, I don't think any Crazyflie owner
would miss out on the Android app, because it's not in the store yet. So I'd not consider it as highly time critical.
veeduber

Re: Android client with basic support for PS3 controller

Post by veeduber »

derf,

I just got my crazyFlie together tonight, and I am hoping to use your android app. Could you give me a sort of shopping list for which cables to get? Sorry to ask, but when looking online, there are a bunch of Y cables. I am assuming I need a single male end to plug into the USB-->microUSB dongle and thern two femal ends to accept 1. the controller (Still need to get that) and 2. power? I am not sure what I am powering. Is it the joystick?

Maybe I am misunderstanding the config of the Y cable. Does it go into the joystick? - Thanks, Kevin
Surrender
Expert
Posts: 100
Joined: Tue May 14, 2013 8:31 pm
Location: Austria

Re: Android client with basic support for PS3 controller

Post by Surrender »

Morning,
You need not a Y cable but a USB OTG cable (micro or mini usb female to USB female with special setting in cable).
These costs around 3-5€ on amazon.
I can check my shopping history which one i have choosen.

This USB OTG is connected to your phone and you plug in the crazyradio to the usb.
You have to install the android app and then attach your crazyradio and then start the app.
Now you have a virtual joystick on the phone display and with this you can control your crazyflie.

Conlusion: When using the android app you don't need any external controller, only the phone, the usb otg cable and the crazyradio.

I hope you can use this answer (:

Sent from my GT-I9100 using Tapatalk 4 Beta
Post Reply