Orange Pi mcu permission denied

Basic Information:

Printer Model: Aquila S2
MCU / Printerboard: N32
Host / SBC: Orange Pi Zero 3
klippy.log

Describe your issue:

I’m trying to control a 12V led strip (single color) from klipper mainsail web interace. As per now I connected my led to a mosfet and it is controlled by the pin gpio73 (pin 7) of my Orange Pi Zero 3.

It works perfectly well when I activate the pin directly from the host via putty, but it doesn’t work when I use the following lines in my printer.cfc.

#############
[mcu opi]
#serial: /tmp/klipper_host_mcu # For Raspberry Pi
serial: /usr/local/bin/klipper_mcu # For Orange Pi

[output_pin halo_led]
pin: opi:gpiochip0/gpio73

[gcode_macro LEDON]
gcode:  SET_PIN PIN=halo_led VALUE=1

[gcode_macro LEDOFF]
gcode:  SET_PIN PIN=halo_led VALUE=0
##############

I thought the problem was comming from a permission denied to access the gpio since I got this error in klippy.log. (mcu ‘opi’: Unable to open serial port: [Errno 13] could not open port /usr/local/bin/klipper_mcu: [Errno 13] Permission denied: ‘/usr/local/bin/klipper_mcu’).
So I enter this command : sudo chmod 777 /usr/local/bin/klipper_mcu

And now I’m getting this error: mcu ‘opi’: Unable to open serial port: Could not configure port: (25, ‘Inappropriate ioctl for device’).

Does someone know how to properly activate a gpio pin from klipper via an Orange Pi ?

Thank you,

Mathieu

The mcu configuration is wrong. Klipper is expecting a serial device but you are pointing it to a binary executable. The line above it that you have commented out is actually the correct line. The instructions for setting up the Klipper host mcu are here: RPi microcontroller - Klipper documentation

When I uncomment that line below,

[mcu opi]
serial = /tmp/klipper_host_mcu

I receive the error below.

mcu 'opi': Unable to open port: [Errno 2] No such file or directory: '/tmp/klipper_host_mcu'

That’s when I found on a forum that the path was not the same on Orange Pi than on Raspberry Pi. May be I’m wrong.

Also, that’s what is returned when I setup the MCU if it can help.

orangepi@orangepizero3:~/klipper$ sudo service klipper stop
make flash
sudo service klipper start
  Flashing
Installing micro-controller code to /usr/local/bin/
Attempting host MCU restart...
orangepi@orangepizero3:~/klipper$ sudo usermod -a -G tty orangepi

Thank you,
Mathieu

As instructed by @theophile, please follow the link he provided. You are not following it.

This is what I followed first and I just tried it again.
Do I need to do the optional steps ? I thought they were not concerning me since I don’t want pwm, hardware pwm or spi…

Basically, the instructions take you through the process of compiling the host mcu process for your machine and setting up a system service to manage that process. Once the binary is compiled and installed and the service is started, a virtual serial port will be created at /tmp/klipper_host_mcu. If you are not seeing that path, then the host process is not running. That may be because the system service wasn’t set up correctly or hasn’t been started. It may also be because the binary executable failed to start for some reason, though if that were the case, I would hope you would see indications of that in your system logs or somewhere.

Thank you very much guys, I found another thread where @sineos contributed last year right here:

And this thread was referencing to this one where I found my solution:

In conclusion, I followed this procedure posted by @teophile letter by letter and I used the solution of Piezo in this last thread and it finally worked !

Thank you again,

Sorry, I should have paid more attention to this thread.

I’ve found that the simplest solution is to use the Orange Pi Debian image and not Armbian.

The Debian image works without any issues.

It’s strange since I am using debian bullseye. I still tried the solution for Armbian and it worked.
Programmation is not my field of expertise so sometimes I make backup and I use the old good trials and errors method.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.