Closed dutts closed 3 years ago
Does the db row count for the 'speedtest' table increment when the job runs via the 'pi' user's crontab? You can view the rowcounts by using the following command:
/opt/netperf/tools/db_rowcounts.sh
Do any relevant message show up in the syslog, particularly immediately after the cron job runs?
Are you using the open source 'speedtest-cli' or Ookla's client?
Can you please send me the following via email (mr_canoehead@telus.net): 1) /opt/netperf/config/netperf.json 2) the contents of the 'pi' user crontab (crontab -l > crontab.txt)
Just to make sure this isn't a general problem I reinstalled the project on my RPi 4B today (it's been busy with another project), am not experiencing this issue.
Thanks, Chris
Apologies for the delay in getting back to you, I realised that my pi might not have been in such good health as some deeper digging into some other bizarre behaviour was giving me segmentation faults. Have dug out a fresh micros card and will try a new install shortly.
Will close if I can't reproduce.
First of all, thanks a lot @mr-canoehead for the awesome project. Installed it today and it works like a charm! Thanks to the wiki the installation is really straight forward and easy 👍
I faced the same problem as @dutts and was able to resolve it after looking at this: https://stackoverflow.com/questions/14612444/bash-script-runs-manually-but-fails-on-crontab
I changed the following line https://github.com/mr-canoehead/network_performance_monitor/blob/ca88f4010d5171ffea77578a5c6ea350491b0c02/netperf/test_network.py#L145 to include the full path to speedtest-cli
which i found using which speedtest-cli
like this:
cmd = "{}/usr/local/bin/speedtest-cli --json {}".format(cmd_prefix,speedtest_server_opt)
This resolves the issue for me.
First of all, thanks a lot @mr-canoehead for the awesome project. Installed it today and it works like a charm! Thanks to the wiki the installation is really straight forward and easy 👍
I faced the same problem as @dutts and was able to resolve it after looking at this: https://stackoverflow.com/questions/14612444/bash-script-runs-manually-but-fails-on-crontab
I changed the following line
to include the full path to
speedtest-cli
which i found usingwhich speedtest-cli
like this:cmd = "{}/usr/local/bin/speedtest-cli --json {}".format(cmd_prefix,speedtest_server_opt)
This resolves the issue for me.
Great spot! I hadn’t had a chance to dig into this yet so glad it’s been solved!
Hi,
Thank you for doing this, since working from home full time recently and battling with a ropey Sky Broadband connection this has been an invaluable use of a spare pi I had lying around.
I have one issue that I can't figure out though; the Speedtest runs fine when I log in as
pi
and executepython3 /opt/netperf/test_network.py isp
the script completes and my speed test data ends up in the database and graph but never works under cron with this line5,35 * * * * python3 /opt/netperf/test_network.py isp > /dev/null
I get a zero result and the following entries in
netperf.log
Cron's log entry in
/var/log/syslog
shows it running as user piThe other cron jobs work fine, any ideas what's going wrong or how I can further diagnose the issue?
Thanks again
Rich