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

beeper always on when connected to Configurator #13367

Closed
aowi7280 opened this issue Feb 12, 2024 · 32 comments · Fixed by #13599
Closed

beeper always on when connected to Configurator #13367

aowi7280 opened this issue Feb 12, 2024 · 32 comments · Fixed by #13599
Labels
BUG Bugs are excluded from automatically being marked as stale

Comments

@aowi7280
Copy link

aowi7280 commented Feb 12, 2024

Describe the bug

Beeper issue. It acts like the USB configuration is turned on when it isn't. The low battery alarm goes off when attached to configurator via USB. PR #13350 seems to have broken it. PR #13352 is OK.

To Reproduce

Flash PR #13350 or newer. Nightly configurator, within the last week.

Expected behavior

No beeper when it is configured that way.

Support ID

389823ab-8305-474c-82ea-0d3192b3e57

Flight controller

Airbot OmnibusF4SD

Other components

ViFly Finder with backup battery

How are the different components wired up (including port information)

No response

Add any other context about the problem that you think might be relevant here

No response

@aowi7280 aowi7280 added the Template: Bug Set by auto_close_issue. label Feb 12, 2024
@haslinghuis haslinghuis added BUG Bugs are excluded from automatically being marked as stale and removed Template: Bug Set by auto_close_issue. labels Feb 12, 2024
@haslinghuis haslinghuis added this to the 4.5 milestone Feb 12, 2024
@nerdCopter
Copy link
Member

@aowi7280 , please test master and report findings.
zulu-dev

@aowi7280
Copy link
Author

aowi7280 commented Feb 17, 2024

@nerdCopter Did not work. Still beeps while connected. It starts as I load the backup.
*** Support data submitted ***
Id: "6adebcec-ca68-4564-bfd4-bfe78d783ffe"
Went back to PR13352 with the same backup and that works fine.

@nerdCopter
Copy link
Member

maybe as simple as, but unsure. seems voltage detection sees USB voltage as low and therefore beeps.
image

if the toggle is not the answer, then maybe code needs some beeper gating (for not USB or maybe the isVoltageFromBattery boolean). 🤷‍♂️
@freasy

@aowi7280
Copy link
Author

aowi7280 commented Apr 3, 2024

I have that turned off. @freasy

@SupaflyFPV
Copy link
Contributor

I use motor beacon but will get a buzzer next week and test

@freasy
Copy link
Member

freasy commented Apr 8, 2024

@aowi7280 can you give us a config dump?

@thecmac
Copy link

thecmac commented Apr 8, 2024

I can't reproduce this one either. Buzzer works as expected.

Unique device ID: 0x44002a5547500d20333332

Build Key: 6a6151d5dd8a0f2e2f73f68871e4aa55

@freasy
Copy link
Member

freasy commented Apr 8, 2024

I can't reproduce this one either. Buzzer works as expected.

Unique device ID: 0x44002a5547500d20333332

Build Key: 6a6151d5dd8a0f2e2f73f68871e4aa55

I suspect a weird config here. Because you can set the threshold for "is USB"

I looked through a lot of code and didn't see a issue :/

Before I pump more hours in, I need confirmation and a way to reproduce the issue

@KingRikkie
Copy link

I asked my friend who owns a Omnibus F4 SD to flash latest Master and he can not reproduce this issue. Beeper behaves like expected. Likely @aowi7280 has a botched up config.

@aowi7280
Copy link
Author

I figured out what is causing it, but I don't understand why. It does not happen with the PR13352, it does with any release after that, including the RC3. It has something to do with the aux channel that I have for the beeper. If I put the beeper on Aux 4, it beeps while on the bench. If I move it to Aux 3. It doesn't beep. Here are the differences.

aux (beeps)

aux 0 0 0 1800 2100 0 0
aux 1 1 1 900 1200 0 0
aux 2 2 1 1300 1700 0 0
aux 3 46 2 1800 2100 0 0
aux 4 13 3 1300 1700 0 0
aux 5 26 0 1800 2100 0 0
aux 6 35 3 1800 2100 0 0
aux 7 36 4 1800 2100 0 0

aux (doesn't beep)

aux 0 0 0 1800 2100 0 0
aux 1 1 1 900 1200 0 0
aux 2 2 1 1300 1700 0 0
aux 3 46 2 1800 2100 0 0
aux 4 13 2 1300 1700 0 0
aux 5 26 0 1800 2100 0 0
aux 6 35 3 1800 2100 0 0
aux 7 36 4 1800 2100 0 0

I have most beeper functions turned off, including on USB
beeper -GYRO_CALIBRATED
beeper -RX_LOST
beeper -RX_LOST_LANDING
beeper -DISARMING
beeper -ARMING
beeper -ARMING_GPS_FIX
beeper -BAT_CRIT_LOW
beeper -BAT_LOW
beeper -GPS_STATUS
beeper -ACC_CALIBRATION
beeper -ACC_CALIBRATION_FAIL
beeper -READY_BEEP
beeper -MULTI_BEEPS
beeper -DISARM_REPEAT
beeper -ARMED
beeper -SYSTEM_INIT
beeper -ON_USB
beeper -BLACKBOX_ERASE
beeper -CRASH_FLIP
beeper -CAM_CONNECTION_OPEN
beeper -CAM_CONNECTION_CLOSE
beeper -RC_SMOOTHING_INIT_FAI

OK
image

Not OK
image

@aowi7280
Copy link
Author

aowi7280 commented Apr 13, 2024

I just set it back to Aux 4 to double verify and it isn't beeping now*. I saw a little jumping around on the Modes tab when first moving the switches, now it is fine. I think I had a dirty aux switch. Time to open it up and use some DeoxIt contact cleaner. But I still don't understand what changed in the firmware. I didn't even have the radio on when it first started happening. *Edit: I have to cycle power to change the Aux channel. It still beeps when I don't have the radio turned on. It doesn't matter what aux channel I use or switch it is on. I went back to PR 13352 and it works correctly, so 13350 is the culprit.

@aowi7280 aowi7280 changed the title Low battery beeper always on when connected to Configurator beeper always on when connected to Configurator Apr 19, 2024
@aowi7280
Copy link
Author

I updated to RC4, Configurator RC4 and it still happens. I don't think it is a low battery beep, it goes off when I turn on the radio. And it stays off when I turn off the radio.

@freasy
Copy link
Member

freasy commented Apr 19, 2024

@aowi7280 i still want to look at a config dump from you

@aowi7280
Copy link
Author

aowi7280 commented Apr 19, 2024

Id: "b3255d4f-85cf-443d-ac51-90c36bb44042"
I am starting to think its the battery on the Vifly beeper going bad. I have a new on that I am going to put on tomorrow. It seems to come and go. It was just beeping while I got the support id, then it just stopped.
I put a new beeper on and it behaves the same. When I plug in USB, the beeper starts beeping until I turn on the radio.

beeper

beeper -GYRO_CALIBRATED
beeper -DISARMING
beeper -ARMING
beeper -ARMING_GPS_FIX
beeper -BAT_CRIT_LOW
beeper -BAT_LOW
beeper -GPS_STATUS
beeper -ACC_CALIBRATION
beeper -ACC_CALIBRATION_FAIL
beeper -READY_BEEP
beeper -MULTI_BEEPS
beeper -DISARM_REPEAT
beeper -ARMED
beeper -SYSTEM_INIT
beeper -ON_USB
beeper -BLACKBOX_ERASE
beeper -CAM_CONNECTION_OPEN
beeper -CAM_CONNECTION_CLOSE
beeper -RC_SMOOTHING_INIT_FAIL

@aowi7280
Copy link
Author

aowi7280 commented Apr 21, 2024

I went back to PR #13352 and it works like normal.

@granolaFPV
Copy link

When I experience this behavior it’s because my beeper switch is set to activate at the channel midpoint (1500) and when the quad is in failsafe (no radio connected) the channels default to the center position.

It looks like this might be what you’re experiencing? Does the quad beep when the radio is powered off, but not while it’s on? Looking at the screenshots you posted it appears that the quad is in failsafe in the second photo (with channel values =1500), but not the first (channel values = 1000).

My solution is to set the failsafe value of the beeper channel to 1000.

@ledvinap
Copy link
Contributor

@aowi7280 : Can you post blackbox log? set blackbox_mode = always and record few logs when powered over USB

@aowi7280
Copy link
Author

@granolaFPV Yes, that seems to be what is happening. But it should not beep on the bench when connected to USB with no radio on (and Beep on USB is off).
Uploading LOG00002.BFL.txt…
Uploading LOG00004.BFL.txt…
@ledvinap 2 logs attached

@mituritsyn
Copy link
Contributor

But it should not beep on the bench when connected to USB with no radio on (and Beep on USB is off).

100% agree, have reported this issue in discord months ago

@haslinghuis
Copy link
Member

@aowi7280 @mituritsyn

Please test #13588

@ledvinap
Copy link
Contributor

@aowi7280 : It seems that something broke when uploading files. Can you try again?

@mituritsyn
Copy link
Contributor

@aowi7280 @mituritsyn

Please test #13588

doesn't work. I still hear activated beeper mode that I expected to be disabled with usb connection

@aowi7280
Copy link
Author

aowi7280 commented Apr 27, 2024

@ledvinap see attached. Part way though, I turned on the radio and the beeper stopped.
LOG00001 (2).BFL.txt

@pfeerick
Copy link

pfeerick commented Apr 28, 2024

edit: Scratch that... I forgot to disable ONUSB when reflashing 4.4.3 again... I've been going back and forward too many times today 🤪

On my Mobula7 (HAMO/CRAZYBEEF4FR(STM32F411), ELRS via UART), which has a beeper that is powered over USB, it will do this also if I move the beeper active range to cover middle (normally I have it on a 2POS switch, so the default of middle of not handset active has never been a problem). If I power on the FC over USB (after disabling beeper ON_USB), with the handset off, it beeps on 4.5.0-RC4, but does NOT on 4.4.3 (the beeper mode is merely highlighted as active). On 4.5.0-RC4, it initially didn't indicate it was active (no yellow highlight), but on a reboot and saving the config again it did, and ON_USB has no effect at all on the beeps.

With literally just this, I am the proud owner of a healthy beep-o-matic... (only configured Serial RX, and set armed and beeper).

# 

# diff

# version
# Betaflight / STM32F411 (S411) 4.5.0 Apr 16 2024 / 16:45:59 (7c8a55258) MSP API: 1.46
# config rev: 20a24e4

# start the command batch
batch start

board_name CRAZYBEEF4FR
manufacturer_id HAMO

# feature
feature TELEMETRY
feature LED_STRIP
feature OSD

# serial
serial 1 64 115200 57600 0 115200

# beeper
beeper -ON_USB

# aux
aux 0 0 0 1600 2100 0 0
aux 1 13 0 1400 1600 0 0

# master
set osd_canvas_height = 13

profile 0

rateprofile 0

# end the command batch
batch end

# 

I thought this was not new behaviour, as I can see a post from Jul 21 documenting this exact same behaviour... (so maybe 4.2.x firmware) https://intofpv.com/t-quad-starts-beeping-as-soon-as-i-plug-the-usb ... but I think this is in conjunction with the main battery being connected also.

Edit: I have to cycle power to change the Aux channel. It still beeps when I don't have the radio turned on.

It seems when you turn off the radio, the channels stay where they are (for serial connected ELRS anyway, as it doesn't have failesafe positions if not PWM). So if you power on with transmitter off, beeper will go off if it is supposed to be active in the middle (~1500us). If you connect the transmitter, change the buzzer switch to low (~1000us), and then turn the transmitter off, the channels won't change, so the buzzer will remain off.

@haslinghuis haslinghuis removed this from the 4.5 milestone Apr 28, 2024
@ledvinap
Copy link
Contributor

ledvinap commented Apr 28, 2024

if (
mode == BEEPER_SILENCE || (
(beeperConfig()->beeper_off_flags & BEEPER_GET_FLAG(BEEPER_USB))
&& getBatteryState() == BATTERY_NOT_PRESENT
) || IS_RC_MODE_ACTIVE(BOXBEEPERMUTE)
) {

(edit) Main problem is that BEEPER_USB is flag that DISABLES beeper when powered by USB only. Description in configurator is wrong, you must enable the option.

Dependence on RX is probably from IS_RC_MODE_ACTIVE(BOXBEEPERMUTE) - IIRC there was some channel normalization recently and better handling of RX missing data, it may have changed default state of RC modes. We should check that modes behave as expected without RX.

@ledvinap
Copy link
Contributor

System Uptime: 48 seconds, Current Time: 2024-04-19T00:11:46.023-06:00
Voltage: 2 * 0.01V (0S battery - INIT)

Battery is in BATTERY_INIT, not BATTERY_NOT_PRESENT. From BB log, battery voltage is very close to zero.

see #13350 (review)

I'm working on fix

@ledvinap
Copy link
Contributor

@aowi7280 : #13599 should fix it

@aowi7280
Copy link
Author

Thanks @ledvinap . I had to try the cloud build 3 times before I got it to work (Configurator: 10.10.0 (c97deaf) released). But your beeper fix seems to work correctly now. It beeps 3 times then stops when when FC is powered by USB only. It works correctly when switched on/off by the radio when powered by battery alone. The beeper behavior is slightly different though. Before, I could turn the beeper on with the radio switch even though USB was off in the configurator. Now it won't turn on at all unless the USB is selected on. That is fine. I appreciate all the work. I assume #13599 is safe to fly? It flies OK in my living room.

@aowi7280
Copy link
Author

@pfeerick That work around in "post from Jul 21" works also on 4.5.0 release.

@mituritsyn
Copy link
Contributor

doesn't fixed. I don't understand how the battery voltage detection is connected with the activated beeper mode. the problem is that when connected to the configurator the beeper mode will be activated even with the usb option switched off while it shouldn't

@mituritsyn
Copy link
Contributor

image

by switching this option off the user expects that the beeper will not emit any sound while the flight unit is connected via usb

@haslinghuis haslinghuis reopened this May 5, 2024
@ledvinap
Copy link
Contributor

ledvinap commented May 5, 2024

@mituritsyn : beeper is not controlled by configurator connection, but by USB powering FC.
Either provide necessary information (https://github.com/betaflight/betaflight/blob/master/.github/ISSUE_TEMPLATE/firmware-bug-report.yml) or open new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Bugs are excluded from automatically being marked as stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.