JS Failed to execute commandLine

I’m sure this was working but I’m seeing this fail now, has something changed?

var calcMbs=125000;
console.log("speedtest: start");
var results = actions.Exec.executeCommandLine(time.Duration.ofSeconds(30), "/usr/bin/speedtest", "-f", "json");
var js= JSON.parse(results);

output:
[rg.openhab.core.io.net.exec.ExecUtil] - Failed to execute commandLine ‘[/usr/bin/speedtest, -f, json]’

I don’t know speedtest history, but the current version does not know about a parameter -f. Instead, you have to use --json, so the line should read like this:

var calcMbs=125000;
console.log("speedtest: start");
var results = actions.Exec.executeCommandLine(time.Duration.ofSeconds(30), "/usr/bin/speedtest", "--json");
var js= JSON.parse(results);

nope correct command is :

let results = actions.Exec.executeCommandLine(time.Duration.ofSeconds(30), "speedtest", "-f json");

ie speedtest -f json ( or speedtest --format=json )
either way I still get output:

Failed to execute commandLine '[speedtest, -f json]'

I don’t know the answer but meanwhile there is a Speedtest Binding available :innocent: :

Speedtest addon doesn’t seem to work or I haven’t found out how to start it
and it seems its gettting the same issue:

2025-05-17 11:46:30.508 [DEBUG] [.speedtest.internal.SpeedtestHandler] - The command to be executed will be '[sh, -c, /usr/bin/speedtest -f json --accept-license --accept-gdpr]'
2025-05-17 11:46:30.510 [DEBUG] [.speedtest.internal.SpeedtestHandler] - An exception occurred while executing '[sh, -c, /usr/bin/speedtest -f json --accept-license --accept-gdpr]': 'Cannot run program "sh": error=0, Failed to exec spawn helper: pid: 739937, exit value: 1'

issue was a java upgrade issue, restarted after updating java and now works

As said above, I don’t know the history of speedtest, but please see the manual:

Please refer to the parameter list, not tldr (which does not match with parameters… )

This happens to my system on Java upgrades too. I have to remember to restart OH each time.