Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1] 2 3 4

Author Topic: Using DSLstats to detect line errors and force line to resync.  (Read 10059 times)

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Using DSLstats to detect line errors and force line to resync.
« on: December 28, 2017, 08:11:25 PM »

Admin note - topic split from original thread here

can't you automate that with dslstats?


Was able to stop it using the following commands rather than a modem power cycle.

adsl connection --down
adsl connection --up


OK looking for suggestions here please.

Whatever it is happens daily.   It will always be in the morning - anytime between 8am and mid-day, but not at a set time so that using a timer to reboot the modem wouldn't be of help.

I also now have quite a lot of Smart Home equipment which relies on the modem and/or wifi being up, so manually turning the modem off if I'm out for the day is no longer ideal.  eg recent examples
1) Didn't realise until walking into a cold house, when in theory Hive would have either (a) detected I was on the way home and started warming the house or (b) I could have turned it on via my mobile phone.
2) Although still havent got a bulb to fit the porch light, as long as the router is on, I can still get either Hive or a TP-link plug to turn on one of the other lights before I enter.


I think I need some sort of automated script that would detect if the CRCs exceed 10k for more than 5 mins then get the modem to carry out the above commands.
One very important consideration though - it must not loop repeatedly just in case on the off-chance a modem reset doesn't clear and I then end up with a far worse situation of banding rather than INP.


----
ETA screen cap from MDWS to show what happens.   From this you can see the CRC spike each day, and also how on occasion it gets stuck, which in turns causes the Err Secs to attract the attention of DLM.
« Last Edit: January 12, 2018, 02:29:53 PM by kitz »
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

NewtronStar

  • Kitizen
  • ****
  • Posts: 4898
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #1 on: December 29, 2017, 12:36:46 AM »

I would look for a script that says if errored seconds are => than 2000 then adsl connection --down
adsl connection -up you don't want the errored seconds to go above 2880 ES threshold for the Speed profile.
Logged

burakkucat

  • Respected
  • Senior Kitizen
  • *
  • Posts: 38300
  • Over the Rainbow Bridge
    • The ELRepo Project
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #2 on: December 29, 2017, 01:10:01 AM »

if errored seconds are => than 2000
  • Are you suggesting the absolute value since the link was established?
  • The delta between two consecutive data harvests expressed as "per minute"?
  • Or something completely different?
Logged
:cat:  100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

Please consider making a donation to support the running of this site.

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #3 on: December 29, 2017, 01:33:18 AM »

If Err Secs > 2000 could be dangerous, as that could commence a constant resync loop and result in banding.  :(


I had been looking at the warning options from within DSLstats (see below).

Err/Secs per hour could be a bit too late.... and it certainly would have been for the last episode.
CRC's are usually the first and most noticeable sign when it sticks.   Problem there being that it can hit 10k CRCs, but then recover soon after.   

It will have to be something like if last 5 or 10 min CRCs are each more than 10k then send command to modem.

This isn't something that there will be any script out there anywhere on the Internet for.   
DSLstats could probably detect this, and can email a warning...  but its then how to get that info to send the command to the modem.
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #4 on: December 29, 2017, 02:51:29 AM »

Just set up email alerts and hit another snag.   At first I thought it wasn't working, then I realised that something I run to help prevent spam doesn't much like the fact that there is no date in the email sent field despite adding the address to safe sender list.
 
No date means it always goes to the bottom of the pile and when you get as much mail as I do, then unless Ive just downloaded mail from the server, there's a good chance I wont see it. :(

Quote
DSLstats alert
me@myemail.com
Sent: None
To me@myemail.com
Test alert
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

Chrysalis

  • Content Team
  • Addicted Kitizen
  • *
  • Posts: 7382
  • VM Gig1 - AAISP L2TP
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #5 on: December 29, 2017, 05:22:01 AM »

Request to Eric then I guess?  I have email alerts which is how I was aware of my burst.

Here is what I configured.

SNRM below 2db, send alert.
ES/hour rises above 300 send alert.
Resync occurred send alert.

Given I usually get less than 300 ES/day tho the avg hourly rate for me is barely 10 per hour so I could probably set much lower to something like 50/hour to get more advanced warnings of problems.

These emails are not treated high priority by me tho, so dont goto my phone, so I keep 300 and it serves to inform probably after the event when I eventually check email something has happened.
Logged

d2d4j

  • Kitizen
  • ****
  • Posts: 1103
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #6 on: December 29, 2017, 09:42:34 AM »

Hi kitz

I hope you don’t mind but following this thread, I think you would always run the risk of a loop

I might simply suggest just to have 2 cron (schedule) jobs, first to stop adsl and the second to start adsl.

I would have these run after a known time when any issues are over so say 12.30 each day, with the first to run at 12.30.30 and the second to start 5 minutes later 12.35.30

You would have a 5 minute break in broadband but no risk of looping causing banding

You would have to make it a time when dslstats is not connecting to modem which is why I showed 30 seconds past the minute

I could be entirely wrong though, so apologies in advance

Many thanks

John
Logged

roseway

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 43432
  • Penguins CAN fly
    • DSLstats
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #7 on: December 29, 2017, 10:14:39 AM »

Quote
Request to Eric then I guess?

Yes, noted. I'll look at this ASAP, but it won't be immediate, I'm afraid.
Logged
  Eric

NewtronStar

  • Kitizen
  • ****
  • Posts: 4898
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #8 on: December 29, 2017, 09:45:14 PM »

If Err Secs > 2000 could be dangerous, as that could commence a constant resync loop and result in banding.  :(

Then if Err Secs > 2000 then adsl connection --down so modem is awaiting for end-user to manually send the command adsl connection --up once they arrive back home this would stop the loop of death your worried about if I'm right you would need 20 retrains in 24 hours on the speed profile to become banded by DLM.
Logged

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #9 on: December 30, 2017, 03:00:05 AM »

I hope you don’t mind but following this thread, I think you would always run the risk of a loop

Not at all - all suggestions appreciated.   Yes I agree 2 separate commands would be best.  There would presumably have to be some sort of delay to let the modem come down before issuing the up command.

I so wish it was the same time each day, but I've seen it occur anything from between 7.30 up until mid-day. Therefore your suggestion of 12:30 makes sense.   

Except...  if whatever causes it happened before 10am then I'm stuffed.   As per the graph, Err Secs went from practically 0 at 10am to >13k by 2:30pm.
It only needs 1-2 hrs unnoticed before it will trigger DLM.    If I knew what time it was going to happen I could either use a timer plug or control it from my phone using a smart plug. 

I've racked my brains for months how best to approach it and from watching line behaviour think something like

Code: [Select]
If (5 consecutive mins of CRCs > 10k) {
   adsl --down;
   Wait 10 mins;
   adsl --up; }

This should then ensure no looping.   But tbh I think its wishful thinking because thats the bit I don't know how can be done.
I can get DSL stats to inform me if CRCs are > 10k per min.    Therefore if I get 5 of those emails in a row I know the line is freaking out.
The next problem is doing something automated with that information...  so back to

Quote
I think I need some sort of automated script that would detect if the CRCs exceed 10k for more than 5 mins then get the modem to carry out the above commands.

The automated script problem I think would still exist even if it was Err/Secs.  :( 
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #10 on: December 30, 2017, 03:00:34 AM »

Yes, noted. I'll look at this ASAP, but it won't be immediate, I'm afraid.

Thank you muchly :)
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #11 on: December 30, 2017, 03:25:49 AM »

Then if Err Secs > 2000 then adsl connection --down so modem is awaiting for end-user to manually send the command adsl connection --up once they arrive back home this would stop the loop of death your worried about if I'm right you would need 20 retrains in 24 hours on the speed profile to become banded by DLM.


Thanks NS, but would like it to come back up for the following reasons.

1) As mentioned above because of Smart Home equipment. 
  - Alexa voice commands don't work without Internet connection.
  - Can't remote control lighting and heating from phone from an outside network or using mobile phone unless modem is up.
  - Location services wont work - although Ive not yet tried this, the app is capable of automatically detecting you are 'x' miles from home and auto turn on the heating to your desired temp for when you get home.



2) Leaving the router turned off for 'x' hours after getting 2000 Err/Secs would be exceedingly risky and likely to result in DLM taking action.  DLM doesnt work on a straight forward number of errors per day.  It uses MTBE (Mean Time between errors) of 30 for Speed profile. The 2880 figure is based on the modem being up for a full 24hrs. Switching the router off for 'x' hours reduces this trigger figure proportionately.  Best action is rebooting modem and getting it back to normal asap to balance for full day MTBE.

3) If err secs >2000...  as b*cat has already mentioned what timescale. If its per day, then the modem still stand the probability of looping. If DSLstats has already recorded 2000 so far that day as the figure would be >2000 for the remainder of the day.

Retrains work in same way.  Whilst it may be 20 per full day,  DLM actually works on MTBR of 4200, so any long period downtime is going to reduce the trigger.


 
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

d2d4j

  • Kitizen
  • ****
  • Posts: 1103
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #12 on: December 30, 2017, 10:10:59 AM »

Hi kitz

Many thanks

As a short term fix, you could schedule each hour to cover the period and dlm should not take action

You could use ns to bring down and run a startup schedule say every 15 minutes (based on startup adsl should fail if adsl already up)

I know it’s not ideal, but a short term fix until better is created

It’s just a thought and if you want, I’ll post up a vbs script for you to stop start adsl.

Many thanks

John
Logged

d2d4j

  • Kitizen
  • ****
  • Posts: 1103
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #13 on: December 30, 2017, 10:56:45 AM »

Hi

Sorry, I thought I would show my telnet script in case anyone wanted to use/adapt it

You need to change x.x.x.x with your router IP address and username password with your your username password

If you want 2 scripts to stop and start, just delete the entries accordingly and save

Save the file as yourfilename.vbs

This script is based on windows, Linux is easier but not created a Linux script

You can adjust the wait times

Many thanks

John

set WshShell = WScript.CreateObject("WScript.Shell")
 
WshShell.run"telnet.exe x.x.x.x"
 
WScript.Sleep 100
'WshShell.SendKeys"telnet x.x.x.x"
'WshShell.SendKeys("{Enter}")
WScript.Sleep 100
'write the user name to the cmd window
WshShell.SendKeys"Username"
WshShell.SendKeys("{Enter}")
WScript.Sleep 100
'write the password to the cmd window
WshShell.SendKeys"Password"
WshShell.SendKeys("{Enter}")
WScript.Sleep 100
WshShell.SendKeys"show adsl"
WshShell.SendKeys("{Enter}")
WshShell.SendKeys"adsl connection --down"
WshShell.SendKeys("{Enter}")
WScript.Sleep 100000
WshShell.SendKeys"adsl connection --up"
WshShell.SendKeys("{Enter}")
WshShell.SendKeys"quit"
WshShell.SendKeys("{Enter}")
 
Logged

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: Using DSLstats to detect line errors and force line to resync.
« Reply #14 on: December 30, 2017, 11:13:34 AM »

Code: [Select]
set WshShell = WScript.CreateObject("WScript.Shell")
 
WshShell.run"telnet.exe x.x.x.x"
 
WScript.Sleep 100
'WshShell.SendKeys"telnet x.x.x.x"
'WshShell.SendKeys("{Enter}")
WScript.Sleep 100
'write the user name to the cmd window
WshShell.SendKeys"Username"
WshShell.SendKeys("{Enter}")
WScript.Sleep 100
'write the password to the cmd window
WshShell.SendKeys"Password"
WshShell.SendKeys("{Enter}")
WScript.Sleep 100
WshShell.SendKeys"show adsl"
WshShell.SendKeys("{Enter}")
WshShell.SendKeys"adsl connection --down"
WshShell.SendKeys("{Enter}")
WScript.Sleep 100000
WshShell.SendKeys"adsl connection --up"
WshShell.SendKeys("{Enter}")
WshShell.SendKeys"quit"
WshShell.SendKeys("{Enter}")

Thank you so much for that. <3    Yes that would work if I scheduled it to run each hour between 9am and 1pm.  So 5 resyncs.
Looking back it mostly happens between 8:30 and 11:30 and there's only been a couple of times ever that its been before and after that, neither which have stuck. 
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker
Pages: [1] 2 3 4