speedtest not showing in utilitytab

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
GrimReaper
Posts: 1
Joined: Saturday 07 September 2019 19:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

speedtest not showing in utilitytab

Post by GrimReaper »

Hi

I have followed this guide: https://www.domoticz.com/forum/viewtopic.php?t=13814

As i dont have a username and password (yet ;) ) i have removed the username and password

Spoiler: show
#!/bin/bash

#setup
host='http://***.***.***.***:8080'
#idx for download, upload and ping
idxdl=82024
idxul=82025
idxpng=82026
idxbb=1406B


# speedtest server number
serverst=7214

# no need to edit
# speedtest-cli --simple --server $serverst > outst.txt
speedtest-cli --simple > speedtest.txt

download=$(cat speedtest.txt | sed -ne 's/^Download: \([0-9]*\.[0-9]*\).*/\1/p')
upload=$(cat speedtest.txt | sed -ne 's/^Upload: \([0-9]*\.[0-9]*\).*/\1/p')
png=$(cat speedtest.txt | sed -ne 's/^Ping: \([0-9]*\.[0-9]*\).*/\1/p')

# output if you run it manually
echo "Download = $download Mbps"
echo "Upload = $upload Mbps"
echo "Ping = $png ms"

# Updating download, upload and ping ..
wget -q --delete-after "http://$host/json.htm?type=command&param=udev ice&idx=$idxdl&svalue=$download" >/dev/null 2>&1
wget -q --delete-after "http://$host/json.htm?type=command&param=udevice&idx=$idxul&svalue=$upload" >/dev/null 2>&1
wget -q --delete-after "http://$host/json.htm?type=command&param=udevice&idx=$idxpng&svalue=$png" >/dev/null 2>&1

# Reset Broadband switch
wget -q --delete-after "http://$host/json.htm?type=command&param=udevice&idx=$idxbb&svalue=0" >/dev/null 2>&1

# Domoticz logging
wget -q --delete-after "http://$host/json.htm?type=command&param=addlogmessage&message=speedtest.net-logging" >/dev/null 2>&1

When i do a manual trigger or via a cronjob i get a error in my log:
2019-09-10 19:45:04.764 Error: Error executing script command (/home/pi/script/speedtest.sh). returned: 1024

When i check my script via ssh ./speedtest.sh i get a valid result ( Download = 27.65 Mbps, Upload = 3.57 Mbps,Ping = 31.95 ms). So the script itself is fine.

I dont have a clue what could be the issue any more. Anyone a idea?

Image
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest