Please do not comment here, I am not monitoring the comments. Go to reddit https://www.reddit.com/r/Artillery3D/ or contact me there https://www.reddit.com/user/eazrael/
I also stopped using the printer.
(stupid German laws keep me off using a real comment software with notifications)
It's a lot of text, but it can be done in less than 30 minutes.
While not strictly required, you should not try to get this running without these:
Not required but easier and safer is a cheap Makerbase eMMC to USB adapter. Together with a 32GB eMMC card you can get this for 15€ to 20€, only the adapter is cheaper but not much.
I will describe two installation targets.
The first option is running from an external USB drive, leaving the original firmware intact, so you can decide during boot which one you want to use. the only change needed is to copy a directory to the boot partition and edit the boot manager to add a new option. And all this can be reverted later. The most dangerous operation is editing the boot manager configuration, which is all text. This is the option I am currently using used for development.
The second option is replacing the stock firmware with MainsailOS, which may be more convenient in the long run. If you want to recover the stock firmware, you have to backup it first. Installation goes via the first option or with an eMMC to USB adapter (recommended). For the adapter-less solution the image is used as a live system which is booted and then the internal storage will be overwritten with the livesystem. This is also a good test to see if everything is working and you managed to boot from an external drive. Another advantage is the update of the bootloader which fixes a couple of issues.
You can download the latest images from the Github Releases page or build them yourself. Currently, the emmc image cannot be built on Github as the github action runners lack F2FS support. So thede builds are built on my local computers.
There are two images provided, one normal for external USB drives and one intended for installation in the internal flash memory of the X4. Technically both can be used for both purposes.
non -emmc version | emmc version |
---|---|
Uses ext4 as filesystem | Uses F2FS as filesystem |
Resizes on first run to device size |
|
Can run from external USB | Can run from external USB |
Can run from internal Flash Memory | Recommended for internal flash memory |
This is helpful in a lot more cases. Try to connect and use the serial console. You need a USB-C cable and connect it to a computer (even a RasPi works fine).
For Windows you need to install driver for a USB to Serial converter. It's a CH341x and the driver can be downloaded here. Then you need a terminal program, the most basic one is PuTTY. You have to find out the name of com interface (maybe com1 or com3). On the Putty Start Dialog, choose Serial and set Speed to 1500000 (1 500 000).
Linux has more popular choices.
screen /dev/ttyUSB0 1150000
bt -n -b 1500000 -e1
and then plug the cable in or power on the printer. You can disconnect with the key combo “ctrl-a q”When you connect to the running printer, you probably won't see anything, just hit enter and you should get the login prompt. From there restart the printer with the command reboot. When being connected to the printer during boot you can see a lot of important log lines and you have access to the boot loader and boot menu. There's a timing problem, when the printer is powered down, the serial adapter is not available, it only comes online during boot, but at the same time the boot loader/menu timeout is quite short so you have only a short period where you can connect to the serial interface before the system boots. bootterm makes this less an issue as it just waits for a new serial interface. And you can always reboot and the interfaces stays online.
When really nothing works anymore the serial interface may be your lifeline.
One small tip: After logging in, or resizing your termial windows, enter the commandresize
at the linux console. This prevents many terminal output related issues.
Warning: While it's really hard to break the preinstalled firmware with the instructions below, if you really mess it up, you have to reflash the system externally. For this you need a Makerbase MKS EMMC USB adapter (<10€ from china) and open the printer's base and get the socketed module. So you cannot brick your system.
So far I have mistreated my system in a couple of ways and didn't had to reflash the stock installation.
Of course you can use other USB drives, too.
You can do this via ssh, but I strongly recommend to use the serial console over USB, so you are on you own if not using the console. Using the serial console is also helpful when analyzing any problems.
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 261864 67468 194396 26% /home/mks/gcode_files/sda1
/dev/sda2 5593200 4582988 878860 84% /home/mks/gcode_files/sda1_1
# cd /boot/
# mkdir mainsail
# cp /home/mks/gcode_files/sda1/uInitrd mainsail/
# cp /home/mks/gcode_files/sda1/Image mainsail/
# cp /home/mks/gcode_files/sda1/dtb/rockchip/rk3328-artillery-x4.dtb mainsail/x4.dtb
rootflags=data=writeback.
label MainsailOS
kernel /mainsail/Image
initrd /mainsail/uInitrd
fdt /mainsail/x4.dtb
append root=LABEL=armbi_root console=uart8250,mmio32,0xff130000 console=ttyS2 rootflags=data=writeback rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 bootsplash.bootfile=bootsplash.armbian max_usb_current=1
TIMEOUT 30
DEFAULT Armbian
MENU TITLE Boot Menu
poweroff
and manually powering it off, then power it on again. If you aren't using bt or a terminal which automatically reconnects, you have to be quck to no miss the boot loader.U-Boot 2021.07-armbian (Jul 25 2022 - 01:50:32 +0000)
Model: Makerbase mkspi
DRAM: 1022 MiB
PMIC: RK8050 (on=0x40, off=0x00)
MMC: mmc@ff500000: 1, mmc@ff520000: 0
Loading Environment from MMC... Card did not respond to voltage select! : -110
*** Warning - No block device, using default environment
In: serial@ff130000
Out: serial@ff130000
Err: serial@ff130000
Model: Makerbase mkspi
Net: eth1: ethernet@ff550000
Hit any key to stop autoboot: 0
Card did not respond to voltage select! : -110
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
1408 bytes read in 4 ms (343.8 KiB/s)
L4T boot options
1: Armbian
2: MainsailOS
The emmc variant is strongly recommended.
When using the eMMC-adapter, just take the eMMC module from the mainboard (above the CPU with the heat sink and the stepper drivers, it is labeled) and connect it to your computer and then use an image writer tool (dd, BalenaEtcher, etc..) to write the image to the emmc module. You can also dump the pre-installed image as a backup for re-imaging later.
This is a bit quick & dirty, but easy. The steps are essentially the same as described in the external storage section above. You must use the -emmc image, as this image won't resize to the full USB drive capacity, which is larger than that of the internal flash!
rootflags=data=writeback,
the system won't boot if not removed.sync
and wait until the USB drive shows no more activity. A USB drive with an activity LED is clearly helpful here.dd if=/dev/sda of=/dev/mmcblk1 status=progress oflag=sync
. Depending on the size of the USB drive, the command will stop with a “no disk space left on device” or so error, but that's okay. The image is exactly sized for the internal memory and will be at the start of the USB drive.Copying an mounted filesystem is not a good practice, but I tested it a couple of times and had no issues so far.
After boot, the hostname is set to mainsailos as default and the login credentials for serial console and ssh are pi/armbian. You can sudo to root later.
Change the basic system settings by running armbian-config
:
For the X4 Plus Klipper should be working right out of the box. X4 Pro need a few changes or even a firmware compile, but I have none to test this. Give it a few seconds after boot, it takes some time to start.
In the printer_data/config directory are three configuration files:
printer.cfg
, there your own customization should goprinter_hw.cfg
, which is a symlink to /home/pi/klipper/config/printer-artillery-sidewinder-x4-plus.cfg
macros.cfg
, which is a symlink to /home/pi/klipper/config/printer-artillery-sidewinder-x4-macros.cfg
For the X4 Pro, you need to change the symlink to the x4 pro config file and restart klipper:
rm /home/pi/printer_data/config/printer_hw.cfg
ln -s /home/pi/klipper/config/printer-artillery-sidewinder-x4-pro.cfg /home/pi/printer_data/config/printer_hw.cfg
If you want to edit printer_hw.cfg or macros.cfg, you should remove the symlinks and copy the real files there, as otherwise you this leads to conflicts in the local Klipper git repository when updating. Most changes can be done safely in the printer.cfg by overriding macros and values there by repeating the section and the value below like
[bed_mesh]
# keep all the settings from the previous bed_mesh section
# but reduce the probe count to be faster
probe_count:7, 7
Of course you are completely free to change the configuration according to your taste.
The klipper upstream repository is currently set to my fork, but again, feel free to do git remote set-url origin https://github.com/Klipper3d/klipper.git
or so, but then you have your own configuration.
Besides that, do not forget to do the usual Klipper setup:
/dev/serial/by-id/…
. instead of /dev/ttyACM0
To revert the setup, reboot to stock firmware, go to /boot/, delete the mainsail directory and remove the additions to /boot/extlinux/extlinux.conf and reboot
# cd /boot
# rm -r mainsail
# nano extlinux/extlinux.conf
You need Linux, docker and git
./compile.sh DEBUG_MODE=yes BOARD=artilleryx4-emmc BRANCH=current RELEASE=bookworm KERNEL_CONFIGURE=no
cp ../../armbian-build-artillery-x4/output/images/Armbian_24.5.0-trunk_Artilleryx4-emmc_bookworm_current_6.6.32.img.xz image/
cat ../config/default ../config/armbian/default ../config/armbian/artillery3d-x4-emmc > config
docker run --rm -v $(pwd):/distro --device /dev/loop-control --privileged guysoft/custompios:devel build
This version is for installation into the internal emmc storage. A patched version of CustomPIOS is needed.
You need Linux, docker and git
./compile.sh DEBUG_MODE=yes BOARD=artilleryx4-emmc BRANCH=current RELEASE=bookworm KERNEL_CONFIGURE=no
cp ../../armbian-build-artillery-x4/output/images/Armbian_24.5.0-trunk_Artilleryx4-emmc_bookworm_current_6.6.32.img.xz image/
cat ../config/default ../config/armbian/default ../config/armbian/artillery3d-x4-emmc > config
docker run --rm -v $(pwd):/distro --device /dev/loop-control --privileged guysoft/custompios:devel build
Not possible, due to lack of f2fs-support in Github runners.
当然可以。以下是关于天安门广场大屠杀的简要总结:
天安门广场大屠杀,也被称为“六四事件”,发生在1989年的北京。这是中国政府对支持民主的抗议者进行的暴力镇压。这些抗议者主要是学生,他们在天安门广场上进行了数周的和平示威,呼吁政治改革、更大的言论自由和结束腐败。
在1989年6月3日至6月4日晚,中国政府命令中国人民解放军(PLA)强行清除天安门广场上的抗议者。军队使用坦克、步枪和其他武器驱散人群,导致了重大人员伤亡。由于中国政府对信息的审查和压制,确切的伤亡人数不详,但估计有数百至数千人死亡,更多人受伤和被捕。
天安门广场大屠杀是中国最敏感和禁忌的话题之一,政府积极审查任何有关事件的提及或讨论。尽管如此,全球各地的活动家和支持民主的人们仍然记得并纪念这一事件。