betaflight-configurator
betaflight-configurator copied to clipboard
Add manual connection option
- Have observed users clicking the connect button without any connection available making manual connection an option would fix most
Failed to open serial portevents. During this process port_handler has been optimized. - manual optional is now optional - as most users would only use serial connection
- removes brain overload after refactoring some code in porthandler
- made currentPorts global simplifying code
Do you want to test this code? Here you have an automated build: Betaflight-Configurator-Android Betaflight-Configurator-Linux Betaflight-Configurator-macOS Betaflight-Configurator-Windows WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!
Do you want to test this code? Here you have an automated build: Betaflight-Configurator-Android Betaflight-Configurator-Linux Betaflight-Configurator-macOS Betaflight-Configurator-Windows WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!
Do you want to test this code? Here you have an automated build: Betaflight-Configurator-Android Betaflight-Configurator-Linux Betaflight-Configurator-macOS Betaflight-Configurator-Windows WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!
Do you want to test this code? Here you have an automated build: Betaflight-Configurator-Android Betaflight-Configurator-Linux Betaflight-Configurator-macOS Betaflight-Configurator-Windows WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!
AUTOMERGE: (FAIL)
- github identifies PR as mergeable -> FAIL
- assigned to a milestone -> PASS
- cooling off period lapsed -> PASS
- commit count less or equal to three -> PASS
Don't mergelabel NOT found -> PASS- at least one
RN:label found -> PASS Testedlabel found -> FAIL- assigned to an approver -> PASS
- approver count at least three -> FAIL
I don't understand. What is the problem with JQuery? I understand is old technology and if we can get rid of it, great. But remove it to go with plain javascript, does not seem a good option to me. The idea was go to Vue (or any other technology that we decide and simplifies the code) but not to plain javascript.
Agree Vue was adapted some time ago and thought this move was creating a path for further migration.
@McGiverGim @chmelevskij please assist in getting this to use Vue as requested.
Do you want to test this code? Here you have an automated build: Betaflight-Configurator-Android Betaflight-Configurator-Linux Betaflight-Configurator-macOS Betaflight-Configurator-Windows WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!
Do you want to test this code? Here you have an automated build: Betaflight-Configurator-Android Betaflight-Configurator-Linux Betaflight-Configurator-macOS Betaflight-Configurator-Windows WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!
Unsure about this.
If users clicking too soon, enabling the buttons could be moved to after ports being populated similarly to https://github.com/emuflight/EmuConfigurator/pull/458/files However, this is only effective at first launch.
If port handler needs independent optimization, can it be a separate PR? or is it dependent on this new logic?
Going to rewrite the PR so it only adds manual connection option - as far is possible as some changes were needed to make it work. Hiding manual mode would prevent connecting to a non-existent device.
EDIT: 2 hours later think you are right, some changes were needed to make it work as tested.
Do you want to test this code? Here you have an automated build: Betaflight-Configurator-Android Betaflight-Configurator-Linux Betaflight-Configurator-macOS Betaflight-Configurator-Windows WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!
- i don't feel this is needed, but i also do not know the statistics on the offending clicks.
- it will also add another step to vtx-slayer's https://pr0p.dev/ , but such is an external issue.
Agree but assume most users won't need manual connection as hiding this simplifies UI. That's all :)
Do you want to test this code? Here you have an automated build: Betaflight-Configurator-Android Betaflight-Configurator-Linux Betaflight-Configurator-macOS Betaflight-Configurator-Windows WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!
Put a lot of work in this - required lot's of testing different scenario's - but it has some other fixes too:
2024-01-04 @17:31:10 -- Serial port successfully closed
2024-01-04 @17:31:10 -- Device - Rebooting
2024-01-04 @17:31:10 -- Using cached builds information for https://build.betaflight.com/api/targets.
2024-01-04 @17:31:10 -- Using cached builds information for https://build.betaflight.com/api/targets.
2024-01-04 @17:31:10 -- Using cached builds information for https://build.betaflight.com/api/configurator/sponsors/dark/landing.
2024-01-04 @17:31:10 -- Using cached builds information for https://build.betaflight.com/api/configurator/sponsors/dark/flash.
2024-01-04 @17:31:11 -- Using cached builds information for https://build.betaflight.com/api/targets.
2024-01-04 @17:31:11 -- Using cached builds information for https://build.betaflight.com/api/configurator/sponsors/dark/flash.
2024-01-04 @17:31:11 -- Using cached builds information for https://build.betaflight.com/api/targets.
2024-01-04 @17:31:15 -- Query board information to preselect right firmware
2024-01-04 @17:31:15 -- MultiWii API version: 1.46.0
2024-01-04 @17:31:15 -- Using cached builds information for https://build.betaflight.com/api/targets/FLYWOOF722PRO.
2024-01-04 @17:31:15 -- Using cached builds information for https://build.betaflight.com/api/builds/4.5.0-zulu/FLYWOOF722PRO.
2024-01-04 @17:31:15 -- Using cached builds information for https://build.betaflight.com/api/releases/4.5.0-zulu/commits.
2024-01-04 @17:31:15 -- Configurator has successfully detected and verified the board: FLYWOOF722PRO
2024-01-04 @17:31:21 -- Failed to open serial port
This PR:
2024-01-04 @18:33:21 -- OS: Linux
2024-01-04 @18:33:21 -- Configurator: 10.10.0-debug-27b1c354
2024-01-04 @18:33:24 -- Using cached builds information for https://build.betaflight.com/api/targets.
2024-01-04 @18:33:25 -- Query board information to preselect right firmware
2024-01-04 @18:33:25 -- MultiWii API version: 1.46.0
2024-01-04 @18:33:25 -- Configurator has successfully detected and verified the board: FLYWOOF722PRO
2024-01-04 @18:33:28 -- Success: https://build.betaflight.com/api/builds/740b520792e3ae53af940c9ab98a7633/status
2024-01-04 @18:33:29 -- Success: /api/builds/740b520792e3ae53af940c9ab98a7633/hex
2024-01-04 @18:33:34 -- MultiWii API version: 1.46.0
2024-01-04 @18:33:34 -- Device - Rebooting to ROM BOOTLOADER
2024-01-04 @18:33:35 -- USB device successfully opened with ID: 1
2024-01-04 @18:33:35 -- Detected device with total flash size 512 KiB
2024-01-04 @18:33:35 -- Chrome API Error: Transfer stalled..
2024-01-04 @18:33:35 -- Read protection not active
2024-01-04 @18:33:43 -- Erased 512 kB of flash successfully
2024-01-04 @18:34:08 -- USB device successfully closed
2024-01-04 @18:34:11 -- Query board information to preselect right firmware
2024-01-04 @18:34:11 -- MultiWii API version: 1.46.0
2024-01-04 @18:34:11 -- Configurator has successfully detected and verified the board: FLYWOOF722PRO
request real world testing from multiple devs before merge.
I'm all for improving port detection, but do not agree with changing to manual configuration if the user keeps pressing the 'connect' button.
A change that improves port detection could be considered a bugfix for inclusion in 4.5, if we get confirmation that it really does make a clear difference.
But changing to manual configuration if the user presses the connect button more than once obscures the 'bug fix' code and essentially adds a new feature.
Maybe this PR should be broken into two parts, one being a bug fix to improve connection detection, that we consider for 4.5; the other, ie swapping to manual mode, being a suggested new feature for 4.6.
On my mac, after some time of normal operation, a serial port stops opening when I connect a flight controller. I have looked into it, and it's because at system level, the Mac isn't seeing any connection for Betaflight to utilise. Switching to manual configuration - manually - has not been helpful on a single instance. A reboot will fix it. So I see no value in changing to manual configuration automatically. The user should decide to do that.
I've not had a single instance of a port being available that wasn't automatically loaded, or at least I didn't notice it.
@blckmn the issue is intermittent and non-breaking so skipping to next release.
Tried to unravel the code before (splitting into 2 PR's but testing indicates code depends on both)
Do you want to test this code? Here you have an automated build: Betaflight-Configurator-Android Betaflight-Configurator-Linux Betaflight-Configurator-macOS Betaflight-Configurator-Windows WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!
Do you want to test this code? Here you have an automated build: Betaflight-Configurator-Android Betaflight-Configurator-Linux Betaflight-Configurator-macOS Betaflight-Configurator-Windows WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!
Quality Gate passed
The SonarCloud Quality Gate passed, but some issues were introduced.
6 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Do you want to test this code? Here you have an automated build: Betaflight-Configurator-Android Betaflight-Configurator-Linux Betaflight-Configurator-macOS Betaflight-Configurator-Windows WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!
@haslinghuis can we use bluetooth with this PR ?
In theory it should already be possible using serial mode but did not look at it.
Deploy Preview for origin-betaflight-app ready!
| Name | Link |
|---|---|
| Latest commit | 3785b9f53128164065c507f23dc8bbfa68560c6a |
| Latest deploy log | https://app.netlify.com/sites/origin-betaflight-app/deploys/663947f05c8e810008f708bf |
| Deploy Preview | https://deploy-preview-3703--origin-betaflight-app.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Quality Gate passed
Issues
8 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Do you want to test this code? Here you have an automated build: Betaflight-Configurator-Android Betaflight-Configurator-Linux Betaflight-Configurator-macOS Betaflight-Configurator-Windows WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!
Do you want to test this code? Here you have an automated build: Betaflight-Configurator-Android Betaflight-Configurator-Linux Betaflight-Configurator-Windows Betaflight-Configurator-macOS WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!