OctoPrint Plugin for Klipper

I made a OctoPrint plugin for the Klipper 3D printer firmware. It’s on GitHub at: github.com/mmone/OctoprintKlipperPlugin.

Features so far:
  • Simplified connection dialog.
  • Restart Host and MCU processes.
  • User defineable macro buttons.
  • Assisted bed leveling wizard with user definable probe points.
  • Dialog to set a coordinate offset for future GCODE move commands.
  • PID Tuning Dialog.
  • Message log displaying messages from Klipper prepended with “//” and “!!”.
  • Basic Klipper configuration editor.
  • Performance graph displaying key parameters extracted from the Klipper logs.


Install via OctoPrints Plugin Manager or manually using this URL:


OctoPrint will inform you when a new version of this plugin becomes available.

Some screenshots:

Video Streaming for ARM

UV4L was originally conceived as a modular collection of Video4Linux2-compliant, cross-platform, user space drivers for real or virtual video input and output devices (with absolutely no external difference from kernel drivers), and other pluggable back-ends or front-ends.

It has evolved over the years and now includes a full-featured Streaming Server component with a customisable web UI providing a set of standard, modern and unique solutions for encrypted live bidirectional data, audio and video streaming, mirroring or conferencing over the web and for the IoT . Since recent releases UV4L has also been providing a RESTful API for the developers who want to implement their custom applications.

HDMI Capturing

The Video4Linux2 uv4l-raspicam driver for Raspberry Pi  has been extended to support the TC358743 HDMI to MIPI converter chip. This chipset is often found in the B101 capture boards made by Auvidea.

HowTo Enable the RaspiCam in Octoprint

First, if you haven’t already, activate the camera in raspi-config. Login via SSH type “sudo raspi-config” select “Interfacing Options” and enable the camera.

Configuring the camera

Now edit “sudo nano /boot/octopi.txt” uncomment the camera=”auto” line and change it to camera=”raspi”. Uncomment camera_raspi_options=”-fps 10″. These settings configure the camera to provide and image in the format 640×480@10fps. If you would like to change that check the available options in the official forum: discourse.octoprint.org/t/available-mjpg-streamer-configuration-options

Enabling the camera in the octoprint browser interface

In the browser click on the little wrench in the top bar to open the settings dialog. Select “Webcam & Timelapse”. Set the “Stream URL” parameter to “http://octopi.local:8080/?action=stream”. Obviously change the hostname if you have configured it to something different.

Finally restart octoprint for the changes to take effect.

Disable Bluetooth on the Raspberry Pi Zero W

The onboard Bluetooth device of the Raspberry Pi Zero W and the Pi 3 can be disabled by adding dtoverlay=pi3-disable-bt to the config.txt file. Wifi is disabled with dtoverlay=pi3-disable-wifi.

The config.txt file is read by the GPU before the ARM CPU and Linux are initialised. It must be located on the first (boot) partition of your SD card alongside bootcode.bin and start.elf. This file is normally accessible as /boot/config.txt from Linux, and must be edited as root. From Windows or OS X it is visible as a file in the only accessible part of the card. If you need to apply some of the config settings below, but you don’t have a config.txt on your boot partition yet, simply create it as a new text file.

Any changes will only take effect after you have rebooted your Raspberry.

More boot config options for the Raspberry devices are documented here: https://www.raspberrypi.org/documentation/configuration/config-txt/


HowTo build the Marlin 3D Printer Firmware on the Raspberry Pi

If you are already running the excellent octoprint as a printserver on a Raspberry Pi it is very convenient to also build Marlin on it. The new Raspberry Pi Zero W with onboard wifi is at only 10$ just perfect for both tasks. If you want to use the camera streaming of octoprint I would recommend a Pi3 though.

I made a script that sets up the necessary build environment and provides commands for building and uploading. It uses the official Arduino toolchain. Everything is standalone, nothing is installed outside the marlintool directory.


here on github: https://github.com/mmone/marlintool

or download directly as a zip: https://github.com/mmone/marlintool/archive/master.zip

Build configuration

Before first use: Rename the marlintool.params.example file to “marlintool.params”

In its default configuration the script is setup to build the official “Marlin” firmware  but can be easily reconfigured to build any Marlin variant.

Several additional parameters in the “marlintool.params” file allow to adapt the script to your needs.

parameter description
marlinRepositoryUrl The marlin git repository.
marlinRepositoryBranch The branch of the configured repo to use.
marlinDependencies A list of dependencies to download in the format:
[name],[repo url],[library directory](optional).
A library directory should only be specified if the library is not in the root of the repository.
hardwareDefinitionRepo If you build for the Anet board this downloads the necessary hardware definition for the Arduino build environment. If you dont need this set it to an empty string.
boardString The Anet board identifier.
arduinoToolchainVersion The Arduino toolchain version to use. The build platform and architecture are auto detected. At the moment Linux 32 Bit, 64 Bit, ARM and OS X are supported.
port The serialport to use for uploading.
arduinoDir Where to put the Arduino toolchain.
marlinDir Where to checkout Marlin sources.
buildDir The build directory.

Reminder: If you are running octopi on you Raspberry you need to disconnect it from your printer before uploading, otherwise the serial port is blocked.

Note: On OS X due to how the Arduino toolchain is packaged the Arduino splash screen will be displayed even when the toolchain is used from the commandline. This will cause the terminal window you launch marlintool from to lose focus. It also means that a build cannot be launched from a remote ssh session.

Building for Anet Hardware

If you are building the firmware for the Anet A6/A8 you can find suitable example configurations in the Marlin sources at: github.com/MarlinFirmware/Marlin/tree/1.1.x/Marlin/example_configurations/Anet. Just replace the “Configuration.h” and “Configuration_adv.h” in the marlin directory with the files your find there for a good starting point of your configuration.


Commandline parameters

-s  — setup

Download and configure the toolchain and the necessary libraries for building Marlin. Also fetches the Anet board hardware definition from github if specified.

-m  — marlin

Download Marlin sources.

-f –fetch

Update an existing Marlin clone.

-v  — verify

Build without uploading.

-u  — upload

Build and upload Marlin. If you are running octopi on you Raspberry you need to disconnect it before uploading otherwise the serial port is blocked.

-b  –backupConfig  [name]

Backup the Marlin configuration to the named backup.

-r  –restoreConfig [name]

Restore the given configuration into the Marlin directory.

-c  — clean

Cleanup everything. Remove Marlin sources and Arduino toolchain.

-p  — port [port]

Set the serialport for uploading the firmware. Overrides the default set in the script.

-h  — help

Show help.

Building a Raspian Image with Xenomai

The LinuxCNC wiki has detailed instructions on how to build a Raspian image with the Xenomai development framework / realtime kernel extension. They also link to a ready made image if you don’t want to build it yourself.

If you build yourself and copy and paste the comands into your shell be aware that under item “5. Create SD card image / Populate BOOT” there seems to be a random character in the command: “sudo cp linux-rpi-3.2.27/build/arch/arm/boot/Image mnt/boot/kernel.img” behind the “…/boot/Image” part, remove it otherwise it will not execute.

Raspberry Pi Oscilloscope and Logic Analyzer

The BitScope BS05U is a simple Oscilloscope, Logic Analyzer and Signal Generator for the Raspberry Pi. As it connects via USB and there is software for Windows, Mac OS X and Linux available it can be used on this systems as well.


  • 20 MHz Bandwidth.
  • 40 MSps Logic Capture.
  • 2 Analog Scope Channels.
  • 2 Analog Comparator channels.
  • 6 Logic/Protocol Analyzer channels.
  • 8 & 12 native analog sample resolution.
  • Decodes Serial, SPI, I2C, CAN and more.
  • Windows, Linux, Mac OS X & Raspberry Pi.
  • Built-in analog waveform & clock generators.
  • User programmable, C/C++, Python, VM API.
  • Tiny, light weight (12g) and water resistant.


Raspberry Pi based Autopilot Sensor Platform

The guys at emlid have developed Navio a navigation/flight controller sensor shield for the Raspberry Pi targeting robotic models like cars, boats, submarines, multirotors and planes.

With a lot of projects in the field of flight/navigation controller hardware moving away from 8-Bit to 32 Bit MCU for better performance, it seems that it was about time that someone developed something like that for the Pi. While you would think that it’s generally a bad idea to have a control loop running in a non-realtime environment, realtime kernel extensions like for example Xenomai make things like this possible and manageable. All while running in a linux environment with all the features of an OS and the command line magic of the tools you love available at your fingertips.

In case of the Pi you have the added benefit of comparatively large processing power that makes things like streaming video of a camera or even running image recognition on top of it possible, especially if you incorporate the GPU.

Apart from that the possibility to for example add Wi-fi or 3G connectivity by simply plugging in a device into the USB port seems also a plus.

This are the features the shield adds to your Pi:

  • 13 PWM outputs to control servos
  • 9DOF inertial measurement unit
  • Pressure and temperature sensor
  • GPS with carrier phase measurement
  • External GPS antenna
  • 4-channel 16bit ADC
  • 1 trillion read/write cycles FRAM. An interesting feature as in my experience the SD card read/write access, if necessary, is often a problem if you want to achieve realtime performance.
  • Bright RGB LED
  • I2C, SPI, UART ports.

On the software side of things emlid is planing to port ArduCopter to the Pi.