Custom controls for printer leveling?

Hey all.

I was thinking of maybe making a Custom Control .gcode script to help me level my printer by moving the nozzle directly over the bed-leveling screws. I know there are leveling plugins out there, but they all seem to "over-complicate" things compared to what I need...

Problem is:
1: I'm new to OctoPi, and Custom Controls scare me...
2: I don't know .gcode well enough to know what commands to use.

To get started, I'll just ask the following: Is there a command that tells the print-head to go to a specific X/Y position, or do all moves have to be done relative to current position?

That depends...

Moving the hotend assembly (or the bed) is done in either absolute or relative mode. If you're doing something like this, I think I would put things in absolute mode and then just do the appropriate G0/G1 command to move it where you'd like it to be.

G90
G0 X10 Y10
1 Like

Yeah, absolute position is exactly what I was thinking of. This is a good start. I also found the G Code reference over at RepRap, so I'll do some more digging and see if I can figure this out now. :slight_smile:

Hmm... Something went very wrong here... This is the exact code I pasted into the config.yaml file:

controls:
  - name: Bed leveling
    layout: horizontal
    children:
    - name: Front Left
      command:
      - G90
      - G0 X17 Y93
    - name: Back Left
      command:
      - G90
      - G0 X17 Y301
    - name: Front Right
      command:
      - G90
      - G0 X385 Y93
    - name: Back Right
      command:
      - G90
      - G0 X385 Y301

Then I rebooted OctoPrint as per the instructions here, and now my OctoPrint is not starting again.
I tried rebooting the RaspberryPi, but still nothing. The OctoPrint log-file has no entries after I ordered the reboot, and here's the output from a service status call:

pi@octopi:~/.octoprint $ sudo service octoprint status
● octoprint.service - LSB: OctoPrint daemon
   Loaded: loaded (/etc/init.d/octoprint; generated; vendor preset: enabled)
   Active: active (exited) since Mon 2019-06-24 15:05:56 CEST; 19min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 346 ExecStart=/etc/init.d/octoprint start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/octoprint.service

Jun 24 15:05:56 octopi systemd[1]: Starting LSB: OctoPrint daemon...
Jun 24 15:05:56 octopi octoprint[346]: Starting OctoPrint Daemon: OctoPrint.
Jun 24 15:05:56 octopi systemd[1]: Started LSB: OctoPrint daemon.

The initial restart of OctoPrint was at 15:05, and I rebooted the RaspberryPi at ~15:30,,,

Yep, the config.yaml parser is pretty particular. Try copying/pasting all that you added into some text editor for temporary storage, remove it from the Raspi's file and then get it to boot. Once you've done that I'd suggest making a copy of your working config.yaml file first for safety's sake.

Then begin slowly and try to get a single control added to the interface. I personally have never used the Custom Control Editor plugin but you might consider it.