Coder Social home page Coder Social logo

klipper-on-orange-pi-zero-2's Introduction

Install Klipper on Orange Pi Zero 2

Due to the lack of Raspberry Pi at a reasonable price, I'm looking for some alternative SBC to run klipper on it. Orange Pi Zero 2 is a good choice. It has a quad-core CPU, 1GB of RAM, and built-in dual-band WIFI support.

Here is how I get klipper running on the Orange Pi Zero 2. I mostly only cover the parts specific to Orange Pi Zero 2 here. There are plenty of tutorials for installing klipper out there, e.g. videos by NERO 3d or Teaching Tech.

Please refer to the user manual on orangepi.org for more detail about setting up the Orange Pi Zero 2.

Also note that some part of this instruction have not been thoroughly tested and your mileage may vary.

Prepare the Operating System

The recommended OS is Debein from orangepi.org. I've tried several versions of armbian but couldn't get WIFI to work.

I'm running the newest version of Debian server Orangepizero2_3.0.6_debian_bullseye_server_linux5.16.17 as of the time of writing.

Flash the SD card

The process is basically the same as flashing Raspberry Pi OS. I recommend using the tool belenaEtcher. It's available on Windows, macOS, and Linux.

The installation is quite straight forward. Download the OS image and extract the .img file from the .7z file. Get the micro SD card plugged in to your computer. Finally, launch balenaEtcher, choose the correct image file and storage, press Flash!, and it will take care of all the rest.

etcher

First Boot and Setup

To do the setup, you have to access the Orange Pi either through SSH, or have a monitor and keyboard attached.

  1. SSH through ethernet

    The Orange Pi has to be connected to the router through the ethernet port.

    Look up the IP address assigned to the Orange Pi in the setting webpage of your router. If you don't have access to the router's setting, you can use some port scanning tool like Angry IP Scanner and scan for port 22 on the local network.

    Use your preferred SSH client to connect to the Pi: ssh root@[IP address of your Pi]. (If it asks for something about fingerprint, type yes and press Enter.)

  2. SSH through debug serial port

    Use a 3.3V USB to TTL module to connect to the debug serial pins on the board.

    debug_serial

    Find the serial port of the USB to TTL module on your PC (it depends on the OS you are using) and connect SSH through that port with baudrate 115200.

Login and Setup the User

  1. Login to user root with the default password orangepi.

  2. Change the default password for better security by running passwd.

  3. Update the system packages with apt update --allow-releaseinfo-change && apt dist-upgrade.

  4. To prevent possible issues with scripts written for Raspberry Pi, create a new user pi by running adduser pi and set the password for it.

    adduser

    Tip: By default Debian will not let you use a simple password. You can disable the password check by editing /etc/pam.d/common-password and remove the option obscure. You are responsible for the risk by doing so.

    password

  5. Give pi the permission to run commands as root by adding it to the group sudo with adduser pi sudo.

  6. (Optional) Remove the default user orangepi with userdel -r orangepi.

  7. Switch to the user pi by running su -l pi or reboot and login as pi.

Connect to WIFI

Run the command nmtui-connect and a list of available WIFI should appear. Select your SSID and enter your WIFI password.

wifi

If there is no WIFI showing up, it might be the WIFI driver is not working. Try another version of OS and do some searching.

Install the Required Software

We need to have klipper, Moonraker, and one of the clients (Mainsail, Fluidd, or Octoprint) installed to make it functional.

There are two ways to do the installation:

  1. Use KIAUH (Recommended).

    Follow the instructions to run the script, and use the Install menu to install klipper, Moonraker, and one frontend.

  2. Manual install.

    There is a good guide on Mainsail's document.

Setup klipper

If the software installation goes well, the web interface should show up in your browser at http://<IP address of your Pi> .

Now you can follow the klipper documentation to finish the configuration process for your printer.

Connect to MCU through UART Pins

You can use the UART pins on the 26-pin header to communicate with the MCU.

uart

  1. Enable the UART5 interface.

    Add the following line to the end of the file /boot/orangepiEnv.txt:

    overlays=uart5
  2. Edit the printer.cfg and use serial: /dev/ttyS5 in the [mcu] section.

Use Orange Pi as a MCU

  1. Follow the instructions on klipper's document to flash the klipper_mcu.

  2. Enabling SPI (Optional): Add the following lines to the end of the file /boot/orangepiEnv.txt:

    overlays=spi-spidev
    param_spidev_spi_bus=1
    param_spidev_spi_cs=1
  3. Enabling I2C (Optional): Add the following line to the end of the file /boot/orangepiEnv.txt:

    overlays=i2c3

Acknowledgement and Related Links

klipper-on-orange-pi-zero-2's People

Contributors

imgbotapp avatar nhchiu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

klipper-on-orange-pi-zero-2's Issues

Orange Pi Zero 2 I2C pins

Hi,

Just wanted to add that using the overlays setting in orangepiDev.txt to enable I2C was unnecessary as the SCK and SDA pins already appear in /dev:

$ ll /dev/i2c-*
crw-rw---- 1 root i2c 89, 0 Apr 28 23:53 /dev/i2c-0
crw-rw---- 1 root i2c 89, 1 Apr 28 23:53 /dev/i2c-1

Adding the overlays parameter meant sudo i2cdetect -y 0 could not find the expected -0 and -1 pins.

There is one I2C error I can't resolve (yet) though:

$ dmesg | grep i2c
[    1.263757] i2c_dev: i2c /dev entries driver
[    2.712772] mv64xxx_i2c 7081400.i2c: can't get pinctrl, bus recovery not supported
[    2.713881] axp20x-i2c 0-0036: AXP20x variant AXP806 found
[    2.796056] axp20x-i2c 0-0036: AXP20X driver loaded

Thanks for the notes.

Orange Pi Z2 GPIO

Hey I see you are one of the few that seem to be using OPi Z2 to run octoprint. Have you had any luck finding and running any GPio plugins? I want to read a BME680 and control a fan based on it's readings but all the RPi.GPIO plugins I have found fail to install in Octoprint probably because of the different pin configs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.