Difference between revisions of "Rebuild"

From iagent
Jump to: navigation, search
 
(53 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[File:Rebuild header.png|center]]
 
[[File:Rebuild header.png|center]]
Rebuild is a simplified build system for making images for Recore. It is based on Armbian's Build system, and adapted to the creating finished images for printing with Mainsail, Fluidd or OctoPrint as user interfaces.  
+
Rebuild is a complete Linux image for [[Recore A8|Recore]] 3D printer controller boards. Rebuild comes with Klipper installed and the choice of either [https://docs.mainsail.xyz/ MainSail], [https://docs.fluidd.xyz/ Fluidd] or [https://octoprint.org/ OctoPrint]. The name Rebuild is a reflection of the [https://www.armbian.com/ Armbian] build system, but adapted for Recore boards.  
  
 +
Rebuild has now been released as v1.0.0
  
Rebuild is a complete Linux image for Recore 3D printer controller boards. It comes with Klipper installed and the choice of either MainSail, Fluidd or OctoPrint.  
+
=Installing Rebuild on Recore=
 +
Recore has eMMC (embedded MMC), so in order to install sotware on the board, a USB drive must be used. For instructions on making a flasher image, have a look at [[Reflash]]
 +
<div class="alert alert-warning">
 +
===='''Note'''====
 +
In order to install Rebuild v1.0.0, you need to use Reflash v1.0.0. There is a blog post explaining this new way to install an image on Recore: https://www.iagent.no/2024/05/08/reflash-a-new-way-to-upgrade-firmware/
 +
</div>
 +
 
 +
==Latest images==
 +
The latest images for Recore are available from github. You can choose to download an image directly from within Reflash, or you can choose to download first and then upload it. Here are the latest images: https://github.com/intelligent-agent/Rebuild/releases
 +
 
 +
=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/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 wifi dongle.
 +
If a network cable is used, the board should respond to the address:
 +
http://recore.local
 +
 
 +
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 Refactor/Rebuild. The configuration file is set up
 +
to work out of the box without anything connected on the pins of the board. The default Klipper config can be used as a starting point for building a custom config file for the printer at hand.  
  
Rebuild is still in testing There is a release candidate available: v1.0.0-RC1
+
After the Klipper configuration is complete, do a test print to make sure everything is working.
  
=Installing an image=
+
<div class="alert alert-success">
For instructions on making a flasher image, have a look at [[Reflash]]
+
===='''Important'''====
<div class="alert alert-warning">
+
If you get in a situation where Klipper is unable to start normally, replace the content of the "printer.cfg" file with the default config file that came with Rebuild. The default config file should be available in the "config examples" folder in Fluidd and Mainsail. You might need to do a full reboot of the board after going back to that default config. This is a good way to get back to a known working image.  
===='''Note'''====
+
<div class="res-img">
In order to install Rebuild v1.0.0-RC1, you need to use Reflash v1.0.0-RC0 or newer.
+
[[File:Config-examples.png]]
 +
</div>
 
</div>
 
</div>
  
=Latest images=
+
== Recore booting ==
The latest images for Recore are available from github: https://github.com/intelligent-agent/Rebuild/releases, but you can also choose to install an image directly from Reflash.  
+
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===
 +
Starting with Rebuild v1.0.0, u-boot will do a scan for a USB mass storage device and if a working version of Reflash or Rebuild or Refactor is found, it will boot to that image.
 +
# Download Refactor/Rebuild/Reflash and flash it to a USB drive.
 +
# Insert the USB drive in the board.
 +
# Boot the board normally (Use the Boot button/apply power)
 +
The board should now be have the kernel/rootfs from the USB drive.
 +
</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]] 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
 +
# Install the sunxi-tools program
 +
# Run the fel command ('''make fel''') from the host computer. All the necessary binarys are in the Recore repository:
 +
You can read more about the steps needed to boot aboard in FEL mode on the Sunxi wiki: https://linux-sunxi.org/FEL
  
 +
'''Note:''' Depending on what linux platform you're running from, sunxi-tools will require the following dependencies to compile properly:
 +
* libftd-dev
 +
* libusbx-dev
 +
* libudev-dev
 +
(These are Debian/ubuntu names. For Fedora, change -dev to -devel)
 +
 +
This should upload 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 more in [[Recore_A6#USB_connectors_not_discovered_when_powered_by_USB_device|in the "known errors" section of Recore A6]]
 +
</tab>
 +
</tabs>
 +
 +
==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, the SSH access is disabled, but it can be enabled in two ways.
 +
# You can choose "enable SSH on new image" in the Reflash user interface
 +
# You can start the SSH service from Mainsail/Fluidd
 +
SSH access is only enabled for user '''debian''' using the password '''temppwd'''.
 +
The first time you log in, you will be prompted to change the password. After the password has been changed, you will need to log in again.
 +
 +
==Serial port acccess==
 +
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.
 +
 +
===Upgrading Debian via apt upgrade===
 +
The /boot partition of Rebuild is mounted "read only", so it will have to be remounted as Read Write before running an upgrade. This is handled automatically by apt in this version:
 +
<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 Recore A7 write the following on the command line. First SSH into the board.
 +
<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]]
 +
 +
==Using KlipperScreen==
 
KlipperScreen is running on X, so a new config should allow rotating the screen.  
 
KlipperScreen is running on X, so a new config should allow rotating the screen.  
 
<pre>
 
<pre>
Line 33: Line 140:
 
sudo systemctl restart KlipperScreen
 
sudo systemctl restart KlipperScreen
 
</pre>
 
</pre>
 +
 +
If it is necessary to rotate the touch panel as well, here is a useful section that can be added to the bottom of that same file. Uncomment the rotation that matches your setup.
 +
<pre>
 +
Section "InputClass"
 +
            Identifier "Coordinate Transformation Matrix"
 +
            MatchIsTouchscreen "on"
 +
            MatchDevicePath "/dev/input/event*"
 +
            MatchDriver "libinput"
 +
            Option "CalibrationMatrix" "1 0 0 0 1 0 0 0 1"    # 0 degrees
 +
            #Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"  # 90 degrees
 +
            #Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1" # 180 degrees
 +
            #Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"  # 270 degrees
 +
 +
EndSection
 +
</pre>
 +
 +
==Recompiling and installing binaries==
 +
===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 (8KB offset) 
 +
Flash the binary
 +
<pre>
 +
dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8 conv=notrunc
 +
</pre>
 +
 +
Note: U-boot needs to be patched in order to use the eMMC as the first (and only) boot device.
 +
The changes can be done in "spl_mmc_get_device_index" where dev_num should be 0 instead of 1.
 +
 +
===AR100 firmware===
 +
The AR100 CPU needs a binary file that is loaded on startup by the systemd file klipper.service
 +
The AR100 binary file comes pre-compiled in Refactor, so most users should not have to re-compile it.
 +
For experiments the AR100 binary can be recompiled on Recore (architecture aarch64) or on a host computer (amd64 or similar). 
 +
 +
====Compiling the ar100 binary====
 +
To configure klipper for AR100 and build the binary:
 +
<pre>
 +
cd /home/debian/klipper/
 +
cp test/configs/ar100.config .config
 +
make olddefconfig
 +
make
 +
</pre>
 +
 +
This will produce a bin file located in out/ar100.bin, so it should be moved to /opt/firmware
 +
<pre>
 +
mv out/ar100.bin /opt/firmware/
 +
</pre>
 +
Once the AR100 binary has been updated, klipper.service can be restarted which then loads the new AR100 binary.
 +
<pre>
 +
systemctl restart klipper
 +
</pre>
 +
 +
====Cross compilation toolchain for ARM64====
 +
The AR100 needs a cross compilation toolchain. For ARM64, it can be downloaded from feeds.iagent.no:
 +
 +
http://feeds.iagent.no/toolchains/ 
 +
 +
The toolchain has been built with 
 +
 +
https://github.com/richfelker/musl-cross-make
 +
 +
GCC version: 11.2.0
 +
 +
====Cross compilation toolchain for x86_64====
 +
The toolchain used during automatic testing and is the same used for the CRUST firmware project:
 +
 +
https://github.com/crust-firmware/crust#building-the-firmware
 +
 +
 +
===STM32 firmware===
 +
 +
The firmware for the stm32f031 mcu that is responsible for ADC
 +
conversions and PWM for heaters and fans comes pre-installed in the flash of the MCU.
 +
It can be recreated on the board using the Klipper build system.
 +
<pre>
 +
cd /home/debian/klipper
 +
cp test/configs/stm32f031.config .config
 +
make menuconfig
 +
-> Enable extra low-level configuration options
 +
-> Processor model (STM32F031)
 +
-> Bootloader offset (No bootloader)
 +
-> Clock Reference (Internal clock)
 +
-> (16) Internal clock trim override
 +
-> Communication interface (Serial (on USART2 PA15/PA14))
 +
-> Baud rate for serial port: 250000
 +
make
 +
</pre>
 +
 +
====Flashing STM32 firmware====
 +
To flash the STM32 firmware:
 +
<pre>
 +
cp out/klipper.bin /opt/firmware/stm32.bin
 +
sudo flash-stm32
 +
</pre>
 +
 +
===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>
 +
systemctl restart klipper
 +
</pre>
 +
 +
The log for Klipper is located in /tmp. It can be viewed as:
 +
<pre>
 +
tail -f /tmk/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 Toggle===
 +
Toggle is started automatically by the systemd service toggle.service. A user is created for Toggle on first boot, but the credentials are not set until a user is created in OctoPrint. Once the wizard has been completed, the Toggle user is active, but the credentials will not be valid until OctoPrint is restarted. Therefore, if Toggle is needed, restart OctoPrint after the wizard is complete.
 +
 +
Toggle is running on Weston, so a new config should allow rotating the screen.
 +
<pre>
 +
sudo nano /etc/xdg/weston/weston.ini
 +
</pre>
 +
Edit the section about rotation:
 +
<pre>
 +
[output]
 +
name=HDMI-A-1
 +
transform=rotate-90
 +
</pre>
 +
After that, Weston can be restarted.
 +
<pre>
 +
sudo systemctl restart weston
 +
</pre>
 +
 +
See the Ubuntu documentation for valid rotations: [https://manpages.ubuntu.com/manpages/jammy/man5/weston.ini.5.html weston.ini]
 +
 +
===Running OctoPrint===
 +
OctoPrint is stated on boot. If there is a need to restart the daemon, use this command
 +
<pre>
 +
systemctl restart octoprint
 +
</pre>
 +
 +
 +
== Known issues==
 +
=== Error message: Unable to retrieve Moonraker service info ===
 +
<div class="res-img">
 +
[[File:Error msg Unable to retrieve Moonraker service info.png]]
 +
</div>
 +
Error message is observed on first boot after flashing rebuild-fluidd-v1.0.0.img.xz on a Recore A7.
 +
 +
Issue seems to be related to that moonraker starts before the ssh service is registered by systemd (Linux service manager).
 +
[https://github.com/intelligent-agent/Rebuild/issues/27 Github Issue 27]
 +
<pre>
 +
Unable to retrieve Moonraker service info. Service file must be updated manually.
 +
</pre>
 +
Workaround 1: Reboot the recore.
 +
Workaround 2: Restart moonraker.

Latest revision as of 22:35, 14 May 2024

Rebuild header.png

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. The name Rebuild is a reflection of the Armbian build system, but adapted for Recore boards.

Rebuild has now been released as v1.0.0

Installing Rebuild on Recore

Recore has eMMC (embedded MMC), so in order to install sotware on the board, a USB drive must be used. For instructions on making a flasher image, have a look at Reflash

Note

In order to install Rebuild v1.0.0, you need to use Reflash v1.0.0. There is a blog post explaining this new way to install an image on Recore: https://www.iagent.no/2024/05/08/reflash-a-new-way-to-upgrade-firmware/

Latest images

The latest images for Recore are available from github. You can choose to download an image directly from within Reflash, or you can choose to download first and then upload it. Here are the latest images: https://github.com/intelligent-agent/Rebuild/releases

Getting started

USB-C.png
Ethernet.png
Blink.png
Http.png

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/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 wifi dongle. If a network cable is used, the board should respond to the address: http://recore.local

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 Refactor/Rebuild. The configuration file is set up to work out of the box without anything connected on the pins of the board. The default Klipper config can be used as a starting point for building a custom config file 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 the "printer.cfg" file with the default config file that came with Rebuild. The default config file should be available in the "config examples" folder in Fluidd and Mainsail. You might need to do a full reboot of the board after going back to that default config. This is a good way to get back to a known working image.

Config-examples.png

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)

  1. Turn on power
  2. The BROM will load u-boot SPL from eMMC
  3. The u-boot SPL will load u-boot
  4. u-boot will load Linux
  5. Linux will load the rootfs from eMMC.

Loading u-boot from eMMC but load kernel and rootfs from USB

Starting with Rebuild v1.0.0, u-boot will do a scan for a USB mass storage device and if a working version of Reflash or Rebuild or Refactor is found, it will boot to that image.

  1. Download Refactor/Rebuild/Reflash and flash it to a USB drive.
  2. Insert the USB drive in the board.
  3. Boot the board normally (Use the Boot button/apply power)

The board should now be have the kernel/rootfs from the USB drive.

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:

  1. Flash the Reflash Linux distro to a USB drive.
  2. Insert the USB drive in the Recore board in one of the two host connectors close to the HDMI.
  3. Hold down the FEL button while applying power to the board via the USB-C connector.
  4. Download the Recore repository https://github.com/intelligent-agent/Recore
  5. Install the sunxi-tools program
  6. Run the fel command (make fel) from the host computer. All the necessary binarys are in the Recore repository:

You can read more about the steps needed to boot aboard in FEL mode on the Sunxi wiki: https://linux-sunxi.org/FEL

Note: Depending on what linux platform you're running from, sunxi-tools will require the following dependencies to compile properly:

  • libftd-dev
  • libusbx-dev
  • libudev-dev

(These are Debian/ubuntu names. For Fedora, change -dev to -devel)

This should upload 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 more in in the "known errors" section of Recore A6

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, the SSH access is disabled, but it can be enabled in two ways.

  1. You can choose "enable SSH on new image" in the Reflash user interface
  2. You can start the SSH service from Mainsail/Fluidd

SSH access is only enabled for user debian using the password temppwd. The first time you log in, you will be prompted to change the password. After the password has been changed, you will need to log in again.

Serial port acccess

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.

Upgrading Debian via apt upgrade

The /boot partition of Rebuild is mounted "read only", so it will have to be remounted as Read Write before running an upgrade. This is handled automatically by apt in this version:

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 Recore A7 write the following on the command line. First SSH into the board.

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

Mainsail.png

Using KlipperScreen

KlipperScreen is running on X, so a new config should allow rotating the screen.

sudo nano /usr/share/X11/xorg.conf.d/90-monitor.conf

Add the following:

Section "Monitor"
    Identifier "HDMI-1"
    Option "Rotate" "left"
EndSection

After that, KlipperScreen can be restarted.

sudo systemctl restart KlipperScreen

If it is necessary to rotate the touch panel as well, here is a useful section that can be added to the bottom of that same file. Uncomment the rotation that matches your setup.

Section "InputClass"
            Identifier "Coordinate Transformation Matrix"
            MatchIsTouchscreen "on"
            MatchDevicePath "/dev/input/event*"
            MatchDriver "libinput"
            Option "CalibrationMatrix" "1 0 0 0 1 0 0 0 1"    # 0 degrees
            #Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"  # 90 degrees
            #Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1" # 180 degrees
            #Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"  # 270 degrees

EndSection

Recompiling and installing binaries

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 (8KB offset) Flash the binary

dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8 conv=notrunc

Note: U-boot needs to be patched in order to use the eMMC as the first (and only) boot device. The changes can be done in "spl_mmc_get_device_index" where dev_num should be 0 instead of 1.

AR100 firmware

The AR100 CPU needs a binary file that is loaded on startup by the systemd file klipper.service The AR100 binary file comes pre-compiled in Refactor, so most users should not have to re-compile it. For experiments the AR100 binary can be recompiled on Recore (architecture aarch64) or on a host computer (amd64 or similar).

Compiling the ar100 binary

To configure klipper for AR100 and build the binary:

cd /home/debian/klipper/
cp test/configs/ar100.config .config
make olddefconfig
make

This will produce a bin file located in out/ar100.bin, so it should be moved to /opt/firmware

mv out/ar100.bin /opt/firmware/

Once the AR100 binary has been updated, klipper.service can be restarted which then loads the new AR100 binary.

systemctl restart klipper

Cross compilation toolchain for ARM64

The AR100 needs a cross compilation toolchain. For ARM64, it can be downloaded from feeds.iagent.no:

http://feeds.iagent.no/toolchains/

The toolchain has been built with

https://github.com/richfelker/musl-cross-make

GCC version: 11.2.0

Cross compilation toolchain for x86_64

The toolchain used during automatic testing and is the same used for the CRUST firmware project:

https://github.com/crust-firmware/crust#building-the-firmware


STM32 firmware

The firmware for the stm32f031 mcu that is responsible for ADC conversions and PWM for heaters and fans comes pre-installed in the flash of the MCU. It can be recreated on the board using the Klipper build system.

cd /home/debian/klipper
cp test/configs/stm32f031.config .config
make menuconfig
-> Enable extra low-level configuration options
-> Processor model (STM32F031)
-> Bootloader offset (No bootloader)
-> Clock Reference (Internal clock)
-> (16) Internal clock trim override
-> Communication interface (Serial (on USART2 PA15/PA14))
-> Baud rate for serial port: 250000
make

Flashing STM32 firmware

To flash the STM32 firmware:

cp out/klipper.bin /opt/firmware/stm32.bin
sudo flash-stm32

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.

systemctl restart klipper

The log for Klipper is located in /tmp. It can be viewed as:

tail -f /tmk/klippy.log

Klipper can also be restarted from the OctoPrint interface. On the "Klipper" tab, press "Firmware" to restart the Klipper firmware.

Klipper-firmware-press.png

Running Toggle

Toggle is started automatically by the systemd service toggle.service. A user is created for Toggle on first boot, but the credentials are not set until a user is created in OctoPrint. Once the wizard has been completed, the Toggle user is active, but the credentials will not be valid until OctoPrint is restarted. Therefore, if Toggle is needed, restart OctoPrint after the wizard is complete.

Toggle is running on Weston, so a new config should allow rotating the screen.

sudo nano /etc/xdg/weston/weston.ini

Edit the section about rotation:

[output]
name=HDMI-A-1
transform=rotate-90

After that, Weston can be restarted.

sudo systemctl restart weston

See the Ubuntu documentation for valid rotations: weston.ini

Running OctoPrint

OctoPrint is stated on boot. If there is a need to restart the daemon, use this command

systemctl restart octoprint


Known issues

Error message: Unable to retrieve Moonraker service info

Error msg Unable to retrieve Moonraker service info.png

Error message is observed on first boot after flashing rebuild-fluidd-v1.0.0.img.xz on a Recore A7.

Issue seems to be related to that moonraker starts before the ssh service is registered by systemd (Linux service manager). Github Issue 27

Unable to retrieve Moonraker service info. Service file must be updated manually.

Workaround 1: Reboot the recore. Workaround 2: Restart moonraker.