Moonraker GPIO issue (Orange Pi Zero 2)

Basic Information:

Printer Model: Ender 3
MCU / Printerboard: Orange Pi Zero 2/ BTT E3 mini V2
moonraker.log (180.2 KB)
klippy.log (23.7 KB)

Fill out above information and in all cases attach your klippy.log file. Pasting your printer.cfg is not needed

Describe your issue:


I am not super smart when in comes to programming, but can usually find the resources I need to fix an issue when one arrives. I am thoroughly stumped on this one. I would greatly appreciate your time and help.

I am trying to use an Orange Pi Zero 2, which i already have been successfully using moonraker and mainsail on for some time. I am trying to control a 3.3v relay and power on and off my printer from mainsail using moonraker’s power printer option.

Side note I have set this up with my raspberry pi 3 and 4 very easily since they are quite mainstream and have proper support. thanks for the simple setup!

With my orange pi on the other hand I have not been able to get past a pin parsing issue. Any way that I type the pin it continues to show a pin parsing error in mainsail and in the moonraker log. I will provide any information needed that may not be included in my moonraker log file.


Here is a capture of the errors in moonraker.

According to the log you are getting a permission denied error when Moonraker attempts to initalize the gpio. This suggests that the ender3 user does not have the necessary permissions. On RPi OS the user is added to the gpio group to gain access, presumably its the same on the the Orange Pi’s release of Debian.

Thanks for the quick feedback, I will make sure to add my account to that.

Would giving the account sudo access correct the gpio group error or do I need to add the user directly to a gpio group?


I suspect you will need to add the user to the gpio group. According to this issue you may also need to add a udev rule.

Hello, I have attempted to follow your instructions, upon further research I have found a possible issue, it seems I dont have a gpio group. How would I add this? the link you sent me only showed creating files that I believe would relate to this gpio group. Thanks

In the link you sent it showed a gpio group in this file but mine does not seem to have this included. I hope that help you help me haha. Thanks

Unfortunately I’m not sure I can be much assistance. Its distribution specific, there should be some documentation from OrangePi on how to enable userspace gpio access.

In the linked issue the user was using Armbian, so that may be an alternative solution.

Hi CNCMarlin,

I’m currently using an Orange Pi Zero 2 GPIO with Klipper to turn on printer via a relay.

As Arksine said, you should create a gpio group and add your user to it. In my case i’m using Armbian bullseye. I have not set a udev rule for gpio.

As i can see in your moonraker warnings, you’re trying to set gpio7. Try to refer the gpio used according to gpiochip/gpioline notation of the board. In this case, you are using the same pin as i’m using, which is gpio73. You can check pin notation with gpio readall utility (it came with armbian, not sure if with orangepi OS).

I’m attaching my current config in moonraker.conf:

[power printer]

type: gpio
pin: gpiochip1/gpio73
off_when_shutdown: True
initial_state: off

Try with that and see if it works.

Thanks for that info! I’m planning to install armbian on another sd card and see if I get better results. I wanted to do so originally but was having issues with wifi, but it seems those issues have been fixed!

I have tried with that exact gpio73 since that is what I had found online as the gpio pinout, but it did not work.

I should have time to get this done this weekend and will update with my result. Thanks to both of you for your insight.

Yes, Orange Pi Zero 2 is quite new board, so a lot is in development. I’m using this version:

klipper@orangepizero2:~$ uname -a
Linux orangepizero2 4.9.255-sun50iw9 #2 SMP PREEMPT Mon Mar 7 09:47:31 CET 2022 aarch64 GNU/Linux

If you have the gpioinfo utility, when pin config is working correctly, the command should tell you that moonraker is using the pin as follows.

        line  70:      unnamed       unused   input  active-high
        line  71:      unnamed       unused   input  active-high
        line  72:      unnamed       unused   input  active-high
        line  73:      unnamed  "moonraker"  output  active-high [used]
        line  74:      unnamed       unused   input  active-high
        line  75:      unnamed       unused   input  active-high
        line  76:      unnamed          "?"  output  active-high [used]

Finally, this is my user config (username is klipper):

klipper@orangepizero2:~$ groups
klipper tty disk dialout sudo audio video plugdev games users systemd-journal input netdev ssh bluetooth gpio
klipper@orangepizero2:~$ cat /etc/group | grep gpio

So am currently in the process of setting up armbian bullseye on my orangepi zero. I could not use the direct link from the armbian website and instead used an archived version that I found to work through some forms. My only concern is that when I was setting up on first boot it said it was a build generated only for developers to fix ux bugs. Is this something I should avoid? I am continuing to set it up until I hear otherwise and will update on the gpio issue I was having.

Hope you are having great weekends!

clarification* the direct link from armbian’s website would not boot (no red led status). Upon looking for bootable version since I knew there had to be some since you are using it I found a forum that stated a specific version and date. I found something similar to that version in the github archive repository, so I believe it is coming from a legitimate source as far as I am aware.

Hey doggisbag, would you be willing to help my get your exact version of armbian? I’m not sure how complicated that would be but I am definitely having trouble with finding one without to many bugs and functioning wifi.

I got that version I wrote about earlier today setup, but as soon as I attempted the printer power function in moonraker it once again had a parsing error due to not having the correct permissions, did you have to run through some hoops to get your specific version of armbian to work as well?

Thanks for helping me out.