DietPi mcu Permission Denied

Basic Information:

Printer Model: Ender 3 Neo
MCU / Printerboard: Creality 4.2.2 GD32F330
Host / SBC: Dell Wyze 3040 DietPi (debian 13)
klippy.log

Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there

Describe your issue:

Thanks in advance for reading and even considering helping! I really do try to solve stuff on my own, but I am out of my depths.

I am trying to get my klipper to connect to my Ender 3’s mcu, but the klippy logs tell me permission denied no matter what I do.

I have looked through so many forum and reddit posted. Added my user to the dialout group (sudo usermod -a -G dialout $USER). I have tried every variation of by-id or by-path I could find. Every time I get permission denied.

I am fairly sure my firmware is flashed. I was able to use a 8gb sd card formatted to FAT32 with 4096 block sizes. I made the firmware saved it with a unique name (kdatetime.bin) and the screen on my ender went blank and expected. I was also able to flash back to stock firmware and get octoprint on my other PC to reconnect just to make sure the board wasn’t bricked. I flashed back to the klipper firmware (unique name again) with the screen unplugged. Steps were, printer off, insert card, printer on for a few minutes, printer off, remove SD, printer on and reconnect klipper in fluidd.

So I know the cable is good, confirmed with octoprint. I know the SDcard is good for flashing, flashed back to stock.

I just can’t get the permissions right and no google-fo has brought me an answer.

So helpful outputs?

dietpi@DietPi:~$ groups
dietpi dialout
dietpi@DietPi:~$ ls /dev/serial/by-id/*
/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
dietpi@DietPi:~$ ls /dev/serial/by-path/*
/dev/serial/by-path/pci-0000:00:14.0-usb-0:1:1.0-port0  /dev/serial/by-path/pci-0000:00:14.0-usbv2-0:1:1.0-port0
sudo dmesg when plugging in printer:

[ 3829.604434] usb 1-1: USB disconnect, device number 2
[ 3829.606006] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 3829.606192] ch341 1-1:1.0: device disconnected
[ 3831.091906] usb 1-1: new full-speed USB device number 4 using xhci_hcd
[ 3831.229845] usb 1-1: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.64
[ 3831.229892] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 3831.229914] usb 1-1: Product: USB Serial
[ 3831.234950] ch341 1-1:1.0: ch341-uart converter detected
[ 3831.236436] usb 1-1: ch341-uart converter now attached to ttyUSB0
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method: command

klippy.log (279.7 KB)

Welcome makerjud,
I can probably not help you with your problem.

All I remember is, ‘root’ vs ‘user’. If I remember right you should install ‘Klipper’ as ‘user’, not as ‘root’.
Also, you might do a search here


and read. Good luck.

1 Like

Hey @hcet14!

Thanks for the comment! I did neglect to mention that I used kiauh to install klipper and moonraker.

If I remember correctly kiauh won’t allow using root for install. So I am pretty sure I installed under the dietpi user.

And I for sure have used the search function to look at all 25 permission denied related threads. It’s where I got things like checking the groups and trying to add the dietpi user to the dialout group.

Sorry, that were my 2ct.

1 Like

I absolutely appreciate the contribution!

1 Like

Sorry, didn’t read. Did that ‘dialout’ work?

You have to install a web client before you can reach klippy VIA a network connection.

Do you have a screen attached to your Pi (not the MCU printer board)? If so KlipperScreen is the place to start. If not Mainsail and/or Fluidd are needed.

1 Like

Yes Fluidd is installed on another computer.

@hcet14 No it did not.

1 Like

Sorry, didn’t read your attached klippy.log and got you wrong with the title.

7260    serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
.
.
7325    mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 13] Permission denied: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'

See Sineos perfect How-To Trouble-Shoot.

Fluidd is not “Installed” on the other computer. Fluid runs on the SAME host (the dietPi) as klippy. Fluidd then provides REMOTE access via http.

The Fluid instance shown in in your last post makes no sense when compared to the KIAUH screenshot above.

Is klipper + Fluidd installed as root and another instance of klippy installed as dietPi? That is the only thing that makes sense unless you have another machine running klipper + fluidd on your network.

To lay it out in layers
Your web browser (installed on your phone/PC) uses http to connect with:
Fluidd (installed on the dietPi) which serves web pages built with data from:
MoonRaker (installed on the dietPi) which exchanges data with:
Klippy (installed on the dietPi) which is the engine that does all the work and connects to:
Klipper firmware running on the MCU

Thanks for the reply, but Fluidd is running on another computer. Klipper and moonraker run on the Dell and Fluidd runs in docker on my unraid server. I am trying to offload as much from the Dell as I can since it only have 8gb of emmc. Fluidd is connected to klipper/moonraker via the IP.

I have walked through that and based on the examples everything looks fine. My dmesg related to the USB doesn’t indicate BRLTTY or ModemManager is taking over the USB port.

I have been pouring over the official install docs all day trying to find something I have missed to get it working.

I have gone over my make menuconfig and tried every variation related to my printer ( or as close as I can get since the Ender 3 Neo doesn’t have its own Klipper printer.config).

I just can’t get past the permission on the port to allow klipper to connect to the mcu.

Only Moonraker and Klippy technically have to run on the host. You can host Fluidd on a different computer fine and connect over WiFi to Moonraker.

3 Likes

Okay then… live and learn.
Thanks for pointing that out.

3 Likes

“permission denied” is a Linux permissions error not a klipper error.

Is DietPi-Dashboard enabled on your 3040? It should be on port 5252

Nope, no dashboard on that port and looking at the dietpi installed software list the dashboard isn’t listed.

I was thinking last night, maybe I was barking up the wrong tree posting this on the klipper forum.

If I were you I’d use kiauh to install Fluid on the 3040 (as dietpi not root) and hope the installer sets the permissions correctly.

FWIW Sovol printers use a H616 SOM with 8GB EMMC. They install armbian along with clipperscreen, mainsail, and fluidd. Users do have to delete completed g-code files fairly regularly but have no performance issues. Your dual core Atom should be fine with a “conventional” install. If system loads are too high you can split off fluidd later.

So I tried using this little Dell to run octoprint in the past and while it did work, the storage just filled up so fast with logs and junk that I couldn’t upload gcode without hunting down free space. I ended up moving octoprint to docker on my unraid server and it works great. But I wanted to give klipper a try so I broke out the dell again to have a native host for the printer.

I was hoping with fluidd on a machine with more space that wouldn’t be an issue. Maybe my understanding of the architecture is misguided.

I haven’t run OctoPrint in a LONG time. I do know that lots of guys “get by” with 8GB of EMMC running Klipper.

I don’t know for sure but I think that even if you run Fluidd on another machine the g-code files end up on the 3040. I would imagine klippy reads the g-code files directly from the file system during printing.

Well I got a responce of the dietpi support forum that seems to be good.

I guess there is no group inheritance on DietPi (like on default Debian) so the systemd service starts only with group 1000 (dietpi), group dialout is missing.

cat /proc/$(systemctl show -p MainPID --value klipper)/status | grep Groups
Groups: 1000

You would need to modify the systemd service, so it starts also with dialout group. To do so execute sudo systemctl edit klipper.service.
Right where your cursor is add

[Service]
SupplementaryGroups=dialout

Then reload and restart

sudo systemctl daemon-reload
sudo systemctl restart klipper.service

Now you can check if it runs also with dialout group (and tty), it should show 5 20 1000

cat /proc/$(systemctl show -p MainPID --value klipper)/status | grep Groups

Now there is no permission denied error in the klippy.log, but still not mcu connection and what appear to be a whole bunch of python issues?

New log attached:
klippy_01.20.log (121.7 KB)