• Stars
    star
    129
  • Rank 269,311 (Top 6 %)
  • Language
    Python
  • Created almost 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PrusaLink

PrusaLink is a compatibility layer between 8-bit Prusa 3D printers (MK2.5, MK2.5S, MK3, MK3S and MK3S+) and PrusaConnect, which lets you control and monitor your 3D printer from anywhere. Get more info at connect.prusa3d.com

PrusaLink also provides a local web interface: Prusa-Link-Web

Setup

To use PrusaLink please follow our Setup Guide

Login

If you wish to log into the console environment and haven't changed the credentials, you'll need these default ones:

username: jo
password: raspberry

Dev Setup

If using the Raspberry Pi pins, follow the guide above for the hardware preparation. Pins can be used even on regular (non-Zero) Pis through Dupont jumper cables. Just make sure those make proper contact with the Einsy board. A connection over USB is also possible, making PrusaLink compatible with pretty much any Linux system, but since the RPi has been used as a reference, please excuse the Debian specific instructions.

If using the Pi, create your micro SD card the usual way, a Lite image will do nicely. Just in case, here's a guide: https://www.youtube.com/watch?v=ntaXWS8Lk34

UART over GPIO pins

On some RPis, the main UART is handling Bluetooth, so the printer communication would get handled by a miniUART, which doesn't work for us. To disable Bluetooth, add these lines into config.txt which is located in the Pi's boot partition.

[all]
enable_uart=1
dtoverlay=disable-bt

Installation

PrusaLink needs libpcap headers installed to name its OS threads. Git and Pip are needed for installation, while pigpio is only needed if the RPi GPIO pins are to be used.

sudo apt install git python3-pip pigpio libcap-dev libmagic1 libturbojpeg0 libatlas-base-dev python3-numpy libffi-dev

# If you are using different distro (e.g. Ubuntu), use libturbojpeg library
# instead of libturbojpeg0

# for the Raspberry Pi camera module support
# pre-installed on the newer Raspberry Pi OS images post September 2022
sudo apt install -y python3-picamera2 --no-install-recommends

pip install PrusaLink

# Or install straight from GitHub
pip install git+https://github.com/prusa3d/gcode-metadata.git
pip install git+https://github.com/prusa3d/Prusa-Connect-SDK-Printer.git
pip install git+https://github.com/prusa3d/Prusa-Link.git

Config

PrusaLink behavior can be altered using command arguments and configuration files. The default configuration path is /etc/prusalink/prusalink.ini and does not get created automatically. The configuration documentation can be found under prusa/link/data/prusalink.ini. The executable argument documentation is provided in the standard help text screen shown after running prusalink --help

The prusa_printer_settings.ini file is created by the PrusaLink wizard, and can be downloaded from the PrusaConnect settings page once you register your printer.

Configuring PrusaLink on the SD card

If you need to manually configure PrusaLink on the SD created from our image, it now comes with an auto-copy script. Put your prusalink.ini or prusa_printer_settings.ini files into the boot portion of the SD, That's the only one that shows up under Windows or Mac, and they will get copied over to their default locations on the next boot.

Permission denied

Make sure the user you're running PrusaLink under is a member of the group dialout. To add it, run

sudo usermod -a -G dialout <username>

then log out and in with that user.

Access on port 80

PrusaLink has a local web interface, to make it accessible on the default port 80, either start it as root and configure the user to which it should de-elevate itself after the web server is up, or start it as a normal user on port 8080 - or any other, then redirect the port 80 to the port PrusaLink is listening on using these commands.

Running behind a reverse-proxy

If you got a proxy that changes the URI path, add the X-Forwarded-Prefix header. PrusaLink will use it to construct the correct URLs for the web interface.

# use -i to specify the interface affected
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

PrusaLink advertises itself on the local network. This makes it visible in PrusaSlicer under Physical Printers -> Browse. To advertise port 80, the instance has to be able to ping itself. This can be done by setting up a similar redirect on the loopback interface

iptables -t nat -I OUTPUT -p tcp -o <loopback device name> -d localhost --dport 80 -j REDIRECT --to-ports 8080

Multi-instance

If you want to connect multiple printers to a single pi, have a look at MULTIINSTANCE.md

Usage

By default, the executable starts the daemon process and exits. The executable is called prusalink and can be used to control the daemon, if you want to run it in your terminal instead, use the -f option To get the most recent help screen use prusalink --help, here's what it says in 0.7.0

usage: prusalink [-h] [-f] [-c <file>] [-p <FILE>] [-a <ADDRESS>] [-t <PORT>]
                 [-I] [-s <PORT>] [-i] [-d] [-l MODULE_LOG_LEVEL] [--profile]
                 [command]

PrusaLink daemon.

positional arguments:
  command               daemon action (start|stop|restart|status) (default:
                        start)

options:
  -h, --help            show this help message and exit
  -f, --foreground      run as script on foreground
  -c <file>, --config <file>
                        path to config file (default:
                        /etc/prusalink/prusalink.ini)
  -p <FILE>, --pidfile <FILE>
                        path to pid file
  -a <ADDRESS>, --address <ADDRESS>
                        IP listening address (host or IP)
  -t <PORT>, --tcp-port <PORT>
                        TCP/IP listening port
  -I, --link-info       /link-info debug page
  -s <PORT>, --serial-port <PORT>
                        Serial (printer's) port or 'auto'
  -i, --info            more verbose logging level INFO is set
  -d, --debug           DEBUG logging level is set
  -l MODULE_LOG_LEVEL, --module-log-level MODULE_LOG_LEVEL
                        sets the log level of any submodule(s). use
                        <module_path>=<log_level>
  --profile             Use cProfile for profiling application.

More Repositories

1

PrusaSlicer

G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
C++
7,280
star
2

Prusa-Firmware

Firmware for Original Prusa i3 3D printer by PrusaResearch
C++
1,966
star
3

Original-Prusa-i3

Original Prusa i3 MK2 3D printer printed parts
OpenSCAD
1,553
star
4

Prusa-Firmware-Buddy

Firmware for the Original Prusa MINI, Original Prusa MK4 and the Original Prusa XL 3D printers by Prusa Research.
C
993
star
5

Original-Prusa-MINI

Original Prusa MINI 3D printer hardware
382
star
6

PrusaSlicer-settings

Prusa3D specific settings for the Slic3r Prusa Edition
347
star
7

PrusaControl

PrusaControl is an alternative user interface for Slic3r Prusa Edition
Python
127
star
8

Prusa-Link-Web

Prusa Web interface resources
JavaScript
109
star
9

MM-control-01

MMU 3-axis stepper control
C++
91
star
10

Heatbed_MK52_magnetic

44
star
11

Original-Prusa-SL1

Original Prusa SL1 printer parts
43
star
12

libbgcode

Prusa Block & Binary G-code reader / writer / converter
G-code
40
star
13

MM-control-2.0

Multi Material 2.0 PCB board
HTML
35
star
14

Buddy-board-MINI-PCB

HTML
35
star
15

Prusa-Firmware-SL1

Original Prusa SL1 3D printer firmware
BitBake
33
star
16

PRUSA_Laser_filament_sensor

31
star
17

Prusa3D-Sample-Objects

30
star
18

MK3_Power_Panic

30
star
19

Prusa3D-Test-Objects

Testing and calibration objects/gcodes.
29
star
20

Prusa-Connect-SDK-Printer

Python printer library for Prusa Connect
Python
22
star
21

Prusa-Firmware-MMU

C
20
star
22

Prusa-Firmware-ESP32-Cam

Firmware for ESP32 Cam modules to be used in Prusa Connect
C++
20
star
23

Heatbed-Mini-PCB

HTML
16
star
24

MK2mm_Stepper_switch

rev 0.4
15
star
25

Prusa-ESP-Nic-FW

ESP8266 as generic network interface over UART
C
14
star
26

Prusa-CW-Firmware

Original Prusa Curing and Washing machine firmware
C++
13
star
27

Arduino_Boards

Board definitions for Arduino compatible boards manufactured by Prusa Research
C
13
star
28

PrusaControl-settings

11
star
29

Prusa-Error-Codes

Python
8
star
30

stk500v2-prusa

Prusa edition of STK500v2 bootloader
C
7
star
31

hackaton2019

Prusa Hackaton 2019 repository
C
5
star
32

Original-Prusa-CW1

Original Prusa CW1 parts
5
star
33

Prusa3D-Drivers

Prusa Drivers package
5
star
34

SL-CONTROLLER-PCB

HTML
4
star
35

SL-PS-PCB

HTML
3
star
36

CW-01-LED-PCB

HTML
3
star
37

CW-CONTROLLER-PCB

HTML
3
star
38

gcode-metadata

Python G-CODE metadata parsing library
G-code
3
star
39

avrdude

HTML
2
star
40

IR-MH-sensor-PCB

HTML
2
star
41

SL-USB-PCB

HTML
2
star
42

SL-LED-PCB

HTML
2
star
43

PF-build-env

C
1
star