imurvai

[WIP] Control SBrick and BuWizz with Android and iOS Game Controller

Recommended Posts

I have tried version 0.9 on an Samsung Galaxy Note II LTE GT-N7105 running Andriod 4.4.2.

I connect the PS3 controller to the GT-N7105 with an OTG cable as shown in the attached picture and it works. But not for Bluetooth connection.

I use it on a car with 4 M Motor for acceleration and 1 Servo Motor for steering. I assign Button A to go forward, Button B to go backward, Left Joy Horizontal to do the steering. 

Below are some observations:

1. When the car is moving forward and I want to go backward, I have to release A and wait until the car stop (about 1 sec.) and then press B.  If I press B without waiting the car stop, I will experience a power drop and the car can only go backward with lower speed (sometime even don't move), just like it is running out of battery. If I release B at this situation and wait for about a sec., full power backward or forward can be resumed.

2. Sometimes when I launch the app, I can test the channels of all SBricks under the "Manage SBricks" but when I play a profile, the connection just can't be established. If I go to the bluetooth menu, I can see that the SBricks are not connected and I need to turn off bluetooth and on again and connect each of the SBricks under the bluetooth menu (not in the app).

Am I doing something wrong?

2017-02-23_20-46-42_IMG_8974.JPG

Share this post


Link to post
Share on other sites
4 hours ago, Desmond said:

1. When the car is moving forward and I want to go backward, I have to release A and wait until the car stop (about 1 sec.) and then press B.  If I press B without waiting the car stop, I will experience a power drop and the car can only go backward with lower speed (sometime even don't move), just like it is running out of battery. If I release B at this situation and wait for about a sec., full power backward or forward can be resumed.

 

are you sure it is not the BB that is damaged? try to accelerate by repeatedly pressing A button and see if the car slow down after some acceleration, it can be the thermal cut off of the BB that is old and cut the current at a lower power consumption than it should be (well.. 4 m motors are a lot) even try to go forward/backward with only the BB switch and see if the problem appears again, if yes change BB (but not batteries) and try again with the sbrick.

Edited by PKW

Share this post


Link to post
Share on other sites

I've experienced similar issue with single RC motor attached to small/train BB. While driving in one direction seemed to be fine (even going full speed), going back and forth slowed down performance dramatically. Like batteries would have died immediately. 

Share this post


Link to post
Share on other sites

My mistake, the moc is driven by 4 L Motors, not 4 M Motors!

Here is the video that I just recorded:

apart from the power drop, I find that the servo motor can't steer when the car is in motion.

here is the setup:

https://goo.gl/photos/EMjkEML4N2yzvwCV7

https://goo.gl/photos/nMgHYqPqV1zFdW7Y6

https://goo.gl/photos/Na929huXPmZUFgAs6

https://goo.gl/photos/8hwFSaecs9BhVBoA9

https://goo.gl/photos/U7gdWTbbc8LKnuN7A

https://goo.gl/photos/hUDD5Y5mVqLiuf7h9

 

The moc is by Madoca

 

Edited by Desmond

Share this post


Link to post
Share on other sites

it might be a bug in latest firmware, because previous 2 firmware works just fine, however the latest finw just having problem starting with 2 L motor, with 2 M motor it works just fine

Share this post


Link to post
Share on other sites

Have you tried the official app to see if the problem lies within the controller app or the SBrick itself?

On 23/02/2017 at 1:14 PM, Desmond said:

I connect the PS3 controller to the GT-N7105 with an OTG cable as shown in the attached picture and it works. But not for Bluetooth connection.

I bought a non-official PS3 gamepad for that same purpose, and also wasn't able to connect via Bluetooth, either to the phone, the tablet or the computer; only via USB. It did work via BT on a friend's PS3, so I let him keep it and bought myself a generic gamepad, which does work. So, we can conclude here that PS3 controllers can connect wirelessly only to PS3 consoles.

Share this post


Link to post
Share on other sites

just wanna say i love your software  it made the Sbrick complete. 

have a question.  i updated to last version of your program.  but now i cant name the Sbricks.  is it the program or the fact that the Sbricks is updated also ?

Share this post


Link to post
Share on other sites
8 hours ago, mortil said:

just wanna say i love your software  it made the Sbrick complete. 

have a question.  i updated to last version of your program.  but now i cant name the Sbricks.  is it the program or the fact that the Sbricks is updated also ?

Hi,

I'm glad the app is working ok for you :)
Yes, I removed the renaming option because in one of the latest firmware updates it became possible to rename the SBrick on the device itself and I haven't made that change yet. What you can do is to rename the SBrick in the official app.

Share this post


Link to post
Share on other sites

Hi guys,

anyone tried to use this controller with app from @imurvai? I'm having some troubles with using it - connection frequently break's, motors don't run with 100% efiiciency or work even with no buttons pressed :(

 

productshot_steelseries-freedom1.jpg

Share this post


Link to post
Share on other sites
On 25/2/2017 at 0:52 AM, AVCampos said:

Have you tried the official app to see if the problem lies within the controller app or the SBrick itself?

I bought a non-official PS3 gamepad for that same purpose, and also wasn't able to connect via Bluetooth, either to the phone, the tablet or the computer; only via USB. It did work via BT on a friend's PS3, so I let him keep it and bought myself a generic gamepad, which does work. So, we can conclude here that PS3 controllers can connect wirelessly only to PS3 consoles.

It does but you need the to be the phone root user and use some kernel (or even a paid app) to find controller id, so it actually doesn't on most samsung phones, I think some Sony should have BT keys for linking to ps3 controller as mac computer but i'm not sure 

Share this post


Link to post
Share on other sites

Yes, I have a Sony phone and indeed it has a settings item to connect a PS3 controller. However it didn't work with my non-official one.

Share this post


Link to post
Share on other sites
On 2017-03-03 at 7:45 AM, imurvai said:

Hi,

I'm glad the app is working ok for you :)
Yes, I removed the renaming option because in one of the latest firmware updates it became possible to rename the SBrick on the device itself and I haven't made that change yet. What you can do is to rename the SBrick in the official app.

you my dear sir is awesome... thanks

Share this post


Link to post
Share on other sites

Big thx imurvai. I've just tested with a Xiaomi gamepad and google pixel phone, works like a charm. One thing I noticed is soon as I turn off the phone screen, the connection seems stopped. Is there a way I can switch off the phone screen and still able to use the app, like it's running at the background. I'm afraid the phone screen be touched if put in the pocket something like that. 

Overall, it's fantastic as I'm no longer worried about my kids drooping the phone.

:thumbup:

Share this post


Link to post
Share on other sites
1 minute ago, benxz said:

Big thx imurvai. I've just tested with a Xiaomi gamepad and google pixel phone, works like a charm. One thing I noticed is soon as I turn off the phone screen, the connection seems stopped. Is there a way I can switch off the phone screen and still able to use the app, like it's running at the background. I'm afraid the phone screen be touched if put in the pocket something like that. 

Overall, it's fantastic as I'm no longer worried about my kids drooping the phone.

:thumbup:

Hi,

Yeah, it's a known limitation of the app. Unfortunately whenever the app goes to background it stops getting the controller inputs.

Share this post


Link to post
Share on other sites

My sbrick app will not connect if I didn't quit the controller app after using it, seems it's not releasing the sbrick module just by closing the app, have to do a force quit from memory. Not sure if anyone has the same response. 

Share this post


Link to post
Share on other sites
22 hours ago, benxz said:

My sbrick app will not connect if I didn't quit the controller app after using it, seems it's not releasing the sbrick module just by closing the app, have to do a force quit from memory. Not sure if anyone has the same response. 

Hi,

I just tried it but could not reproduce this issue. It must be something with your phone's bluetooth stack.

Share this post


Link to post
Share on other sites

@imurvai your app is amazing, a real life saver :) I uploaded a small video about the setup I used with it on the 42065 RC Tracked Racer. Unfortunately the BuWizz power output cannot be changed with the SBrick connected so it is not as fast as it could be, but much easier to control with the gamepad.

 

 

Share this post


Link to post
Share on other sites

@kbalage Put the same horizontal settings on the left joy and keep the vertical settings as is and you can control the vehicle using only the left joy and also won't have the "overlapping" effect.

Share this post


Link to post
Share on other sites

@imurvai Thank you I tried that previously, for me somehow it's easier to have the 2 different axises on two separate joysticks :)

Share this post


Link to post
Share on other sites

Wow Imurvai this looks so cool, I have just ordered a controller to test it out. Also thinking of getting a Buwizz, not sure if they have released their protocol  yet, they said they were going to during the kickstarter campaign, what would be really awesome is for a single controller to be able to control buwizz & sbrick together using one of the buwizz outputs to power the sbrick, giving you 7 separate controls or 11 with 2 s bricks and a Buwizz. Would that be possible to do?

 

Share this post


Link to post
Share on other sites
5 hours ago, Oldlegonerd said:

Wow Imurvai this looks so cool, I have just ordered a controller to test it out. Also thinking of getting a Buwizz, not sure if they have released their protocol  yet, they said they were going to during the kickstarter campaign, what would be really awesome is for a single controller to be able to control buwizz & sbrick together using one of the buwizz outputs to power the sbrick, giving you 7 separate controls or 11 with 2 s bricks and a Buwizz. Would that be possible to do?

 

Hi,

well, once I have the buwizz protocol I'll see. I was thinking of the same though, maybe it would make the app a little bit complicated but theoretically it's feasible.

Share this post


Link to post
Share on other sites
On 25/4/2017 at 4:22 PM, imurvai said:

Put the same horizontal settings on the left joy and keep the vertical settings as is and you can control the vehicle using only the left joy and also won't have the "overlapping" effect.

i know it was me to suggest that, unfortunatelly i bought and return several economic joystick that didn't worked well, but what i noticed (with ps3 controller trough otg) is that "skid steering" is not proportional so while moving slowly even a small tilt of the joystick on the left/right result in a turn, there is no way to make it feel like a real controller? this is what i use on my arduino, note that left/right/front/back are pwm signals [0;255] each one corresponding to one direction of the joystick, i don't know if this can be useful, maybe you can add a toggle for joystick that say "skid steer" and then "select left track...select right track" and it set everything for the control by itself

if(back < 0) //cottect the turning direction while go backward but not while pivot turning
  {
    sentData.speedmotorLeft = back -right + left;
    sentData.speedmotorRight = back + right - left;
  }
  else if(forward >= 0) // else could be called but else if prevent some strange moving if forward is negative due to wrong initialization
  {
    sentData.speedmotorLeft = forward + right -left;
    sentData.speedmotorRight = forward - right + left; 
  }

  //recorrect the data not to have more than while 255PWM while non pivot-steering 
  sentData.speedmotorLeft = constrain(sentData.speedmotorLeft,-PWMmax,PWMmax);
  sentData.speedmotorRight = constrain(sentData.speedmotorRight,-PWMmax,PWMmax);


NB2: you don't need the else, that is there to make the tank turn like a car while going backwards

Edited by PKW

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.