janh / go-dsl

Library and application for reading xDSL stats
Mozilla Public License 2.0
31 stars 2 forks source link

Authenticating… failed: no prompt detected #3

Closed isslam95 closed 2 years ago

isslam95 commented 2 years ago

hello

I'm trying to connect to Zte h168n and with this command "dsl -d mediatek_telnet -u root 192.168.1.1" and it gives me this error no prompt detected

janh commented 2 years ago

If the screenshot on the OpenWrt forum shows the full list of commands, then it is likely that not all data can be read on this device.

However, this is not the issue here. From the error message, it looks like the output from the Telnet server doesn't match the prompts expected by the client.

Packet captures of both the failing connection, and of a working Telnet connection using a regular Telnet client may help to fix this.

The full packet capture isn't actually needed, just the TCP payload is sufficient. Steps to get this with Wireshark (assuming the actual capture is already finished):

Make sure to change the device's password before the packet capture, so the actual password doesn't end up in the capture!

isslam95 commented 2 years ago
00000000  ff fd 01 ff fd 1f ff fd  21 ff fb 01 ff fb 03 48   ........ !......H
00000010  31 36 38 4e 56 33 2e 31  0d 0a 0d 4c 6f 67 69 6e   168NV3.1 ...Login
00000020  3a 20                                              : 

00000000 ff fb 01 ... 00000003 ff fb 1f ... 00000006 ff fa 1f ... 00000009 ff ff ff ff .... 0000000D ff f0 .. 0000000F ff fc 21 ..! 00000012 ff fd 03 ... 00000015 72 6f 6f 74 0d 0a root.. 00000022 72 6f 6f 74 0d 0a 50 61 73 73 77 6f 72 64 3a 20 root..Pa ssword: 0000001B 72 6f 6f 74 0d 0a root.. 00000032 0d 0a 0d 0a 42 75 73 79 42 6f 78 20 76 31 2e 30 ....Busy Box v1.0 00000042 31 20 28 32 30 31 35 2e 30 37 2e 31 35 2d 31 30 1 (2015. 07.15-10 00000052 3a 33 35 2b 30 30 30 30 29 20 42 75 69 6c 74 2d :35+0000 ) Built- 00000062 69 6e 20 73 68 65 6c 6c 20 28 61 73 68 29 0d 0a in shell (ash).. 00000072 45 6e 74 65 72 20 27 68 65 6c 70 27 20 66 6f 72 Enter 'h elp' for 00000082 20 61 20 6c 69 73 74 20 6f 66 20 62 75 69 6c 74 a list of built 00000092 2d 69 6e 20 63 6f 6d 6d 61 6e 64 73 2e 0d 0a 0d -in comm ands.... 000000A2 0a 23 20 .# this with dsl -d broadcom_telnet -u root 192.168.1.1

isslam95 commented 2 years ago
00000000  ff fd 01 ff fd 1f ff fd  21 ff fb 01 ff fb 03 48   ........ !......H
00000010  31 36 38 4e 56 33 2e 31  0d 0a 0d 4c 6f 67 69 6e   168NV3.1 ...Login
00000020  3a 20                                              : 

00000000 ff fb 01 ... 00000003 ff fb 1f ... 00000006 ff fa 1f ... 00000009 ff ff ff ff .... 0000000D ff f0 .. 0000000F ff fc 21 ..! 00000012 ff fd 03 ... this with dsl -d mediate_telnet -u root 192.168.1.1

janh commented 2 years ago

Can you try the change in the branch zte-zxhn-h168n-v3 fixes the issue?

isslam95 commented 2 years ago

it's working now Screenshot (2)

janh commented 2 years ago

I'm wondering why the FEC and CRC error counters are missing. Could you provide a copy of the raw.txt file? Maybe there is a way to fix this.

isslam95 commented 2 years ago

`# cat /proc/tc3162/adsl_stats ADSL link status: up

Opmode: ITU G.993.2(VDSL2) TPSTC type: 64/65B PTM TC

near-end interleaved channel bit rate: 28671 kbps near-end fast channel bit rate: 0 kbps far-end interleaved channel bit rate: 3070 kbps far-end fast channel bit rate: 0 kbps

near-end FEC error fast: 0 near-end FEC error interleaved: 71445 near-end CRC error fast: 0 near-end CRC error interleaved: 0 near-end HEC error fast: 0 near-end HEC error interleaved: 0 far-end FEC error fast: 0 far-end FEC error interleaved: 0 far-end CRC error fast: 0 far-end CRC error interleaved: 0 far-end HEC error fast: 0 far-end HEC error interleaved: 0 ADSL uptime : 1:55, 5 secs ADSL activetime :0 min, 15 secs

Downstream: relative capacity occupation: 100% noise margin downstream: 11.3 dB output power upstream: 9.2 dbm attenuation downstream: 7.2 dB

Upstream: relative capacity occupation: 100% noise margin upstream: 29.2 dB output power downstream: 8.2 dbm attenuation upstream: 0.0 dB

Bit table: carrier load: number of bits per tone tone 0- 31: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 tone 32- 63: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 tone 64- 95: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 tone 96-127: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 tone 128-159: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 tone 160-191: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 tone 192-223: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 tone 224-255: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

near end itu identification: 26005443434e0000 far end itu identification: b5004244434dc01c attain upstream: 33975 attain downstream: 60808

ADSL activetime second: 15 ADSL total ativetime second: 47 ATURANSIRev: 0 ATUCANSIRev: 0 ATURANSIStd: 0 ATUCANSIStd: 0 Interleave Depth: 1871

atur chan interleave delay: 7 atur chan prev tx rate: 0 kbps atur chan curr tx rate: 3070 kbps atur chan crc block len: 0 Adsl Standard: VDSL2 Adsl Type: ANNEX_B NNEX_B

cat /proc/tc3162/vdsl_interface_config

cat: /proc/tc3162/vdsl_interface_config: No such file or directory

cat /proc/tc3162/adsl_fwver

FwVer:5.6.5.0_B_A60901 HwVer:T14.F7_0.2

cat /proc/tc3162/adsl_showbpc_ds

cat: /proc/tc3162/adsl_showbpc_ds: No such file or directory

cat /proc/tc3162/adsl_showbpc_us

cat: /proc/tc3162/adsl_showbpc_us: No such file or directory

cat /proc/tc3162/adsl_showsnr

cat: /proc/tc3162/adsl_showsnr: No such file or directory

cat /proc/tc3162/vdsl_showbpc_ds

cat: /proc/tc3162/vdsl_showbpc_ds: No such file or directory

cat /proc/tc3162/vdsl_showbpc_us

cat: /proc/tc3162/vdsl_showbpc_us: No such file or directory

cat /proc/tc3162/vdsl_showsnr

cat: /proc/tc3162/vdsl_showsnr: No such file or directory

wan vdsl2 show mgcnt

/bin/sh: sed: not found /bin/sh: dmesg: not found

wan vdsl2 show pms_pmd rx

wan vdsl2 show pms_pmd rx; dmesg | sed -n 'H;/<<< RX PMSTC Parameters >>>/h;${ g;p}' /bin/sh: sed: not found /bin/sh: dmesg: not found

wan vdsl2 show pms_pmd tx

wan vdsl2 show pms_pmd tx; dmesg | sed -n 'H;/<<< TX PMSTC Parameters >>>/h;${ g;p}' /bin/sh: sed: not found /bin/sh: dmesg: not found

wan vdsl2 show dmt

/bin/sh: sed: not found /bin/sh: dmesg: not found

wan vdsl2 show pmdtestparam qln

/bin/sh: sed: not found /bin/sh: dmesg: not found

wan vdsl2 show pmdtestparam hlog

/bin/sh: sed: not found /bin/sh: dmesg: not found

`

isslam95 commented 2 years ago

files in /proc/tc3162/ are

`

cat /proc/tc3162/

/proc/tc3162/adsl_cwmp_diagnostic0 /proc/tc3162/gsw_mib0 /proc/tc3162/adsl_cwmp_diagnostic1 /proc/tc3162/gsw_mib1 /proc/tc3162/adsl_cwmp_diagnostic2 /proc/tc3162/gsw_mib2 /proc/tc3162/adsl_cwmp_diagnostic3 /proc/tc3162/gsw_mib3 /proc/tc3162/adsl_cwmp_diagnostic4 /proc/tc3162/gsw_mib4 /proc/tc3162/adsl_cwmp_diagnostic5 /proc/tc3162/gsw_mib5 /proc/tc3162/adsl_cwmp_diagnostic6 /proc/tc3162/gsw_mib6 /proc/tc3162/adsl_fwver /proc/tc3162/gsw_stats /proc/tc3162/adsl_perf /proc/tc3162/mac_esd_check /proc/tc3162/adsl_stas_curdaySt /proc/tc3162/port_reverse /proc/tc3162/adsl_stas_intervaldaySt /proc/tc3162/ptm_b0_stats /proc/tc3162/adsl_stas_last /proc/tc3162/ptm_dbgLevel /proc/tc3162/adsl_stas_prevdaySt /proc/tc3162/ptm_do_reset_sequence /proc/tc3162/adsl_stas_quthourSt /proc/tc3162/ptm_l2encap_dbgEn /proc/tc3162/adsl_stas_show /proc/tc3162/ptm_priPktChk /proc/tc3162/adsl_stas_total /proc/tc3162/ptm_qoswrr /proc/tc3162/adsl_stats /proc/tc3162/ptm_reg_dump /proc/tc3162/aer_status /proc/tc3162/ptm_swReset /proc/tc3162/ahb_status /proc/tc3162/ptm_tcqos_disc /proc/tc3162/automount_pid /proc/tc3162/ptm_trafficShapingSet /proc/tc3162/cpu_port_flowctl /proc/tc3162/ptm_txCntLimiter_dump /proc/tc3162/dbg_msg /proc/tc3162/stag_to_vtag /proc/tc3162/eth1_link_st /proc/tc3162/support_flash /proc/tc3162/eth1_qoswrr /proc/tc3162/sys_has_hwnat /proc/tc3162/eth1_tcqos_disc /proc/tc3162/sys_has_usb_device /proc/tc3162/eth_link_st /proc/tc3162/sys_has_usbhost /proc/tc3162/eth_port_status /proc/tc3162/sys_has_wifi /proc/tc3162/eth_portmap /proc/tc3162/tcci_cmd /proc/tc3162/eth_reg /proc/tc3162/tcconsole_enable /proc/tc3162/eth_rxring /proc/tc3162/tcconsole_timeout /proc/tc3162/eth_stats /proc/tc3162/tcsupport_adslinfo /proc/tc3162/eth_txring0 /proc/tc3162/tpstc_reg_dump /proc/tc3162/gen_1588_pkt /proc/tc3162/vport_enable /proc/tc3162/gsw_link_st `

janh commented 2 years ago

So this device misses many of the interesting procfs files. And for the wan commands the output is only printed to the kernel log, which cannot be accessed properly without dmesg command.

However, the missing FEC and CRC counters was actually a bug which is now fixed. I also merged the Telnet fix into the master branch, so it is now included in binaries.

isslam95 commented 2 years ago

thank u