

Where responseData is of type byte and contains the data from the data field of the command from original json sent by the server (see documentation). Therefore RepetierSharp also provides an event handler for the raw command response data: rc.OnRawResponse += (callbackId, command, responseData) => This data can be cast to the corresponding type by determining the command and using the provided types within the namespace - analogous to the events.Īt the moment the following commands (inclusive responses) are suppored:Īnalogous to the events there are many commands and serialization for all is not yet implemented. Where callbackId is the id corresponding to the sent command, command is the name of the command and response of the type IRepetierMessage is the actual response data. To get responses for the sent commands it is possible to register event handler similar as for the events: rc.OnResponse += (callbackId, command, response) => Where eventData is of type byte and contains the data from the data field of the event from original json sent by the server (see documentation). Since there are many events and serialization for all events is still not implemented RepetierSharp also provides an event handler for the raw event data: rc.OnRawEvent += (eventName, printer, eventData) =>

The eventName can be used to determine the event and cast the event data to the corresponding type provided in the RepetierSharp namespace.Īt the moment the following repetier events are supported: Where eventData is a IRepetierEvent instance. To get notified about repetier events it is possible to register and event handler like this: rc.OnEvent += (eventName, printer, eventData) =>

The following commands and events are named after the Repetier Server commands/events from the API documentationĪt the moment RepetierSharp supports the following features: Events RepetierConnection rc = new RepetierConnectionBuilder() More examplesĬreate a connection, register an event handler for successfull connection, which activates the printer with the slug "Delta" and enqueues and starts the job with the id 6. When both, API-Key and user credentials are supplied, the last option will be used. WithCredentials("user", "password", rememberSession: true)Įxample using a Repetier Server API-Key: RepetierConnection rc = new RepetierConnectionBuilder() In most cases you would want to create a connection by suppling a API-Key or user credentials:Įxample using user credentials: RepetierConnection rc = new RepetierConnectionBuilder() This gives you access to the repetier server with the global user profile. The most basic configuration to setup a working RepetierConnection looks like this: RepetierConnection rc = new RepetierConnectionBuilder() To establish a connection it is possible to provide the Repetier Server API-Key or user credentials. Simply start by creating an instance of the RepetierConnection class. RepetierSharp uses a fluent builder api to reduce the complexity when creating a new client instance. I will try to write a more thourough documentation as soon as possible.
#Repetier server key how to
The following sections show some examples on how to use the RepetierSharp client. Bugs are to be expected - please bear with me and help improving RepetierSharp by submitting issues on GitHub. This was needed because I wanted to control the Repetier Server programmatically to automate certain tasks.ĭISCLAIMER: RepetierSharp is still in beta. But I could not find any client implementing the Repetier Server API.

#Repetier server key software
I quite enjoy using the Repetier Server software to control/manage our 3d printers. Framework supportĬurrently RepetierSharp supports. Note that you are still able to use RepetierSharp by just using the version independent event handlers for events and command responses: OnRawEvent(string eventName, string printer, byte payload) and OnRawResponse(int callbackID, string command, byte response) respectively. The serialization for most commands and events should be working with earlier versions, but there is the possibilty of crashes when using RepetierSharp with earlier versions due to undocumented changes. This library is build against and tested with RepetierServer version 1.2.0.
#Repetier server key professional
"Repetier-Server is the professional all-in-one solution to control and manage your 3d printers and to get the most out of it." RepetierSharp is a simple, event-driven client which encapsulates the WebSocket API (as well as the REST API where needed) to control the Repetier Server. RepetierSharp - A simple, event driven Repetier Server client Introduction
