How to monitor your internet connection with virtual custom sensors
Moderator: leecollings
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: monitor internet connection with virtual sensors
@Derik:
I realised the package has different names, and maybe its even added in the latest distro's only, I don't know.
@hourly runs every xx:00 if I recall correctly, not sure though.
Glad your're happy with it
I realised the package has different names, and maybe its even added in the latest distro's only, I don't know.
@hourly runs every xx:00 if I recall correctly, not sure though.
Glad your're happy with it
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: monitor internet connection with virtual sensors
emme wrote:low ping means fast response.... so it's good
high ping means slow response... that' bad
Watch out the unit: normally it's ms-->milliseconds
Thanks
What's a normal/good ping?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: monitor internet connection with virtual sensors
The lower the better. Here's my graph, lowest I got was 25'ish (on cablemodem)
I eventually found out my problem so, the very high pings are either other stuff that's going on (downloading stuff with sabnzbd full throttle) or my connection with my cable modem and switch flappy (probably the auto-negiotation about duplex / speed etc going haywire). Still have to fix that, but TP-link doesn't offer a lot of Mac-software to manage stuff
regards!
I eventually found out my problem so, the very high pings are either other stuff that's going on (downloading stuff with sabnzbd full throttle) or my connection with my cable modem and switch flappy (probably the auto-negiotation about duplex / speed etc going haywire). Still have to fix that, but TP-link doesn't offer a lot of Mac-software to manage stuff
regards!
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: monitor internet connection with virtual sensors
mmm
Hope this "garbage " give no trouble... I mean the Json files
Or i there something that i do wrong ...
This going to kill my sd ...[ after a few months .]
Hope this "garbage " give no trouble... I mean the Json files
Or i there something that i do wrong ...
This going to kill my sd ...[ after a few months .]
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: monitor internet connection with virtual sensors
hmm i have the same thing, even with the 'wget -q' and redirect to /dev/null etc. weird. gotto look into that.
somewhat reassuring, I think I'm using my SSD for about 2 years now with a lot of scripting, testing, trial and error, etc and it's still fine.
somewhat reassuring, I think I'm using my SSD for about 2 years now with a lot of scripting, testing, trial and error, etc and it's still fine.
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: monitor internet connection with virtual sensors
safi78 wrote:hmm i have the same thing, even with the 'wget -q' and redirect to /dev/null etc. weird. gotto look into that.
somewhat reassuring, I think I'm using my SSD for about 2 years now with a lot of scripting, testing, trial and error, etc and it's still fine.
Ok like to hear from you when you think you have a solution, i will test
My sd is stable ony this stuff is not the best option in that place...
When domoticz kills... some people here @ home get nervous..
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: monitor internet connection with virtual sensors
backup, backup backup
Anyway, you can always create a 'ram-drive' to redirect this stuff to? Saves you disk-trashing
Anyway, you can always create a 'ram-drive' to redirect this stuff to? Saves you disk-trashing
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: monitor internet connection with virtual sensors
Backup is not the problem....safi78 wrote:backup, backup backup
Anyway, you can always create a 'ram-drive' to redirect this stuff to? Saves you disk-trashing
Code: Select all
0 1 * * * sudo ~/domoticz/scripts/domoticz_backup.sh
5 1 * * 6 sudo ~/domoticz/scripts/scripts_backup.sh
10 1 * * 6 sudo ~/domoticz/scripts/domoticz_map_backup.sh
1 1 1 * * sudo ~/domoticz/scripts/raspberry_backup.sh
And Domoticz is going so fast that i do not every time how anything is working..
1 person says to me... when you can hold your card clean why don;t you do that
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 13
- Joined: Thursday 08 August 2013 22:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: monitor internet connection with virtual sensors
Try this:
curl -s -i -H "Accept: application/json" "http://$host:$port/json.htm?type=command¶m=udevice&idx=$idxdl&svalue=$download"
curl -s -i -H "Accept: application/json" "http://$host:$port/json.htm?type=command¶m=udevice&idx=$idxul&svalue=$upload"
curl -s -i -H "Accept: application/json" "http://$host:$port/json.htm?type=command¶m=udevice&idx=$idxpng&svalue=$png"
this will not add files
curl -s -i -H "Accept: application/json" "http://$host:$port/json.htm?type=command¶m=udevice&idx=$idxdl&svalue=$download"
curl -s -i -H "Accept: application/json" "http://$host:$port/json.htm?type=command¶m=udevice&idx=$idxul&svalue=$upload"
curl -s -i -H "Accept: application/json" "http://$host:$port/json.htm?type=command¶m=udevice&idx=$idxpng&svalue=$png"
this will not add files
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: monitor internet connection with virtual sensors
do i need to replace this.. or add?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: monitor internet connection with virtual sensors
@Derik: I've been running beta since the beginning, never had any problems. A quick reinstall, yes, but restoring the db / scripts etc gets me up-and-running in an hour.
And, I see you are Dutch as well, so you can have a new SSD within 24 hours with BOL or CoolBlue
@geho: Thanks a bundle! Added to original post.
And, I see you are Dutch as well, so you can have a new SSD within 24 hours with BOL or CoolBlue
@geho: Thanks a bundle! Added to original post.
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: monitor internet connection with virtual sensors
Code: Select all
pi@raspberrypi ~/domoticz/scripts $ ./speedtest.sh
ping = 37.035 ms
download = 33.04 Mbps
upload = 9.32 Mbps
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"
}
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"
}
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: monitor internet connection with virtual sensors
Works fine here. What did you put in your script?
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: monitor internet connection with virtual sensors
Code: Select all
#!/bin/bash
#setup
host=192.168.5.75
port=8081
username=LOGIN
password=WW
pingidx=4427
downloadidx=4426
uploadidx=4425
# no need to edit
speedtest-cli --simple > output.txt
ping=$(cat output.txt | sed -ne 's/^Ping: \([0-9]*\.[0-9]*\).*/\1/p')
download=$(cat output.txt | sed -ne 's/^Download: \([0-9]*\.[0-9]*\).*/\1/p')
upload=$(cat output.txt | sed -ne 's/^Upload: \([0-9]*\.[0-9]*\).*/\1/p')
#output if you run it manually
echo "ping = $ping ms"
echo "download = $download Mbps"
echo "upload = $upload Mbps"
curl -s -i -H "Accept: application/json" "http://$host:$port/json.htm?type=command¶m=udevice&idx=$idxdl&svalue=$download"
curl -s -i -H "Accept: application/json" "http://$host:$port/json.htm?type=command¶m=udevice&idx=$idxul&svalue=$upload"
curl -s -i -H "Accept: application/json" "http://$host:$port/json.htm?type=command¶m=udevice&idx=$idxpng&svalue=$png"
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: monitor internet connection with virtual sensors
Not sure, but didn't you forget the $username & $password like so:
?
Code: Select all
curl -s -i -H "Accept: application/json" "http://$username:$password@$host:$port/json.htm?type=command¶m=udevice&idx=$pingidx&svalue=$ping"
curl -s -i -H "Accept: application/json" "http://$username:$password@$host:$port/json.htm?type=command¶m=udevice&idx=$downloadidx&svalue=$download"
curl -s -i -H "Accept: application/json" "http://$username:$password@$host:$port/json.htm?type=command¶m=udevice&idx=$uploadidx&svalue=$upload"
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: monitor internet connection with virtual sensors
And seriously, do you have like 4000+ devices in your domoticz history?
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: monitor internet connection with virtual sensors
Dear Safi,
looks working @ my crontab time.. without garbage in my sd.. [ love your great work ]
See tomorrow, how his is working
And yes my history is real great.... the reason my complicated Zwave network....
did open new sensors for long time to see my new devices.
Then i delete them all, when i get my new devices..
Did this servile times.....
And Domoticz is still counting...
Only working like a rocket....
Thanks!!
looks working @ my crontab time.. without garbage in my sd.. [ love your great work ]
See tomorrow, how his is working
And yes my history is real great.... the reason my complicated Zwave network....
did open new sensors for long time to see my new devices.
Then i delete them all, when i get my new devices..
Did this servile times.....
And Domoticz is still counting...
Only working like a rocket....
Thanks!!
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: monitor internet connection with virtual sensors
Thanks again
Works great without garbage
Works great without garbage
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: monitor internet download speed with virtual sensor
I installed it and ran an admin-cmd. But PIP is not recognized as command or program...jumbotroll wrote:On windows 10 it's working here.manjh wrote:This is great for the R-Pi, but is there an alternative for a Windows based server?
Install python 3.5.2 from https://www.python.org/downloads/
Open cmd as Administrator and type: pip install speedtest-cli
Then you can type: speedtest
In which directory does Python install? I can't find anything that looks recognizable!
Edit: never mind, I found the directory and was able to install the speedtest package, and run the speedtest manually.
Thanks!
Last edited by manjh on Monday 24 October 2016 21:47, edited 1 time in total.
Hans
Who is online
Users browsing this forum: No registered users and 1 guest