Octoprint & Smoothieware

Hi Everyone,

Trying to get my Tevo Little Monster on Smoothieware to work with Octoprint (latest stable version) on a PI 3 B+. Followed the instructions here: https://github.com/foosel/OctoPrint/wiki/Setup-OctoPrint-with-Smoothie

Implemented the Safe Method.
Initially, it failed as sudo anything required a password.
Solved this by adding mount, umount, sync to visudo to disable the password prompt for these

The script works fine now and copies (or in my case moved) files from the PI SD to the Smoothieboard SD Card. BUT the files do not show up in the Octoprint file manager (moved file disappears) till I either reboot the PI or manually run the M20 command in the Gcode window.

Hitting the refresh button in the file manager does noting either.

Question: How can I either add the M20 to the Copt to SD Card script or fix the refresh button in the GUI?

Thanks !

I note that Guy did some interesting things with the pi user so that it can do many things (in the OctoPi image for OctoPrint on Raspberry Pi computers).

The error sounds like the files land in ~/.octoprint/uploads as a user other than pi, if I'm guessing correctly. You might try remoting into the Raspi and doing an ls -l ~/.octoprint/uploads to see who the owner is. Or maybe I'm way off of the mark.

No, the uploads land from user pi in the folders.
The issue is 2 fold:

  1. sudo command needs a password so the script can not execute it as pi unless I exclude the 3 commands (mount, umount and sync) from the password requirement. - done that and this part is fine

  2. file list does not update. As it updates correctly if I issue the M20 command I assume that the "update" button in the GUI sends a different command. Hence the question whether it is possible to remap the button and/or add a gcode send command to the script so after copy and unmount I would send the refresh command

I recall walking through a lot of the code from Guy and I remember thinking "wow, that's clever" in the area of sudo requirements. He did some kind of work-around for that.

I can't find it, though.


Maybe he did something with the special file bits, I just don't remember. Maybe this was the version before the ip tables redirect thing.

Back to question 2, in a case like this, I'd usually just walk the existing code to see what it does and to consider editing it in place.

The cleverer people here might be able to advise you on what it does and what's possible.