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

[Feature request]: WIFI not working on MKS SKIPR *MINI* 1.0 with Armbian-build #46

Open
1 of 2 tasks
bsafh opened this issue Jan 18, 2025 · 76 comments
Open
1 of 2 tasks

Comments

@bsafh
Copy link

bsafh commented Jan 18, 2025

What happened?

The MKS SKIPR Mini v1.0 does have Wifi onboard, you can clearly see the Wifi antenna ... - the SKIPR v1.0 does not have Wifi.

This board (MKS SKIPR MINI) is part of the TronXY Klipper Upgrade Kit, I think, it's used as well in some TwoTree printers.

Well, the Wifi works well using the MKS original Armbian Buster Image supplied by TronXY.

The loaded wifi modules are brcmfmac, brcmfutil and cfg80211.

x5sa:/etc:# lsmod | grep br   
brcmfmac              385024  0
brcmutil               24576  1 brcmfmac
cfg80211              876544  1 brcmfmac
x5sa:/etc:# 

However, when booting the MKS SKIPR Mini with the unofficial Armbian Bookworm image from here, there is no Wifi adapter in the hardware list, no wlan0 interface and no brcfmmac module loaded ...

The mdoules are there in the kernel libs and they are present on the /boot/ partition, but they are not loaded.

I can't find any differences in /etc/udev/* either ...

I guess I'm missing something obvious, but I can't find it ...

Attached the hwinfo output for both boot images

hwinfo-buster.txt

hwinfo-bookworm.txt

How to reproduce?

boot the MKS SKIPR Mini v1.0 with the original MKS Armbian Buster image -> Wifi works

boot the MKS SKIPR Mini v1.0 with the Armbian Bookworm image from this repo -> no Wifi at all

Branch

main (main development branch)

On which host OS are you running the build script and observing this problem?

Debian 12 Bookworm

Are you building on Windows WSL2?

  • Yes, my Ubuntu/Debian/OtherOS is running on WSL2

Relevant log URL

siee attachments

Code of Conduct

  • I agree to follow this project's Code of Conduct
@redrathnure
Copy link
Owner

Just FYI "MKS SKIPR v1.0" and "MKS SKIPR Mini v1.0" are different boards. The first one is tested for my images, the second one not, because I do not have this hardware on my desk.

What does it means for you:

  1. You may be extremely luck just flash MKS SKIPR image and get everything working out of the box. However seems it is not the case
  2. You may use files, patches and help from this images or repo, however in generally it's up to you to introduce full support for "MKS SKIPR Mini" board (as well as deciding where and how to contribute these changes)
  3. This also means you are talking more about feature request, e.g. for the new board support, or asking for some related information. But this is defensively not a bug :)

From my experience, each new board adaptation starts from following questions:

  1. Do you have access to the schematic? If yes, sharing it here would increase chances for success.
  2. Does somebody else have done this adaptions? Perhaps you see similar printer or printer with similar board in other issues from this repository.
  3. (if no luck with prev. two points) try to compare unpacked DTS files from original/fully worked image and custom one. Please note name differences (MKS likes to use rk3328-roc-cc-org name, my custom image use separated rk3328-mkspi one). If you failed to compare them (or just do not from where to start), you may post your unpacked DTS file here.
  4. (WARNING, MAY BE DANGEROUS) you may blindly swap dtb files from working image to the custom one (boot partition on SD, please keep in mind naming). However it may be not the safest solution because who knows which kind of hardware do you have and how it should be configured.

@bsafh
Copy link
Author

bsafh commented Jan 18, 2025

MKS supplies an own systemd-service for WLAN - don't ask, I do not know why.

the output on the **Buster ** image is

x5sa:multi-user.target.wants:# systemctl status makerbase-wlan0.service
● makerbase-wlan0.service - Makerbasi mkspi WPA supplicant daemon
   Loaded: loaded (/lib/systemd/system/makerbase-wlan0.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2025-01-18 19:31:33 CET; 6min ago
 Main PID: 4587 (wpa_supplicant)
    Tasks: 1 (limit: 998)
   Memory: 1.5M
   CGroup: /system.slice/makerbase-wlan0.service
           └─4587 /sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-wlan0.conf -Dnl80211,wext -iwlan0

Jan 18 19:31:33 x5sa systemd[1]: Started Makerbasi mkspi WPA supplicant daemon.
Jan 18 19:31:33 x5sa wpa_supplicant[4587]: Successfully initialized wpa_supplicant
Jan 18 19:31:34 x5sa wpa_supplicant[4587]: wlan0: Trying to associate with SSID 'Flusenhund2'
Jan 18 19:31:35 x5sa wpa_supplicant[4587]: wlan0: Associated with ee:de:27:f6:09:36
Jan 18 19:31:35 x5sa wpa_supplicant[4587]: wlan0: CTRL-EVENT-CONNECTED - Connection to ee:de:27:f6:09:36 completed [id=0 id_str=]
Jan 18 19:31:35 x5sa wpa_supplicant[4587]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
x5sa:multi-user.target.wants:# systemctl status wpa_supplicant.service 
● wpa_supplicant.service - WPA supplicant
   Loaded: loaded (/lib/systemd/system/wpa_supplicant.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2025-01-18 19:34:46 CET; 2min 59s ago
 Main PID: 5468 (wpa_supplicant)
    Tasks: 1 (limit: 998)
   Memory: 740.0K
   CGroup: /system.slice/wpa_supplicant.service
           └─5468 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant

Jan 18 19:34:46 x5sa systemd[1]: Starting WPA supplicant...
Jan 18 19:34:46 x5sa wpa_supplicant[5468]: Successfully initialized wpa_supplicant
Jan 18 19:34:46 x5sa systemd[1]: Started WPA supplicant.
x5sa:multi-user.target.wants:# 

x5sa:multi-user.target.wants:# journalctl -n 5000 | grep -i wpa
Jan 18 19:31:33 x5sa wpa_supplicant[1263]: nl80211: Failed to open /proc/sys/net/ipv4/conf/p2p-dev-wlan0/drop_unicast_in_l2_multicast: No such file or directory
Jan 18 19:31:33 x5sa wpa_supplicant[1263]: nl80211: Failed to set IPv4 unicast in multicast filter
Jan 18 19:31:33 x5sa systemd[1]: Stopping Makerbasi mkspi WPA supplicant daemon...
Jan 18 19:31:33 x5sa wpa_supplicant[1263]: nl80211: Failed to open /proc/sys/net/ipv4/conf/p2p-dev-wlan0/drop_unicast_in_l2_multicast: No such file or directory
Jan 18 19:31:33 x5sa wpa_supplicant[1263]: nl80211: Failed to set IPv4 unicast in multicast filter
Jan 18 19:31:33 x5sa wpa_supplicant[1263]: nl80211: deinit ifname=p2p-dev-wlan0 disabled_11b_rates=0
Jan 18 19:31:33 x5sa wpa_supplicant[1263]: p2p-dev-wlan0: CTRL-EVENT-TERMINATING
Jan 18 19:31:33 x5sa wpa_supplicant[1263]: wlan0: CTRL-EVENT-DISCONNECTED bssid=ee:de:27:f6:09:36 reason=3 locally_generated=1
Jan 18 19:31:33 x5sa wpa_supplicant[1263]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Jan 18 19:31:33 x5sa wpa_supplicant[1263]: wlan0: CTRL-EVENT-TERMINATING
Jan 18 19:31:33 x5sa systemd[1]: Stopped Makerbasi mkspi WPA supplicant daemon.
Jan 18 19:31:33 x5sa systemd[1]: Started Makerbasi mkspi WPA supplicant daemon.
Jan 18 19:31:33 x5sa wpa_supplicant[4587]: Successfully initialized wpa_supplicant
Jan 18 19:31:34 x5sa wpa_supplicant[4587]: wlan0: Trying to associate with SSID 'Flusenhund2'
Jan 18 19:31:35 x5sa wpa_supplicant[4587]: wlan0: Associated with ee:de:27:f6:09:36
Jan 18 19:31:35 x5sa wpa_supplicant[4587]: wlan0: CTRL-EVENT-CONNECTED - Connection to ee:de:27:f6:09:36 completed [id=0 id_str=]
Jan 18 19:31:35 x5sa wpa_supplicant[4587]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 18 19:31:35 x5sa bash[1438]: [Aug 26 2024][17:42:25] /home/l123456/share/responsity/serial_screen_project/chuang_xin_yuan/klp-chuangxingyuan/src/mks_wpa_cli.cpp: 62
Jan 18 19:31:35 x5sa bash[1438]: 收到wpa回调信息:
Jan 18 19:31:35 x5sa bash[1438]: [Aug 26 2024][17:42:25] /home/l123456/share/responsity/serial_screen_project/chuang_xin_yuan/klp-chuangxingyuan/src/mks_wpa_cli.cpp: 66
Jan 18 19:31:35 x5sa bash[1438]: [Aug 26 2024][17:42:25] /home/l123456/share/responsity/serial_screen_project/chuang_xin_yuan/klp-chuangxingyuan/src/mks_wpa_cli.cpp: 67
Jan 18 19:31:44 x5sa bash[1438]: [Aug 26 2024][17:42:25] /home/l123456/share/responsity/serial_screen_project/chuang_xin_yuan/klp-chuangxingyuan/src/mks_wpa_cli.cpp: 697
Jan 18 19:31:44 x5sa bash[1438]: [Aug 26 2024][17:42:25] /home/l123456/share/responsity/serial_screen_project/chuang_xin_yuan/klp-chuangxingyuan/src/mks_wpa_cli.cpp: 62
Jan 18 19:31:44 x5sa bash[1438]: 收到wpa回调信息:
Jan 18 19:31:44 x5sa bash[1438]: [Aug 26 2024][17:42:25] /home/l123456/share/responsity/serial_screen_project/chuang_xin_yuan/klp-chuangxingyuan/src/mks_wpa_cli.cpp: 62
Jan 18 19:31:44 x5sa bash[1438]: 收到wpa回调信息:
Jan 18 19:34:46 x5sa systemd[1]: Stopping WPA supplicant...
Jan 18 19:34:46 x5sa systemd[1]: wpa_supplicant.service: Succeeded.
Jan 18 19:34:46 x5sa systemd[1]: Stopped WPA supplicant.
Jan 18 19:34:46 x5sa systemd[1]: Starting WPA supplicant...
Jan 18 19:34:46 x5sa wpa_supplicant[5468]: Successfully initialized wpa_supplicant
Jan 18 19:34:46 x5sa systemd[1]: Started WPA supplicant.
x5sa:multi-user.target.wants:# 


the output on the Bookworm image is

root@x5sa:~# systemctl status makerbase-wlan0.service   
○ makerbase-wlan0.service - Makerbasi mkspi WPA supplicant daemon
     Loaded: loaded (/lib/systemd/system/makerbase-wlan0.service; enabled; preset: enabled)
     Active: inactive (dead) since Sat 2025-01-18 19:34:12 CET; 1s ago
   Duration: 88ms
    Process: 8157 ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-wlan0.conf -Dnl80211,wext -iwlan0 (code=killed, signal=TERM)
   Main PID: 8157 (code=killed, signal=TERM)
        CPU: 65ms

Jan 18 19:34:12 x5sa systemd[1]: Started makerbase-wlan0.service - Makerbasi mkspi WPA supplicant daemon.
Jan 18 19:34:12 x5sa wpa_supplicant[8157]: Successfully initialized wpa_supplicant
Jan 18 19:34:12 x5sa systemd[1]: Stopping makerbase-wlan0.service - Makerbasi mkspi WPA supplicant daemon...
Jan 18 19:34:12 x5sa systemd[1]: makerbase-wlan0.service: Deactivated successfully.
Jan 18 19:34:12 x5sa systemd[1]: Stopped makerbase-wlan0.service - Makerbasi mkspi WPA supplicant daemon.


root@x5sa:~# systemctl status wpa_supplicant.service   
● wpa_supplicant.service - WPA supplicant
     Loaded: loaded (/lib/systemd/system/wpa_supplicant.service; enabled; preset: enabled)
     Active: active (running) since Sat 2025-01-18 19:17:39 CET; 17min ago
   Main PID: 663 (wpa_supplicant)
      Tasks: 1 (limit: 974)
     Memory: 3.0M
        CPU: 43ms
     CGroup: /system.slice/wpa_supplicant.service
             └─663 /sbin/wpa_supplicant -u -s -O "DIR=/run/wpa_supplicant GROUP=netdev"

Jan 18 19:17:38 x5sa systemd[1]: Starting wpa_supplicant.service - WPA supplicant...

(and that's it, nothing more, even after hours)

root@x5sa:~# journalctl -n 5000 | grep -i wpa
root@x5sa:~# journalctl -n 5000 | grep -i wifi
root@x5sa:~# journalctl -n 5000 | grep -i wlan
root@x5sa:~# 



@redrathnure
Copy link
Owner

Disclaimer: I am not Linux kernel OR Debian configuration guru, so please double check information above and be ready that it is a useless crap...
However I have feeling that there are few misconceptions:

  1. wpa_supplicant for me sounds like a magic service which "just" help you o configure wifi during first run. In old rasbian, armbian and current MKS OEM images you may find a wpa_supplicant.conf file in the boot preparation, wehre you may put your wifi data (SSID and password) and enjoy by automatically connection after first run. However I am not sure it's really have seance after initial configuration and I am olmost sure it is not imply DTS and kernel modules for WIFI (basically drivers for your wlan device)
  2. More fun for migration may be givven by different network managers. If I got it right, WIFI interface managed by systemd-networkd in OEM image and NetworkManager in the modern/custom images. Configuration files and approach how to up and down network interfaces may be different.
  3. All this network manager have sence only after you configure proper kernel support of your wifi card. Usually this means two components: DTS/dtb declaration and proper kernel modules. For the first you may unpack dtb -> dts and try to review wifi related sections, for the second part you should review and/or compare lsmod outputs. In bast case you should have custom DTS declaration with common kernel modules, in worst case you would find custom/closed source kernel modules from MKS ;(

I would start from DTS and kernel modules investigation. Till you will see inactive network device. And only after this jumping to NetworkManager, sustemD and other services.

@bsafh
Copy link
Author

bsafh commented Jan 18, 2025

From my experience, each new board adaptation starts from following questions:

I'll start comparing the DTS files tomorrow

The obvious difference here is that the SKIPR has no wlan onboard whereas the Mini does have one.

I do not have acces to the schematic and I could not find anything about the wifi adaptations anywhere. There is no info available in which other printers this board may be used, it seems to be OEM only and is not listed in the MKS website or repos and not in the Tronxy website/repo.

It does use the same Arm CPU and STM mcu.

@redrathnure
Copy link
Owner

Yeah, I see. Then we use only information from worked dts and lsmod, hope it would be enough...

@bsafh
Copy link
Author

bsafh commented Jan 18, 2025

Till you will see inactive network device. And only after this jumping to NetworkManager, sustemD and other services.

3. worst case you would find custom/closed source kernel modules from MKS ;(

Well, the MKS Buster image shows that it's a standard Broadcom wlan card (brcfm). Those modules brcfmmac and brcfmutils are present as kernel moduls in the Bookworm custom image and they can be loaded with modprobe. They "just" do not recognize the hardware.... (and are not automatically loaded, on the SKIPR without "Mini" they are of no use obviously).

So it's rather unlikely that there is some unknown closed source blob for wlan. Hopefully the DTS comparison will help (they did put the DTS on the Buster image in /root/ for whatever reason, looks like they just did not clean up after the implementation, there are several not used things in /root/ and /home/mks/...)

@bsafh bsafh changed the title [Bug]: WIFI not working on MKS SKIPR *MINI* 1.0 with Armbian-build [Feature request]: WIFI not working on MKS SKIPR *MINI* 1.0 with Armbian-build Jan 18, 2025
@bsafh
Copy link
Author

bsafh commented Jan 18, 2025

First quick glance at the DTS file in /root/ of the MKS Buster image:

                wireless-wlan {
                        wifi-wake-host {
                                rockchip,pins = < 0x01 0x13 0x00 0x66 >;
                        };
                };
        wireless-wlan {
                compatible = "wlan-platdata";
                rockchip,grf = < 0x3f >;
                sdio_vref = < 0xce4 >;
                status = "okay";
                WIFI,host_wake_irq = < 0x29 0x13 0x00 >;
                wifi_chip_type = "rtl8723bs";
        };

Hmm, rtl?? Not brc? Wrong file? No... the DTS is definitely the one which is used . And wlan0 is definitely working .. Strange naming though.

Why isn't it

x5sa:~:# locate r8723bs.ko
/usr/lib/modules/5.16.20-rockchip64/kernel/drivers/staging/rtl8723bs/r8723bs.ko.xz
x5sa:~:#

that is not loaded, but wlan0 works ...

__symbols__ {
...
      wifi_enable_h = "/pinctrl/sdio-pwrseq/wifi-enable-h";
...

There is no armbianEnv.txt in /boot/ on the MKS image, but in /boot/extlinux/extlinux.conf there ist the line
fdt /dtb/rockchip/rk3328-roc-cc.dtb
which is the filename in /root/

-rw-r--r-- 1 root   root     64K Aug  1  2023 rk3328-roc-cc.dtb
-rw-r--r-- 1 mks    mks      75K Jul 24  2023 rk3328-roc-cc.dts

This DTS/DTB is used on the MKS image on the exact Hardware the Bookworm image is intended to run.

On the running printer with original MKS Buster image:

x5sa:~:# dtc -I dtb -O dts -o devicetree.dts /boot/dtb/rockchip/rk3328-roc-cc.dtb
x5sa:~:# diff devicetree.dts rk3328-roc-cc.dts
x5sa:~:#

Is it possible/sensible to use this DTS on the Bookworm image? Just rename it (to what name?) and copy? (Of cource make a Backup of the existing /boot/ first ...)

As it is used on that exact hardware, the hardware definitions should fit? The DTS/DTB file is a copy from the working printer with the original tronxy/mks hardware and the original eMMC supplied by by TronXY/MKS, so if that does not match the hardware, the printer should not work?)

@bsafh bsafh closed this as completed Jan 18, 2025
@bsafh
Copy link
Author

bsafh commented Jan 18, 2025

Arghhh . I hit the wrong button on my smartphone .. I did NOT intend to close the issue, but I cn't reopen it...

The chip on the actual board is an AMPAK AP6212 (AP 6212 written on it ...)
https://www.ampak.com.tw/product/WiFi-Bluetooth/stamp-type-1T1R/AP6212
So it's not a Broadcom as the loaded kernel module brcfmmac suggest, and it is not a rtl8723bs as written in the DTS/DTB.... miracle of IoT/SoC devices...
"The integrated module provides SDIO interface for Wi-Fi, UART / I2S / PCM interface for Bluetooth." (AMPAK).

But I find links to a Broadcom-AP6212 as well on github. There is no logo on the actual chip, just the marking AP6212.
So ... brcfmmac seems to make sense, but the rtk8723bs in the (working) DTS does not make sense to me.

How to proceed?

@redrathnure redrathnure reopened this Jan 18, 2025
@bsafh
Copy link
Author

bsafh commented Jan 18, 2025

This seems to be the same problem on another rockchip 3328 based board with the same wlan/Bluetooth chip AP6212

#28 (comment)
(ap6212 works if replaced with kingroon's rk3328-roc-cc.dtb renamed to rk3328-mkspi.dtb)

So, just taking the DTS/DTB from the MKS Buster image from /boot/dtb/ might actualky do the trick??

@redrathnure
Copy link
Owner

redrathnure commented Jan 18, 2025

OK, a few points from my side:

MKS Buster/OEM image uses /boot/dtb/rk3328-roc-cc.dtb, new custom images uses /boot/dtb/rk3328-mkspi.dtb one. Potentially you may try to extract /boot/dtb/rk3328-roc-cc.dtb, rename it and put to the new image.

Looks like MKS use the same WIFI module in different boards. I see some traces in MKS KliPad (Sovol printers???) and klipad50 (from QIDIs machines???). If it's true, you may gather some info from hteir resources (seems like a few guys manage to make wlan worked). So just a few random links from other issues:

... and from my experience diff cli is not really suitable for the compaction. It's better to use something more smarter, e.g. VSCode...

So, I would say you may try to just swap dtb files and check how wlan works. If it OK, then let's compare DTS files and may be try to reverse-engineering restore original pin numbers and IRQ configuration for related sections.

Funny fact: OEM image does not guaranty you correct configuration. I found errors in power domain, power and HDMI controllers in the original MKSPI images....

@bsafh
Copy link
Author

bsafh commented Jan 19, 2025

  • a photos of "potentially similar" board:

that's different. The SKIPR Mini looks like this

Image
Image
Image

Funny fact: OEM image does not guaranty you correct configuration. I found errors in power domain, power and HDMI controllers in the original MKSPI images....

I know ... the "mksclient" (the one I converted to a static binary) program (assuming it controls the touchpad) displays a "RST" button (with "Firmware stopped, reset firmware?" above the button). Well, clicking it does reset the mcu - but it does also silently replace your printer.cfg with a faulty version from wherever. Not only are your adaptations gone, but the version has the direction of the extruder stepper motor reversed ... very helpful idea...

and from my experience diff cli is not really suitable for the compaction. It's better to use something more smarter, e.g. VSCode...

yes. diff is just a quick way to see whether two files are completely identical

there are 3 versions of rk3328-roc-cc.dtb on the MKS image:

  1. one in /root/
  2. one on /boot/dtb/rockchip/
  3. one in /boot/dtb-5.16.20-rockchip64/rockchip/

the first two are identical, the third one is smaller (1 kB)

a quick glance with diff shows the main differences are that the two identical versions contain info about the touchscreen and the wlan card, and some spi0 pins which are missing in the third one (that seems to be the original one)

rk3328-roc-cc.dts.txt

This is the diff between them
dts-diff.txt

and here the rk3328-mkspi form this repo (I did not modify anything, just decompiled it)

rk3328-mkspi.dts.txt
which is around 2 kB smaller that the MKS version

the diff (I still have to install VSCode) shows quite a big number in pins being different in addition to the wlan and touchscreen stuff

diff-roc-cc-vs-mkspi.txt

@redrathnure
Copy link
Owner

redrathnure commented Jan 19, 2025

Have you try to swap /boot/dtb/rk3328-roc-cc.dtb (from OEM) -> /boot/dtb/rk3328-mkspi.dtb (to custom)? Is WiFi works?

After quick look at diff I would say:

  1. Wifi declaration may be adopted to the new DTS (custom DTS, manual patching or may be DTS overlay)
  2. However I do not understand how display works. Is it connected to the board via black socket in the left top side?
  3. They declare 1 SPI interface with 2 chips spi_for_cs0 and spi_for_cs1 (good naming, yeah) with compatible = "rockchip,spi_test_bus1_cs2"; for both of them. The both work with 5MHz spi-max-frequency. So this might be a two lines for LCD and touch, however I am have no idea what is on the other end of this lines and how host communicates with it. Probably this is part around mksclient service.

@redrathnure
Copy link
Owner

... and a few hints about diffs:

  • you may replace > to > and < to < (spaces) to minimize changes.
  • for now you may ignore differences in HDMI, ethernet and mmc related nodes. It is not so important, at least for now

@bsafh
Copy link
Author

bsafh commented Jan 19, 2025

https://torte71.github.io/InsideSovolKlipperScreen/sovol_mods.html - MKS services

most of those are present as well on the MKS SKIPR Mini / TroXY Klipper Upgrade Kit

root@x5sa:~# ls -la /etc/systemd/system/multi-user.target.wants/
total 8
drwxr-xr-x  2 root oot 4096 Jan 18 18:23 .
drwxr-xr-x 21 root oot 4096 Jan 18 18:11 ..
[....]
lrwxrwxrwx  1 root oot   42 Jan 18 13:32 makerbase-byid.service -> /lib/systemd/system/makerbase-byid.service
lrwxrwxrwx  1 root oot   44 Jan 18 15:21 makerbase-client.service -> /lib/systemd/system/makerbase-client.service
lrwxrwxrwx  1 root oot   46 Jan 18 16:09 makerbase-net-mods.service -> /lib/systemd/system/makerbase-net-mods.service
lrwxrwxrwx  1 root oot   50 Jan 18 17:42 makerbase-time-monitor.service -> /lib/systemd/system/makerbase-time-monitor.service
lrwxrwxrwx  1 root oot   43 Jan 18 17:44 makerbase-wlan0.service -> /lib/systemd/system/makerbase-wlan0.service
[....]
lrwxrwxrwx  1 root oot   42 Jan  3 04:30 wpa_supplicant.service -> /lib/systemd/system/wpa_supplicant.service
root@x5sa:~# 

makerbase-client.service is the service with the binary only mksclient in den /home/mks/Desktop/... directory ...

plr ist present as well, but not as a service, it's just sitting in /rooT and it is called from the tronxy supplied printer.cfg ...

@bsafh
Copy link
Author

bsafh commented Jan 19, 2025

I copied rk3328-roc-cc.dtb (renamed to rk3328-mkspi.dtb) into /root/dtb/rockchip/ and rebooted.

and ...
wlan works!
ethernet still works as well, but not as eth0, but as end1 and with a different MAC address, which is a bit annoying, but I found it (different IP obviously)


root@x5sa:~# ifconfig
end1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.80.139  netmask 255.255.255.0  broadcast 192.168.80.255
        inet6 fe80::d1a1:36a3:7623:af85  prefixlen 64  scopeid 0x20<link>
        inet6 2003:ce:7748:1bc5::2000:a8a2  prefixlen 128  scopeid 0x0<global>
        inet6 2003:ce:7748:1bc5:3f71:fb2c:f660:910e  prefixlen 64  scopeid 0x0<global>
        inet6 2003:ce:7748:1bc5:5cb0:6a13:9d5e:9e71  prefixlen 64  scopeid 0x0<global>
        ether 52:59:2e:7d:c7:9a  txqueuelen 1000  (Ethernet)
        RX packets 80291  bytes 16027440 (15.2 MiB)
        RX errors 0  dropped 40821  overruns 0  frame 0
        TX packets 22008  bytes 8849674 (8.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 59  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 6303  bytes 629408 (614.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6303  bytes 629408 (614.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.81.149  netmask 255.255.255.0  broadcast 192.168.81.255
        inet6 fda1:1eb6:88ab:0:ced2:5d38:ca57:a4c  prefixlen 64  scopeid 0x0<global>
        inet6 fdeb:49a5:9a8c:4:52cf:93e1:4529:66f0  prefixlen 64  scopeid 0x0<global>
        inet6 fd02:8239:3c80:0:794:7785:199e:4e49  prefixlen 64  scopeid 0x0<global>
        inet6 2003:ce:7748:1bc2::4000:695d  prefixlen 128  scopeid 0x0<global>
        inet6 fd02:8239:3c80:1:d721:353:a04f:10b1  prefixlen 64  scopeid 0x0<global>
        inet6 fdeb:49a5:9a8c:5:c8f3:addc:288f:b446  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::1c85:b89c:1cb4:723f  prefixlen 64  scopeid 0x20<link>
        inet6 fdeb:49a5:9a8c:0:c4e1:bc80:e06c:39d2  prefixlen 64  scopeid 0x0<global>
        inet6 2003:ce:7748:1bc2:166e:adab:4bf8:fe94  prefixlen 64  scopeid 0x0<global>
        ether 54:78:c9:b8:af:06  txqueuelen 1000  (Ethernet)
        RX packets 3488  bytes 600604 (586.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1772  bytes 473390 (462.2 KiB)
        TX errors 0  dropped 4 overruns 0  carrier 0  collisions 0

root@x5sa:~# 

(yes, that are public IPv6 addresses, but you still won't reach that system ... )

that looks like success!

the rest of this Sunday is family-dedicated, cu l8ter

@redrathnure
Copy link
Owner

Damn, I just realize they have LCD and Touchscreen related pins in OEM DTS:

pinctrl_tsc2046_pendown = "/pinctrl/touchscreen/pinctrl_tsc2046_pendown";
pinctrl_tsc2046_cs = "/pinctrl/touchscreen/pinctrl_tsc2046_cs";
pinctrl_ili9341_cs = "/pinctrl/lcd/pinctrl_ili9341_cs";

however there are no pin declarations. Most likely it's just leftover after "dirty" patching of mkspi image. This means your chances to have standard fb0 and input devices (with standard kernel modules) are pretty low.

Perhaps you should look at #36 (comment) message and previous discussion. I have feeling skipr mini has the same story.

@bsafh
Copy link
Author

bsafh commented Jan 19, 2025

however there are no pin declarations. Most likely it's just leftover after "dirty" patching of mkspi image. This means your chances to have standard fb0 and input devices (with standard kernel modules) are pretty low.

Yes, I expected that I won't have the screen via KlipperScreen. With any luck, I might have the touchscreen via the "mksclient" program which seems to manage it.

But that's for another day.

wlan works now:

1: None 00.0: 0282 WLAN controller
  [Created at pci.1030]
  Unique ID: YpgV.Vu98QzaObUF
  SysFS ID: /devices/platform/ff510000.mmc/mmc_host/mmc2/mmc2:0001/mmc2:0001:1
  SysFS BusID: mmc2:0001:1
  Hardware Class: network
  Model: "ARM Ethernet controller"
  Device: "ARM Ethernet controller"
  Driver: "brcmfmac"
  Driver Modules: "brcmfmac", "brcmfmac", "brcmfmac"
  Device File: wlan0
  Features: WLAN
  HW Address: 54:78:c9:b8:af:06
  Permanent HW Address: 54:78:c9:b8:af:06
  Link detected: yes
  WLAN channels: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
  WLAN frequencies: 2.412 2.417 2.422 2.427 2.432 2.437 2.442 2.447 2.452 2.457 2.462 2.467 2.472 2.484
  WLAN encryption modes: WEP40 WEP104 TKIP CCMP
  WLAN authentication modes: open sharedkey wpa-psk wpa-eap
  Module Alias: "of:NmmcT(null)Crockchip,rk3328-dw-mshcCrockchip,rk3288-dw-mshc"
  Config Status: cfg=new, avail=yes, need=no, active=unknown

12: None 00.0: 0200 Ethernet controller
  [Created at pci.1030]
  Unique ID: MSyK.TfPFe67fIBB
  SysFS ID: /devices/platform/ff550000.ethernet
  SysFS BusID: ff550000.ethernet
  Hardware Class: network
  Model: "ARM Ethernet controller"
  Device: "ARM Ethernet controller"
  Driver: "rk_gmac-dwmac"
  Driver Modules: "dwmac_rk"
  Device File: end1
  HW Address: 52:59:2e:7d:c7:9a
  Permanent HW Address: 52:59:2e:7d:c7:9a
  Link detected: yes
  Module Alias: "of:NethernetT(null)Crockchip,rk3328-gmac"
  Driver Info #0:
    Driver Status: dwmac_rk is active
    Driver Activation Cmd: "modprobe dwmac_rk"
  Config Status: cfg=new, avail=yes, need=no, active=unknown

my DHCP server does show AMPAK as vendor of the wlan card.

this is the new hardware info (hwinfo) with the MKS DTB used:

hwinfo-bookworm-new.txt

@redrathnure
Copy link
Owner

And a few remark about WLAN success experiment:

I copied rk3328-roc-cc.dtb (renamed to rk3328-mkspi.dtb) into /root/dtb/rockchip/ and rebooted.
and ...
wlan works!

Basically it means all changes only in DTS. They use standard kernel modules for it. Which is good news. This part may be easily wrapped as DTS overlay (see an example) and contributed to this and armbian repos.

ethernet still works as well, but not as eth0, but as end1 and with a different MAC address, which is a bit annoying, but I found it (different IP obviously)

eth0, but as end1 it's pretty usual for modern bistro. Not saying I like it... however you may easily remap it usinf udev rules, if you really want (I gave up, too laze to do this each time :))

and with a different MAC address hm, this is strange. The ethernet@ff nodes looks pretty similar (between custom and OEM images).... However it should not be a problem because this is one time configuration of your DHCP :)

Have a nice weekend :)

@bsafh
Copy link
Author

bsafh commented Jan 19, 2025

)

2. However I do not understand how display works. Is it connected to the board via black socket in the left top side?

upper left is the (metallic) Ethernet port. It's connected to the black socket on the right side (see from top).

Image
Image
Image

@bsafh
Copy link
Author

bsafh commented Jan 19, 2025

  • differences in HDMI

there is no HDMI connector on the board anyway ...

@bsafh
Copy link
Author

bsafh commented Jan 19, 2025

This part may be easily wrapped as DTS overlay (see an example) and contributed to this and armbian repos.

that would be nice :-) (though I never packaged anything to be excepted into official repos, but ... well, that would be good)

@bsafh
Copy link
Author

bsafh commented Jan 20, 2025

The QR Code on the back reads
M3052600433

The connector for the display ist labeled "H-UART 1", or "A-UART1" (the top of the first Letter is covered by the connector case). Is that any help for Göttingen the display work as KlipperScreen?

@redrathnure
Copy link
Owner

No idea, to be frankly. This is match with 2 SPI declarations in OEM DTS file, but they specify compatible = "rockchip,spi_test_bus1_cs2";...

@redrathnure
Copy link
Owner

Any dmesg logs related to spi, input, uart or serial words?

@redrathnure
Copy link
Owner

I have a feeling that Sovol owners know how to make screen working.
This page (see at the end) describes how to make this interface visible for linux. After it you should see spi device, something like /dev/spi0.0. And then they have a page where's describing how to rotate screen (for me it means what KlipperScreen already works).

@bsafh
Copy link
Author

bsafh commented Jan 20, 2025

I have a feeling that Sovol owners know how to make screen working. This page (see at the end) describes how to make this interface visible for linux. After it you should see spi device, something like /dev/spi0.0. And then they have a page where's describing how to rotate screen (for me it means what KlipperScreen already works).

That's a good hint. I'll try that as soon as possible - probably next weekend, maybe I find a bit of spare time before that.

@bsafh
Copy link
Author

bsafh commented Jan 20, 2025

Any dmesg logs related to spi, input, uart or serial words?

yes, indeed there are

This is from the running original MKS/TronXY image:

x5sa:~:# dmesg | grep -i spi
[    1.729560] enter spi_setup
[    1.729860] spi_setup, spi->max_speed_hz:5000000, spi->controller->max_speed_hz:50000000
[    1.730630] exit spi_setup, max_speed_hz:5000000
[    1.732402] enter spi_match_device
[    1.732756] spi_match_device:of_driver_match_device
[    1.733533] Enter spi_probe, dev->of_node:/spi@ff190000/spi_for_cs0@0
[    1.734188] spi_probe, of_clk_set_defaults:0
[    1.734616] spi_probe, dev_pm_domain_attach:0
[    1.735455] spi_probe, sdrv->probe:0
[    1.735992] enter spi_setup
[    1.736261] spi_setup, spi->max_speed_hz:5000000, spi->controller->max_speed_hz:50000000
[    1.737092] exit spi_setup, max_speed_hz:5000000
[    1.738890] enter spi_match_device
[    1.739246] spi_match_device:of_driver_match_device
[    1.739928] Enter spi_probe, dev->of_node:/spi@ff190000/spi_for_cs1@1
[    1.740560] spi_probe, of_clk_set_defaults:0
[    1.741053] spi_probe, dev_pm_domain_attach:0
[    1.741869] spi_probe, sdrv->probe:0
[    1.909847] SPI driver ads7846 has no spi_device_id for ti,tsc2046
[    1.910455] SPI driver ads7846 has no spi_device_id for ti,ads7843
[    1.911020] SPI driver ads7846 has no spi_device_id for ti,ads7845
[    1.911580] SPI driver ads7846 has no spi_device_id for ti,ads7873
[    1.912173] enter spi_match_device
[    1.912880] dev_node:/spi@ff190000/spi_for_cs0@0, drv_name:ti,tsc2046
[    1.913541] enter spi_match_device
[    1.914247] dev_node:/spi@ff190000/spi_for_cs1@1, drv_name:ti,tsc2046
[   41.853866] enter spi_setup
[   41.853887] spi_setup, spi->max_speed_hz:5000000, spi->controller->max_speed_hz:50000000
[   41.853931] exit spi_setup, max_speed_hz:5000000
[   41.853942] enter spi_setup
[   41.853945] spi_setup, spi->max_speed_hz:5000000, spi->controller->max_speed_hz:50000000
[   41.853955] exit spi_setup, max_speed_hz:5000000
x5sa:~:#                                                                             
x5sa:~:# dmesg | grep -i uart
[    0.000000] earlycon: uart8250 at MMIO32 0x00000000ff130000 (options '')
[    0.000000] printk: bootconsole [uart8250] enabled
[    0.000000] Kernel command line: root=UUID=5dcae443-0796-4029-ae6c-bf5bd2a37067 console=uart8250,mmio32,0xff130000 console=tty0 rootflags=data=writeback rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 bootsplash.bootfile=bootsplash.armbian
[    0.003050] printk: bootconsole [uart8250] disabled
[    0.088640] Serial: AMBA PL011 UART driver
[   14.161814] dw-apb-uart ff130000.serial: forbid DMA for kernel console
x5sa:~:#    
x5sa:~:# dmesg | grep -i serial
[    0.088640] Serial: AMBA PL011 UART driver
[    1.585612] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    1.591589] ff110000.serial: ttyS0 at MMIO 0xff110000 (irq = 19, base_baud = 1500000) is a 16550A
[    1.593691] ff120000.serial: ttyS1 at MMIO 0xff120000 (irq = 20, base_baud = 1500000) is a 16550A
[    1.595699] ff130000.serial: ttyS2 at MMIO 0xff130000 (irq = 21, base_baud = 1500000) is a 16550A
[    1.692765] Serial: AMBA driver
[    1.778250] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.779955] usb usb1: SerialNumber: ff580000.usb
[    1.807081] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.808788] usb usb2: SerialNumber: ff5c0000.usb
[    1.878328] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.880136] usb usb3: SerialNumber: ff5d0000.usb
[    1.889843] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.891580] usb usb4: SerialNumber: xhci-hcd.0.auto
[    1.898919] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.900625] usb usb5: SerialNumber: xhci-hcd.0.auto
[    2.303505] usb 4-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.641125] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.642686] usb 3-1: SerialNumber: 240056001651343036333837
[    2.739426] usb 4-1.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.191089] usb 4-1.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.192734] usb 4-1.4.1: SerialNumber: 00000000
[    4.123079] usb 4-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    4.579140] usb 4-1.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    5.019177] usb 4-1.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    5.020948] usb 4-1.4.1: SerialNumber: 00000000
[   14.161814] dw-apb-uart ff130000.serial: forbid DMA for kernel console
x5sa:~:#                                                                           
x5sa:~:# dmesg | grep -i input
[    2.007800] input: rk805 pwrkey as /devices/platform/ff160000.i2c/i2c-1/1-0018/rk805-pwrkey/input/input0
[    3.721506] rk_gmac-dwmac ff550000.ethernet: clock input or output? (output).
[   17.156860] input: webcamproduct: usb-webcam as /devices/platform/ff600000.usb/xhci-hcd.0.auto/usb4/4-1/4-1.4/4-1.4.1/4-1.4.1:1.0/input/input1
[   18.686130] input: BRLTTY 5.6 Linux Screen Driver Keyboard as /devices/virtual/input/input2
x5sa:~:#         

@bsafh
Copy link
Author

bsafh commented Jan 23, 2025

@torte71 yes, that looks very much like a leftover. Seems they do not clean up after finishing their work. Which in this case might be a good thing.

@torte71
Copy link

torte71 commented Jan 24, 2025

The kernel is different on the skipr-mini image.
(I compared both original images from the manufacturer)
Both are "vmlinuz-5.16.20-rockchip64", but

  • klipad50:
    • byte # 0x68: 0x60 (this is only the first difference)
    • sha256: 01ef404e19ac7af559b92b4d1e020b0ca0ac7b6e0b63ebc9a449639d035bb47d
  • skipr-mini:
    • byte# 0x68: 0xa4
    • sha256: c6dcae6707c9b67957a5f97374d09342dce5fa1e6c0b4ae0df19e22ad2f03009

And they behave differently with the display:

  • booted skipr-mini image on klipad50
    • replaced dtb with original klipad50 dtb
      • screen stays black
      • fbset -i returns "1920x1080"
    • replaced kernel with original klipad50 kernel
      • screen is on
      • fbset -i returns "800x480"
      • bootsplash stays permanently on (here: mks logo with a "progress" circle, but skipr-mini may have a different logo compiled in)
        • until (as root) "echo off > /sys/devices/platform/bootsplash.0/enabled"

These are the changes from klipad50 to skipr-mini kernel-config
(they can't show, if mks "hacked" the display sources):

--- klipad50-config-5.16.20-rockchip64   2023-08-04 13:50:08.000000000 +0800
+++ skipr-mini-config-5.16.20-rockchip64  2022-07-25 09:58:42.000000000 +0800
@@ -3375,6 +3375,16 @@
 CONFIG_WLCORE_SPI=m
 CONFIG_WLCORE_SDIO=m
 CONFIG_WILINK_PLATFORM_DATA=y
+# CONFIG_RTL8822BS is not set
+CONFIG_RTL8723DU=m
+CONFIG_RTL8723DS=m
+CONFIG_RTL8822CS=m
+CONFIG_RTL8822BU=m
+CONFIG_RTL8821CU=m
+CONFIG_88XXAU=m
+# CONFIG_RTL8192EU is not set
+CONFIG_RTL8189FS=m
+CONFIG_RTL8189ES=m
 CONFIG_WLAN_VENDOR_ZYDAS=y
 CONFIG_USB_ZD1201=m
 CONFIG_ZD1211RW=m
@@ -3654,7 +3664,7 @@
 # CONFIG_INPUT_PCF8574 is not set
 # CONFIG_INPUT_PWM_BEEPER is not set
 # CONFIG_INPUT_PWM_VIBRA is not set
-# CONFIG_INPUT_RK805_PWRKEY is not set
+CONFIG_INPUT_RK805_PWRKEY=y
 # CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
 CONFIG_INPUT_DA7280_HAPTICS=m
 # CONFIG_INPUT_ADXL34X is not set
@@ -5903,7 +5913,10 @@
 CONFIG_BOOTSPLASH=y
 # end of Console display driver support

-# CONFIG_LOGO is not set
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
 # end of Graphics support

 CONFIG_SOUND=m

I'll try, if I can force using the edid settings from the klipad50 when running the skipr-mini kernel.
If that activates the display, then that may be possible the other way round on the skipr-mini.
But if the skipr-mini kernel has a different display driver "hacked in", then we have a "situation". 😢

A rather desperate attempt, but as it can be easily checked:
Do the following commands stop the initial bootlogo and display a working console with some messages and the login prompt?

sudo su
echo off > /sys/devices/platform/bootsplash.0/enabled

Edit: (But I strongly doubt, that this can create the missing "/dev/fb0")
Edit#2: Just for completeness: After replacing the kernel, I've regenerated initrd with update-initrd -u (as root).

@redrathnure
Copy link
Owner

redrathnure commented Jan 24, 2025

Okay, I'm starting to understand what they did, unfortunately.

First of all, what the magic rockchip,spi_test_bus1_cs2 string:
Actually this is example/tutorial from rockchip documentation. They provide example how to adjust DTS file and write related kernel module. Kinda "hello world" example.

Why it's important in our context:
This string is used to choose right kernel module to handle this device (device driver)... and the rockchip,spi_test_bus1_cs2 copy-paste means (with high probability) that they have custom kernel module. From previous message I would assume they have custom kernel module with hard coded LCD parameters.

Plus in case of OEM mkspi image they took standard display module and changed it. So even if you see ilitek,ili9341 it is not 100% that this is ili9341 driver from mainline kernel repo.

What may be done:

  1. Found/ask for sources, especially kernel patches. Yeah, GPL, I know :)
  2. try to guess hardware. In case of MK-TS35 we knew a controller model (chip marking) and this helped to find right driver
  3. try to find similar product/board/printer/display and look how they solve this issue (if they have done it).

@bsafh
Copy link
Author

bsafh commented Jan 24, 2025

A rather desperate attempt, but as it can be easily checked:
Do the following commands stop the initial bootlogo and display a working console with some messages and the login prompt?

on the Armbian mkspi image or on the original MKS/Tronxy image?

  1. Found/ask for sources, especially kernel patches. Yeah, GPL, I know :)

well, I guess the whole thing is buildt by MKS and just sourced by Tronxy (that's where I bought it directly from their shop). So I am not a customer of MKS, but of Tronxy. Tronxy supposedly does not even have the source code.

So whom to ask for what exactly? I can do that, but my experience is that their will only be any answer if we ask very specific for a specific file e.g., not just for all source code.

@bsafh
Copy link
Author

bsafh commented Jan 24, 2025

2. try to guess hardware. In case of MK-TS35 we knew a controller model (chip marking) and this helped to find right driver

the screen is 100x58mm roughly (roughly 4.3 inch display?). It seems not to match anything on the Makerbase website though.

Image
Image
Image

does that help? I can't determine what hardware that might be.

@torte71
Copy link

torte71 commented Jan 24, 2025

A rather desperate attempt, but as it can be easily checked:
Do the following commands stop the initial bootlogo and display a working console with some messages and the login prompt?
on the Armbian mkspi image or on the original MKS/Tronxy image?

On the mkspi image with the adjusted dtb (not the one with "spi_test_bus1_cs2").

(I found that command in the skipr-mini image, i.e. that image already does it at the end of the boot process)

@bsafh
Copy link
Author

bsafh commented Jan 24, 2025

it's this display: https://store.tronxy.com/product-8000160.html

the QR code is not an URL, but text:
DYFGHSFHXSFF43FHV1.65+10806071

the code on the display
TJC4827X243_011C_I_P20
leads to only two hits in google:

https://www.reddit.com/user/Valakiiii/comments/

https://www.reddit.com/r/ElegooNeptune3/comments/19dvjai/neptune_3_pro_lcd_touch_screen_with_klipper/?tl=de

both talk about this being a "TJC (Nexion clone)" and it seems to be used on the Twotrees SK1 as well.

the second thread points to
https://github.com/joakimtoe/KlipperLCD (but I'm not really sure whether that is exactly the same touchscreen ....) - the photo
https://www.reddit.com/media?url=https%3A%2F%2Fpreview.redd.it%2Fneptune-3-pro-lcd-touch-screen-with-klipper-v0-ay7p2o9v8fec1.jpeg%3Fwidth%3D604%26format%3Dpjpg%26auto%3Dwebp%26s%3Db9679b2601564618d7bc837c4bfef2ed51eecb40
seems to be a bit different

but this
https://www.reddit.com/media?url=https%3A%2F%2Fpreview.redd.it%2Fneptune-3-pro-lcd-touch-screen-with-klipper-v0-5ik3u33js86e1.jpeg%3Fwidth%3D4096%26format%3Dpjpg%26auto%3Dwebp%26s%3D06223889293670a7e65a1198a421ccb6b9a9771c
looks identical, just the code reads _Z15 instead of _I_P20 ...

so KlipperLCD might actually work?

@torte71
Copy link

torte71 commented Jan 24, 2025

The KlipperLCD project might work.
That would mean, that this device is by no means a linux supported display. It is connected by a serial line (ttyAMA0) and receives commands from it to display either plaintext or bitmap data.

I already wondered, if the image you sent me, has ever displayed something on that screen:
There are a bunch of syslogs in /var/log/messages*, and when split into parts which begin with "Booting Linux", it shows that on every boot process there are two "Cannot find any crtc or sizes" error messages.
So it looks to me, as if there was never a working display detected.

Then I did an strace of the "mksclient" binary, and it tries to open "/dev/ttyS1" and to connect to a wifi p2p point.
So this "mksclient" may well be something like the KlipperLCD project: A special program that displays custom information by sending that to the display device over a serial line.
But there I don't see a chance, that this display can be turned into a standard display which can be used by linux just as any other display.
Unless someone with "guru" skills wrote a linux device driver for such serial-attached displays.
(And I would really love to be proved wrong on this assumption.)

@bsafh
Copy link
Author

bsafh commented Jan 24, 2025

the KlipperLCD project seems to use it as a KlipperScreen on a RaspberryPi, so it sort of uses it as a standard display.

Unfortunately...

  1. it does this in vertical mode only, whereas the TronXY display is horizontally mounted
  2. the project itself seems to be abandoned completely :-(

see here: joakimtoe/KlipperLCD#20 (comment) ...

@bsafh
Copy link
Author

bsafh commented Jan 24, 2025

so ... that's bad, as expected.

Where does that leave me?
Even if I'm willing to buy a Linux supported display/touchscreen - is there any way to connect that to the SKIPR Mini board? The SKIPR Mini does not have a HDMI connector :-(

so no chance at all, I guess?

@torte71
Copy link

torte71 commented Jan 24, 2025

the KlipperLCD project seems to use it as a KlipperScreen on a RaspberryPi, so it sort of uses it as a standard display.

I don't agree that KlipperLCD makes the display a standard display:

It collects data periodically and then pushes this data to the screen:

Neither in the imports or the rest of the sources I see anything that would access a display device or XOrg.

KlipperLCD is a mini replacement for KlipperScreen IMO, which just shows certain info.
Like a tool, that displays e.g. cpu-temperature on a one-line LCD strip.

I don't know, if there are other possibilities to attach screens, e.g. via SPI or I2C, so that they are detected and supported as a standard display devices (I am no hardware expert, my playground is userspace and gui). But that would also require an existing connector to make use of these bus-systems.

@GoldenGreek
Copy link

RE: KlipperLCD on the MKS Skipr Mini, Oren on the Infimech-TX unofficial discord has made quite a bit of progress on writing a custom firmware for the TJC screen to interact with KlipperLCD project. I've abandoned all os-level work on the Skipr-Mini due to work demands about 4 months ago, but they might be able to help you out: https://discord.com/invite/2qSEqESHKS

@bsafh
Copy link
Author

bsafh commented Jan 24, 2025

KlipperLCD is a mini replacement for KlipperScreen IMO, which just shows certain info.

oh yes, I see - sorry for the confusion

@torte71
Copy link

torte71 commented Jan 24, 2025

This could be a solution: DisplayLink's video over usb3
https://www.synaptics.com/products/displaylink-graphics/displaylink-products-list?field_displaylink_category_value=usb_adapters
https://support.displaylink.com/knowledgebase/articles/683482-displaylink-support-for-ubuntu-now-available
There seems to be linux support, but I can't tell, how good that works.

There is also USB-C Alt-Mode, which allows DisplayPort over USB-C, but again, I have not the slightest idea, how well that works. And if it can be used with the usb3 port instead of usb-c.

@bsafh
Copy link
Author

bsafh commented Jan 24, 2025

DisplayLink over USB3 in general works, I use that on Linux notebook to connect to connect to an USB3 docking station with 2 HDMI monitors - but that's an i7, not a MKS-Pi

I have no idea what the USB-C connector on the board is for, it's not routed to outside of the case.

@torte71
Copy link

torte71 commented Jan 24, 2025

Such an "internal-only" usb-c is on the klipad50 as well.
The board can be powered over this port, but I haven't found any other use.
(I am unsure about the two "Download/Touch" jumpers, as well as the "CH-D+" button - and as long as I only have this one board, I am not going to touch them, to see if they release the magic smoke 😄).

Though the klipad has another usb-c port, which offers a serial console.

Image

@torte71
Copy link

torte71 commented Jan 24, 2025

Another approach:
If you are satisfied with what the screen does in the original skipr-mini image, then you can try running that stuff on a recent armbian system.
See "/var/lib/dpkg/info/makerbase-client.*":

  • "makerbase-client.list" contains the list of files copied by that package
  • "makerbase-client.postinst" shows, what was done in the installation process

You can try copying the files from makerbase-client.list into the same location on the new system and executing the commands from makerbase-client.postinst to complete the installation.

These (non-default) processes showed up with ps ax:

/usr/bin/bash /home/mks/Desktop/myfile/ws/start.sh
/bin/bash /root/gpio-monitor.sh
/bin/bash /root/set-time.sh
/home/mks/Desktop/myfile/ws/build/mksclient
/usr/bin/bash /root/mcu-id.sh

Start them in the same order, and with some luck, you'll see blinkenlights.

@bsafh
Copy link
Author

bsafh commented Jan 24, 2025

  • "makerbase-client.list" contains the list of files copied by that package

  • "makerbase-client.postinst" shows, what was done in the installation process

That's a great idea! I'll try that tomorrow.

The mksclient binary won't run as is, as it it linked dynamically againt the libs on the older mks kernel version, but I did already a conversion into a statically linked binary, which in theory should run.

It did start, but it just crashed, most probably because I just copied the binary alone (+ the start.sh)

/usr/bin/bash /home/mks/Desktop/myfile/ws/start.sh - is called from systemd on startup, calls mksclient
gpio-monitor belongs to another non-szatndard package
set-time.sh is another stupid non-stanhdard-package, it just checks whether there is a specific chinese NTP server available
mcu-id.sh just determines the MCU id and does nothing with it

@redrathnure
Copy link
Owner

Okay, now it has sense.

Just to summarize current state:

[ LCD ] <-- SPI bus -> [ MKSPI ]
  1. Two smartish devices which connected via serial interface.
  2. on SKIPR mini side (MKSPI , Raspberry PI , whatever runs Klipper) a Host Agent is running, which collect data from Klipper and send it to the LCD. And periodically read user input from LCD and forward it to the Klipper
  3. LCD side has Firmware, which read data from Host Agent, display them and send user input to Host Agent (if there are any)

And this may explain a magic around SPI bus and non existed HDMI interface :)

To make it worked you would need "just" 4 steps:

  1. Connect LCD and SKIPR mini. It's already done because you have a cable with connectors, no need any additional stuff.
  2. Have proper LCD Firmware and Host Agent which able to communicate with each other. Sounds simple, yeah :)

About Host Agent. mksclient most likely is not the best option because a) nobody knows what is inside and b) it's is not clear how to run in in the costume images. So KlipperLCD looks like valid option here, at least as start point.

LCD Firmware, in generally you already have worked one. Perhaps problem we do not know used protocol (yet?). In worth case you may experiment with firmware from other printers.

So, firstly you may try to install KlipperLCD and check results. There are chance that it will works out of the box because usually there are no any reason to reinvent a wheel protocol for each and every printer.

Otherwise you may sniff a data sensed via serial/spi interface just to get a feeling what is going on here.

And a few side notes:

  • most likely HDMI, rockchip-drm, X11 and KlipperScreen are not relevant for these boards. HDMI messages most likely just a side effect of misconfiguration DTS.
  • As board do not have any HDMI/video interfaces, I would recommend ether concentrate on the KlipperLCD approach (see also a message bellow) or just stay with WEB UI only.
  • AiHMI t7 chip looks like widely used platform for similar solutions, e.g. Ender 3. So may be some help may be gathered in related forums.

@bsafh
Copy link
Author

bsafh commented Jan 24, 2025

  • just stay with WEB UI only.

I think I'll do that for now. I haven't got enough time to get KlipperLCD running. And once started, there is no going back because for KlipperLCD I have to flash the LCD firmware and I do not have the original firmware to flash it back in case that doesn't work.

@torte71
Copy link

torte71 commented Jan 24, 2025

I am pretty sure, that #46 (comment)
shows the flashing tool and firmware for the screen.

And btw., if the static linking of mksclient does not work, you can always use LD_LIBRARY_PATH variable to point it to a local copy of the required old libraries.

@bsafh
Copy link
Author

bsafh commented Jan 25, 2025

  • "makerbase-client.postinst" shows, what was done in the installation process

Yes... thy are doing shady things:

cat /home/mks/Desktop/myfile/others/extruder.py > /home/mks/klipper/klippy/kinematics/extruder.py
cat /home/mks/Desktop/myfile/others/cartesian.py > /home/mks/klipper/klippy/kinematics/cartesian.py
cat /home/mks/Desktop/myfile/others/corexy.py > /home/mks/klipper/klippy/kinematics/corexy.py
# cat /home/mks/Desktop/myfile/others/heater_bed.py > /home/mks/klipper/klippy/extras/heater_bed.py
cat /home/mks/Desktop/myfile/others/probe.py > /home/mks/klipper/klippy/extras/probe.py
cat /home/mks/Desktop/myfile/others/configfile.py > /home/mks/klipper/klippy/configfile.py
cat /home/mks/Desktop/myfile/others/heater_fan.py > /home/mks/klipper/klippy/extras/heater_fan.py

So they are replacing parts of Klipper. That's bad.
I'm not sure I want to do that.

Especially as they are based on Klipper 0.10.x, on my New Armbian Image I have the latest Klipper version.. (0.12.x??)

Ah, that triggers another thought...
In the old Klipper version, the configs live in ~/klipper/klipper_config/ not printer_data/config/ and there was no ../printer_data/comms/. I guess mksclient uses either klippy.serial or klippy.sock, but expects them in different location and perhaps under different names.

Where did the old Klipper version store those sockets/device files and what were the names?

@torte71
Copy link

torte71 commented Jan 25, 2025

You can boot the original image to locate these klipper files/directories and then create same-named symlinks in the new image to point them to their actual equivalents.

But it may turn out to become a lot of work, e.g. if it depends on certain klipper behaviours, which have changed in the meantime.

The changes to the mainstream klipper version (from the time when makerbase created that image) can be shown with "git diff" (in ~/klipper), "git status" gives a list of all changed or added files. Amongst others, the changes show some added gcode macros. You would have to find out for yourself, if any of those changes are required for mksclient to run correctly.
And it still may be, that changes between the ancient and recent klipper versions will not work with mksclient.

I personally would not invest too much time into mksclient.
I'd rather give KlipperLCD a try, as it does not depend on klipper modifications or ancient versions.

@bsafh
Copy link
Author

bsafh commented Jan 25, 2025

I'd rather give KlipperLCD a try, as it does not depend on klipper modifications or ancient versions.

Sounds like it, yes.

Or get a Pi Zero2W + an HDMI touchscreen, put moonraker and KlipperScreen on that and connect via IP to the SKIPR Mini ... basically kill the problem by throwing enough money at it. But that's independent of any legacy stuff.

@bsafh
Copy link
Author

bsafh commented Feb 1, 2025

I "solved" the screen challenge by buying a cheap 7 inch HDMI touchscreen from AliExpress plus a Pi Zero2W and installed KlipperScreen on that and connect to moonraker via WLAN.

Image
Image
Image

Image

Image

@redrathnure
Copy link
Owner

Cool, Just curious what the point in skipr mini in this case? mkspi + hdmi screen OR skipr/mkspi kit with 3.5" screen would cost bit less and work bit better:)

@bsafh
Copy link
Author

bsafh commented Feb 1, 2025 via email

@ils15
Copy link

ils15 commented Mar 10, 2025

i really interested on it
buy a SK1 and want to develop some things

@bsafh
Copy link
Author

bsafh commented Mar 10, 2025

buy a SK1

There are better boards. For example, on the SKIPR board, the CAN chip is only useable with crude hacks.

The SKIPR mini from this thread is worse: noch HDMI, no SPI, only an undocumented serial display interface, limited RAM, totally outdated operating system and very old Klipper version on the eMMC image.

But you cannot buy the SKIPR mini anyway, it's not listed on their website, it's an OEM board only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants