Kitz Forum

Broadband Related => Broadband Hardware => Topic started by: Weaver on September 15, 2018, 10:12:19 AM

Title: Causing a Resynch
Post by: Weaver on September 15, 2018, 10:12:19 AM
How can I conveniently cause a modem to resync? - from my bed. I had some trick once but I have forgotten.

Tools available:
Title: Re: Causing a Resynch
Post by: Ixel on September 15, 2018, 10:46:54 AM
The only method I can think of is via clueless. FireBrick won't cause a re-sync unless you can get it to telnet into one of the modems and issue the appropriate command. The only other alternative I can think of, since option 1 and 2 are unavailable, is to have a remote controlled power socket (something like this perhaps - https://www.amazon.co.uk/Energenie-Remote-Control-Sockets-Pack/dp/B004A7XGH8). Maybe not that specific one however since I've noticed some bad reviews on it. You could probably get something like it which connects to the local area network and can therefore be controlled via LAN or WAN, but those might be pricey.
Title: Re: Causing a Resynch
Post by: Weaver on September 15, 2018, 11:16:49 AM
@ixel very helpful - thank you very much indeed.

I forget how to do it via clueless though.

That remote mains switch is not for me, emits rf interference, nasty, and says you cannot use several next to one another. I might very well want to power-cycle individual modems, as opposed to the whole lot, and so that would mean having multiple units. And in any case, you say it has bad reviews.

Something that works over a LAN would be a viable option.

In any case though, the clueless method would be far better. I am not keen on power-cycling modems anyway since it takes them ages to come up, which is very annoying. Even when you just order them to reboot, using the appropriate command in the web admin ui, it takes an annoying amount of time and seems (unsurprisingly) no better than a cold boot. So presumably there is no difference due to performing vs not performing possible optional one-off hardware test sequences on cold boot only.
Title: Re: Causing a Resynch
Post by: j0hn on September 15, 2018, 12:07:27 PM
adsl connection --up

Will trigger a resync of the xDSL link.
You can bring it down, and then back up, by using

adsl connection --down
then
adsl connection --up

but I'm confident that 'adsl connection --up' on its own triggers a resync if already connected.
Title: Re: Causing a Resynch
Post by: Weaver on September 15, 2018, 01:25:06 PM
Unfortunately I have not worked out how to talk to the modems through the two obstacles in the way, as mentioned in my earlier post. But that would be a good tip, as it is bound to be miles faster than doing a reboot just to get the desired effect.
Title: Re: Causing a Resynch
Post by: Weaver on September 15, 2018, 01:28:21 PM
I said earlier that I had forgotten how to do the good thing via clueless. It seems to me though that triggering a target SNRM reset using clueless will make the link resynch - no? A bit too drastic though. I am trying to remember whether or not there is a better way.
Title: Re: Causing a Resynch
Post by: DaveC on September 15, 2018, 02:04:19 PM
I haven't tested it, but I've just looked on clueless for a BT ADSL line, and one of the options is "Kill (BT)".  The hover text (which I'm guessing you don't see from your ipad) says "Clear stuck session from BT end, causes resync".

Sounds like it's worth a try.

Also, I would be happy to give you a hand configuring your firebrick to give you access to your modems.
Title: Re: Causing a Resynch
Post by: jelv on September 15, 2018, 06:11:37 PM
If it were me I'd hit the button in Clueless that is labelled Reboot!  :P

I get to that by selecting the circuit and then in the Router section click Router Settings. Reboot is at the bottom of the page (the very last button).
Title: Re: Causing a Resynch
Post by: burakkucat on September 15, 2018, 06:33:49 PM
If it were me I'd hit the button in Clueless that is labelled Reboot!  :P

I get to that by selecting the circuit and then in the Router section click Router Settings. Reboot is at the bottom of the page (the very last button).

Surely that is a misnamed (and mislabelled) button? I would be very surprised if A&A allow end users to "reboot" A&A hardware. Perhaps the button should really be named (and labelled) as "circuit retrain" or "circuit resynchronise"?
Title: Re: Causing a Resynch
Post by: Weaver on September 15, 2018, 08:16:17 PM
@burakkucat - to clear up confusion, that will be for CPE, routers managed by Aa and it will presumably remotely control the CPE by TR-069.

I do not have any such thing in clueless though, I don’t have the devices set up as modem-routers, and I don’t modems managed by AA, even though I did buy one of my many units from them. Anyway, TR-069 will not work for me anyway as I have taken careful steps to prevent it being used. This is because I am using a custom firmware image in the modems, provided by our very own Johnson, and also I have a small number of per-modem configuration tweaks, setting ADSL2-only for one. So I do not want any chance of firmware updates being triggered remotely or anyone mucking about with the config.

But it is a shame not to have that facility.
Title: Re: Causing a Resynch
Post by: jelv on September 15, 2018, 09:40:16 PM
Surely that is a misnamed (and mislabelled) button?

Well how would you label a button that (using TR-069) makes the router reboot?
Title: Re: Causing a Resynch
Post by: burakkucat on September 15, 2018, 11:23:35 PM
Well how would you label a button that (using TR-069) makes the router reboot?

That functionality is not what Weaver requires, nor has in existence with his equipment.  :no:  He wishes to initiate a retrain of his xDSL (ITC-T G.992.3) circuit(s). His router, a Firebrick FB2700, does not need to undergo a warm restart.
Title: Re: Causing a Resynch
Post by: DaveC on September 15, 2018, 11:41:54 PM
In this context, I think "router" is being used to include routers not being routers (i.e. in bridge mode).  IIUC, in a "B10A (Bridge mode) -> Firebrick" scenario, A&A's TR-069 talks to the B10A.

But as Weaver has disabled TR-069 control of his devices, it's not an option.

EDIT: After a little investigation, it seems I was wrong.  A&A can send a configuration to the router to enable bridge mode, but after that, A&A have no further access to it (which makes sense). 
Title: Re: Causing a Resynch
Post by: Weaver on September 16, 2018, 12:38:29 AM
> but after that, A&A have no further access to it (which makes sense).

I wonder why that is?

I did wonder about that.
Title: Re: Causing a Resynch
Post by: j0hn on September 16, 2018, 04:06:36 AM
A bridge modem should have no access to the internet, and rightly so imo.
If necessary a static route could be set up to establish a link between modem - router to give such access.

AA uploading a config to enable bridge mode stops the modem accessing the internet to receive any further updates.
Title: Re: Causing a Resynch
Post by: burakkucat on September 16, 2018, 03:01:29 PM
An example based on what j0hn has said, in reply #3 above, --

> xdslctl info --state
xdslctl: ADSL driver and PHY status
Status: Showtime
Last Retrain Reason:   8000
Last initialization procedure status:   0
Max:   Upstream rate = 1040 Kbps, Downstream rate = 6228 Kbps
Bearer:   0, Upstream rate = 1019 Kbps, Downstream rate = 5119 Kbps

 > xdslctl connection --up
 > xdslctl info --state
xdslctl: ADSL driver and PHY status
Status: G.994 Training
Last Retrain Reason:   2000
Last initialization procedure status:   0

 > xdslctl info --state
xdslctl: ADSL driver and PHY status
Status: G.992 Started
Last Retrain Reason:   2000
Last initialization procedure status:   0

 > xdslctl info --state
xdslctl: ADSL driver and PHY status
Status: G.922 Channel Analysis
Last Retrain Reason:   2000
Last initialization procedure status:   0

 > xdslctl info --state
xdslctl: ADSL driver and PHY status
Status: Idle
Last Retrain Reason:   8000
Last initialization procedure status:   3

 > xdslctl info --state
xdslctl: ADSL driver and PHY status
Status: G.994 Training
Last Retrain Reason:   8000
Last initialization procedure status:   3

 > xdslctl info --state
xdslctl: ADSL driver and PHY status
Status: G.992 Started
Last Retrain Reason:   8000
Last initialization procedure status:   3

 > xdslctl info --state
xdslctl: ADSL driver and PHY status
Status: G.922 Channel Analysis
Last Retrain Reason:   8000
Last initialization procedure status:   3

 > xdslctl info --state
xdslctl: ADSL driver and PHY status
Status: Showtime
Last Retrain Reason:   8000
Last initialization procedure status:   0
Max:   Upstream rate = 1056 Kbps, Downstream rate = 6336 Kbps
Bearer:   0, Upstream rate = 1019 Kbps, Downstream rate = 5119 Kbps

 >


Ideally you need some help with the configuration of your Firebrick FB2700 so that you can connect to each one of the four modems, individually, from a device on your LAN.

DaveC has offered to assist you --

. . . I would be happy to give you a hand configuring your firebrick to give you access to your modems.
Title: Re: Causing a Resynch
Post by: banger on September 17, 2018, 12:11:33 AM
If you get a connection through the Firebrick I find the smoothest way to re-sync is from the web gui of the VMG1312-B10A by opening power menu and toggling DSL power radio button quickly with an apply after each off and on action.
Title: Re: Causing a Resynch
Post by: burakkucat on September 17, 2018, 03:49:06 PM
If you get a connection through the Firebrick I find the smoothest way to re-sync is from the web gui of the VMG1312-B10A by opening power menu and toggling DSL power radio button quickly with an apply after each off and on action.

Thinking around that suggestion . . .

Four lines, four circuits and four ZyXEL VMG1312-B10As. Suppose each modem was configured to power down the xDSL WAN, wait one minute and then power up the xDSL WAN. That would result in a circuit re-train (or resynchronisation) event. Now suppose that each modem performs that task, but staggered by six hours. Each modem would be re-trained once over any 24 hour period and whilst the re-train is occurring, the other three modems provide service continuity with 75% of the total bandwidth DS/US.  :-\
Title: Re: Causing a Resynch
Post by: Weaver on September 17, 2018, 04:10:42 PM
Now see Firebrick Config - Access to Modems Admin I/Fs. Now Using a VLAN MUX (https://forum.kitz.co.uk/index.php/topic,22442.0.html).

A redirect to a specific thread, perhaps more on-topic.

[Moderator edited to associate the new thread topic with the URL.]
Title: Re: Causing a Resynch
Post by: banger on September 17, 2018, 09:22:17 PM
Thinking around that suggestion . . .

Four lines, four circuits and four ZyXEL VMG1312-B10As. Suppose each modem was configured to power down the xDSL WAN, wait one minute and then power up the xDSL WAN. That would result in a circuit re-train (or resynchronisation) event. Now suppose that each modem performs that task, but staggered by six hours. Each modem would be re-trained once over any 24 hour period and whilst the re-train is occurring, the other three modems provide service continuity with 75% of the total bandwidth DS/US.  :-\

Should work, the VMG-1312-B10A has its own power schedule rules you can set for the DSL power.
Title: Re: Causing a Resynch
Post by: Weaver on September 17, 2018, 09:55:10 PM
I am thinking about writing an iPad program to remotely reboot a modem via http admin i/f then. I am intending to use my usual workhorse, the Workflow language and development app, but unfortunately I don’t have the tools to access it using telnet with Workflow, it only has functions to speak http and nothing else. I managed to put together something useful for the Dlink modems I was using previously. The biggest pain is working out what the exact protocol exchange needs to be and how to log in to authenticate access.
Title: Re: Causing a Resynch
Post by: johnson on September 18, 2018, 06:03:39 AM
Its a bit off the wall, but if all Workflow speaks is http and the idea of an running a second (tiny) web server on your 1312s doesn't disgust you then its not hard to make a little mongoose (https://github.com/cesanta/mongoose) server that executes commands. For example:

Code: [Select]
#include "mongoose.h"

static const char *s_http_port = "8000";
static struct mg_serve_http_opts s_http_server_opts;

static void ev_handler(struct mg_connection *nc, int ev, void *p) {
  if (ev == MG_EV_HTTP_REQUEST) {
struct http_message *hm = (struct http_message *) p;

if (mg_vcmp(&hm->uri, "/reboot") == 0) {

       system("reboot");

               mg_printf(nc, "%s", "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n");
               mg_printf_http_chunk(nc, "DONE");
               mg_send_http_chunk(nc, "", 0);

        } else{
          mg_serve_http(nc, (struct http_message *) p, s_http_server_opts);
        }
  }
}

int main(void) {
  struct mg_mgr mgr;
  struct mg_connection *nc;

  mg_mgr_init(&mgr, NULL);
  printf("Starting web server on port %s\n", s_http_port);
  nc = mg_bind(&mgr, s_http_port, ev_handler);
  if (nc == NULL) {
    printf("Failed to create listener\n");
    return 1;
  }

  mg_set_protocol_http_websocket(nc);
  s_http_server_opts.document_root = ".";
  s_http_server_opts.enable_directory_listing = "yes";

  for (;;) {
    mg_mgr_poll(&mgr, 1000);
  }
  mg_mgr_free(&mgr);

  return 0;
}

Just tried this out on a 1312, it either serves the directory its run from or with the magic uri reboots the device. It can be run from a USB stick connected to the router or baked into a firmware. A USB stick is a nice way of testing as can be shared easily by the router using samba. Does Workflow deal with samba shares?

Its not pretty or nice, but obviously any commands required could be run - /resync /setsnr etc etc.
Title: Re: Causing a Resynch
Post by: Weaver on September 18, 2018, 06:50:09 AM
That is such a clever bit of lateral thinking. Thank you for that !!
Title: Re: Causing a Resynch
Post by: burakkucat on September 18, 2018, 04:23:59 PM
The questions you need to first answer are --
Clearly a "yes" to the first will also cause the second to occur.
Title: Re: Causing a Resynch
Post by: kitz on September 19, 2018, 05:59:27 PM
Quote
How can I conveniently cause a modem to resync? - from my bed.

If all else fails get something like a HS110 (https://www.tp-link.com/uk/products/details/cat-5258_HS110.html) which you can control from your ipad/phone.

I have some sort of weird daily spike of REIN and every so often the errors will stick at ~30k, so if Im not on the ball, DLM will kick in the next day.  This can be a nuisance if I'm not home so spot it.

So I have a system set up whereby DSLstats will send me an alert email.   Then I use the Kasa app on my phone to turn off the plug and back on again.    Not the most elegant of solutions but hey it works and is so easy to do from anywhere. 
Title: Re: Causing a Resynch
Post by: Weaver on September 19, 2018, 11:34:06 PM
Thank you so much for that HS110 link. I am hoping that that device works on an existing wireless LAN? Or possibly uses Bluetooth. (Rather than polluting the airwaves with its own independent signal.)
Title: Re: Causing a Resynch
Post by: j0hn on September 20, 2018, 01:05:53 AM
It connects to the homes WiFi.
You can trigger it by Alexa, Google Home, IFTTT (push button, webhooks, etc etc) or the TP-Link Kasa App.
Creating a 1x1 widget push button with IFTTT works great.

I have the HS100 (https://www.tp-link.com/uk/products/details/cat-5258_HS100.html) which is the same device as the HS110 without the energy monitoring part. I got mine effectively free on Prime day and use it on my kettle  ;D
The HS100 is usually cheaper than the HS110 if you don't need the energy monitoring part.
I've added the last 3 months price on Amazon for both as an example of prices.

When I wake up I just say...
Alexa kettle on/Alexa turn the kettle on (either works)
and by the time I roll out of bed and go downstairs to make a coffee the kettles boiled.

It would be very very simple to configure it to toggle power on/off with a single push button on your IOS device of choice with the IFTTT app for the purpose of powering on/off your modems.

The great thing about the HS100/HS110 is they work on just the LAN.
Many smart plugs insist on routing all your power on/off requests through their servers so if your home, on the WiFi but have no internet access then you can still control the plugs.
Particularly good for rebooting modems/routers or after a power off you wouldn't be able to power back on (if on the home WiFi).
Title: Re: Causing a Resynch
Post by: johnson on September 20, 2018, 07:26:55 AM
When I wake up I just say...
Alexa kettle on/Alexa turn the kettle on (either works)
and by the time I roll out of bed and go downstairs to make a coffee the kettles boiled.

Do you not have to remember to "prime" the kettle?  ;D
Title: Re: Causing a Resynch
Post by: kitz on September 20, 2018, 11:14:27 PM
Quote
I am hoping that that device works on an existing wireless LAN?

J0hn answered your question, but just to add a little bit more.  I also have a HS100 (freebie from TPlink to several members of this forum  who beta tested them before they were publicly available in the UK).

Yes they work over wifi and as J0hn mentioned, they work seamlessly with Alexa.   I didn't want to confuse you in my  earlier post, but if I am home I can simply say "Alexa - Turn off router".  Outside of home (eg if I'm at my daughters house)  I can use the Kasa app on my phone to control it.

In total, I have 4 of these plugs controlling various electrical items, 2 of which are TP-link. The TP-links are more expensive but IMHO they are far more reliable. The other 2 I have were cheaper but were slightly more of a pain to set up, and both of them tend to lose connectivity every couple of months or so.  I've had the TP-links for several years and not once has either of them lost connectivity.   I also have about 8 Hives which control lighting that I've had no issues with, but I don't have any Hive plugs to rate their performance. If I were to get another plug, then I personally would get another tp-link-  despite them being a bit more expensive as they are more reliable and the Kasa app is better.

Quote
It would be very very simple to configure it to toggle power on/off with a single push button on your IOS device of choice with the IFTTT app for the purpose of powering on/off your modems.

@ Weaver.  You could even use a 4 way adapter so that just one device would control all four modems.  In the kitchen I use one of the other (non tplink) plugs in a 4-way to control a few electrical items.   You can even group devices - which I have done with my lighting, but nothing stopping you grouping plugs either. 

Grouping plugs and lighting with Alexa/echo is brilliant for me especially when I'm having a bad day as it allows me to set up custom commands.
eg I can simply say " Alexa - Goodnight" and she responds "Night night sleep well I have turned off all the lights."  At which point it will ensure all the lights in my group are off and also 2 of the plugs.    I can also do the reverse and ask her to turn things on in the morning without even leaving my bed,  so it's ideal for anyone with disabilities. 

Custom grouping and custom commands is limitless.  For eg I have 3 lights in the study  (Study1, Study2, Study3) which I can control individually.   These are grouped as "Study lights".   Then they are in another group "Upstairs"  and finally in group "All lights".    By using groups I can control an individual bulb, or all 3 in the study at once, or as part of any of the other 2 groups.  It gives you an idea of what you could achieve by grouping your modems.


----
PS you don't need an Echo/Alexa.   You could do it all via the app on your phone/ipad.   Alexa just gives you the ability to issue the commands by voice which is quicker than opening up the app on your phone...  and allows you to group devices from different manufactures.  Without Alexa you can only group devices by the same manufacturer.   
Title: Re: Causing a Resynch
Post by: Weaver on September 20, 2018, 11:24:02 PM
That does sound absolutely brilliant. Thanks for that product tip.
Title: Re: Causing a Resynch
Post by: j0hn on September 21, 2018, 12:29:17 AM
Quote from: kitz
Custom grouping and custom commands is limitless.  For eg I have 3 lights in the study  (Study1, Study2, Study3) which I can control individually.   These are grouped as "Study lights".   Then they are in another group "Upstairs"  and finally in group "All lights".    By using groups I can control an individual bulb, or all 3 in the study at once, or as part of any of the other 2 groups

I really wish they would add this for multi room music on echo devices.
I can't create an everywhere group and then separate upstairs/downstairs groups.
Each Echo device can only be in a single group for multi room music so if I create an everywhere then that's it.