Automatically upload from NAS

Hmm. Does Octoprint upload the file if you restart Octoprint? Anything in the log?

I'm thinking that if the user is different on the NAS device and it's trying to copy things over to the Raspberry then this is what's creating the confusion.

Baby steps:

  1. Turn off OctoPrint with a sudo service octoprint stop
  2. Copy the file over from the NAS device as whoever into the Raspberry's watch folder
  3. Do an ls -l in that folder to see the owner/group identification
  4. Do a sudo chown pi:pi filename.gcode in that folder to change it to the pi user and group
  5. Start OctoPrint with sudo service octoprint start
  6. See if it works

If that works then the problem is the owner as it lands in that folder. You might try instead using a command like this from the NAS device so that it will arrive with the pi user's ownership:

scp something.gcode pi@octopi.local:~/.octoprint/watch/.

...after storing the pi user's key information on the NAS device with this command (as run on the NAS device):

ssh-copy-id -i ~/.ssh/id_rsa.pub pi@octopi.local

This assumes that you've created an openssl keypair on the NAS device first and you used id_rsa (the default) when prompted for that.

Thank you for the guide. Here are the results:

-rwxr--r-- 1 herbert Herbert 775327 Sep 23 14:55 TestV2.gcode

after restarting octoprint is the file succesfully uploaded.

So after playing a bit around with restarting ocotprint I found out, that octoprint only uploads the files in the watched folder when I restart it.

What I'm saying is that OctoPrint runs (normally) as the pi user. OctoPrint will watch the watch folder then need to read it (probably has rights to do that) but when it's finished processing it will need to delete that file. If the file's owner is herbert then maybe it can't do that.

But he said Octoprint runs as "Herbert".

So after playing a bit around with restarting ocotprint I found out, that octoprint only uploads the files in the watched folder when I restart it.

I had the same issue but now it work and i dont found the reason why it works now. Did you activate the active polling?

image

normally, but because I'm not running it on an raspberry pi, my octoprint user is herbert.
I found this out with this command

Yes this is allready activated.

@Herbert. You speak German or?

@OutsourcedGuru

What I'm saying is that OctoPrint runs (normally) as the pi user. OctoPrint will watch the watch folder then need to read it (probably has rights to do that) but when it's finished processing it will need to delete that file. If the file's owner is herbert then maybe it can't do that.

I have the same config and it works. (nas is my default user)

yes :grinning:

could you give some more information on how you setup octoprint and the nas?

Nothing special:
Ubuntu 18.4 Server with installed Octoprint

With CIFS/SMB i share the "watched" folder to all my systems. Yes i had the same problem as you but after some server restarts it works perfekt. Sorry i dont know why and i cant reproduce the problem.

@foosel
In general it works in 99% of the cases. Some times Octoprint doenst perform the upload. So.. if i move the file outside the folder and back again... the fileupload works for the 1% also.

My question now: What kind of log file (debug level) you need? I want open a issue but without log it makes no sense.

octoprint.log. that should hopefully contain a hint on what's going on. Ticket template also asks for that for that very reason :wink: