-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix Hardware Id hiding when no version detected #2266
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b518509
Hide hardwareId when no version detected
asizon 5b836e0
Force FC status reset when flashing
asizon 95665de
Move resetState to stm32.js
asizon 67be783
Added condition to avoid duplication when is connected
asizon 883bb9c
Remove hardwareId when checks for usb devices
asizon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a workaround that relies on certain conditions to be true on something unrelated
firmwareVersion. As such it is likely to be broken without being detected in the future. It is probably a more maintainable approach to resethardwareIdto be empty at the same place thatfirmwareVersionis reset on disconnect.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will be as easy...
I've looked at the code, and it seems this two FC/MSP variables are being filled by two different MSP commands. The problem is that we have a listener that each time we connect, including when we connect to go to DFU to flash a firmware, we read the
hardwareId. The other one is only read when we really "connect" in the Configurator and then we read all the FC info.With all of this:
EDIT: this variable can be
GUI.connected_tothat containsfalseif not connected or the port in text form if connected. I don't know if there is other more suitable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @mikeller I'm not satisfied enough with this fix that is based on firmwareVersion, I'll give it one more review to find a better solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I found the time to test this with an actual board only now - since the
hardwareIdis based on actual information that is returned from the board, I am not sure that it is wrong to show it while flashing the firmware. After that it becomes stale, as there is no way for us to ensure that the same board is connected, especially with the flashing process involving changes between the VCP in serial mode and DFU.So maybe, instead of hiding this when flashing, we should just make sure that
hardwareIdis reset at the end of flashing?Maybe this could be improved optically by moving the Target information above the firmware version information in the top bar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikeller definitelly it happens when dfu autoenable is used in firmware flasher tab, fc reboots in dfu mode and the hardwareId is recognized. If we enable dfu in setup tab al works as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asizon: Yes, this is to be expected. If the flight controller is not in DFU mode already when the flashing is started, we try to 'half-connect' in order to issue the MSP command to reboot the flight controller into DFU mode. This is when the hardware id is read. So keeping this hardware id while the subsequent flashing process is running seems to me to make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asizon: Do you want to change this so that the hardware id is shown during flashing if it is known?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @mikeller im going to look at this, sorry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason to be sorry - this is a hobby, and everything is voluntary.