Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BLE Joystick #2050

Merged
merged 4 commits into from Mar 7, 2023
Merged

Update BLE Joystick #2050

merged 4 commits into from Mar 7, 2023

Conversation

Pmant
Copy link
Contributor

@Pmant Pmant commented Jan 16, 2023

This PR aims to fix #1563 and does further improvements to the BLE Joystick.

Android does not understand simulation controls like rudder or throttle.
To achieve a higher compatibility a generic gamepad with 8 axis and 16 buttons is used instead of simulation controls.

CRSF Channel mapping:

  • first 8 CRSF channels are mapped to axis 1-8 in this order: x, y, rx, ry, z, rz, slider1, slider2
  • remaining 8 channels are mapped to buttons 1-8
  • the user can modify the model's outputs to remap channels
  • 3 way switches can be mapped to an axis to receive a meaningful output

The PR also removes the 100Hz update rate limit and instead uses the Packet Rate set by the user.
I have tested this on a Windows PC with Packet Rate F1000 and did not drop packages. However it's up to the user to change the Packet Rate if it does not run well with less powerful receivers.

- changes BLE device to use a generic gamepad with 8 Axis and 16 Buttons
- first 8 Channels will be mapped to axis 1-8, other channels will be mapped to buttons
- removes update rate limitations
@nightflasher
Copy link
Contributor

tested on my oneplus 7t with android 11 in currykitten sim and freerider recharged - working fine.
also tested on my ideapad 330 (ubuntu 22.04.1) with freerider (recharged) and also working fine.
good work!

@nightflasher
Copy link
Contributor

While in Bluetooth joystick mode, the Lua script crashes. Maybe somebody could create a little joystick bitmap for the OLED screen?!
And change the Lua script to give hint, that this mode is running and the sx12xx chip is in deep sleep - joystick mode.

@pkendall64
Copy link
Collaborator

pkendall64 commented Jan 29, 2023

Tested on Mac with Tryp, Liftoff and FPV.SkyDive. Lua script does not crash for me.

@nightflasher
Copy link
Contributor

nightflasher commented Jan 31, 2023

Which ExpressLRS version is this, when running this branch now? Is it 3.2.0 or way earlier?

@pkendall64
Copy link
Collaborator

Which ExpressLRS version is this, when running this branch now? Is it 3.2.0 or way earlier?

This PR is based off the current master branch, which has all the features of 3.2.0.

@nightflasher
Copy link
Contributor

Tested on Mac with Tryp, Liftoff and FPV.SkyDive. Lua script does not crash for me.

so i've to add my hardware: jumper t-lite (v1) will test with v2 later

@Pmant
Copy link
Contributor Author

Pmant commented Feb 1, 2023

so i've to add my hardware: jumper t-lite (v1) will test with v2 later

Personally I've tested it on the v2 without problems for ~30 minutes on all packet rates. Which packet rate were you using?

@mvaldesshc
Copy link

mvaldesshc commented Feb 2, 2023

I tried using it in my Poco X3 Pro with Miui 13.0.3, and it didn't work in FPV.SkyDive and in freerider demo.
Also tried with a random game (Descenders) and it didn't work either. :(

@nightflasher
Copy link
Contributor

nightflasher commented Feb 2, 2023

I tried sky.dive on iPhone - didn't work, but didn't work with any Bluetooth controller on any simulator on iPhone. On Android, fpv freerider (inkl recharged) and CurryKitten Simulator works fine.
Sky.dive didn't work, only with cable - I don't like it anyway.

Tested again:
sky.dive did work on my oneplus 7t (Android 11) —still don't like it anyway.

@arthurson
Copy link

tx16s mk2 elrs, tried this and fails, no reaction on android and even pc, my elrs version become head ism2g4 a08732

@mvaldesshc
Copy link

I tried sky.dive on iPhone - didn't work, but didn't work with any Bluetooth controller on any simulator on iPhone. On Android, fpv freerider (inkl recharged) and CurryKitten Simulator works fine.
Sky.dive didn't work, only with cable - I don't like it anyway.

Tested again:
sky.dive did work on my oneplus 7t (Android 11) —still don't like it anyway.

Did you do anything on you phone for it to work?

@pkendall64
Copy link
Collaborator

Did you do anything on you phone for it to work?

iPhone only allows accredited bluetooth HID devices to attach to them. So it will never work on an iPhone.

@nightflasher
Copy link
Contributor

Did you do anything on you phone for it to work?

No, just connected via Bluetooth and it works. Works on all modules and t-lite v2 with Ubuntu 22.04 (fpv freerider inkl recharged and steam), as well as all the sims on my android.
Sky.dive was a bit odd (arming via touchscreen) - but that's why I don't like it.

@Pmant
Copy link
Contributor Author

Pmant commented Feb 4, 2023

At this point it is hard to tell whether the reported issues are caused by this implementation or the inability of the receiving device and software to work with any BLE gaming device. Can anyone confirm it not working whilst working with another BLE controller?

@arthurson
Copy link

for d113a5, tx16s mk2 elrs can now finally work on android 12, tried skydive and rds , no problem, and really thanks all of you.

@pkendall64 pkendall64 merged commit 8c67f21 into ExpressLRS:master Mar 7, 2023
@FunkyKwak
Copy link

Hi,
I am very interested in this update, mainly for the Android support (#1563), thank you !
Do you know if this will be included in the next release ? And when ?

@Pmant
Copy link
Contributor Author

Pmant commented Mar 16, 2023

Hi, I am very interested in this update, mainly for the Android support (#1563), thank you ! Do you know if this will be included in the next release ? And when ?

This PR is merged already and will be released with version 3.3. You can test it now if you select the master branch as the firmware version in ExpressLRS Configurator.
grafik

@FunkyKwak
Copy link

Hi, I am very interested in this update, mainly for the Android support (#1563), thank you ! Do you know if this will be included in the next release ? And when ?

This PR is merged already and will be released with version 3.3. You can test it now if you select the master branch as the firmware version in ExpressLRS Configurator. !

Thank you for your answer, I will definitely give a try !

@Trevorlahey87
Copy link

My tx16s mk2 worked fine with ble joystick on velocidrone. I updated to 3.3.0 now my windows 10 laptop recognizes and connects to the tx Bluetooth but in the sim nothing. Any known fixes for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BLE Joystick doesn't work under Android
8 participants