Connecting to Pseudoterminals

Is there a way to connect to a Pseudoterminal?

Let's say, I'm running my Stepper driver and G-Code engine on the same device that the octoprint is running on. Naturally, I would want Octoprint to connect to that engine locally (peferably by TCP/IP but I'll live with serial). How do I change the connection endpoint from /dev/ttyUSB0 to /dev/[some virtual port].

Hi @kurtnelle!

There is already a virtual printer installed with OctoPtint.
I hope this helps

You might see if the documentation for config.yaml helps.

But then again, many of these are represented in the Settings area.

Cool, so I can change the serial port to a virtual port that loops back to my engine by changing the config.yaml? Will the settings be locked on the UI when that happens? I want to prevent the end user from being able to change it (without having to modify the python).

Further, will that config.yaml change persist even after octoprint version updates?

Your config.yaml should persist from one update to the next, noting that plugins and OctoPrint routinely updates it.

You can't necessarily prevent a geeky user from modifying his/her config.yaml, though, especially if they know the Pi's password. Note that a geeky user who knows the API key could likely change settings remotely from the REST API.

Unless you write a plugin to block changes in the Connection side panel, the user could in theory change this back to the raw device. I couldn't tell you if the non-Admin setting for a user in User Access control would or wouldn't affect this; you'd need to test.

Ewald was suggesting the available virtual printer.

In your case, I think I would suggest something which involves socat.

1 Like