-
-
Notifications
You must be signed in to change notification settings - Fork 13
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 Request]: Add DTB Support for Built-in Wi-Fi on MKS KliPad #42
Comments
Hello @ils15 , |
IF you want, i can colaborate and test with you |
I may give you a hints about declaring a new boards. If your product is based on mkspi it should be not too hard. However, for me personally, I see no reason to invest my time in a product that I will not use or have no any other benefits from it, sorry. |
ok, but can i compile by myself and send a PR with new (not too new) product? about klippad |
Sure, you can. Actually there are few options here, depend how deeply you would dive (and how match time to spend:) ). Unfortunately I cannot say something concrete about klippad because I have no idea about it. So, about options:
This process is very depends of your goals and having access to required documentation and patches. |
Looks similar to #12 |
I think using overlay DTBs is a good approach and I already planned to give it a go. |
you need to patch supercapacitor module too |
@redrathnure NetworkManager and networkd enabled at the same time led to a long boot delay here (NetworkManager-wait-online.service blocked systemd-networkd-wait-online.service, until it timed out after ~2 minutes). |
Networkd is installed in the community releases from https://github.com/armbian/community/releases , which I wanted to use as the base for the Klipad50 replacement image. About the capacitor: I haven't seen any documentation for it. There is a makerbase service in the original image, which mentions a "supper"(sic) capacitor. It should shutdown the system if signaled by a gpio, but they have commented out the command for reading the gpio, so it actually does nothing but syncing the filesystem every 2 seconds: https://torte71.github.io/InsideSovolKlipperScreen/makerbase-soft-shutdown-files.html#rootsoft_shutdownsh |
Looks like yet another "improvement" from Debian...
Armbian conmunity and my images should be almost identical. Difference may be in preinstalled Kernel headers, but the kernel and OS should be the same.
Funny, I thought you guys talking about hardware capacitor :) |
I've now compared your latest image 1.0.1-25.2.0-trunk with the community release 25.2.0-trunk.293 (trunk.298 does not contain mkspi for whatever reason). The community image turned out to be more "bare-bone" than your image. Your image is ~500M bigger and comes with more preinstalled packages (NetworkManager, vim, mc, aptitude, ...). Your image handles handles networking better:
Whereas the community image
So your images are more comfortable to set up. If you plan to continue offering releases in the future (even though your changes made it into mainline Armbian), then I'll recommend using your images as a base.
Yes, it's the big brown package in the upper left corner of the photo which @ils15 posted here. |
Hello all and thanks for all of the effort you've put into this already. 👍 I don't think it's wild speculation to say that, based on the information available, @ils15 is likely referring to EMMC corruption, where Sovol's 2 second And FWIW, I've tested all 3 buttons on the board, none of them appear to effect either the enabled gpio85 or the rk805 input device... Again, thanks for this! From the sounds of it, the MKS-KLIPAD50 will be getting a proper DTB / overlay fairly soon. ❤️ [edit] |
I saw the script.... I think it installs a service in the systemd manager to detect system shutdown events. When the system begins shutting down, the service intercepts the process and sends a command (echo 0) to discharge the supercapacitor by toggling its control pin. After this step, the system shutdown continues as usual. However, this method has limitations. For example, if the printer is powered off using the physical switch or during a power outage, the script cannot execute, leaving the supercapacitor charged. MKS had previously advised users to wait around 5 seconds after turning off the system before flipping the physical power switch on the printer. This delay ensures the system fully powers down, preventing issues like eMMC corruption or board dead. It seems likely that the supercapacitor was included to mitigate problems arising from sudden power-offs. By holding the board powered for a few seconds after the physical switch is flipped, it helps prevent data corruption. This feature may also address the issue where some users experienced their printer failing to turn back on after abrupt shutdowns. In summary, the supercapacitor acts as a safeguard to provide a smoother shutdown process and enhance system reliability, particularly in scenarios where power is cut off unexpectedly. Mks send this to all manufactures I guess, but some of the cannot implement property |
I friend of mine talked about a solution he bad implemented. He push pwm tô 100% in capacitor pin tô prevent it. I think can be a solution too |
What is "the script" you are referring to? |
Your makerbase-soft-shutdown.service inside repo |
I'll see what I can find out about gpio100 and this supper capacitor. |
I am unsure, if this script has any real effect, apart from the syncing (what may in fact reduce problems, if the power is just cut instead of shutting down first). My new (klipperized) image will have this service included. If it didn't cause trouble in the original image, then it probably won't hurt in the recent one. And if one dislikes it, it can be removed with "dpkg -r makerbase-soft-shutdown-service". Btw., that script does not intercept a shutdown. It is simply started at boot time, at that time it writes a "0" to gpio100 (once) and then constantly syncs the filesystem. |
Status feedback on including the Klipad50 dtb into the Armbian build system: I've rewritten the decompiled DTB from the Klipad50 board that it now uses symbolic names and references instead of constants and phandles, so it's better comparable to your and other dts files. See here for the main differences: torte71@5351004 Though I am not sure yet, if a dtb-overlay is the best option. |
Sounds like good news! A few points from my side:
BTW, side question: have you managed to make screen work? Looks like SKIPR Mini board has very similar configuration. |
I am not sure, what you mean exactly.
Not to forget that I don't have to learn the overlay syntax 😄. This simple form seems not to have any effects when activated, so I'd probably have to understand and use that fragment@ and __fixups__ stuff as used here.
I did an automatic github build with this workflow which created a working image.
I've started with a fork of your repo with the overlay option in mind. But sure, for a separate board definition, official Armbian is the place to go.
Yes. Everything that worked with the original klipad buster image now works with the new dts/dtb (at least I didn't notice any degradation yet). The generated dtb file has the same contents as the original one (apart from the phandle references). |
and
May be I missed something, however I see
Oh, yeah :)
kinda lazy to configure GH workflows and I am not really sure a free credits would be enough. Plus usually I test images before publishing release.
A few remarks here:
IMO it's good choice :)
Asking more about OS level configuration. From DTS I see only one SPI bus with 2 chips, and not sure how it works from KlipperScreen side. Do you have fb device? Does kernel recognizes it as display and input device? Is it done by standard Klipper + KlipperScreen or do you need any "special" MKS services? |
Ah, OK. The defconfig created by the patch (and the patch itself) should have a unique name with klipad50 in it. And the second patch which modifies that defconfig once more can be eliminated by having all correct options already in the first patch,
OK. I just thought that I've overlooked some nice automatisms.
I am also thinking of enabling bsp and kernel updates. An automatic kernel update worked fine during my test with the community image (with a temporary helper, which copies over the klipad50 dtb file afterwards - required just until the klipad get's included in mainline).
None of the mks services are required for normal operation/hardware setup, or at least with your images. (All following output is from a clean image, as we build it. No additional drivers, services, etc. installed.) Framebuffer device is up and running:
Touchscreen is available and working as /dev/input/event0.
And the display is detected as a HDMI device:
|
Nice, CC @bsafh About |
May I propose that the board be named |
Good point, I think I'll change to "mksklipad50". |
Are these LEDs working on your boards with your image (led-0 showing heartbeat and led-1 mmc activity)?
On klipad50, I can't get them detected as a "gpio-leds" device, dmesg complains Exactly as on your mkspi, they are bound to &rk805's gpio 0 and 1.
Our rk805 pmic sections use different "interrupt-parent" and "interrupts" (to match the original dtb), their other settings are identical. mkspi pmic@18:
klipad pmic@18:
In rather desperate attempts I tried your mkspi settings for pmic (gpio2, RK_PA6) and sdmmcio-regulator (gpio2 - just because it uses the same gpio as pmic) and all logic combinations of these settings. But -as expected- no change happened. If these leds don't work on your mkspi image as well, then the kernel might be the place to look at. |
MKSPI board has "hard soldered" LEDs to TX/RX lines of debug UART interface (USB TypeC port). However SKIPR board has a true LEDs with working heartbeat indications. I have never tried to reconfigure them to something else, in real machine the board is hidden and I do not care about LEDs. |
OEM mkspi image has prrtty strange irq mapping for rk805. Looks like it was mapped to some unsoldered pin, which leads to thousands interruptions per second. So I changed it according to public available schematic. 'IRQ 123, nobody cares' kernel error was gone, however I would not 100% trust mks documentation:) |
Found it. Now I need to find out, why this module isn't loaded automatically. The "compatible" string in the devicetree should take care of that afaik, but for whatever reason it currently doesn't. |
About the automatic loading: For comparison: The pinctrl-rockchip module does such a check via
Whereas nothing like this is found in the pinctrl-rk805 module. |
And talking about strange wirings, the "rtc" seems such a case on the klipad50: If gmac2phy (ethernet@ff550000) is disabled, calling "hwclock" times out, printing |
Maybe some of the links in my prior posts are broken now - I've renamed my repository from "armbian-mkspi" to "armbian-mksklipad50" and its "main" branch now points at the generated, symbolic dts (not at the simply decompiled version as before). |
@redrathnure Thanks again for your support and your work on porting the Makerbase build framework. |
From Armbian perspective, the kernels built from this (or my mksklipad50) project are customized ones, meaning that Armbian cannot offer updates for them, so using "BSPFREEZE=yes" is still recommended. Whereas the community builds (or any other which was compiled from unmodified "armbian/build" checkout) use their well known precompiled kernels, making updates possible (also applies to bsp and dtb). |
yeah, this one of reason why this repo and related builds are still existed here. |
@torte71 could you give a information about your build:
I would post this info on a main readme just to simplify life for people who looking for these images. |
The board is only available as the Sovol KlipperScreen, there's just the label on the board saying "MKS KLIPAD50 Vx.y".
The Sovol SV07 and SV07+ have that KlipperScreen installed by default.
I am not sure yet, if I will provide my own builds in the future - but the networkd/NetworkManager issues with the minimal build from the community images speak for such custom builds. If I decide to continue doing my builds, I will use this project, : In any case I will continue providing complete Klipper images, which aim to mimic the original Sovol images as exactly as possible (and meaningful): Currently I am awaiting the first automated builds, they should happen next week,
I think my site is offering the most information about that device It describes, how I create the Klipper images, the additional services that Makerbase installed on that device and all kind of stuff that I use for copy&pasting help in the FB groups for these printers. Apart from this
A link to my "InsideSovolKlipperScreen" would be a good choice, I guess. :) |
From 3 weeks ago: #42 (comment)
Using Maybe that's interesting for your mkspi project too? (Regarding my last post: I am quite sure that I will stop offering my own Debian/Server builds, as Ubuntu/Server works perfectly well as a Klipper base in my situation. But I know you have different requirements.) Discussion about available options on Armbian forum |
Done |
Dear Developer,
We kindly request the addition of Device Tree Blob (DTB) support to enable the built-in Wi-Fi functionality for the MKS KliPad. This enhancement would greatly improve the user experience and connectivity options for the device.
Proposed Changes
DTB Modification: Update the existing DTB file to include necessary configurations for the built-in Wi-Fi module.
Wi-Fi Driver Integration: Ensure proper integration of the Wi-Fi driver with the DTB configurations.
Automatic Wi-Fi Detection: Implement automatic detection of the built-in Wi-Fi hardware on boot.
Benefits
Simplified Setup: Users won't need to rely on external Wi-Fi adapters.
Improved Reliability: Built-in Wi-Fi support should offer more stable connectivity.
Enhanced User Experience: Streamlined out-of-the-box Wi-Fi functionality.
Technical Considerations
Identify the specific Wi-Fi chip used in the MKS KliPad.
Ensure compatibility with the existing Klipper firmware.
Consider power management implications for the built-in Wi-Fi module.
We believe this feature would significantly enhance the MKS KliPad's functionality and appeal to users. Thank you for considering this request.
https://torte71.github.io/InsideSovolKlipperScreen/rk3328-roc-cc_dts.html
EDIT: can you see this?
https://torte71.github.io/InsideSovolKlipperScreen/sovol_mods.html
The text was updated successfully, but these errors were encountered: