Xbox 360 controller for OctoPrint

The fun never stops... So I just got my xbox 360 USB receiver in the mail to go with the almost-new controller that I bought at Gamestop days before they closed their stores in California.

So I'd purchased this third controller for safety's sake since I'd purchased a used xbox 360 before lockdown ($45). Staring at it on the table I thought that I should hook this (spare controller) up to my 3D printer.

It's been way too easy.

  • Load driver
  • Adjust udev for rights
  • Reboot
  • Grab a Python module
  • Rock & roll

All I have to do now is to write a plugin to marry this to the G0 commands. I'm thinking...


  • Left joystick (floats) => absolute move X/Y
  • Lpad up/down (bool) => relative move Z (1mm)
  • Lpad left/right (bool) => relative move Z (0.1mm)
  • Right joystick (floats) => relative move X/Y from current position
  • Start (bool) => Home X/Y/Z
  • Left trigger (float) => relative retract
  • Right trigger (float) => relative extrude
  • Left bumper (bool) => unload filament (retract 130mm)
  • Right bumper (bool) => load filament (extrude 130mm)
  • Left joystick push (bool) => center extruder
  • Right joystick push (bool) => ?
  • A (bool) => Resume
  • B (bool) => Pause
  • X (bool) => Cool
  • Y (bool) => Preheat
  • Back (bool) => Cancel


[x] B (Pause)
[x] A (Resume)
[x] Back (Cancel)
[x] Start (Home XYZ)
[x] Left Bumper (unload filament)
[x] Right Bumper (load filament)
[x] Lpad up (1mm up)
[x] Lpad down (1mm down)
[x] Lpad left (0.1mm up)
[x] Lpad right (0.1mm down)
[x] X (cool extruder)
[x] Y (preheat extruder)
[x] Left joystick push (center extruder)
[x] Left joystick (absolute moves X/Y)


Minecraft 3D printer edition?

1 Like

I've been thinking about it, and have decided you must make a game of some type... Something multiplayer or solo, not sure. Game of skill. Maybe reverse jenga or something?

RetroPie supports it, for what it's worth.

At this very moment I'm working on the OctoPrint plugin for controlling it. Given that there's no visual interface, I'm left with things like I've indicated above.

Alright... I've got a fair bit of code and I'll install/test it tomorrow on my 3D printer. :slight_smile:

Looks like I've got something throwing commands. I'll take things slowly and make sure that I don't screw things up.

UPDATE: It's pretty much completed now and working fine on my own printer, for what it's worth.

Hi, i am interested about your project, can you atach the code or maybe the istruction to make it?
Thank you very much.

In the begining i start to think how to atach an analog joystik at the raberry to controll x/y and z, but your project is better.

Here's the repository but I'd suggest that it's only really useful now for another coder. You might want to review the code to see if there's anything you might re-use.

Keep in mind that many analog joysticks would present themselves almost like a mouse to the operating system. You might want to review pygame to see if they have support for this (probably).

Iā€™m just curious, which tasks are so control-intensive so you need a hardware controller?

I've had a TFT control screen on the printer since I bought it. The stock Robo 3D menu interface allowed you to get the printer ready, start/pause/cancel a job and to run some wizards for a few things.

I replaced that menuing interface and it was my intention to prep jobs with it. But having introduced the Xbox 360 controller, those tasks now seem to be much easier with this joystick, essentially. Typical work-saving features include (some) extrusion/retraction or a full amount of something like 130mm for filament changes; pre-warming the hotend or cooling it; homing the axes after a reboot.