OpenWrt Forum Archive

Topic: Tp-Link td-w8970

The content of this topic has been archived between 26 Mar 2018 and 7 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Toutatis wrote:

@ rezad1393

the source port should be added . without that port forwarding doesn't mean anything.

- Thread
https://forum.openwrt.org/viewtopic.php?id=36055
Post 21
Point b) the source ip is either unset (should be this way) ...

in your situation as i said you meant port not IP.
I don't know who wrote that but that doesn't seem right.maybe he(or she) meant that if you set the source port then the IP is not always needed and if you set the source IP then the source port is not needed (which the first scenario is the most used one for torrenting and such).

but consider this. you are telling your router(firewall) to send(forwards) some packages that were not initiated from lan before to a host on your lan on some specified port. so how does your firewall know which ones to send?
either by port or by IP or by both. see?
because in port forwarding(for torrenting for example) (unlike simple web browsing) the wan side initiate a connection and if you don't open the port(forward it in this case) the firewall sees that as a not valid request , like a hacker trying to connect to your LAN and blocks that.

BTW through alll of this it is necessary to have the application running. did you do that?
if you use a private tracker some of them have port checking that work quite correctly.

(Last edited by rezad1393 on 1 Sep 2016, 06:16)

Sorry I meant port

c) the source port is either unset (should be this way)

For my understanding, could you tell me the concept of
- External IP address (the drop-down list has all the lan host IP)
- External port
in the firewall port forwards
- What does mean "d" in src_dport

(Last edited by Toutatis on 1 Sep 2016, 18:31)

Toutatis wrote:

Sorry I meant port

c) the source port is either unset (should be this way)

For my understanding, could you tell me the concept of
- External IP address (the drop-down list has all the lan host IP)
- External port
in the firewall port forwards
- What does mean "d" in src_dport

I dont understand your question.
are you fimiliar at all with port forwarding?
external ip and port are the wan side of connection in this case.
when you are torrenting you want other users to initiate conncetion to your torrent client. if you dont use port forwarding(opening ports for some WAN IPs or all WAN IPs) then they cant see your client because your firewall blocks them.
firewall are state orientated, which mean they keep track of connections orogins for firewalling , so when somebody frmo WAN side tries to connect to you inside you LAN , they are Excternall to your LAN network, so their IP and port are said to be external.
that's it.

based on some info on internet:
config redirect
    option  src       $source_interface
    option  src_dport $original_destination_port
    option  dest      $destination_interface
    option  dest_ip   $destination_ip
    option  dest_port $destination_port
    option  proto     $protocol

happy to hear that.
but from what I read you didn't find the issue causing this.it just got fixed by itself( hail the magic unicorns running our routers).
btw what image you used for installing ? maybe it had a bug.
and I just copy from some section of my firewall config to other and restart the firewall service and it always worked.
I usually use the trunk version. but because I create my own images so I can replace the default installed apps.
If you have any more questions , I will be happy to help,though I am a newbie like you with just a little bit more exp.

P.S. be careful with your router . mine got bad sector( i think). whatever you write to its space it will be written to the flash and they are not really  for many writes ( manufactures just writes the firmware updates to them).

if you write (create) files on it and write to them ( like logs outside of tmp area) , I recommend using a external_root approach with a usb. that way you will also get more space for other stuff to install.

I will go that way for my new wrt1200ac router too even though it has 128MB flash.(supposedly but I can only see 22MB, the rest is for many configs that I cant touch). I was burned once with flash bad sector ( or what ever that is maybe it was ram bad sector) so I will try to use the usb approach.

(Last edited by rezad1393 on 2 Sep 2016, 15:39)

Hi,

I'd  like to give that whole VDSL with OpenWRT business another try.

But first, i have to ask... What kind of cable do i even need, what port on the Router do i use?

You see, my Telekom Speedport has a cable with a TAE-F plug on one end and an RJ45 on the other.

The W8970 has 4 (RJ45) Ethernet ports and one RJ11 labled "ADSL"

Surely this cant work if i just stick that telekom cable into one of the ethernet ports?

And surely a regular RJ11 telephone cable doenst have enough shielding for vdsl 50?


Thanks

(Last edited by hacki on 29 Sep 2016, 15:14)

hacki wrote:

And surely a regular RJ11 telephone cable doenst have enough shielding for vdsl 50?

Shielding? We are talking about copper wires between you and the exchange which many times are not even twisted. Regular RJ11 cable works just fine for all of us.

Alright.

Well, in any case, it doesnt work, still only syncs up with ADSL speed (18/7mbits) and doesnt log in.

I'll wait for the next release of openwrt or an official release of LEDE. Dont want to screw around with snapshots.

Thanks

Hacki, you might want to post your /etc/config/network just to see that your config looks right.

Hi,

I got it (kindof) working with the following config:

config atm-bridge 'atm'
        option vpi '1'
        option vci '32'
        option encaps 'llc'
        option payload 'bridged'

config interface 'wan'
    option ifname 'ptm0.7'
    option proto 'pppoe'
    option username 'foo '
    option password 'bar'
    option ipv6 '1'


config vdsl 'dsl'
    option annex 'b' 
    option firmware '/lib/firmware/vdsl.bin' 
    option tone 'bv' 
    option xfer_mode 'ptm'

I'm using the Firmware_Speedport_W921V_1.21.000.bin firmware.


Unfortunately it still only syncs at ADSL speeds; but at least im online.

~# /etc/init.d/dsl_control status
Chipset:        Lantiq-VRx Unknown
Line State:        UP [0x801: showtime_tc_sync]
Data Rate:        18.820 Mb/s / 1.416 Mb/s
Line Attenuation:    8.3dB / 0.0dB
Noise Margin:        6.0dB / 5.6dB
Line Uptime:        1m 59s

I suspect its a problem with the firmware i'm using?
Is there some other firmware that might work?

Tried the Annex B vdsl.bin from here https://github.com/ScApi/P2812HNUFx-Pre … 20firmware

Played around with the tone/annex settings (a,av,b,bv),

still only adsl speed. (I have a VDSL 50 line)

(Last edited by hacki on 30 Sep 2016, 13:38)

Your config looks OK but you are clearly using an older version of dsl_control (old firmware) as the new one gives much more info. I just use firmware that was packed with recent trunk and it works OK. The info looks like this

ATU-C Vendor ID:                          Broadcom 164.140
ATU-C System Vendor ID:                   Broadcom
Chipset:                                  Lantiq-VRX200 Unknown
Firmware Version:                         5.7.3.3.0.6
API Version:                              4.16.6.3
XTSE Capabilities:                        0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2
Annex:                                    B
Line Mode:                                G.993.2 (VDSL2)
Profile:                                  17a
Line State:                               UP [0x801: showtime_tc_sync]
Forward Error Correction Seconds (FECS):  Near: 0 / Far: 6343
Errored seconds (ES):                     Near: 0 / Far: 1134
Severely Errored Seconds (SES):           Near: 0 / Far: 0
Loss of Signal Seconds (LOSS):            Near: 0 / Far: 0
Unavailable Seconds (UAS):                Near: 33 / Far: 33
Header Error Code Errors (HEC):           Near: 0 / Far: 0
Non Pre-emtive CRC errors (CRC_P):        Near: 0 / Far: 0
Pre-emtive CRC errors (CRCP_P):           Near: 0 / Far: 0
Power Management Mode:                    L0 - Synchronized
Latency / Interleave Delay:               Down: Fast (0.16 ms) / Up: Fast (0.0 ms)
Data Rate:                                Down: 39.950 Mb/s / Up: 1.999 Mb/s
Line Attenuation (LATN):                  Down: 13.6dB / Up: 15.0dB
Signal Attenuation (SATN):                Down: 13.7dB / Up: 15.8dB
Noise Margin (SNR):                       Down: 14.1dB / Up: 29.5dB
Aggregate Transmit Power(ACTATP):         Down: 2.1dB / Up: 13.5dB
Max. Attainable Data Rate (ATTNDR):       Down: 66.779 Mb/s / Up: 24.246 Mb/s
Line Uptime Seconds:                      446034
Line Uptime:                              5d 3h 53m 54s

Yes, well, i'm using CC 15.05.1

I dont really feel like flashing a new image, especially since im using an extroot setup, and i dont exactly know how that would work out.
Dont want to spend hours trying to get that thing working again..

This is starting to piss me off.

I couldnt resist and tried upgrading to Trunk.

That worked, but then it turned out USB is broken. It didnt work, despite having all the modules installed and loaded.
Great.

So on to LEDE Trunk. USB works! Yay.

But:

ATU-C Vendor ID:                          
ATU-C System Vendor ID:                   
Chipset:                                  Lantiq-VRX200 Unknown
Firmware Version:                         5.8.1.5.0.7
API Version:                              4.17.18.6
XTSE Capabilities:                        0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2
Annex:                                    B
Line Mode:                                G.993.2 (VDSL2)
Profile:                                  17a
Line State:                               UP [0x801: showtime_tc_sync]
Forward Error Correction Seconds (FECS):  Near: 0 / Far: 0
Errored seconds (ES):                     Near: 0 / Far: 82
Severely Errored Seconds (SES):           Near: 0 / Far: 22
Loss of Signal Seconds (LOSS):            Near: 0 / Far: 4
Unavailable Seconds (UAS):                Near: 220 / Far: 220
Header Error Code Errors (HEC):           Near: 0 / Far: 0
Non Pre-emtive CRC errors (CRC_P):        Near: 0 / Far: 0
Pre-emtive CRC errors (CRCP_P):           Near: 0 / Far: 0
Power Management Mode:                    L0 - Synchronized
Latency / Interleave Delay:               Down: Fast (0.16 ms) / Up: Interleave (5.0 ms)
Data Rate:                                Down: 18.710 Mb/s / Up: 1.532 Mb/s
Line Attenuation (LATN):                  Down: 7.9dB / Up: 3.7dB
Signal Attenuation (SATN):                Down: 7.9dB / Up: 3.7dB
Noise Margin (SNR):                       Down: 6.0dB / Up: 6.2dB
Aggregate Transmit Power (ACTATP):        Down: 12.8dB / Up: 14.5dB
Max. Attainable Data Rate (ATTNDR):       Down: 19.730 Mb/s / Up: 1.558 Mb/s
Line Uptime Seconds:                      7
Line Uptime:                              7s

... Great.

I tried firmware versions 5.7.3.3.0.6 as well as 5.7.9.9.0.something - no difference. It only wants to sync at about 19/1.5 mbit\s

So what now?

And before you ask; the speedport gets a sync with 55 mbit\s or something.

(Last edited by hacki on 30 Sep 2016, 23:08)

Problem Solved.

It was in fact the Cable.

I slapped together a little RJ45 to RJ11 adapter to use the telekom cable i have with the W8970 .. Lo and behold:

ATU-C Vendor ID:                          Broadcom 176.29
ATU-C System Vendor ID:                   Broadcom
Chipset:                                  Lantiq-VRX200 Unknown
Firmware Version:                         5.8.1.5.0.7
API Version:                              4.17.18.6
XTSE Capabilities:                        0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2
Annex:                                    B
Line Mode:                                G.993.5 (VDSL2 with down- and upstream vectoring)
Profile:                                  17a
Line State:                               UP [0x801: showtime_tc_sync]
Forward Error Correction Seconds (FECS):  Near: 0 / Far: 33955
Errored seconds (ES):                     Near: 0 / Far: 163
Severely Errored Seconds (SES):           Near: 0 / Far: 22
Loss of Signal Seconds (LOSS):            Near: 0 / Far: 4
Unavailable Seconds (UAS):                Near: 110 / Far: 110
Header Error Code Errors (HEC):           Near: 0 / Far: 0
Non Pre-emtive CRC errors (CRC_P):        Near: 0 / Far: 0
Pre-emtive CRC errors (CRCP_P):           Near: 0 / Far: 0
Power Management Mode:                    L0 - Synchronized
Latency / Interleave Delay:               Down: Fast (0.15 ms) / Up: Fast (1.0 ms)
Data Rate:                                Down: 51.392 Mb/s / Up: 10.046 Mb/s
Line Attenuation (LATN):                  Down: 15.0dB / Up: 15.4dB
Signal Attenuation (SATN):                Down: 15.1dB / Up: 15.5dB
Noise Margin (SNR):                       Down: 19.4dB / Up: 25.1dB
Aggregate Transmit Power (ACTATP):        Down: 3.6dB / Up: 14.5dB
Max. Attainable Data Rate (ATTNDR):       Down: 102.941 Mb/s / Up: 38.728 Mb/s
Line Uptime Seconds:                      10
Line Uptime:                              10s

I suspect it has something to do with the little board thats hidden in the TAE plug, looks like a resistor and a diode or something.

Edit: This is really weird.
I looked into it a little further and it turns out the little board in there is called the "galvanic signature" or somesuch; its only there for diagnostic purposes and nothing else.
So whats the difference between the two cables? Well; the telecom cable only has two pins.
The other cables has all 6 pins connected. So i tried what happens when i cut pins 3 through 6 .... What should i say:

/etc/init.d/dsl_control status
ATU-C Vendor ID:                          
ATU-C System Vendor ID:                   
Chipset:                                  Lantiq-VRX200 Unknown
Firmware Version:                         5.8.1.5.0.7
API Version:                              4.17.18.6
XTSE Capabilities:                        0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2
Annex:                                    B
Line Mode:                                G.993.5 (VDSL2 with down- and upstream vectoring)
Profile:                                  17a
Line State:                               UP [0x801: showtime_tc_sync]
Forward Error Correction Seconds (FECS):  Near: 0 / Far: 0
Errored seconds (ES):                     Near: 0 / Far: 163
Severely Errored Seconds (SES):           Near: 0 / Far: 22
Loss of Signal Seconds (LOSS):            Near: 3 / Far: 4
Unavailable Seconds (UAS):                Near: 286 / Far: 286
Header Error Code Errors (HEC):           Near: 0 / Far: 0
Non Pre-emtive CRC errors (CRC_P):        Near: 0 / Far: 0
Pre-emtive CRC errors (CRCP_P):           Near: 0 / Far: 0
Power Management Mode:                    L0 - Synchronized
Latency / Interleave Delay:               Down: Fast (0.15 ms) / Up: Fast (1.0 ms)
Data Rate:                                Down: 51.392 Mb/s / Up: 10.046 Mb/s
Line Attenuation (LATN):                  Down: 15.2dB / Up: 15.5dB
Signal Attenuation (SATN):                Down: 15.3dB / Up: 15.5dB
Noise Margin (SNR):                       Down: 20.2dB / Up: 25.6dB
Aggregate Transmit Power (ACTATP):        Down: 3.5dB / Up: 14.5dB
Max. Attainable Data Rate (ATTNDR):       Down: 105.594 Mb/s / Up: 39.302 Mb/s
Line Uptime Seconds:                      4
Line Uptime:                              4s

This doesnt make a whole lot of sense to me since there are only 2 pins connected inside the telephone wall jack.

I'm just glad i finally got it working..

(Last edited by hacki on 1 Oct 2016, 13:21)

From the beginning I suspected that there was something wrong with Your connection - Your SNR was very low (6dB).

Now I have a tip for you.
Since your SNR is around 20dB now You can try to reduce it for 3dB using commands below:

dsl_cpe_pipe.sh locs 0 -30
dsl_cpe_pipe.sh acs 2

As the result your router should have better synchro (over 50Mb/s)

It works with LEDE - I checked that with my ZyXEL P-2812HNU-F1
My default synchro was 64Mb/s - after I reduced SNR for 5dB (dsl_cpe_pipe.sh locs 0 -50) I get synchro 77Mb/s (my vdsl line is 80Mb/s).

(Last edited by Scotch's on 1 Oct 2016, 14:23)

Hi,

The synchro im getting now is fine, since i only have a VDSL 50 line.
Its now getting precisely the same rate i'm getting with the telekom speedport.

I just dont understand how cutting a few cables could have that effect. I wonder if they are cross-connected inside the wall jack which confuses the W8970 or the DSLAM.

Great! By the way in your config you can safely delete the section "atm-bridge"

config atm-bridge 'atm'
        option vpi '1'
        option vci '32'
        option encaps 'llc'
        option payload 'bridged'

as this is for adsl not vdsl. It makes no difference performance-wise just your config is nicer and cleaner.

(Last edited by dziny on 1 Oct 2016, 19:45)

@haki
Scotch's tip increase the line quality not the speed smile

How to backup original firmware and install openwrt without opening the case

You will need:

1) a usb stick/thumb drive formatted as vfat/msdos
2) PC connected to TD-W8970 v 1 running original firmware either by wire or wireless
3) Telent and dd installed on the PC

Prepare the openwrt images on PC

Download the official 15.05 relese of openwrt-lantiq-xrx200-TDW8970-sysupgrade.image and run the following commnad:

dd if=openwrt-lantiq-xrx200-TDW8970-sysupgrade.image bs=1310720 skip=1 of=openwrt-lantiq-xrx200-TDW8970-sysupgrade-1.image

Create folder td-w8970 on your usb stick/thumb drive then copy these two files over the newly created folder. Unmount/eject the usb stick and plug it into the usb port on the back of TD-W8970.

Backup the original firmware
Open telnet and connect to 192.168.1.1 with login/password both as admin. Type sh after logging successfully. Run the following command to backup:

cat /dev/mtd0 > /var/usbdisk/sda1/td-w8970/mtd0
cat /dev/mtd1 > /var/usbdisk/sda1/td-w8970/mtd1
cat /dev/mtd2 > /var/usbdisk/sda1/td-w8970/mtd2
cat /dev/mtd3 > /var/usbdisk/sda1/td-w8970/mtd3
cat /dev/mtd4 > /var/usbdisk/sda1/td-w8970/mtd4
cat /dev/mtd5 > /var/usbdisk/sda1/td-w8970/mtd5
cat /dev/mtd6 > /var/usbdisk/sda1/td-w8970/mtd6

Verify the size of mtd1 file on the usb stick by executing the following command:

ls -l /var/usbdisk/sda1/td-w8970/mtd1

If the size is 1310720 you can go ahead with installing openwrt otherwise go back to "Prepare the openwrt images on PC" and replace 1310720 by the actual size in the dd command.

Install openwrt
Run the following command

cat /var/usbdisk/sda1/td-w8970/openwrt-lantiq-xrx200-TDW8970-sysupgrade.image > /dev/mtdblock1
cat /var/usbdisk/sda1/td-w8970/openwrt-lantiq-xrx200-TDW8970-sysupgrade-1.image > /dev/mtdblock2

Reboot router afterwards.

Notes
DSL firmware install script no longer works. Google dsl_vr9_firmware_xdsl-05.04.08.00.00.06_05.04.04.04.00.01.bin and save either to /lib/firmware/vdsl.bin or mtdblock4 (mtd erase first then mount) and do a symbolic link to vdsl.bin

fq_codel is the default qdisc which caused unexplained packet loss and network dealy once on the wired network. I have now disabled it by having these lines in /etc/rc.local

for device in eth0 ifb0 ifb1 wlan0 wlan0-1; do
tc qdisc del dev $device root
tc qdisc del dev $device ingress
tc qdisc add dev $device root pfifo
done

Sample network config section for UK ADSL PPOA (atm bridge section is not needed):

config interface 'wan'
    option proto 'pppoa'
    option encaps 'vc'
    option vci '38'
    option vpi '0'
    option username 'foo'
    option password 'bar'
    option ipv6 '0'
    option mtu '1492'

config vdsl 'dsl'
    option xfer_mode 'atm'
    option tone 'av'
    option annex 'a'
    option firmware '/lib/firmware/vdsl.bin'

(Last edited by s7mx1 on 10 Oct 2016, 13:18)

I accidentally deleted the boot partition. now with a Raspberry Pi I want to write a rom that is empty. someone has the chip dump?
Thank You!

I flash my W8970 with Openwrt but the Wlan is not working (Led open green but no ssid on air)

I must have overwritten or erased by mistake the radio required for WLAN in flash and perhaps the  MAC address for  WLAN (ART Partition).

All the rest working fine with the W8970
.
Is anyway to restore Wlan fuction?

Hi
Can anyone write the specs of 2 diodes for me.
D9 and D10. If you place the boards antennas towards you, they are on the middle of the left side of the board.
Thanks guys.

bloodmaster wrote:

I flash my W8970 with Openwrt but the Wlan is not working (Led open green but no ssid on air)

I must have overwritten or erased by mistake the radio required for WLAN in flash and perhaps the  MAC address for  WLAN (ART Partition).

All the rest working fine with the W8970
.
Is anyway to restore Wlan fuction?

Check first, if mdtblock6 was deleted, if yes, you can try to rewite.

hexdump  /dev/mtdblock6 -C

Hi, I'm trying to install openwrt on my td-8970 ver.1.2 using s7mx1's guide from this topic. Everything went fine until I telnet my router. Login password admin/admin and I was in but my router via telnet did not recognize command "sh". When I type help I've got only few commands avaliable. What did I do wrong? My w8970 is running firmware softwareVersion=0.6.0 2.12 v000c.0 Build 140613 Rel.31066n

----------------------------------------------------------------------------------------------------------------
Welcome To Use TP-LINK COMMAND-LINE Interface Model.
----------------------------------------------------------------------------------------------------------------
TP-LINK(conf)#help
normal mode commands:
        clear           ---     clear screen
        exit            ---     leave to the privious mode
        help            ---     help info
        history         ---     show histroy commands
        logout          ---     logout cli model
config mode commands:
        config          ---     enter config mode
        adsl            ---     config adsl
        igmp            ---     igmp config
        wan             ---     wan config
        wlctl           ---     wireless config
        lan             ---     lan config
        dev             ---     device control
TP-LINK(conf)#sh
Command not found:sh

Please read to the end before you try this - while each step worked, my router didn't come back up at the end of it.

SlavekTT wrote:

Hi, I'm trying to install openwrt on my td-8970 ver.1.2 using s7mx1's guide from this topic. Everything went fine until I telnet my router. Login password admin/admin and I was in but my router via telnet did not recognize command "sh".

You cannot use the standard telnet interface in this case. I was able to get a telnet interface by following and modifying the instructions here on the TD8890 page on the openwrt wiki

In the section "Web Interface Hack (without opening the case)". 

I basically downloaded the  statPOSTer.jar file, and then ran it to download and decrypt the config file. I then added the single line:

      <Description val="N600 Wireless Dual Band Gigabit VDSL2 Modem Router`telnetd -p 1023 -l login`" />

Under the DeviceInfo section.

Created an encrypted config and uploaded it to the router. That gave me a telnet session on port 1023, which gives me access to a shell prompt.

I then followed the instructions outlined by s7mx1 (including the block size check against the size of mtd1). Unfortunately after a reboot (by typing 'reboot' on the telnet shell), my router didn't come back up, appears bricked, and I'll need to dig out a serial interface to restore it, probably.

(Last edited by bassplayerchris on 10 Nov 2016, 22:24)