prusalink

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 2 Imported by: 0

README

This package offers a library to communicate with Prusa's PrusaLink enabled printers. It supports the full API available on the printer directly. A CLI is included to allow for easier scripting.

This is still in early development and any feedback or contributions would be greatly appreciated.

Implementation

The current implementation is based on the related source code:

]- v1

The implementation has been tested against my Prusa Mini+. It is possible that some features behave differently on different models. If you come accross one of these instances please open an issue so this can be resolved.

Development

To run the tests in the package you will need to have a Prusa printer with PrusaLink enabled. You will need to create a .envrc file in the root of the project with the following content:

PRUSALINK_HOST=xxxx
PRUSALINK_KEY=xxxx

You can then run the tests with go test ./... or by using the vscode go plugin.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capabilities

type Capabilities struct {
	UploadByPUT bool `json:"upload-by-put"` // The printer supports uploading GCodes by the PUT method.
}

type Printer

type Printer struct {
	*printer.Conn
}

func NewPrinter

func NewPrinter(host string, key string) *Printer

func (*Printer) V1

func (p *Printer) V1() *v1.V1

func (Printer) Version

func (p Printer) Version() (*Version, error)

type Version

type Version struct {
	API            string       `json:"api"`
	Server         string       `json:"server"`
	NozzleDiameter float64      `json:"nozzle_diameter"`
	Text           string       `json:"text"`
	Hostname       string       `json:"hostname"`
	Capabilities   Capabilities `json:"capabilities,omitempty"` // Additional capabilities the printer has.
}

Directories

Path Synopsis
cli
pkg
v1

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL