mmone / OctoprintKlipperPlugin

A plugin for a better integration of Klipper into OctoPrint.
GNU General Public License v3.0
83 stars 62 forks source link

empty settings and macros #11

Closed St007 closed 6 years ago

St007 commented 6 years ago

Installed plugin on Octoprint Version 1.3.9, Klipper Firmware version: v0.6.0-339-g3f59c3d Running on latest Armbian. After install I can't open klipper config (it is just empty), all settings in plugin empty, default emergency stop macro empty too. The only thing working - panel buttons like "get status", "firmware restart". However Performance Graph is empty too (no files in dropdown file selector)

mmone commented 6 years ago

I currently test only on octopi so some paths might be different there.

After install I can't open klipper config (it is just empty)

You can change the path the plugin is looking for the "printer.cfg" in the settings.

all settings in plugin empty

That I can't explain atm. The emergency macro exists but the "GCODE" field is empty? Can you create new macros and are they persistent if you save the settings?

However Performance Graph is empty too (no files in dropdown file selector)

The plugin looks for logfiles in /tmp/ namped klippy.log* are they also located there for your install?

In any case it would help if you could post an octoprint.log. On a standard octopi installation this is located at "/home/pi/.octoprint/logs/octoprint.log"

arminth commented 6 years ago

In a standard install, the klippy.log ist found here: /tmp/klippy.log I also don't get no filechoice for the perfgraph! Cheers Armin

St007 commented 6 years ago

more details:

  1. I used plugin on another armbian with more old Octoprint, Klipper and plugin version and it works there out the box, till now.
  2. I have added path to printer.cfg without any effect
  3. Emergency macro is empty, there is no any macros after fresh install
  4. Log file on my machine is /tmp/klippy.log log file attached octoprint.log
mmone commented 6 years ago

In a standard install, the klippy.log ist found here: /tmp/klippy.log I also don't get no filechoice for the perfgraph!

That is interesting. Could you verify that you have logs in /tmp/ at the moment. If so reload you octoprint in the browser as the listing is only done once when loading the page at the moment

St007 commented 6 years ago

As I can see from logs '/home/pi/printer.cfg' is hardcoded ? and it causes crash on loading settings routine ?

mmone commented 6 years ago

@St007

It is not hardcoded you can configure the path in the Plugins settings in the UI under Klipper/Basic/Klipper Config Path

St007 commented 6 years ago

Yes, I can add the path, but it just not works ...not sure if it is hard to detect current user's home path and look for printer.cfg there instead of trying to load '/home/pi/printer.cfg'

mmone commented 6 years ago

Yes that would be possible an absolute path seemed more flexible. Last thing you could try after checking whether the path displayed in the UI is correct is to restart Octoprint as the settings are only read on startup at the moment.

St007 commented 6 years ago

Yes, the path in settings exists after Octoprint restart, that was the first I tried to do :)

mmone commented 6 years ago

I'm trying to reproduce the issue. What is your actual path?

St007 commented 6 years ago

actual path /home/slv/printer.cfg I guess it is in octoprint log too

mmone commented 6 years ago

actual path /home/slv/printer.cfg I guess it is in octoprint log too

No in the log it is still looking for "/home/pi/printer.cfg" which is the default

If you're still willing to debug some more you could check your Octoprint config file. For me this is located at ~/.octoprint/config.yaml That is where the plugin stores its settings. There should be an entry:

  klipper:
    _config_version: 2
    configuration:
      path: /home/slv/printer.cfg
St007 commented 6 years ago
  klipper:
    _config_version: 2
  softwareupdate:
    _config_version: 6
    check_providers:
      fanspeedslider: fanspeedslider
      klipper: klipper
printerProfiles:
  default: _default
serial:
  additionalPorts:
  - /tmp/printer
  autoconnect: true
  disconnectOnErrors: false
  port: /tmp/printer
server:
  firstRun: false
  onlineCheck:
    enabled: true
  pluginBlacklist:
    enabled: true
mmone commented 6 years ago

OK. I think I can reproduce the issue know. It's a bug. As a quick fix you could manually add the correct path to the config.yaml then the rest of the default config should load as well. I will provide a bugfix release soon.

  klipper:
    _config_version: 2
    configuration:
      path: /home/slv/printer.cfg
mmone commented 6 years ago

The release will include the possibility to configure the path for the klipper logfiles. Where are they located for your install?

St007 commented 6 years ago

klipper log file is in its default location /tmp/klippy.log

mmone commented 6 years ago

OK. Thanks for the debug session.

St007 commented 6 years ago

Thank you for great plugin!

arminth commented 6 years ago

Sorry for late reply, on business trip. I installed 0.2.2 today (after upgrading pip). I have the klippy.log in /tmp . Still, I don't get any file displayed in the choice for the log file. I restarted octoprint. No change. grafik

Cheers Armin

mmone commented 6 years ago

Please post a octoprint.log otherwise I can't really diagnose the problem.

arminth commented 6 years ago

octoprint.log This is my last log.

mmone commented 6 years ago

Hi Armin, I can't find anything at the moment. The log is very long and I dont know when the dialog was opened. It would be great if you could delete you local log file so that a new one is created by octoprint. Then please restart octoprint, open the graph dialog and hit the refresh button for the file listing. Then post this log. Is everything else working? Especially can you view the Klipper Configuration in the settings dialog?

arminth commented 6 years ago

octoprint(1).log Done! Everything else including editing Klipper configuration works fine.

mmone commented 6 years ago

Hmm. Looks clean.

Given you have shell access to the pi we can directly execute the commands I use to list the log files. In a shell execute the following:

ls -l /tmp/*log.*                     # list all log files in the temp dir to make sure files a there.

cd                                          # to go to the user directory
source oprint/bin/activate   # activate the virtual environment used by octoprint
python                                  # launch a python console
import glob
glob.glob("/tmp/*.log*")

The last command should list all klippy logfiles in the directory.

If that works the server side works and the problems must be the Browser. Which Browser are you using btw. ?

arminth commented 6 years ago

2018-08-17 20:56:49,291 - tornado.access - WARNING - 403 POST /api/plugin/klipper (::ffff:192.168.1.40) 45.13ms 2018-08-17 20:56:55,689 - tornado.access - WARNING - 403 POST /api/plugin/klipper (::ffff:192.168.1.40) 48.96ms 2018-08-17 20:56:57,211 - tornado.access - WARNING - 403 POST /api/plugin/klipper (::ffff:192.168.1.40) 44.05ms 2018-08-17 20:56:58,707 - tornado.access - WARNING - 403 POST /api/plugin/klipper (::ffff:192.168.1.40) 45.99ms

Looks like the webserver denies access. Just to check, I tried both nodes on octoprint: access control enabled and disabled. No change...

mmone commented 6 years ago

Hm good catch missed that one :-) Is the octoprint user you have currently logged in "Admin"?

arminth commented 6 years ago

ls -l /tmp/*log.*

doesn't work!

ls: cannot access '/tmp/*log.*': No such file or directory

if I change it to ls -l /tmp/*log

I get -rw-r--r-- 1 pi pi 8596690 Aug 17 21:03 klippy.log

cd pi@octopi:~ $ source oprint/bin/activate (oprint) pi@octopi:~ $ python Python 2.7.13 (default, Nov 24 2017, 17:33:09) [GCC 6.3.0 20170516] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import glob glob.glob("/tmp/*log") ['/tmp/klippy.log']

So maybe typo in the wildcard-selection?

arminth commented 6 years ago

Using Firefox btw.

mmone commented 6 years ago

I wrote "ls -l /tmp/*log.*" and glob.glob("/tmp/*.log*")

arminth commented 6 years ago

Aber an dem liegt's wohl eher nicht! Ich geh mal ins Bett! Bis morgen!

mmone commented 6 years ago

Bis dann ich denke mal nochmal nach ... :-)

arminth commented 6 years ago

Du hast aber oben tatsächlich ls -l /tmp/*log.* geschrieben!

Guck mal!

arminth commented 6 years ago

Kein Stress übrigens. Das Plugin läuft sonst super! Macht deutlich mehr Spaß mit Klipper jetzt! Danke dafür!

mmone commented 6 years ago

Denke ich weiß inzwischen warum es bei mir funktioniert und bei dir nicht. Denke kann das morgen abend fixen.

mmone commented 6 years ago

Mit dem neuen release 0.2.3 sollte es funktionieren. lg Martin

arminth commented 6 years ago

Sehr geil! Danke Dir! Es druckt gerade - danach teste ich sofort!

arminth commented 6 years ago

Klappt!! Sauber! grafik