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?
47 Replies
Digger738
Digger738OP2mo ago
No description
lucadita
lucadita2mo ago
the same happens to me!: /home/pi/ratos-configurator/configuration/scripts/environment.sh: line 7: SUDO_USER: unbound variable
00Cyb3r
00Cyb3r2mo ago
same here any Solution ?
lucadita
lucadita2mo 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
miklschmidt2mo 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
Shaihulud#13572mo ago
The unbound variable went away, but unfortunately no graph is being generated.
lucadita
lucadita2mo 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
miklschmidt2mo 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
lucadita2mo 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
miklschmidt2mo 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
lucadita2mo ago
It not generates the graph.
miklschmidt
miklschmidt2mo 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
lucadita2mo ago
the file and the image in the console. no errors in the console
miklschmidt
miklschmidt2mo ago
Show me the output please better yet, post a debug-zip
lucadita
lucadita2mo ago
No description
miklschmidt
miklschmidt2mo ago
nothing after that?
lucadita
lucadita2mo ago
no nothing!
miklschmidt
miklschmidt2mo ago
Please post a debug-zip
lucadita
lucadita2mo ago
just a moment for the debug
miklschmidt
miklschmidt2mo ago
try set -eo pipefail
lucadita
lucadita2mo ago
I tried with a reduced frequency range, but the result does not change. do you need the debug file?
lucadita
lucadita2mo ago
(with "set -eo pipefail")
miklschmidt
miklschmidt2mo 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
lucadita2mo ago
I have executed the script and it has generated the graphics file in /config/input_shaper
miklschmidt
miklschmidt2mo ago
wat
lucadita
lucadita2mo ago
no error!
miklschmidt
miklschmidt2mo ago
So it works when you run it manually, but not when klipper runs it?
lucadita
lucadita2mo 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
miklschmidt2mo ago
Yeah it needs to be tested with set -eo pipefail from the commandline
lucadita
lucadita2mo ago
I have tested also with set -eo pipefail. no output
miklschmidt
miklschmidt2mo ago
from the commandline?
lucadita
lucadita2mo ago
yes! shure! 😉
miklschmidt
miklschmidt2mo ago
how about set -xe that'll log everything it does please paste it here I don't understand wtf is happening
miklschmidt
miklschmidt2mo 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
lucadita2mo 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#13572mo ago
I downloaded the update and sadly I am still unable to generate a graph. Is this working for anyone else?
Digger738
Digger738OP2mo ago
It still doesn't work for me either.
lucadita
lucadita2mo 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
Valaria
Valaria2mo ago
Hello. Me shows the error for environment.sh
No description
miklschmidt
miklschmidt2mo ago
Update I pushed another update yesterday I know what's causing it to exit (it's a series of && evaluating to false, hence the silence), fix is being tested internally, i've removed the -eo pipefail for now.
Valaria
Valaria2mo ago
@miklschmidt What update? All RatiOS components are actual and cannot be updated.
miklschmidt
miklschmidt2mo ago
Refresh the update manager

Did you find this page helpful?