KiloQubit / probe_accuracy

GNU General Public License v3.0
96 stars 18 forks source link

probe_accuracy.py fails #7

Closed claudermilk closed 1 year ago

claudermilk commented 1 year ago

I am running into this error when executing the probe_accuracy.py script:

Recording data, LEAVE THIS SESSION OPEN UNTIL THE SCRIPT SAYS "DONE"!
Traceback (most recent call last):
  File "/home/pi/probe_accuracy/probe_accuracy.py", line 275, in <module>
    main()
  File "/home/pi/probe_accuracy/probe_accuracy.py", line 268, in main
    data = get_data(args.klippy_uds, args.data_file)
  File "/home/pi/probe_accuracy/probe_accuracy.py", line 121, in get_data
    for line in get_klippy_output(klippy_uds):
  File "/home/pi/probe_accuracy/probe_accuracy.py", line 60, in get_klippy_output
    sock.connect(klippy_uds)
FileNotFoundError: [Errno 2] No such file or directory

I carefully followed the install instructions. python3 is installed, python-venv shows I am at 3.7.3-1. plotly shows all installed. I do have the script at ~/probe_accuracy which is where I am running it from. I'm not sure what file it cannot find.

KiloQubit commented 1 year ago

It can't find your Klipper socket. The default location is in the home directory of the user running the script in printer_data/comms/klippy.sock (e.g. /home/pi/printer_data/comms/klippy.sock). If your Klipper socket is in a different location, you can pass the --klippy-uds /some/other/location/some.sock flag to probe_accuracy.py.

There's a note in the README talking about this:

If you get a FileNotFoundError, your Klipper API server socket may be in a different location. You can pass a different location to the script using the --klippy-uds /some/other/location option

claudermilk commented 1 year ago

I'm an idiot. I read that and it did not register. Looks like on my install it's ./printer_data/comms/moonraker.sock and that runs fine.

KiloQubit commented 1 year ago

I'm an idiot. I read that and it did not register. Looks like on my install it's ./printer_data/comms/moonraker.sock and that runs fine.

No, moonraker.sock is different, that's the Moonraker socket, you need the Klipper socket. You can run the following command on your pi to see where that socket is

ps -ef | grep klippy

The output will look something like (scroll right if you don't see the whole line)

pi           620       1  3 May16 ?        05:08:14 /home/pi/klippy-env/bin/python /home/pi/klipper/klippy/klippy.py /home/pi/printer_data/config/printer.cfg -l /home/pi/printer_data/logs/klippy.log -I /home/pi/printer_data/comms/klippy.serial -a /home/pi/printer_data/comms/klippy.sock
pi        335652  335612  0 23:05 pts/1    00:00:00 grep --color=auto klippy

The socket is the path after the -a option, in my case you see -a /home/pi/printer_data/comms/klippy.sock (which is the default that probe accuracy script looks for). Your Klipper socket must be elsewhere, perhaps in /tmp/.

claudermilk commented 1 year ago

Huh, that's weird. I have no klippy.sock on my system at all. Yet it works fine. This was more for my own interest, so I'm not going to mess around with a working system and possibly break it.