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 ?
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
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 !
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.