-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
Feature/net6 #396
Feature/net6 #396
Conversation
the Avalonia framework. I have only tested for the amtel32U4 MCU. There is no menu support, and only basic functionality is there. The USB detection logic is still flawed and needs to be reworked for some of the more esotric controllers involving com ports or mounted drives.
This is for reviewers to get an idea of the work. I am making more changes, will squash the commits and kill this PR and open a new one when closer.
I am working on a better detection logic for USB devices, and fix the bcdDevice issues in the code. |
@fauxpark Any chance you could have a look and give me some feedback on this? |
@jackhumbert Any chance you could have a look and give me some feedback on this? |
While I understand you wanting feedback, please refrain from pinging users. You have pointlessly selected one who is not active on this project. Someone will get round to this when they have time. |
Fair comment. All part of knowing project etiquette. We all work on things as time allows, same for me. This is a significant feature, and I am blocked until I get some feedback. |
I have some concerns:
The biggest concern I have is what QMK Toolbox gives people that the CLI doesn't -- between We do appreciate the work that has gone into this implementation, and we're not saying "no" -- we're just querying the validity of some of the decisions. We usually prefer to discuss such large-scale implementations with potential developers before they embark on such work -- primarily so things don't get developed when the direction may not be consistent. |
Avalonia supports all three platforms, mac, windows and Linux. This is an example of a cross Platform File manager. Work is required to make things run properly under all three OS's, but the example project shows how to go about it. One needs WPF and C# knowledge to make this work. For me, having one code base, and one that supports unit testing is preferrable to 3 code bases - in keeping with the DRY principle. Installing the drivers with the appropriate permissions automatically is nice for the user, but more of a convenience. Windows installs ALL drivers for known MCU's because it does not ask which one you use, typically one. On Linux, the programmers are installed by a distro-specific package, which typically allow-lists that programmer exe to access the USB directly without root access. One can compile from source on linux too. The programmers are simple, if the required .so dependencies are there, and you have the right CPU arch, it typically runs without issues, but one could test that with Virtual Box. I did this Proof of concept mainly for myself - I want to conveniently program my keyboard under Linux with auto-flash. Yes, I can run a makefile to do this without QMK, but its more cumbersome. With QMK, I just reset my keyboard and it automatically flashes. I have achieved that goal, its running under Linux. I am sharing the code with the community. Treat it as a proposal, this PR is not intended to be merged. I am willing to work with this community to try to make one codebase possible, if the community wants it. If not, that's perfectly OK, no hard feelings. I also dont want to become the sole dev on this. As I was coding this, I tried reaching out, but over the holidays people were busy with other things. Lets have the discussion then about what to do. |
I'm a bit disappointed that a discussion is not taking place about if, and how to possibly move forward with this PR. If I don't hear something soon-ish, I will withdraw/close the PR and assume the larger community does not have an interest. This is OK, no hard feelings in that case. |
From the official docs:
I would prefer to be able to do things in a simple way instead of having a more difficult experience because I'm using Linux. Thanks <3 |
Flashing instructions for all supported bootloaders can be found here: https://docs.qmk.fm/#/flashing Given the issues with this PR that tzarc outlined above, I'll be closing this for the moment. The main blocker IMO is that unless and until the Toolbox gains the ability to call flashing tools external to itself (which I tried to push for here), the "Linux version" will not "just work" on any given distro. Of course we could gather the flashing tools from a bunch of different distros, but as you can see this is already a maintenance nightmare for just Windows and macOS. I would prefer if we did not have to bundle the flashers at all, but this then calls into question the very purpose of the Toolbox... |
This is an alpha level implementation of QMK Toolbox using .net core/Avalonia UI framework. I only have one MCU, so my testing is limited. This version has no HID console, No Keyboard Tester, No menus. It supports the main UI and Auto Flashing.
Description
This is new code, based on the Windows version. The UI has been completely re-written using the Avalonia (WPF). This uses the MVVP pattern, and ViewModels, unlike Windows Forms can be easily unit tested. The USB detection code has been substantially changed as there is no WMI on Linux. The USB library I am using unfortunately does not seem to provide events, so a polling of known devices is done. There are some UI changes, like the Hex File control is not a combo. This is intentional, in the old version it was easy to mess up the path, not sure about multiple entries there.
I hope this can be reviewed by the community, so that we can make it more functional. There are a number of TODO items in the code.
The .net code can be published ad self-contained, meaning no .net framework would be required on the target machine. It also needs an installer and published packages to apt, yum aur etc, or as a flatpak.
Even though this is cross-platform, the code was written with Linux in mind only, more work would be needed to make it truly cross platform. (e.g. resources for all platforms). If this codebase gets feature-parity with the mac and windows ones, one can think about using this as a single codebase supporting all three platforms. The benefit is that all changes happen in one place, and apply to all platforms. I have a mac, a Windows box and Linux.
Some MCU's seem to mount like a thumb drive and one copies the bin file to the device. On linux the problem is detecting which vendor and product id maps to the newly mounted drive. lsblk lists the devices and journalctl log tells you this info, but needs root access to view on most systems. I have no good solution to this yet.
The Avalonia FileOpenDialog is broken (or I am to dumb to get it to work) - I am using a script to accomplish this.
The current code does NOT handle the BCD Revision properly, more work is needed in the UsbListener.cs class. USB Detection happens with polling all the known devices, and is done in a background thread. The Show All usb devices functionality is not supported.
COM Port detection will likely not work for AvrIspDevice and the like; I don't know enough about how this is supposed to work to fix it. Right now its hard-coded to /dev/ttyS0.
UI strings would need to an update to pull from resources which would make a localized app possible, but perhaps thats not needed here.
There is no CI/CD integration yet, one needs the .net core sdk to build.
Dependency versions of nuget packagesneed to be moved to Directory.Build.Targets, and props to Directory.Build.props.
Documentation (readme) changes would need a separate PR once this is in beta. Binaries would have to be packaged into the release as well.
The missing feaures should be easy to add.
To build and run:
Types of Changes
Issues Fixed or Closed by This PR