No Belt Tension Graphs

Today I updated RatOS, and since then I no longer get belt tension graphs. In the console, an error message appears: SUDO_USER: unbound variable. The shaper graphs still work. Does anyone have an idea?
43 Replies
Digger738
Digger738OP2d ago
No description
lucadita
lucadita2d ago
the same happens to me!: /home/pi/ratos-configurator/configuration/scripts/environment.sh: line 7: SUDO_USER: unbound variable
00Cyb3r
00Cyb3r2d ago
same here any Solution ?
lucadita
lucadita2d ago
@miklschmidt I think that there is an error in the script: generate-belt-tension-graph.sh I think we have to comment the second line: set -e -u -> #set -e -u
miklschmidt
miklschmidt2d ago
That'll just prevent it from breaking, there's an actual bug here it seems, gimme a sec! Ah right of course, it's the -u Fix pushed 👍 will be ready to update in 5 minutes 🙂
Shaihulud#1357
The unbound variable went away, but unfortunately no graph is being generated.
lucadita
lucadita2d ago
without the set -e it works! But if it not works with "-e", I think that it means that there is a command in the script that exit unsuccesfully...
miklschmidt
miklschmidt2d ago
any errors? it should keep the -e, that's what makes it exit on errors. -u is what makes it fail on unbound variables (the SUDO_USER is used in a check to see what user ran the script via sudo, it has fallbacks if it's not set)
lucadita
lucadita2d ago
I can't try now, but I'm shure that without set -e the script works correctly. It's weird! I agree with you about the funcion of "set -e": if it exit with "set -e" does it mean that there is something wrong! but the weird part is that If we don't put "set -e" th script do what is expected to do 🙂
miklschmidt
miklschmidt2d ago
Yes because it will just continue when something exits when it's not supposed to. Please run it as it is now, with set -u (obviously update first), and tell me what happens when you run it.
lucadita
lucadita2d ago
It not generates the graph.
miklschmidt
miklschmidt2d ago
What's not generated exactly? The data? the image in the console? is the file present in the input_shaper folder? Are there any errors?
lucadita
lucadita2d ago
the file and the image in the console. no errors in the console
miklschmidt
miklschmidt2d ago
Show me the output please better yet, post a debug-zip
lucadita
lucadita2d ago
No description
miklschmidt
miklschmidt2d ago
nothing after that?
lucadita
lucadita2d ago
no nothing!
miklschmidt
miklschmidt2d ago
Please post a debug-zip
lucadita
lucadita2d ago
just a moment for the debug
miklschmidt
miklschmidt2d ago
try set -eo pipefail
lucadita
lucadita2d ago
I tried with a reduced frequency range, but the result does not change. do you need the debug file?
lucadita
lucadita2d ago
(with "set -eo pipefail")
miklschmidt
miklschmidt2d ago
Last thing, try running the script manually:
cd ~/ratos-configurator/configuration/scripts
./generate-belt-tension-graph.sh
cd ~/ratos-configurator/configuration/scripts
./generate-belt-tension-graph.sh
If that shows nothing either, i'll remove the set line.
lucadita
lucadita2d ago
I have executed the script and it has generated the graphics file in /config/input_shaper
miklschmidt
miklschmidt2d ago
wat
lucadita
lucadita2d ago
no error!
miklschmidt
miklschmidt2d ago
So it works when you run it manually, but not when klipper runs it?
lucadita
lucadita2d ago
yes. bu it works also without "set -e"! it's weird!! just a moment! I have to check if the file was modified.. sorry! I removed the "set -e". with set -e it fail! nothing is generated
miklschmidt
miklschmidt2d ago
Yeah it needs to be tested with set -eo pipefail from the commandline
lucadita
lucadita2d ago
I have tested also with set -eo pipefail. no output
miklschmidt
miklschmidt2d ago
from the commandline?
lucadita
lucadita2d ago
yes! shure! 😉
miklschmidt
miklschmidt2d ago
how about set -xe that'll log everything it does please paste it here I don't understand wtf is happening
miklschmidt
miklschmidt2d ago
AH! .. It's because the while loop reading out the env variables exits with a non-zero exit code when the file is done reading.. doh. Fix on the way 🙂
lucadita
lucadita2d ago
yes, it was clear that there was something that returned a non-zero value, the problem was to understand what generated that non-zero value! 🙂 chapeau!!
Shaihulud#1357
Shaihulud#135713h ago
I downloaded the update and sadly I am still unable to generate a graph. Is this working for anyone else?
Digger738
Digger738OP11h ago
It still doesn't work for me either.
lucadita
lucadita10h ago
you have to wait a new update, or.... waiting the new update, you can comment the second line of the script... the one with "set -e". But I suggest you tu wait for the new update!
blacksmithforlife
Telling people to comment out a line that stops the script if there is an error is a bad idea
Want results from more Discord servers?
Add your server