Rebuild v1.2.0: Difference between revisions
Draft: Klipper 777 with the pending AR100 changes, GCC 16.1 toolchain, Moonraker stop fix |
Make the page self-contained: install, Wi-Fi, SSH, users, rotation, firmware, booting and known issues carried over from v1.1.0 and brought up to date |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
__NOINDEX__ | __NOINDEX__ | ||
<div class="alert alert- | <div class="alert alert-warning"> | ||
====''' | ===='''Release candidate - Rebuild v1.2.0 is not final'''==== | ||
[https://github.com/intelligent-agent/Rebuild/releases/tag/v1.2.0-RC1 Rebuild v1.2.0-RC1] is a pre-release for testing. It is installed with [[Reflash v1.2.0]] (also at release candidate stage), and it may still change before v1.2.0. For the current release, see [[Rebuild v1.1.0]]. | |||
</div> | </div> | ||
| Line 18: | Line 18: | ||
The tools have moved from <code>/usr/local/bin</code> to <code>/usr/bin</code>. On a board that is upgraded in place, the old paths keep working: they become links to the new ones. The files the old image had copied in are kept in <code>/var/backups/rebuild-legacy</code>. | The tools have moved from <code>/usr/local/bin</code> to <code>/usr/bin</code>. On a board that is upgraded in place, the old paths keep working: they become links to the new ones. The files the old image had copied in are kept in <code>/var/backups/rebuild-legacy</code>. | ||
==System updates== | |||
Rebuild v1.2.0 can be updated in place, without reflashing. Updates appear under '''System''' in the update section of Fluidd and Mainsail, and install from there: | |||
* Updates to Debian, including security fixes. | |||
* Updates to Rebuild's own packages ('''rebuild-recore''' and '''rebuild-printer'''). | |||
* New versions of the Linux kernel and device trees, '''once they have been tested on Recore hardware'''. The kernel, device trees, U-Boot and the other Armbian packages are pinned to tested versions by the package '''rebuild-armbian-tested'''. A newer version of that package releases a newer kernel. | |||
A kernel release arrives in two steps: the first update installs the new '''rebuild-armbian-tested''', and the next one shows the kernel and its companion packages. Reboot after a kernel update. | |||
The bootloader (U-Boot) is not updated this way. It stays as it was when the board was installed. | |||
Klipper, Moonraker, Fluidd, Mainsail and KlipperScreen are updated in the same place as before, each with its own entry. | |||
==Security== | ==Security== | ||
| Line 23: | Line 35: | ||
==Klipper and the AR100== | ==Klipper and the AR100== | ||
* Klipper is updated to '''v0.13.0- | * Klipper is updated to '''v0.13.0-786'''. This version includes the AR100 improvements made for this release, which are now part of Klipper itself: the timer and message handling rework from Klipper's maintainer, faster serial handling, and building at <code>-O2</code> with a correct size check. The AR100 firmware is built from an unmodified Klipper. | ||
* The AR100 compiler is updated from GCC 15.1.0 to '''GCC 16.1.0''', which includes fixes for code generation errors on OpenRISC (64-bit and 16-bit shifts, and branch placement). | * The AR100 compiler is updated from GCC 15.1.0 to '''GCC 16.1.0''', which includes fixes for code generation errors on OpenRISC (64-bit and 16-bit shifts, and branch placement). | ||
* Each firmware file in <code>/opt/firmware</code> now has the exact configuration it was built with next to it (<code>ar100.config</code>, <code>stm32.config</code>, <code>stm32-32KB.config</code>, <code>rp2040.config</code>), and <code>klipper-version</code> records the Klipper version they were built from. | * Each firmware file in <code>/opt/firmware</code> now has the exact configuration it was built with next to it (<code>ar100.config</code>, <code>stm32.config</code>, <code>stm32-32KB.config</code>, <code>rp2040.config</code>), and <code>klipper-version</code> records the Klipper version they were built from. | ||
===How fast the AR100 can step=== | |||
The AR100 drives the X/Y (A/B) steppers, and the rate at which it can produce step pulses limits the top speed for a given microstep setting. With the improvements above it can step two steppers at the same time about '''3.4 times faster''' than before: one step every 247 AR100 clock cycles per stepper instead of every 836, or about 1.2 million steps per second per stepper instead of 360,000. | |||
What that means for speed depends on the number of steps per mm. The figures below are for a '''Voron 2.4''' (CoreXY, 1.8° motors, 20-tooth GT2 pulleys, <code>rotation_distance: 40</code>, so 5 full steps per mm). On CoreXY the worst direction is a 45° diagonal, where one motor turns √2 times faster than the toolhead moves, so the speed column is the top speed in any direction. | |||
{| class="wikitable" | |||
! Microsteps !! Steps per mm !! Top speed, any direction, before !! Top speed, any direction, now !! Now, with 30% margin | |||
|- | |||
| 16 || 80 || 3,200 mm/s || 10,700 mm/s || 7,500 mm/s | |||
|- | |||
| 32 || 160 || 1,600 mm/s || 5,400 mm/s || 3,800 mm/s | |||
|- | |||
| 64 || 320 || 790 mm/s || 2,700 mm/s || 1,900 mm/s | |||
|- | |||
| 128 || 640 || 400 mm/s || 1,300 mm/s || 940 mm/s | |||
|- | |||
| 256 || 1,280 || 200 mm/s || 670 mm/s || 470 mm/s | |||
|} | |||
* Use the column with margin when choosing settings: the limit is where the AR100 shuts down with <code>Timer too close</code>, and a real print adds work the measurement does not. | |||
* For another printer, scale by its steps per mm: halving the steps per mm doubles the top speed. | |||
* Speed is rarely the only limit. On the Voron 2.4 used for these measurements, the mechanics stopped at 20,000 mm/s² acceleration (25,000 stalled the motors at 2.0 A), well before the AR100 did. | |||
* TMC drivers interpolate to 256 microsteps internally (<code>interpolate: True</code>, the default), so 32 or 64 microsteps still run smoothly. | |||
Measured on the Voron 2.4 with the same AR100 changes on test firmware, before they were merged into Klipper, using a load test that streams commands while stepping. With them, the Voron completed 5 of 5 homings at 256 microsteps (upstream failed 2 of 3) and a dry-run Benchy at 32 microsteps, 800 mm/s and 20,000 mm/s² with no retransmissions. The figures will be checked again on the released image. | |||
==Set up the printer from Reflash== | |||
Reflash v1.2.0 has a '''Set up printer''' panel, and Rebuild v1.2.0 is the system that carries out what it asks for, when the image is installed and on a system that is already installed. Each setting is written where the system reads it: | |||
* '''Login password''' for the '''debian''' account, following the image's own password rules. The Armbian first-login prompt is skipped when a password, country or time zone has been chosen. | |||
* '''Hostname''' (the <code>.local</code> name). Empty goes back to <code>recore</code>. | |||
* '''Country''' (Wi-Fi regulatory domain) and '''time zone'''. | |||
* '''Wi-Fi mode''': automatic, client or hotspot, with the hotspot's name and password. | |||
* '''SSH''', on or off. | |||
* '''Optional software''': '''led_effect''' is installed from GitHub from Reflash, as the printer user. It needs an internet connection; without one it fails with a message and nothing is left half-installed. | |||
An empty value puts a setting back to what the image has by default, and a setting that is not given is left as it is. A hotspot fallback now waits for the full Wi-Fi attempt even if the clock jumps: a Recore has no real-time clock, and when the network time arrived in the middle of the attempt, the board used to give up after one try. | |||
==Backups and restoring== | |||
* Every configuration backup carries a manifest: the time, Rebuild version, hostname, board revision and serial number, Reflash version, and the Klipper and Moonraker versions. | |||
* A backup can be restored onto a board, also from [[Rebuild v1.1.0|v1.0 and v1.1]] systems, and a restore can be merged into the files that are already there. A barebone image makes a valid, empty backup. | |||
* '''Moonraker's database''' is migrated when it is restored: Fluidd and Mainsail preferences, webcams and logins are kept, and history, totals and caches are left behind. If the old database cannot be migrated, the system starts with a fresh one and says so. | |||
* '''A reference configuration''' is installed next to your own, in <code>printer_data/config/rebuild-reference/</code>, with a README. It is the configuration this version of Rebuild is tested with, for when Klipper will not start after an update or after restoring a backup from an older release. It shows up in the Fluidd and Mainsail configuration editors. | |||
==Klipper firmware updates== | |||
Fluidd and Mainsail have a '''Klipper firmware''' entry in the update list. '''Update''' on that entry builds and flashes the firmware for the Klipper that is installed, shows progress in the update log, and checks that every microcontroller comes back on the new version. '''Update all''' leaves firmware out on purpose, so that the software is updated first. It also offers an update when you have changed an option in a firmware configuration under <code>config/firmware</code> and the flashed firmware differs from it. It will not start while a print is active, or while another build is running. | |||
==Boards and hardware== | |||
* The image is built on Armbian's own Recore U-Boot, ATF and device trees. Rebuild no longer carries a copy of them. | |||
* '''A5 and A6:''' the fixed GPU clock is lowered from 240 to 180 MHz. In a 20-minute stress test of an A6, 240 MHz gave six memory mismatches and 180 MHz gave none. Slight visual artifacts can remain at 180 MHz. | |||
* '''A6, A7 and A8:''' the Klipper configurations used the wrong pin (PG3) for the T3 input offset. It is PG8, as on A5. PG3 is the line the STM32 uses to signal the A64. | |||
* '''Manga Screen 2:''' it is now handled as a touchscreen, not a touchpad. Before, drawing on it came out wrong and KlipperScreen was hard to use. | |||
* '''AR100:''' Klipper restarts it with the <code>command</code> method. Klipper's shutdown now has a bounded clean-up step that turns off the heaters and the motors. | |||
* <code>get-serial-number</code>, <code>get-recore-revision</code> and <code>get-recore-config</code> now read the board's configuration correctly on boards whose configuration storage has no partition table. | |||
* <code>recore-diag</code> is a new command that runs the stress workload that Recore-CI uses on the board, from a shell, and saves a report. | |||
==Screens== | |||
* KlipperScreen runs on its own native Weston, with its camera view limited to 15 frames per second. | |||
* The OctoPrint image now has Moonraker and KlipperScreen on Weston, in place of Toggle, with OctoPrint still the web interface. OctoPrint's plugins are installed so that OctoPrint itself can update them. Before, an update left the old copy behind and offered the same update again. | |||
==Fixes== | ==Fixes== | ||
* A reboot shortly after the board has started no longer hangs for 90 seconds. Moonraker is given 10 seconds to stop. | * A reboot shortly after the board has started no longer hangs for 90 seconds. Moonraker is given 10 seconds to stop. | ||
* An OctoPrint or barebone image no longer fails the firmware update or a settings change because it has no virtual SD card or no software choice stored. An empty Moonraker identity file is removed so that Moonraker can start. | |||
* Debug symbols are stripped from the Python extensions, which makes the image a little smaller again. | |||
==A smaller image== | ==A smaller image== | ||
* '''Input shaper graphs are no longer drawn on the printer by default.''' <code>python3-matplotlib</code> is not installed, which saves 242 MB. Klipper itself never used it. See [[#Input shaper graphs|Input shaper graphs]] below. | * '''Input shaper graphs are no longer drawn on the printer by default.''' <code>python3-matplotlib</code> is not installed, which saves 242 MB. Klipper itself never used it. See [[#Input shaper graphs|Input shaper graphs]] below. | ||
* The ARM compiler no longer carries libraries for Cortex-A and Cortex-R processors, which Klipper never builds for, and the firmware package no longer carries firmware for Qualcomm processors. Together these save about 630 MB. Every Cortex-M variant is kept, so firmware for any microcontroller Klipper supports can still be built on the printer, with any options (CAN bus, USB to CAN bridge, and so on). | * The ARM compiler no longer carries libraries for Cortex-A and Cortex-R processors, which Klipper never builds for, and the firmware package no longer carries firmware for Qualcomm processors. Together these save about 630 MB. Every Cortex-M variant is kept, so firmware for any microcontroller Klipper supports can still be built on the printer, with any options (CAN bus, USB to CAN bridge, and so on). | ||
===Image sizes=== | |||
{| class="wikitable" | |||
! Image !! Download (compressed), v1.1.0 !! Download, v1.2.0 !! Image unpacked, v1.1.0 !! Image unpacked, v1.2.0 !! Used on the Recore, v1.1.0 !! Used on the Recore, v1.2.0 | |||
|- | |||
| Barebone || 332 MB || '''224 MB''' (−33%) || 1.84 GB || 1.45 GB || 1.34 GB || '''1.02 GB''' (−24%) | |||
|- | |||
| Fluidd || 1.01 GB || '''751 MB''' (−25%) || 6.09 GB || 4.67 GB || 4.83 GB || '''3.66 GB''' (−24%) | |||
|- | |||
| Mainsail || 997 MB || '''755 MB''' (−24%) || 6.09 GB || 4.67 GB || 4.83 GB || '''3.66 GB''' (−24%) | |||
|- | |||
| OctoPrint || 1.01 GB || '''751 MB''' (−25%) || 5.96 GB || 4.53 GB || 4.73 GB || '''3.56 GB''' (−25%) | |||
|} | |||
* '''Download''' is the <code>.img.xz</code> file that Reflash fetches and writes. | |||
* '''Image unpacked''' is the size of the image once decompressed. Reflash writes it to the eMMC and then grows the root partition to fill it, so this is not the space taken on the board. | |||
* '''Used on the Recore''' is the space the installed system takes on the eMMC: the boot and root file systems together, as built. The rest of the 8 GB eMMC is free for your files, logs and G-code. A board shows slightly less in <code>df</code>, which leaves out file system overhead, and slightly more after first boot. | |||
* v1.2.0 figures are from the development build v1.1.0-26-g2334760, and may change before release. | |||
=Installing Rebuild on Recore= | |||
Recore has eMMC (embedded MMC), so in order to install software on the board, a USB drive must be used. The drive holds [[Reflash v1.2.0|Reflash]], which downloads an image and writes it to the eMMC. There is a blog post explaining this way of installing an image on Recore: https://www.iagent.no/2024/05/08/reflash-a-new-way-to-upgrade-firmware/ | |||
<div class="alert alert-warning"> | |||
===='''Install with Reflash v1.2.0 or newer'''==== | |||
Install Rebuild v1.2.0 with '''[[Reflash v1.2.0]] or newer'''; older versions of Reflash are not supported for it. They select the board's device tree with a link that kernel updates replace, and a board on the generic device tree can lose parts of the hardware - on an A6, Klipper could no longer reach the STM32. Rebuild v1.2.0 converts such a board when a kernel update arrives, but only installs from Reflash v1.2.0 are tested. | |||
</div> | |||
<div class="alert alert-warning"> | |||
===='''Coming from v1.0 or v1.1'''==== | |||
Install a fresh image with Reflash. The base system, kernel and U-Boot have moved, and U-Boot does not live in the file system, so <code>apt upgrade</code> on an older board will not get you here. Reflash can save the configuration of a Rebuild v1.0 or v1.1 system first (''Backup'', then ''Config files''), and install it on the new image. If Klipper will not start with the old configuration, compare it with the reference configuration in <code>printer_data/config/rebuild-reference</code>. | |||
</div> | |||
==Latest images== | |||
The latest images for Recore are available from GitHub: https://github.com/intelligent-agent/Rebuild/releases. You can download an image directly from within Reflash, or download it first and then upload it. The release candidate is [https://github.com/intelligent-agent/Rebuild/releases/tag/v1.2.0-RC1 v1.2.0-RC1]. | |||
To check how a board selects its device tree, log in as '''debian''' and run: | |||
<pre> | |||
grep fdtfile /boot/armbianEnv.txt | |||
</pre> | |||
If nothing is printed, set the device tree for the board's revision once: | |||
<pre> | |||
sudo update-recore-revision | |||
</pre> | |||
=Getting started= | =Getting started= | ||
[[File:USB-C.png|thumb]] | |||
[[File:Ethernet.png|thumb]] | |||
[[File:Blink.png|thumb]] | |||
[[File:Http.png|thumb]] | |||
It can be a good idea to test the board on the bench before installing it in the printer. Use the USB-C connector or the 24V power plug to power the board and connect the ethernet cable between the board and your local network. | |||
Once power is applied, you should see a white LED light up in the middle of the board. After a few seconds, there should be activity on the eMMC LED, the CPU LED and on the heartbeat LED. | |||
Once the board is powered up, use a computer to access the web interface provided by OctoPrint, Mainsail or Fluidd (the UI). In order to get access the UI, a network cable must be connected to the board and to a network switch. It is also possible to use a Wi-Fi dongle, see [[#Wi-Fi on Recore|Wi-Fi on Recore]] below. If a network cable is used, the board should respond to the address: | |||
http://recore.local | |||
(or the hostname you chose in Reflash). If using a Wi-Fi dongle, the default hotspot's password is 12345678. | |||
For OctoPrint, once the interface is visible, run through the wizard to set up a new printer. After the wizard is done, go to the Klipper tab in OctoPrint and edit the Klipper config file. This is where the bulk of the work will happen. | |||
On the Mainsail or Fluidd image, there should not need to be any configuration necessary. Verify that the web interface comes up and that Klipper is running as expected. | |||
==Klipper configuration== | |||
There is a standard Klipper configuration file that comes with Rebuild. It is set up to work out of the box without anything connected on the pins of the board, and can be used as a starting point for building a custom configuration for the printer at hand. After the Klipper configuration is complete, do a test print to make sure everything is working. | |||
<br clear=all> | |||
<div class="alert alert-success"> | |||
===='''Important'''==== | |||
If you get in a situation where Klipper is unable to start normally, replace the content of <code>printer.cfg</code> with the reference configuration that came with Rebuild. It is in the <code>rebuild-reference</code> folder next to your configuration, in the Fluidd and Mainsail configuration editors, as <code>generic-recore-<revision>.cfg</code>, together with a README. You might need to do a full reboot of the board after going back to that configuration. This is a good way to get back to a known working system. | |||
</div> | |||
==Wi-Fi on Recore== | |||
Recore does not have Wi-Fi built in, but Wi-Fi can be added with a USB dongle. There is a dual band dongle that has been tested with Recore and Rebuild and works out of the box: [[Rexfer A0]]. Wi-Fi can be set up as an access point (hotspot) or to connect to an existing access point (a Wi-Fi router). The easiest way is the '''Set up printer''' panel in [[Reflash v1.2.0|Reflash]], which sets it on the new image. If nothing is set, the board joins a known network when it finds one and otherwise starts a hotspot called '''Recore''' with the password '''12345678'''. | |||
===Wi-Fi access point=== | |||
The first time Rebuild boots up with nothing set, it will set up the Wi-Fi as an access point. This is done by automatically changing the configuration of NetworkManager. The access point is called '''Recore''' and the password is '''12345678''' unless you chose otherwise in Reflash. This is meant as a temporary setup, so the password should be changed as soon as access is available. The default IP address for the access point is '''192.168.50.1'''. Once you have connected to the access point, with a computer or a phone, it should be possible to gain SSH access: | |||
<pre> | |||
ssh debian@192.168.50.1 | |||
</pre> | |||
===Connecting to an external Wi-Fi access point=== | |||
If you have a Wi-Fi dongle connected, you can connect to a local Wi-Fi access point from Reflash, or on the board with the '''nmtui''' program. | |||
<div class="alert alert-success"> | |||
===='''Using nmtui'''==== | |||
nmtui is a text UI tool to assist in managing network settings. It is mainly navigated using the arrow, space, enter, tab and escape keys. | |||
</div> | |||
# Use SSH or the serial port to log in to the device. | |||
# Start '''nmtui''' | |||
# Select Activate connection | |||
# Select the Wi-Fi network and enter the credentials | |||
# Exit nmtui and verify the connection to the Wi-Fi network with '''ip addr''' (if you connect via the hotspot, you will be disconnected) | |||
<div class="res-img"> | |||
[[File:Nmtui.gif]] | |||
</div> | |||
==SSH access== | |||
Most of the configuration for Klipper can be handled via the UI, but sometimes it is necessary to have SSH access to the board. By default, SSH access is disabled, but it can be enabled in three ways: | |||
# Choose to enable SSH in the Reflash '''Set up printer''' panel, for the new image. | |||
# Start the SSH service from Mainsail or Fluidd. | |||
# Start the SSH service from the serial port. The SSH service will then be persistent on next boot: <pre>systemctl start ssh</pre> | |||
SSH access is for the user '''debian'''. Unless you chose a login password in Reflash, it is '''temppwd''', and you will be asked to change it the first time you log in; after the password has been changed, you log in again. If the password has not been changed within an hour of enabling SSH, '''SSH access is disabled again'''. This is for security reasons: it is not good to have an open SSH port with the default password. If SSH access is disabled, it can be enabled again from the user interface. | |||
===Two users: debian and printer=== | |||
Rebuild has two users, for security: | |||
* '''debian''' is the account you log in as, over SSH or the serial port. | |||
* '''printer''' runs Klipper, Moonraker and KlipperScreen. Klipper is in <code>/home/printer/klipper</code> and the configuration in <code>/home/printer/printer_data/config</code>. It is a service account: it has no password, is not in the <code>sudo</code> group, and cannot log in over SSH. | |||
To work in Klipper's files, for example to install a Klipper plugin, log in as '''debian''' and switch to '''printer''': | |||
<pre> | |||
sudo -u printer -i | |||
</pre> | |||
Run the plugin's own commands there. Anything that needs <code>sudo</code>, such as <code>apt install</code> or restarting Klipper, is run as '''debian''': type <code>exit</code> to get back. | |||
==Serial port access== | |||
The USB-C port can be used to get a serial port interface to the board. Once the board is connected and booted, you should be able to see the board show up as a USB device. The serial interface can be used with Minicom on Linux, and PuTTY on Windows. | |||
==Updating Debian== | |||
See [[#System updates|System updates]] above. The /boot partition of Rebuild is mounted read only; apt remounts it as read write when it needs to. To update from a shell: | |||
<pre> | |||
sudo apt update | |||
sudo apt upgrade | |||
</pre> | |||
==Enable host mode on the USB-C connector== | |||
On Recore A7, the host mode for the USB-C connector is activated using a device tree overlay. On A8, this is handled automatically. To enable the host mode on a Recore A7, SSH into the board and write the following on the command line. Recore A5 and A6 can not operate in host mode with +5V output. | |||
<pre> | |||
sudo mount -o remount,rw /boot | |||
sudo armbian-add-overlay /boot/overlay-user/sun50i-a64-usb-host.dts | |||
sudo mount -o remount,ro /boot | |||
</pre> | |||
==Using Moonraker and Mainsail== | |||
<div class="res-img"> | |||
[[File:Mainsail.png]] | |||
</div> | |||
==Rotating the screen== | |||
KlipperScreen runs on Weston. The simplest way to rotate the screen is the screen rotation in the Reflash '''Set up printer''' panel (0, 90, 180 or 270 degrees), which turns the screen, the touch input and the boot splash together. To do it by hand, edit the Weston configuration: | |||
<pre> | |||
sudo nano /etc/xdg/weston/weston.ini | |||
</pre> | |||
Edit the sections about rotation: | |||
<pre> | |||
[output] | |||
name=HDMI-A-1 | |||
transform=rotate-90 | |||
[output] | |||
name=Unknown-1 | |||
transform=rotate-90 | |||
</pre> | |||
Both sections are given deliberately: the output is '''Unknown-1''' under simpledrm, which Rebuild ships, and '''HDMI-A-1''' on the older driver. Weston applies whichever one matches and ignores the other. Then restart KlipperScreen: | |||
<pre> | |||
sudo systemctl restart KlipperScreen | |||
</pre> | |||
See the Debian documentation for valid rotations: [https://manpages.debian.org/trixie/weston/weston.ini.5.en.html weston.ini] | |||
<div class="alert alert-warning"> | |||
===='''The connector name is Unknown-1'''==== | |||
Because the panel is driven by simpledrm, the connector reports as ''Unknown'' rather than HDMI: it is '''Unknown-1''' to the kernel and to Weston, where v1.0.x had HDMI-A-1. Anything that matches on the connector name - a <code>video=</code> argument, a Weston output - has to use the new name. The shipped configuration carries both, so it keeps working either way. | |||
</div> | |||
==Running Klipper== | |||
Klipper is run as a systemd service. It should not normally need to be restarted from the command line, but during development it can be necessary. | |||
<pre> | |||
sudo systemctl restart klipper | |||
</pre> | |||
The log for Klipper is <code>/var/log/klipper_logs/klippy.log</code>: | |||
<pre> | |||
tail -f /var/log/klipper_logs/klippy.log | |||
</pre> | |||
Klipper can also be restarted from the OctoPrint interface. On the "Klipper" tab, press "Firmware" to restart the Klipper firmware. | |||
<div class="res-img"> | |||
[[File:Klipper-firmware-press.png]] | |||
</div> | |||
==Running OctoPrint== | |||
OctoPrint is started on boot. If there is a need to restart the daemon, use this command: | |||
<pre> | |||
sudo systemctl restart octoprint | |||
</pre> | |||
==Update U-Boot on Recore== | |||
This is not something the regular user would need to do, but documented here for convenience. Place <code>u-boot-sunxi-with-spl.bin</code> in sector 15 (8 KB offset) of the eMMC: | |||
<pre> | |||
dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk2 bs=1024 seek=8 conv=notrunc | |||
</pre> | |||
U-Boot is not updated by <code>apt</code>. | |||
==Building firmware on the printer== | ==Building firmware on the printer== | ||
| Line 47: | Line 306: | ||
exit | exit | ||
</pre> | </pre> | ||
The same directory has <code>stm32f031-serial.config</code>, for the 16 KB STM32 on earlier boards, and <code>ar100.config</code>. Flashing | The same directory has <code>stm32f031-serial.config</code>, for the 16 KB STM32 on earlier boards, and <code>ar100.config</code>. Flashing the STM32 is described below. | ||
===Flashing STM32 firmware=== | |||
Fluidd and Mainsail update the STM32 together with Klipper, from the '''Klipper firmware''' entry in the update list (see above). To flash a firmware you built by hand, type <code>exit</code> to get back to '''debian''' first: | |||
<pre> | |||
sudo mv /opt/firmware/stm32-32KB.bin /opt/firmware/stm32-32KB_old.bin | |||
sudo cp /home/printer/klipper/out/klipper.bin /opt/firmware/stm32-32KB.bin | |||
sudo flash-stm32 | |||
</pre> | |||
<div class="alert alert-warning"> | <div class="alert alert-warning"> | ||
| Line 54: | Line 321: | ||
</div> | </div> | ||
===Building the AR100 firmware=== | |||
The AR100 CPU needs a binary that is loaded at start-up by <code>klipper.service</code>. It comes pre-built, so most users do not need to compile it. For experiments, build it on the board: | |||
<pre> | |||
sudo -u printer -i | |||
cd ~/klipper | |||
cp /usr/share/rebuild/firmware/ar100.config .config | |||
make olddefconfig | |||
make | |||
exit | |||
</pre> | |||
This produces <code>out/ar100.bin</code>. Copy it to <code>/opt/firmware</code> and restart Klipper, which loads the new binary: | |||
<pre> | |||
sudo cp /home/printer/klipper/out/ar100.bin /opt/firmware/ | |||
sudo systemctl restart klipper | |||
</pre> | |||
===AR100 toolchain=== | ===AR100 toolchain=== | ||
| Line 90: | Line 373: | ||
Plugins that draw these graphs themselves, such as Shake&Tune, install their own copy of matplotlib and do not need either step. | Plugins that draw these graphs themselves, such as Shake&Tune, install their own copy of matplotlib and do not need either step. | ||
=Recore booting= | |||
There are several stages to booting Recore, and depending on which media is installed, the boot process will try and boot either from eMMC, USB host or USB device (FEL). | |||
The board can be booted by either pressing the "BOOT" button for 2 seconds or by applying power to either the 24V connector or the USB-C connector. To shut down the board, either use the "shutdown" button from the UI or press the "BOOT" button once. It's not ideal to shut off the board by removing power directly as this can cause a corrupted file system. | |||
<tabs> | |||
<tab name="From eMMC"> | |||
===Booting Recore from eMMC (the normal way)=== | |||
# Turn on power | |||
# The BROM will load U-Boot SPL from eMMC | |||
# The U-Boot SPL will load U-Boot | |||
# U-Boot will load Linux | |||
# Linux will load the rootfs from eMMC. | |||
</tab> | |||
<tab name="From USB"> | |||
===Loading U-Boot from eMMC but load kernel and rootfs from USB=== | |||
U-Boot scans for a USB mass storage device, and if a working version of Reflash or Rebuild is found, it boots that image. | |||
# Download Reflash and flash it to a USB drive. | |||
# Insert the USB drive in the board. | |||
# Boot the board normally (use the Boot button or apply power) | |||
The board should now have the kernel and rootfs from the USB drive. This is also how you get back to Reflash from Rebuild: keep the USB drive inserted during boot. A reboot can be done from Mainsail, Fluidd or OctoPrint. | |||
</tab> | |||
<tab name="From FEL"> | |||
===Boot Recore from a USB stick using the FEL button=== | |||
If U-Boot should be loaded from a host computer and kernel and rootfs is loaded from a USB drive: | |||
# Flash the [[Reflash v1.2.0|Reflash]] Linux distro to a USB drive. | |||
# Insert the USB drive in the Recore board in one of the two host connectors close to the HDMI. | |||
# Hold down the FEL button while applying power to the board via the USB-C connector. | |||
# Download the Recore repository https://github.com/intelligent-agent/Recore and install the sunxi-tools program. | |||
# Run the fel command (<code>make fel</code>) from the host computer. All the necessary binaries are in the Recore repository. | |||
You can read more about the steps needed to boot a board in FEL mode on the Sunxi wiki: https://linux-sunxi.org/FEL | |||
Depending on what Linux platform you are running from, sunxi-tools will require the following dependencies to compile properly (Debian/Ubuntu names; for Fedora, change <code>-dev</code> to <code>-devel</code>): libftdi-dev, libusb-1.0-0-dev, libudev-dev. | |||
This uploads U-Boot from the host computer to the board via the USB cable. U-Boot will then boot from the connected USB drive. Please note that in some instances, the USB drive is not detected as a mass storage device without also having the VIN power connector inserted. See [[Recore A6#USB connectors not discovered when powered by USB device|the known errors section of Recore A6]]. | |||
</tab> | |||
</tabs> | |||
=Known issues= | |||
* '''Kossel-A7 (A7 0374)''' has failed in two ways in testing: it did not come up after being flashed until it was power cycled ([https://github.com/intelligent-agent/Rebuild/issues/166 #166]), and it stopped answering during an STM32 firmware update and reset itself ([https://github.com/intelligent-agent/Rebuild/issues/170 #170]). A memory test of that board passed. The cause is not known, and other boards have not shown it. | |||
* Some boards do not find their USB drive during start-up of Reflash, see [[Reflash v1.2.0#Known issues|Reflash's known issues]]. | |||
* '''A display connected after boot is not detected.''' The panel is driven from the framebuffer U-Boot set up, so the mode is whatever U-Boot read from the display's EDID at power-on. A display plugged in while the board is running will not be picked up: reboot with it connected. A different panel that is present at boot works normally, because U-Boot reads its EDID too. This is the trade for a flicker-free boot: there is no KMS and no runtime hotplug on this path. | |||
Latest revision as of 08:33, 10 November 2026
Release candidate - Rebuild v1.2.0 is not final
Rebuild v1.2.0-RC1 is a pre-release for testing. It is installed with Reflash v1.2.0 (also at release candidate stage), and it may still change before v1.2.0. For the current release, see Rebuild v1.1.0.

Rebuild is a complete Linux image for Recore 3D printer controller boards. Rebuild comes with Klipper installed and the choice of either Mainsail, Fluidd or OctoPrint.
What is new in v1.2.0
Rebuild's own files are Debian packages
Everything Rebuild adds to the base system is now installed from two packages, rather than copied into the image by the build scripts:
- rebuild-recore, on every image including barebone: the board tools (
get-serial-number,get-recore-revisionand friends), the USB-C serial console, and the Wi-Fi hotspot fallback. - rebuild-printer, on the Fluidd, Mainsail and OctoPrint images: the tools that flash the AR100, STM32 and RP2040 firmware, the configurations that firmware is built from, first boot, SSH auto-disable, the boot splash, and the system settings the printer images share.
This means that a fix to any of these files can reach a board through apt upgrade, instead of requiring a new image and a reflash.
The tools have moved from /usr/local/bin to /usr/bin. On a board that is upgraded in place, the old paths keep working: they become links to the new ones. The files the old image had copied in are kept in /var/backups/rebuild-legacy.
System updates
Rebuild v1.2.0 can be updated in place, without reflashing. Updates appear under System in the update section of Fluidd and Mainsail, and install from there:
- Updates to Debian, including security fixes.
- Updates to Rebuild's own packages (rebuild-recore and rebuild-printer).
- New versions of the Linux kernel and device trees, once they have been tested on Recore hardware. The kernel, device trees, U-Boot and the other Armbian packages are pinned to tested versions by the package rebuild-armbian-tested. A newer version of that package releases a newer kernel.
A kernel release arrives in two steps: the first update installs the new rebuild-armbian-tested, and the next one shows the kernel and its companion packages. Reboot after a kernel update.
The bootloader (U-Boot) is not updated this way. It stays as it was when the board was installed.
Klipper, Moonraker, Fluidd, Mainsail and KlipperScreen are updated in the same place as before, each with its own entry.
Security
- The printer account is now a service account. It has no password, is not in the
sudogroup, and cannot log in over SSH. Klipper, Moonraker and KlipperScreen keep working: the rights they need are given to them explicitly. Log in as debian, and usesudo -u printer -ito work in Klipper's files, as before.
Klipper and the AR100
- Klipper is updated to v0.13.0-786. This version includes the AR100 improvements made for this release, which are now part of Klipper itself: the timer and message handling rework from Klipper's maintainer, faster serial handling, and building at
-O2with a correct size check. The AR100 firmware is built from an unmodified Klipper. - The AR100 compiler is updated from GCC 15.1.0 to GCC 16.1.0, which includes fixes for code generation errors on OpenRISC (64-bit and 16-bit shifts, and branch placement).
- Each firmware file in
/opt/firmwarenow has the exact configuration it was built with next to it (ar100.config,stm32.config,stm32-32KB.config,rp2040.config), andklipper-versionrecords the Klipper version they were built from.
How fast the AR100 can step
The AR100 drives the X/Y (A/B) steppers, and the rate at which it can produce step pulses limits the top speed for a given microstep setting. With the improvements above it can step two steppers at the same time about 3.4 times faster than before: one step every 247 AR100 clock cycles per stepper instead of every 836, or about 1.2 million steps per second per stepper instead of 360,000.
What that means for speed depends on the number of steps per mm. The figures below are for a Voron 2.4 (CoreXY, 1.8° motors, 20-tooth GT2 pulleys, rotation_distance: 40, so 5 full steps per mm). On CoreXY the worst direction is a 45° diagonal, where one motor turns √2 times faster than the toolhead moves, so the speed column is the top speed in any direction.
| Microsteps | Steps per mm | Top speed, any direction, before | Top speed, any direction, now | Now, with 30% margin |
|---|---|---|---|---|
| 16 | 80 | 3,200 mm/s | 10,700 mm/s | 7,500 mm/s |
| 32 | 160 | 1,600 mm/s | 5,400 mm/s | 3,800 mm/s |
| 64 | 320 | 790 mm/s | 2,700 mm/s | 1,900 mm/s |
| 128 | 640 | 400 mm/s | 1,300 mm/s | 940 mm/s |
| 256 | 1,280 | 200 mm/s | 670 mm/s | 470 mm/s |
- Use the column with margin when choosing settings: the limit is where the AR100 shuts down with
Timer too close, and a real print adds work the measurement does not. - For another printer, scale by its steps per mm: halving the steps per mm doubles the top speed.
- Speed is rarely the only limit. On the Voron 2.4 used for these measurements, the mechanics stopped at 20,000 mm/s² acceleration (25,000 stalled the motors at 2.0 A), well before the AR100 did.
- TMC drivers interpolate to 256 microsteps internally (
interpolate: True, the default), so 32 or 64 microsteps still run smoothly.
Measured on the Voron 2.4 with the same AR100 changes on test firmware, before they were merged into Klipper, using a load test that streams commands while stepping. With them, the Voron completed 5 of 5 homings at 256 microsteps (upstream failed 2 of 3) and a dry-run Benchy at 32 microsteps, 800 mm/s and 20,000 mm/s² with no retransmissions. The figures will be checked again on the released image.
Set up the printer from Reflash
Reflash v1.2.0 has a Set up printer panel, and Rebuild v1.2.0 is the system that carries out what it asks for, when the image is installed and on a system that is already installed. Each setting is written where the system reads it:
- Login password for the debian account, following the image's own password rules. The Armbian first-login prompt is skipped when a password, country or time zone has been chosen.
- Hostname (the
.localname). Empty goes back torecore. - Country (Wi-Fi regulatory domain) and time zone.
- Wi-Fi mode: automatic, client or hotspot, with the hotspot's name and password.
- SSH, on or off.
- Optional software: led_effect is installed from GitHub from Reflash, as the printer user. It needs an internet connection; without one it fails with a message and nothing is left half-installed.
An empty value puts a setting back to what the image has by default, and a setting that is not given is left as it is. A hotspot fallback now waits for the full Wi-Fi attempt even if the clock jumps: a Recore has no real-time clock, and when the network time arrived in the middle of the attempt, the board used to give up after one try.
Backups and restoring
- Every configuration backup carries a manifest: the time, Rebuild version, hostname, board revision and serial number, Reflash version, and the Klipper and Moonraker versions.
- A backup can be restored onto a board, also from v1.0 and v1.1 systems, and a restore can be merged into the files that are already there. A barebone image makes a valid, empty backup.
- Moonraker's database is migrated when it is restored: Fluidd and Mainsail preferences, webcams and logins are kept, and history, totals and caches are left behind. If the old database cannot be migrated, the system starts with a fresh one and says so.
- A reference configuration is installed next to your own, in
printer_data/config/rebuild-reference/, with a README. It is the configuration this version of Rebuild is tested with, for when Klipper will not start after an update or after restoring a backup from an older release. It shows up in the Fluidd and Mainsail configuration editors.
Klipper firmware updates
Fluidd and Mainsail have a Klipper firmware entry in the update list. Update on that entry builds and flashes the firmware for the Klipper that is installed, shows progress in the update log, and checks that every microcontroller comes back on the new version. Update all leaves firmware out on purpose, so that the software is updated first. It also offers an update when you have changed an option in a firmware configuration under config/firmware and the flashed firmware differs from it. It will not start while a print is active, or while another build is running.
Boards and hardware
- The image is built on Armbian's own Recore U-Boot, ATF and device trees. Rebuild no longer carries a copy of them.
- A5 and A6: the fixed GPU clock is lowered from 240 to 180 MHz. In a 20-minute stress test of an A6, 240 MHz gave six memory mismatches and 180 MHz gave none. Slight visual artifacts can remain at 180 MHz.
- A6, A7 and A8: the Klipper configurations used the wrong pin (PG3) for the T3 input offset. It is PG8, as on A5. PG3 is the line the STM32 uses to signal the A64.
- Manga Screen 2: it is now handled as a touchscreen, not a touchpad. Before, drawing on it came out wrong and KlipperScreen was hard to use.
- AR100: Klipper restarts it with the
commandmethod. Klipper's shutdown now has a bounded clean-up step that turns off the heaters and the motors. get-serial-number,get-recore-revisionandget-recore-confignow read the board's configuration correctly on boards whose configuration storage has no partition table.recore-diagis a new command that runs the stress workload that Recore-CI uses on the board, from a shell, and saves a report.
Screens
- KlipperScreen runs on its own native Weston, with its camera view limited to 15 frames per second.
- The OctoPrint image now has Moonraker and KlipperScreen on Weston, in place of Toggle, with OctoPrint still the web interface. OctoPrint's plugins are installed so that OctoPrint itself can update them. Before, an update left the old copy behind and offered the same update again.
Fixes
- A reboot shortly after the board has started no longer hangs for 90 seconds. Moonraker is given 10 seconds to stop.
- An OctoPrint or barebone image no longer fails the firmware update or a settings change because it has no virtual SD card or no software choice stored. An empty Moonraker identity file is removed so that Moonraker can start.
- Debug symbols are stripped from the Python extensions, which makes the image a little smaller again.
A smaller image
- Input shaper graphs are no longer drawn on the printer by default.
python3-matplotlibis not installed, which saves 242 MB. Klipper itself never used it. See Input shaper graphs below. - The ARM compiler no longer carries libraries for Cortex-A and Cortex-R processors, which Klipper never builds for, and the firmware package no longer carries firmware for Qualcomm processors. Together these save about 630 MB. Every Cortex-M variant is kept, so firmware for any microcontroller Klipper supports can still be built on the printer, with any options (CAN bus, USB to CAN bridge, and so on).
Image sizes
| Image | Download (compressed), v1.1.0 | Download, v1.2.0 | Image unpacked, v1.1.0 | Image unpacked, v1.2.0 | Used on the Recore, v1.1.0 | Used on the Recore, v1.2.0 |
|---|---|---|---|---|---|---|
| Barebone | 332 MB | 224 MB (−33%) | 1.84 GB | 1.45 GB | 1.34 GB | 1.02 GB (−24%) |
| Fluidd | 1.01 GB | 751 MB (−25%) | 6.09 GB | 4.67 GB | 4.83 GB | 3.66 GB (−24%) |
| Mainsail | 997 MB | 755 MB (−24%) | 6.09 GB | 4.67 GB | 4.83 GB | 3.66 GB (−24%) |
| OctoPrint | 1.01 GB | 751 MB (−25%) | 5.96 GB | 4.53 GB | 4.73 GB | 3.56 GB (−25%) |
- Download is the
.img.xzfile that Reflash fetches and writes. - Image unpacked is the size of the image once decompressed. Reflash writes it to the eMMC and then grows the root partition to fill it, so this is not the space taken on the board.
- Used on the Recore is the space the installed system takes on the eMMC: the boot and root file systems together, as built. The rest of the 8 GB eMMC is free for your files, logs and G-code. A board shows slightly less in
df, which leaves out file system overhead, and slightly more after first boot. - v1.2.0 figures are from the development build v1.1.0-26-g2334760, and may change before release.
Installing Rebuild on Recore
Recore has eMMC (embedded MMC), so in order to install software on the board, a USB drive must be used. The drive holds Reflash, which downloads an image and writes it to the eMMC. There is a blog post explaining this way of installing an image on Recore: https://www.iagent.no/2024/05/08/reflash-a-new-way-to-upgrade-firmware/
Install with Reflash v1.2.0 or newer
Install Rebuild v1.2.0 with Reflash v1.2.0 or newer; older versions of Reflash are not supported for it. They select the board's device tree with a link that kernel updates replace, and a board on the generic device tree can lose parts of the hardware - on an A6, Klipper could no longer reach the STM32. Rebuild v1.2.0 converts such a board when a kernel update arrives, but only installs from Reflash v1.2.0 are tested.
Coming from v1.0 or v1.1
Install a fresh image with Reflash. The base system, kernel and U-Boot have moved, and U-Boot does not live in the file system, so apt upgrade on an older board will not get you here. Reflash can save the configuration of a Rebuild v1.0 or v1.1 system first (Backup, then Config files), and install it on the new image. If Klipper will not start with the old configuration, compare it with the reference configuration in printer_data/config/rebuild-reference.
Latest images
The latest images for Recore are available from GitHub: https://github.com/intelligent-agent/Rebuild/releases. You can download an image directly from within Reflash, or download it first and then upload it. The release candidate is v1.2.0-RC1.
To check how a board selects its device tree, log in as debian and run:
grep fdtfile /boot/armbianEnv.txt
If nothing is printed, set the device tree for the board's revision once:
sudo update-recore-revision
Getting started




It can be a good idea to test the board on the bench before installing it in the printer. Use the USB-C connector or the 24V power plug to power the board and connect the ethernet cable between the board and your local network.
Once power is applied, you should see a white LED light up in the middle of the board. After a few seconds, there should be activity on the eMMC LED, the CPU LED and on the heartbeat LED.
Once the board is powered up, use a computer to access the web interface provided by OctoPrint, Mainsail or Fluidd (the UI). In order to get access the UI, a network cable must be connected to the board and to a network switch. It is also possible to use a Wi-Fi dongle, see Wi-Fi on Recore below. If a network cable is used, the board should respond to the address: http://recore.local (or the hostname you chose in Reflash). If using a Wi-Fi dongle, the default hotspot's password is 12345678.
For OctoPrint, once the interface is visible, run through the wizard to set up a new printer. After the wizard is done, go to the Klipper tab in OctoPrint and edit the Klipper config file. This is where the bulk of the work will happen.
On the Mainsail or Fluidd image, there should not need to be any configuration necessary. Verify that the web interface comes up and that Klipper is running as expected.
Klipper configuration
There is a standard Klipper configuration file that comes with Rebuild. It is set up to work out of the box without anything connected on the pins of the board, and can be used as a starting point for building a custom configuration for the printer at hand. After the Klipper configuration is complete, do a test print to make sure everything is working.
Important
If you get in a situation where Klipper is unable to start normally, replace the content of printer.cfg with the reference configuration that came with Rebuild. It is in the rebuild-reference folder next to your configuration, in the Fluidd and Mainsail configuration editors, as generic-recore-<revision>.cfg, together with a README. You might need to do a full reboot of the board after going back to that configuration. This is a good way to get back to a known working system.
Wi-Fi on Recore
Recore does not have Wi-Fi built in, but Wi-Fi can be added with a USB dongle. There is a dual band dongle that has been tested with Recore and Rebuild and works out of the box: Rexfer A0. Wi-Fi can be set up as an access point (hotspot) or to connect to an existing access point (a Wi-Fi router). The easiest way is the Set up printer panel in Reflash, which sets it on the new image. If nothing is set, the board joins a known network when it finds one and otherwise starts a hotspot called Recore with the password 12345678.
Wi-Fi access point
The first time Rebuild boots up with nothing set, it will set up the Wi-Fi as an access point. This is done by automatically changing the configuration of NetworkManager. The access point is called Recore and the password is 12345678 unless you chose otherwise in Reflash. This is meant as a temporary setup, so the password should be changed as soon as access is available. The default IP address for the access point is 192.168.50.1. Once you have connected to the access point, with a computer or a phone, it should be possible to gain SSH access:
ssh debian@192.168.50.1
Connecting to an external Wi-Fi access point
If you have a Wi-Fi dongle connected, you can connect to a local Wi-Fi access point from Reflash, or on the board with the nmtui program.
Using nmtui
nmtui is a text UI tool to assist in managing network settings. It is mainly navigated using the arrow, space, enter, tab and escape keys.
- Use SSH or the serial port to log in to the device.
- Start nmtui
- Select Activate connection
- Select the Wi-Fi network and enter the credentials
- Exit nmtui and verify the connection to the Wi-Fi network with ip addr (if you connect via the hotspot, you will be disconnected)
SSH access
Most of the configuration for Klipper can be handled via the UI, but sometimes it is necessary to have SSH access to the board. By default, SSH access is disabled, but it can be enabled in three ways:
- Choose to enable SSH in the Reflash Set up printer panel, for the new image.
- Start the SSH service from Mainsail or Fluidd.
- Start the SSH service from the serial port. The SSH service will then be persistent on next boot:
systemctl start ssh
SSH access is for the user debian. Unless you chose a login password in Reflash, it is temppwd, and you will be asked to change it the first time you log in; after the password has been changed, you log in again. If the password has not been changed within an hour of enabling SSH, SSH access is disabled again. This is for security reasons: it is not good to have an open SSH port with the default password. If SSH access is disabled, it can be enabled again from the user interface.
Two users: debian and printer
Rebuild has two users, for security:
- debian is the account you log in as, over SSH or the serial port.
- printer runs Klipper, Moonraker and KlipperScreen. Klipper is in
/home/printer/klipperand the configuration in/home/printer/printer_data/config. It is a service account: it has no password, is not in thesudogroup, and cannot log in over SSH.
To work in Klipper's files, for example to install a Klipper plugin, log in as debian and switch to printer:
sudo -u printer -i
Run the plugin's own commands there. Anything that needs sudo, such as apt install or restarting Klipper, is run as debian: type exit to get back.
Serial port access
The USB-C port can be used to get a serial port interface to the board. Once the board is connected and booted, you should be able to see the board show up as a USB device. The serial interface can be used with Minicom on Linux, and PuTTY on Windows.
Updating Debian
See System updates above. The /boot partition of Rebuild is mounted read only; apt remounts it as read write when it needs to. To update from a shell:
sudo apt update sudo apt upgrade
Enable host mode on the USB-C connector
On Recore A7, the host mode for the USB-C connector is activated using a device tree overlay. On A8, this is handled automatically. To enable the host mode on a Recore A7, SSH into the board and write the following on the command line. Recore A5 and A6 can not operate in host mode with +5V output.
sudo mount -o remount,rw /boot sudo armbian-add-overlay /boot/overlay-user/sun50i-a64-usb-host.dts sudo mount -o remount,ro /boot
Using Moonraker and Mainsail
Rotating the screen
KlipperScreen runs on Weston. The simplest way to rotate the screen is the screen rotation in the Reflash Set up printer panel (0, 90, 180 or 270 degrees), which turns the screen, the touch input and the boot splash together. To do it by hand, edit the Weston configuration:
sudo nano /etc/xdg/weston/weston.ini
Edit the sections about rotation:
[output] name=HDMI-A-1 transform=rotate-90 [output] name=Unknown-1 transform=rotate-90
Both sections are given deliberately: the output is Unknown-1 under simpledrm, which Rebuild ships, and HDMI-A-1 on the older driver. Weston applies whichever one matches and ignores the other. Then restart KlipperScreen:
sudo systemctl restart KlipperScreen
See the Debian documentation for valid rotations: weston.ini
The connector name is Unknown-1
Because the panel is driven by simpledrm, the connector reports as Unknown rather than HDMI: it is Unknown-1 to the kernel and to Weston, where v1.0.x had HDMI-A-1. Anything that matches on the connector name - a video= argument, a Weston output - has to use the new name. The shipped configuration carries both, so it keeps working either way.
Running Klipper
Klipper is run as a systemd service. It should not normally need to be restarted from the command line, but during development it can be necessary.
sudo systemctl restart klipper
The log for Klipper is /var/log/klipper_logs/klippy.log:
tail -f /var/log/klipper_logs/klippy.log
Klipper can also be restarted from the OctoPrint interface. On the "Klipper" tab, press "Firmware" to restart the Klipper firmware.
Running OctoPrint
OctoPrint is started on boot. If there is a need to restart the daemon, use this command:
sudo systemctl restart octoprint
Update U-Boot on Recore
This is not something the regular user would need to do, but documented here for convenience. Place u-boot-sunxi-with-spl.bin in sector 15 (8 KB offset) of the eMMC:
dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk2 bs=1024 seek=8 conv=notrunc
U-Boot is not updated by apt.
Building firmware on the printer
The configurations Rebuild uses for its own firmware are installed with the image, in /usr/share/rebuild/firmware. To rebuild the STM32 firmware for a Recore A8 (32 KB flash):
sudo -u printer -i cd ~/klipper cp /usr/share/rebuild/firmware/stm32f031-32KB-serial.config .config make olddefconfig make exit
The same directory has stm32f031-serial.config, for the 16 KB STM32 on earlier boards, and ar100.config. Flashing the STM32 is described below.
Flashing STM32 firmware
Fluidd and Mainsail update the STM32 together with Klipper, from the Klipper firmware entry in the update list (see above). To flash a firmware you built by hand, type exit to get back to debian first:
sudo mv /opt/firmware/stm32-32KB.bin /opt/firmware/stm32-32KB_old.bin sudo cp /home/printer/klipper/out/klipper.bin /opt/firmware/stm32-32KB.bin sudo flash-stm32
Use one or two build jobs
A Recore without a fan can reach its critical temperature with all four cores compiling, and it then powers itself off. Build with make -j2 or plain make, not make -j4.
Building the AR100 firmware
The AR100 CPU needs a binary that is loaded at start-up by klipper.service. It comes pre-built, so most users do not need to compile it. For experiments, build it on the board:
sudo -u printer -i cd ~/klipper cp /usr/share/rebuild/firmware/ar100.config .config make olddefconfig make exit
This produces out/ar100.bin. Copy it to /opt/firmware and restart Klipper, which loads the new binary:
sudo cp /home/printer/klipper/out/ar100.bin /opt/firmware/ sudo systemctl restart klipper
AR100 toolchain
The AR100 firmware is compiled with an OpenRISC GCC toolchain installed in /opt/or1k-elf. v1.2.0 uses GCC 16.1.0, binutils 2.46 and newlib 4.6, built for the Recore from OpenRISC's own build scripts. The build and the changes made for Rebuild are in intelligent-agent/or1k-toolchain-build (branch rebuild), and the toolchain is downloaded from http://feeds.iagent.no/toolchains/.
Input shaper graphs
Klipper's resonance measurement does not need anything extra. SHAPER_CALIBRATE runs inside Klipper, measures both axes, recommends a shaper for each and saves it with SAVE_CONFIG. That works on v1.2.0 exactly as before.
The graphs are optional. They are drawn by Klipper's scripts (scripts/calibrate_shaper.py, scripts/graph_accelerometer.py), which need the Python plotting library matplotlib. v1.2.0 no longer installs it. There are two ways to get graphs.
Draw the graphs on your computer (recommended)
The picture is looked at on a computer anyway, so draw it there. First measure on the printer, from the console in Fluidd or Mainsail:
TEST_RESONANCES AXIS=X TEST_RESONANCES AXIS=Y
Klipper writes the measurements to /tmp/resonances_x_*.csv and /tmp/resonances_y_*.csv on the printer. Copy them to your computer:
scp debian@recore.local:/tmp/resonances_*.csv .
Then, on the computer, with Python 3 installed:
git clone https://github.com/Klipper3d/klipper python3 -m pip install numpy matplotlib python3 klipper/scripts/calibrate_shaper.py resonances_x_*.csv -o shaper_calibrate_x.png python3 klipper/scripts/calibrate_shaper.py resonances_y_*.csv -o shaper_calibrate_y.png
Install matplotlib on the printer
If you would rather draw the graphs on the printer, as described in Klipper's documentation, install matplotlib first, logged in as debian:
sudo apt update sudo apt install python3-matplotlib
This takes about 240 MB. Klipper's scripts then work as described in its documentation.
Plugins that draw these graphs themselves, such as Shake&Tune, install their own copy of matplotlib and do not need either step.
Recore booting
There are several stages to booting Recore, and depending on which media is installed, the boot process will try and boot either from eMMC, USB host or USB device (FEL).
The board can be booted by either pressing the "BOOT" button for 2 seconds or by applying power to either the 24V connector or the USB-C connector. To shut down the board, either use the "shutdown" button from the UI or press the "BOOT" button once. It's not ideal to shut off the board by removing power directly as this can cause a corrupted file system.
Booting Recore from eMMC (the normal way)
- Turn on power
- The BROM will load U-Boot SPL from eMMC
- The U-Boot SPL will load U-Boot
- U-Boot will load Linux
- Linux will load the rootfs from eMMC.
Loading U-Boot from eMMC but load kernel and rootfs from USB
U-Boot scans for a USB mass storage device, and if a working version of Reflash or Rebuild is found, it boots that image.
- Download Reflash and flash it to a USB drive.
- Insert the USB drive in the board.
- Boot the board normally (use the Boot button or apply power)
The board should now have the kernel and rootfs from the USB drive. This is also how you get back to Reflash from Rebuild: keep the USB drive inserted during boot. A reboot can be done from Mainsail, Fluidd or OctoPrint.
Boot Recore from a USB stick using the FEL button
If U-Boot should be loaded from a host computer and kernel and rootfs is loaded from a USB drive:
- Flash the Reflash Linux distro to a USB drive.
- Insert the USB drive in the Recore board in one of the two host connectors close to the HDMI.
- Hold down the FEL button while applying power to the board via the USB-C connector.
- Download the Recore repository https://github.com/intelligent-agent/Recore and install the sunxi-tools program.
- Run the fel command (
make fel) from the host computer. All the necessary binaries are in the Recore repository.
You can read more about the steps needed to boot a board in FEL mode on the Sunxi wiki: https://linux-sunxi.org/FEL
Depending on what Linux platform you are running from, sunxi-tools will require the following dependencies to compile properly (Debian/Ubuntu names; for Fedora, change -dev to -devel): libftdi-dev, libusb-1.0-0-dev, libudev-dev.
This uploads U-Boot from the host computer to the board via the USB cable. U-Boot will then boot from the connected USB drive. Please note that in some instances, the USB drive is not detected as a mass storage device without also having the VIN power connector inserted. See the known errors section of Recore A6.
Known issues
- Kossel-A7 (A7 0374) has failed in two ways in testing: it did not come up after being flashed until it was power cycled (#166), and it stopped answering during an STM32 firmware update and reset itself (#170). A memory test of that board passed. The cause is not known, and other boards have not shown it.
- Some boards do not find their USB drive during start-up of Reflash, see Reflash's known issues.
- A display connected after boot is not detected. The panel is driven from the framebuffer U-Boot set up, so the mode is whatever U-Boot read from the display's EDID at power-on. A display plugged in while the board is running will not be picked up: reboot with it connected. A different panel that is present at boot works normally, because U-Boot reads its EDID too. This is the trade for a flicker-free boot: there is no KMS and no runtime hotplug on this path.


