emtrax-ltd / Cura2MoonrakerPlugin

Ultimaker Cura 2 Mooraker Upload Plugin
GNU General Public License v3.0
293 stars 25 forks source link

error: 204 host requires authorisation #20

Closed Kieraneasdale closed 3 years ago

Kieraneasdale commented 3 years ago

Hi there,

Does anyone know or could help with this issue?

Screenshot 2021-10-06 at 18 58 35

Get an error when trying to upload to Klipper from cura. I have added the IP address of my PC to the authorized list of addresses in moonraker.config.

UPDATE: #7 does not fix it for me!? Where can i find "~/.moonraker_api_key" ??

One other question is, for the section in the cura config "name of Moonraker power device". i am assuming this refers to the power device such as a TP link smart plug?

cheers

emtrax-ltd commented 3 years ago

http-204 -> /home/pi/.moonraker_api_key - if it is not there, then take a look -> https://github.com/Arksine/moonraker/blob/master/docs/user_changes.md#april-19th-2021

power device: it is the device name that was defined in moonraker.conf -> [power device_name]

Kieraneasdale commented 3 years ago

I will take a look tonight and report back!

Thanks!

Kieraneasdale commented 3 years ago

Sorry for the late reply. Still no luck, unfortunately!

Iconnected to the rpi in termnial and ran:

pi@fluiddpi:~ $ cd /home/pi/moonraker/scripts pi@fluiddpi:~/moonraker/scripts $ bash fetch-apikey.sh API KEY WAS HERE

And still, this had a 204 error?

emtrax-ltd commented 3 years ago

verify/extend "trusted_clients" in section "authorization" of moonraker.conf

[authorization] ... trusted_clients 192.168.1.30 192.168.1.0/24

Andoramb commented 3 years ago

Hm. Same here:

  1. Fetched the api key form the script
  2. Checked the trusted_clients (connection OK with Postman)
Kieraneasdale commented 3 years ago

verify/extend "trusted_clients" in section "authorization" of moonraker.conf

[authorization] ... trusted_clients 192.168.1.30 192.168.1.0/24

This is one of the first things i checked, and yes the IP from my PC that i am trying to send Gcode from, is on the trusted clients in moonraker.config?

emtrax-ltd commented 3 years ago

really strange! please provide the complete configuration of the plugin (screenshot) and moonraker.

...and are there any hints in the /tmp/moonraker.log or /var/log/nginx/access.log or error.log?

Kieraneasdale commented 3 years ago

SOLVED: 🥇

Right so, for myself, i found that as long as my IP was in the trusted clients in moonraker.config, i did not need to enter all of the log-in credentials in the cura plug-in, or the API key. As shown in this video:

https://www.youtube.com/watch?v=52T1H15Hox0

I did also change force log-in = False in moonraker.config as well, however, i don't know if this had an effect.

Andoramb commented 3 years ago

I have configured user/password to the login in Fluidd; Got the API key, put everything into the plugin config.

It must be my setup then. Feel free to close this issue :)

emtrax-ltd commented 3 years ago

I have configured user/password to the login in Fluidd; Got the API key, put everything into the plugin config.

the "username / password" in the plugin configuration is for http-basic-auth which can be enforced by the nginx - this option is from older days and has nothing to do with the newer functionality of moonraker. please remove the login credentials (not the api-key) from the plugin and give it a try.

Kieraneasdale commented 3 years ago

Okay cheers for all the support though, been very much appreciated!

Andoramb commented 3 years ago

You guys were right: I removed all authentication stuff: no API key, no username/password, no force logins, just the IP with the trusted domain. Turned out to be OK on the first try :) Thanks for the plugin!