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

Bump to share #1510

Merged
merged 12 commits into from Jun 2, 2022
Merged

Bump to share #1510

merged 12 commits into from Jun 2, 2022

Conversation

pkendall64
Copy link
Collaborator

This PR is an extension to the "Loan Model" functionality for transmitter modules with an accelerometer.

The person who is loaning their model must be connected to the model that wish to loan out.

With your radios in an upright position (i.e. antenna facing the sky) bump the radios together. The lender's module will send the "Loan Model" command to the RX and the borrower's TX module will start binding. If all goes well, the model is loaned to the borrower.

To return the model, the borrower uses the LUA script to "Return Model" or the owner power cycles 3 times, as per the "Loan Model" functionality.

@pkendall64 pkendall64 marked this pull request as ready for review April 8, 2022 02:33
@CapnBry
Copy link
Member

CapnBry commented Apr 9, 2022

I'm trying to test this and I am smacking the heck out of my radios (Axis Thor on one) with the antennas pointing up w/ a RX connected and it never goes into binding mode. Is there some other criteria I am missing? Using "Loan Model" from the Lua works, but I can't seem to get a proper bump out of it. Maybe I don't know what a bump is? To me it means moving the backs (module side) toward each other until they hit each other. I've done it a lot harder than someone with a $140 ExpressLRS module probably ever should.

Oh snap they're on sale $95 now! (smacks the heck out of it recklessly)

@pkendall64
Copy link
Collaborator Author

I'm trying to test this and I am smacking the heck out of my radios (Axis Thor on one) with the antennas pointing up w/ a RX connected and it never goes into binding mode. Is there some other criteria I am missing? Using "Loan Model" from the Lua works, but I can't seem to get a proper bump out of it. Maybe I don't know what a bump is? To me it means moving the backs (module side) toward each other until they hit each other. I've done it a lot harder than someone with a $140 ExpressLRS module probably ever should.

Oh snap they're on sale $95 now! (smacks the heck out of it recklessly)

I just knock it on the side with my knuckle!

@StonedDawg
Copy link
Member

Tested this with axis bound to jumper RX, all is working as it should.... was only a tap with my finger!

Copy link
Member

@CapnBry CapnBry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I evaluated this again after manually repulling the PR and bumps work for me!

However, now when I put my radio down on the table (standing up because the massive Thor module means it can't lay down) it goes into loan mode, if I pick it up too quickly, it goes into loan mode, if I hit my right hand too hard with the controller as I prepare to use it or my finger taps the radio body, it goes into loan mode. Is there any way to reduce the sensitivity?

This is a fun idea but I'm really concerned about it being a nuisance. It is really easy to activate for a function that will be so rarely used.

src/lib/GSENSOR/devGsensor.cpp Outdated Show resolved Hide resolved
src/lib/GSENSOR/devGsensor.cpp Outdated Show resolved Hide resolved
src/lib/GSENSOR/devGsensor.cpp Outdated Show resolved Hide resolved
src/lib/GSENSOR/devGsensor.cpp Outdated Show resolved Hide resolved
src/lib/GSENSOR/gsensor.cpp Outdated Show resolved Hide resolved
src/src/rx_main.cpp Outdated Show resolved Hide resolved
src/lib/GSENSOR/devGsensor.cpp Outdated Show resolved Hide resolved
src/lib/GSENSOR/devGsensor.cpp Outdated Show resolved Hide resolved
src/lib/GSENSOR/devGsensor.cpp Outdated Show resolved Hide resolved
src/lib/GSENSOR/devGsensor.cpp Show resolved Hide resolved
@CapnBry
Copy link
Member

CapnBry commented Apr 18, 2022

Any comments about the other points I've made? There's still some pending conversations in the "Files changed" view

@pkendall64 pkendall64 requested a review from CapnBry April 22, 2022 19:27
@CapnBry
Copy link
Member

CapnBry commented Apr 27, 2022

This looks good, but do you want to maybe tie it to config.getMotionMode() == 1? I feel like there should be a way to disable it, and typing it to motionmode would make the most sense.

Also I noticed this (unrelated to your changes), not that it makes any difference but the fanmode and motionmode are not per-model settings so they should go outside the loop. Should we sneak that in too? If you make the bump tied to motion mode, I can claim it is related! 😁 EDIT: I have this in my PWM update since I needed to change config anyway.
image

@pkendall64
Copy link
Collaborator Author

This looks good, but do you want to maybe tie it to config.getMotionMode() == 1? I feel like there should be a way to disable it, and typing it to motionmode would make the most sense.

Also I noticed this (unrelated to your changes), not that it makes any difference but the fanmode and motionmode are not per-model settings so they should go outside the loop. Should we sneak that in too? If you make the bump tied to motion mode, I can claim it is related! 😁 EDIT: I have this in my PWM update since I needed to change config anyway. image

Good ideas, implemented.
I guess we'll see who gets in first 😉

# Conflicts:
#	src/lib/CONFIG/config.cpp
# Conflicts:
#	src/lib/GSENSOR/devGsensor.cpp
#	src/src/rx_main.cpp
#	src/src/rxtx_common.cpp
@CapnBry
Copy link
Member

CapnBry commented May 29, 2022

What's going on developers! Poor PK has been waiting for your approval for over a month! I still stand by my approval.

Copy link
Contributor

@schugabe schugabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did test this PR and the loaning starts even if arm switch is high. If you are flying with the antenna pointing up and tab the tx it would be a insta FS

@pkendall64
Copy link
Collaborator Author

I did test this PR and the loaning starts even if arm switch is high. If you are flying with the antenna pointing up and tab the tx it would be a insta FS

What a disaster that would have been 😓

@JyeSmith JyeSmith merged commit 2a5a778 into ExpressLRS:master Jun 2, 2022
@pkendall64 pkendall64 deleted the smack-transfer branch June 4, 2022 04:53
bkleiner pushed a commit to bkleiner/ExpressLRS that referenced this pull request Jun 12, 2022
* bump/tap detection on accelerometer

* Log the g-sensor data at the end of bumping

Add float logging

* Allow single bump transfer if the radio is in the upright position

* Move deferred function calling to rxtx_common

* STM32 has no room left when debugging

* Changes as per review

* More cleanup as per review

* Tie the bump-to-share function to having motion detection enabled

* Don't do bump loan/bind if armed!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants