Page 3 of 3
Re: [internet sensor] speedtest.net measures
Posted: Sunday 16 October 2016 1:38
by simonrg
I have set up this script and it works really well.
The only problem is after having run it every 5 minutes for a week, I have discovered that each speed measurement appears to download 30MBytes, so my limited allowance disappeared very rapidly.
Is 30MB per test about right?
Is there a way of using less than 30MB per test?
Obviously testing every 5 minutes is probably too often and I could test less often, so use up less of my allowance, but 30MB still seemed too big, so I was wondering if anybody knew how much data speedtest is supposed to transmit?
Re: [internet sensor] speedtest.net measures
Posted: Tuesday 18 October 2016 20:31
by emme
I don't really think that speedtest is intend to be run every 5 minutes
I run it 4 times a day: at 3.00am / 9.00am / 3.00pm / 9.00pm
Speedtest uses all available bandwidth by design... running so often results in poor network performances...
Inviato dal mio EVA-L09 utilizzando Tapatalk
Re: [internet sensor] speedtest.net measures
Posted: Sunday 23 October 2016 13:21
by simonrg
emme wrote:I don't really think that speedtest is intend to be run every 5 minutes
I run it 4 times a day: at 3.00am / 9.00am / 3.00pm / 9.00pm
Speedtest uses all available bandwidth by design... running so often results in poor network performances...
Absolutely right, but equally surprising to me in that I didn't reallise how little of my actual bandwith I noramlly use and how little I have to use to exceed my quotas - at 10Mbps 30MB is about 20seconds, so my quota is fully gone in 7 days rather than 31 at less than 8% usage.
I had assumed that speedtest wasn't really downloading or uploading very much, hence 30MB was a bit of a shock, as you say it has to measure full speed so in hindsight not so surprising

.
I was trying spot why my internet while general fast enough, sometimes shows stuttering which kills streaming and doesn't help with VOIP. So monitoring changes in speed to see if I could spot any trends.
I was combining speedtesting wtih pulling off recieved and transmit statistics from my router to see if I can see correlations apart from the obvious.
Re: [internet sensor] speedtest.net measures
Posted: Sunday 23 October 2016 14:25
by emme
Mmh... have you already checked this project if it could help you?
http://www.domoticz.com/forum/viewtopic.php?t=13421
Inviato dal mio EVA-L09 utilizzando Tapatalk
Re: [internet sensor] speedtest.net measures
Posted: Tuesday 25 October 2016 19:43
by simonrg
Thanks, I have seen that, it pulls it all together.
I am starting to use SNMP to interogate my router and understand how much data is actually being transferred and pick up other statistics.
Combining both speed and actual transfers allows me to have a sensible conversation with my ISP convincing them that what I am seeing is real, on Sunday and Monday my speed dropped to almost zero in the daytime. Magically, the ISP managed to do something, so today's speed is now more stable (this is on the service with no limit on usage

).
Sunday

- 161023BoundlessSpeed.jpeg (39.31 KiB) Viewed 1834 times
Tuesday

- 161025BoundlessDownloadSpeed.png (78.51 KiB) Viewed 1834 times
Re: [internet sensor] speedtest.net measures
Posted: Saturday 12 November 2016 10:31
by korniza
coming back to this idea and I think from the point of usage has no real usage as it measures the free bandwidth. I know, I started this but it was a proof of concept.
I think the best is to get the bandwidth (upsrtream/downstream) that is using polling snmp (need some help if someone has build and lua script to get snmp stats of interface usage) of the dsl router interface and also get respond time from a specific site. An additional value can be the to run bandwidth test on speedtest.net when dsl line is free (if downstream snmp value is < than 1 Mbit for example) and measure the real throughput of internet line.
Next can be some maths and get the % of free/used bandwidth. combined with the ping latency can give a warning scenario: if (ping respond time > 200 ms) and (downstream < 2 Mbit) then set an alarm.
hope for a help on this smarter script.
Re: [internet sensor] speedtest.net measures
Posted: Saturday 12 November 2016 10:54
by simonrg
I have not had time to follow up on SNMP properly, there are SNMP CLI routines, which could be easily used, and cludged into Domoticz via os.execute.
The logic of SNMP is quite complicated it is structured data and you need to have the information for your router to understand which data to ask for.
I would be very interested if somebody else has got further.
Re: [internet sensor] speedtest.net measures
Posted: Sunday 20 November 2016 15:50
by multinet
Hello
I've just installed : jq & speedtest (node was already installed
I get speedtest.zip on github and unzip it in a personnal directory
I've changed the speedtest variable in script to use my directory
When I run manually the script I get this error :
root@domoticz:/home/pi/domoticz/scripts/personnels# ./speedtest.sh
module.js:327
throw err;
^
Error: Cannot find module 'meow'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/pi/domoticz/scripts/personnels/speedtest/cli.js:4:12)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
HTTP/1.1 200 OK
Content-Length: 53
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache
Pragma: no-cache
Access-Control-Allow-Origin: *
{
"status" : "OK",
"title" : "Update Device"
}
HTTP/1.1 200 OK
Content-Length: 24
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache
Pragma: no-cache
Access-Control-Allow-Origin: *
{
"status" : "ERR"
}
HTTP/1.1 200 OK
Content-Length: 24
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache
Pragma: no-cache
Access-Control-Allow-Origin: *
{
"status" : "ERR"
}
Any help ?
here is my speedtest.sh
Code: Select all
root@domoticz:/home/pi/domoticz/scripts/personnels# cat speedtest.sh
#!/bin/bash
# File: broadband.sh
# Check your internet connection using speedtest.net
# Version 0.2 || Last Update: 15 May 2016
#speedtest=`node /opt/node-v5.10.1-linux-armv7l/lib/node_modules/speed-test/cli.js --json | jq '.'`
speedtest=`node /home/pi/domoticz/scripts/personnels/speedtest/cli.js --json | jq '.'`
echo $speedtest
ping=`echo $speedtest|cut -f1 -d","|cut -f2 -d":"|cut -f1 -d"}"| tr -d ' '`
downstream=`echo $speedtest|cut -f2 -d","|cut -f2 -d":"|cut -f1 -d"}"| tr -d ' '`
upstream=`echo $speedtest|cut -f3 -d","|cut -f2 -d":"|cut -f1 -d"}"| tr -d ' '`
#Vars
domoip=192.168.1.142
domoport=8080
ping_idx=392
downstream=393
upstream=394
# debug
# echo $speedtest
# echo $ping
# echo $downstream
# echo $upstream
## ======= No Edit required below line ===========
curl -s -i -H "Accept: application/json" "http://$domoip:$domoport/json.htm?type=command¶m=udevice&idx=$ping_idx&nvalue=0&svalue=$ping"
curl -s -i -H "Accept: application/json" "http://$domoip:$domoport/json.htm?type=command¶m=udevice&idx=$downstream_idx&nvalue=0&svalue=$downstream"
curl -s -i -H "Accept: application/json" "http://$domoip:$domoport/json.htm?type=command¶m=udevice&idx=$upstream_idx&nvalue=0&svalue=$upstream"
Thanks a lot
Multinet
korniza wrote:I created a virtual sensor as Custom sensor but it is just for one of the values (for example downstream). I like to combine all 3 values to 1 custom sensor.
I build the following broadbash.sh script and placed inside domoticz/script folder
Script requirements:
node
speedtest
Jq installed as described on link
You need to change the directory where cli.js is installed.
Also require to get the correct idx for the custom sensors you created as gizmocuz described.
Code: Select all
#!/bin/bash
# File: broadband.sh
# Check your internet connection using speedtest.net
# Version 0.2 || Last Update: 15 May 2016
speedtest=`node /opt/node-v5.10.1-linux-armv7l/lib/node_modules/speed-test/cli.js --json | jq '.'`
echo $speedtest
ping=`echo $speedtest|cut -f1 -d","|cut -f2 -d":"|cut -f1 -d"}"| tr -d ' '`
downstream=`echo $speedtest|cut -f2 -d","|cut -f2 -d":"|cut -f1 -d"}"| tr -d ' '`
upstream=`echo $speedtest|cut -f3 -d","|cut -f2 -d":"|cut -f1 -d"}"| tr -d ' '`
#Vars
domoip=xxx.xxx.xxx.xxx
domoport=8080
ping_idx= xx
downstream= xx
upstream= xx
# debug
# echo $speedtest
# echo $ping
# echo $downstream
# echo $upstream
## ======= No Edit required below line ===========
curl -s -i -H "Accept: application/json" "http://$domoip:$domoport/json.htm?type=command¶m=udevice&idx=$ping_idx&nvalue=0&svalue=$ping"
curl -s -i -H "Accept: application/json" "http://$domoip:$domoport/json.htm?type=command¶m=udevice&idx=$downstream_idx&nvalue=0&svalue=$downstream"
curl -s -i -H "Accept: application/json" "http://$domoip:$domoport/json.htm?type=command¶m=udevice&idx=$upstream_idx&nvalue=0&svalue=$upstream"
Also it required to get a cron job to your system. Remember that is use your internet banwidth, so I suggest a 15 minutes update or longer.
Code: Select all
*/15 * * * * root /home/pi/domoticz/scripts/broadband.sh
Re: [internet sensor] speedtest.net measures
Posted: Saturday 18 January 2020 13:37
by manjh
gizmocuz wrote: ↑Sunday 15 May 2016 12:06
Yes, add the 'Dummy' hardware, then press the button 'Create virtual sensor', and choose 'Custom Sensor' as type
Problem with the custom virtual sensor is: it is not transmitted as a shared device.
I want to run the speedtest in a remote location, and keep track of it in my central Domoticz...
Is there any other device that I could use?
Re: [internet sensor] speedtest.net measures
Posted: Saturday 18 January 2020 15:05
by FireWizard
Hi
manjh wrote
Problem with the custom virtual sensor is: it is not transmitted as a shared device.
I want to run the speedtest in a remote location, and keep track of it in my central Domoticz...
Is there any other device that I could use?
You should use the same devices for Ping, Download and Upload.
If you do not need Domoticz at that remote location for other purposes as only for a speed test, you do not have to install Domoticz as a remote server.
You can use MQTT and maybe you have already installed Mosquitto and Node Red.
If not install it. Various guidelines are available. If you need more info, please ask.
Install:
https://github.com/hobbyquaker/speedtest2mqtt
Send the data to your Mosquitto broker and convert it with Node Red and send the data to Domoticz.
An alternative is this one:
https://github.com/SvenFestersen/speedtest-mqtt
Regards
Re: [internet sensor] speedtest.net measures
Posted: Monday 30 March 2020 20:53
by NLToontje
I'm happy this topic is still alive after so many years
Now, I was looking for something like this, but not exactly the same.
I was looking for a possibility to read the actual up- and download bandwidth from my Cisco router by SNMP using Domoticz. So, not the max. up and download speed as tested by this script, but the real network utilisation.
I know tools like Cacti can create the graphs I'm looking for, but I have Domoticz running (and not Cacti).
So, does anybody know if it is possible to monitor a Cisco device by SNMP with Domoticz and add it to the Domoticz dash showing graphs with the actual used bandwidth over time?
Google doesn't give much info here.......
Re: [internet sensor] speedtest.net measures
Posted: Thursday 24 August 2023 20:26
by benedict
NLToontje wrote: ↑Monday 30 March 2020 20:53
I was looking for a possibility to read the actual up- and download bandwidth from my Cisco router by SNMP using Domoticz. So, not the max. up and download speed as tested by this script, but the real network utilisation.
I know tools like Cacti can create the graphs I'm looking for, but I have Domoticz running (and not Cacti).
So, does anybody know if it is possible to monitor a Cisco device by SNMP with Domoticz and add it to the Domoticz dash showing graphs with the actual used bandwidth over time?
Google doesn't give much info here.......
I'm looking for the same thing. Did you find something to show the actual data/traffic usage per day, week, month? I.e. find out what the total data transferred to/from the internet would be. It's remarkable how few tools calculate this, while it's the most important marker these days. We all pay for it, not for the speeds we get, but for the data we transfer within x time.