Kitz Forum

Broadband Related => Router Monitoring Software => Topic started by: snadge on October 08, 2012, 09:23:10 PM

Title: HG612 SNRM Tweaking Script (ADSL)
Post by: snadge on October 08, 2012, 09:23:10 PM
Huawei Echolife HG612 Noise Margin Tweaking Script (ADSL)

by

Snadge with support from Bald_Eagle

Current Version: v1.04

DOWNLOAD:
http://www.mediafire.com/?t6a21c3j3u0itle

NEW: Now displays sync & SNRM before AND after... :)


This is a new script worked on by me with some help from Bald_Eagle, it only works with ADSL1/2/2+ connections because VDSL Target SNRM is locked. This will telnet into the HG612 and set the SNRM respective to whatever value you put in, and now since version 1.03 displays the result 60 seconds later..

the typical logarithmic values are:-

Value / Effect
65450    -12 dB
65500    -9 dB
1    -5.5 dB
50    -3 dB
100    0 dB
150    +3 dB
200    +6 dB


NOTE: I have used values such as 25, 30, 35, 40, 70, 80, 90 & 110 - so one can try those or other values too (such as getting more or less than a 3db reduction) - I've tried 110 before and got 7.7db from my 7db Target SRNM, have a play around and see what you can get.

Currently for my 7db Target Noise Margin (Sky Broadband) a value of 30 gets me a 3db Noise Margin, those on 6db Target Noise Margins should be able to get 3db with 50 - every modem and line is different, because of this it means you may have to test the water first, some may need to go slightly higher or lower to get the same result.

This script works assuming that you have not changed the IP Address and its still 192.168.1.1, if you have then edit the code in the .bat file to match your IP (right-click on .bat file and choose 'EDIT')

I am hoping to develop this script further - maybe work with other routers / IP Addresses (which would require more user input) or making it with some form of GUI.

this is my first real go at writing scripts and I hope to 'learn' more which will enable me to 'do' more, well, its actually my 3rd script but first one that that proved to have any difficulty creating - my first one was a simple pinging script for HRping and second was two scripts that launched Avast service & tray icon and terminated both for a one click solution to launch and kill Avast (as I only use it during installations), relatively easy in comparison.

Use the download link above. :)

could do with some feedback as currently Ive only tested it on Windows XP Home

SCREENSHOT OF ME ACTUALLY RAISING MY NOISE MARGIN AS IT WAS TOO LOW:

(https://forum.kitz.co.uk/proxy.php?request=http%3A%2F%2Fgoo.gl%2FPEqkC&hash=368a5c14f9f3604a7192cf1033136cfa0d5aa10e)
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: Ixel on October 09, 2012, 01:07:09 AM
...

Nice, but I would like to add that it's not fully conclusive that the target SNRM is locked at the MSAN, in my personal opinion the HG612's --snr parameter just simply doesn't support being adjusted on VDSLx connections (based on my brief testing and proof submitted in my own thread about the FritzBox 7390). Furthermore, if you do 'xdslcmd info --cfg' I find the following exists:
adslTrainingMarginQ4: -1
adslShowtimeMarginQ4: -1

However, there's no mention of a vdslTrainingMarginQ4 or vdslShowtimeMarginQ4. I'm not sure but I'm guessing if you use --snr then the -1's get changed to something else depending on what you set, given -1 is the default setting. If the HG612 was able to adjust the target SNRM on VDSLx connections I'd expect a vdsl variant of the parameter, or at least for it to be called something like 'dslTrainingMarginQ4' rather than specifically being 'adsl...'. Well, that's my input.

Nice script.
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: roseway on October 09, 2012, 10:46:36 AM
Not being a Windows user, I'm unable to test this script, but I hope you'll forgive me for making a slightly pedantic point.

It's not correct to describe what the script does as setting a percentage value for the SNR margin. SNRM is measured in decibels, which are logarithmic values, and you can't take percentages of logarithmic values because this has no mathematical meaning. What the command xdslcmd configure --snr N actually does is to add or subtract a certain number of dB relative to the target set in the exchange. So if your target is currently 9 dB (say) and you set N to 50, this will reduce the target to 6 dB. If you set N to 1 (the smallest value officially supported) then the target is reduced by nearly 6 dB. You can see a table of approximate values here. (http://wiki.kitz.co.uk/index.php?title=Broadcom_CLI#adsl_command)
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: snadge on October 09, 2012, 04:07:54 PM
@ Eric - it seems to work in a similar way , as 100 = -/+0db and 200 = +100% and 50 =-50%

I have used figures such as 30, 35, 40, 50, 80, 90 and I get results close to the percentage, the only reason I thought it wasnt dead on was because the MSAN/Router doesnt always get it right on as depends on changes in noise since execution of command and actual initialization of sync?? just a guess...

these values below seem to imply that one cant use anything else BUT these values, and thats not true..

65450    -12 dB
65500    -9 dB
1    -5.5 dB
50    -3 dB
100    0 dB
150    +3 dB
200    +6 dB

I will edited the script to include this
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: roseway on October 09, 2012, 04:34:25 PM
@ Eric - it seems to work in a similar way , as 100 = -/+0db and 200 = +100% and 50 =-50%

That only applies if you're starting from a target SNR margin of 6 dB. If your target which is set in the exchange is anything else, the percentages don't work out.

Quote
I have used figures such as 30, 35, 40, 50, 80, 90 and I get results close to the percentage, the only reason I thought it wasnt dead on was because the MSAN/Router doesnt always get it right on as depends on changes in noise since execution of command and actual initialization of sync?? just a guess...

If you start from a target of 6 dB, the middling ranges of possible values look like percentages, but if you take a value of 1, for example, the result is nothing like 1%.

Quote
these values below seem to imply that one cant use anything else BUT these values, and thats not true..

65450    -12 dB
65500    -9 dB
1    -5.5 dB
50    -3 dB
100    0 dB
150    +3 dB
200    +6 dB

Sorry if the table gave that impression. They were just example values. I'll look at improving the wording. (As it happens, I have an outstanding task to improve that section anyway, following on some comments made by b*cat.)

Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: GigabitEthernet on October 09, 2012, 05:00:12 PM
As I understand it, every 50% of the adslctl configure --SNR N command equates to 3dB of SNRM.
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: GigabitEthernet on October 09, 2012, 09:08:23 PM
Sorry to be pedantic, but there is a small gramatical error in the script. It should be to rather than too.
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: snadge on October 09, 2012, 10:05:07 PM
cheers - all feedback welcome - please bear in mind the script is offline at moment because its not truly operable on its own, if you have monitoring scripts installed then it will work... I need to include plink & sleep and busy working on that now

sorry about that - first time coder etc..lol

should have it fixed in next hour or so

one can defo use other figures, but as Eric points out it depends on what the ISP has set the TSNRM too as to what result one will get.. mine has only ever been 6db (o2) or 7db (sky) so can only go off my own experiences... on my 7db SNRM I have to use 30 to get it down to 3db, its never dead on, theres always some slight difference each time you try same number.
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: snadge on October 09, 2012, 10:32:44 PM
OK its back up ...

changed the instructions to match what Eric says.
cleaned up code
cleaned up license folder
fixed it so it really does work on its own


thanks to Bald_Eagle for his help on that last bit :)


edit: also, i recall using a value of 110 on my Netgear DG834N and my resulting SNRM was 7.7db, this does seem to give some strength to the whole 'percentage' thing, infact im gunna try it now...
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: snadge on October 11, 2012, 10:00:54 AM
managed to get 19.1Mb sync with 3db this morning, quite happy with that if CRC,ES + RSCorr remains low (value used was 29 - Target margin is 7db)
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: snadge on October 11, 2012, 11:42:08 AM
ok..

Today Iam going to be working on the script, Iam hoping to try and keep it logged in awaiting the result and then it tell you the new sync speed...
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: snadge on October 11, 2012, 02:38:41 PM
ok I have managed to pull this off and ive managed to make a few other changes such as window size, text color, instructions...etc you enter your value and wait 60 seconds for the result to be displayed... :)
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: snadge on October 14, 2012, 11:00:02 PM
NEW: VERSION 1.04

thanks to Mr Eagle we now have a tidier window and it also shows before and after shots of Up/Down Sync & SNRM only (no other jargon)

screeny of me actually raising my SNRM as it was too low:

(https://forum.kitz.co.uk/proxy.php?request=http%3A%2F%2Fgoo.gl%2FPEqkC&hash=368a5c14f9f3604a7192cf1033136cfa0d5aa10e)
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: les-70 on February 03, 2013, 10:40:50 AM
  I have not been able to get this working on a HG622.  The data$$ file ends up with the output below.  I tried some edits of the bat file but with no luck. Please can anyone make suggestion on fixing it?  Also can anyone else with a HG622 try it.

-------------------------------
-----Welcome to ATP Cli------
-------------------------------

Login: admin
Password:
Login incorrect. Try again.

Login:
Login incorrect!

Login: admin
Password:
Login incorrect. Try again.

Login:
Login incorrect!
......................etc
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: roseway on February 03, 2013, 10:57:51 AM
Are you entering the right password ('admin')? Even if you've changed the password in the web interface, this doesn't change the password for telnet login.
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: les-70 on February 03, 2013, 11:08:42 AM
 The username and password are admin and admin.  I have only changed the IP address  but I edited the script to match that.  Looking at the output in data$$ I seem to be sending extra "returns" to the router.  The two inputs of admin get there but both end up being seen as user names. 
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: rhohne on February 03, 2013, 01:33:48 PM
The username and password are admin and admin.

What line endings are you using? Looks like you are using DOS style endings instead of UNIX style. The extra character in the DOS style is enough to muck things up.

Edit: Also ensure that the login files do not contain multiple line endings, for some reason the ones supplied end with <cr><lf><cr><lf>
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: les-70 on February 03, 2013, 03:26:01 PM
 Your clearly correct and editing the 3 login files to have just cr endings gets it to log in and reach a shell.   I had just used the script and files as download and under Windows XP with only a needed IP address edit.  The script now gets the first set of stats,  however it then fails a bit further in.  I thought this would just run under Windows but apparently not.  I will see if I can see what the next problem is!
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: rhohne on February 03, 2013, 04:23:40 PM
If you manually try the command xdslcmd configure --snr XXX, how long is it before your line resyncs? The program assumes that it resyncs within 60 seconds.
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: les-70 on February 03, 2013, 04:45:05 PM
  It does resync within 60 seconds.  However the script hangs at the end of getting the info and does not get as far as trying that, it does not get to showing the stats before the resync.   At its end the data$$ file shows a  failure to log out from the ATP after the first info command.  I can't yet see why this happens. It should get a "byebye etc" judging by trying on telnet. 


Bitswap:   12855/12869      0/0

#
# exit
ATP>exit
Command failed.
ATP>
ATP>
Title: Re: HG612 SNRM Tweaking Script (ADSL)
Post by: les-70 on February 04, 2013, 04:37:23 PM
 I can report that the HG622 ATP level seems fussy over command file input terminations. Ensuring the login files used in the tweaking script have only a <cr> ending, and using a text file with the same <cr> only ending for the exit command as well, gets it working.  (Thanks rhohne)  A small edit is also needed pick up the sync speeds due to a change in the output style.