kennedyshead / aioasuswrt

MIT License
24 stars 24 forks source link

1.1.6 returns error codes on RT-AC53 #10

Closed maweki closed 6 years ago

maweki commented 6 years ago

using the testscript from #1 with python3 I get no results. The commands fail.

DEBUG:asyncio:Using selector: EpollSelector
DEBUG:__main__:wl
INFO:asyncssh:Opening SSH connection to 192.168.1.3, port 22
INFO:asyncssh:[conn=0] Connection to 192.168.1.3, port 22 succeeded
INFO:asyncssh:[conn=0]   Local address: 192.168.1.11, port 41448
DEBUG:asyncssh:[conn=0] Requesting key exchange
DEBUG:asyncssh:[conn=0] Received key exchange request
DEBUG:asyncssh:[conn=0] Beginning key exchange
DEBUG:asyncssh:[conn=0] Completed key exchange
INFO:asyncssh:[conn=0] Beginning auth for user admin
DEBUG:asyncssh:[conn=0] Trying password auth
INFO:asyncssh:[conn=0] Auth for user admin succeeded
DEBUG:asyncssh:[conn=0, chan=0] Set write buffer limits: low-water=16384, high-water=65536
INFO:asyncssh:[conn=0, chan=0] Requesting new SSH session
INFO:asyncssh:[conn=0, chan=0]   Command: for dev in `nvram get wl_ifnames`; do wl -i $dev assoclist; done
INFO:asyncssh:[conn=0, chan=0] Received exit status 127
INFO:asyncssh:[conn=0, chan=0] Received channel close
INFO:asyncssh:[conn=0, chan=0] Channel closed
DEBUG:__main__:['']
DEBUG:asyncssh:[conn=0, chan=1] Set write buffer limits: low-water=16384, high-water=65536
INFO:asyncssh:[conn=0, chan=1] Requesting new SSH session
INFO:asyncssh:[conn=0, chan=1]   Command: for dev in `nvram get wl_ifnames`; do wl -i $dev assoclist; done
INFO:asyncssh:[conn=0, chan=1] Received exit status 127
INFO:asyncssh:[conn=0, chan=1] Received channel close
INFO:asyncssh:[conn=0, chan=1] Channel closed
DEBUG:__main__:{}
DEBUG:__main__:arp
DEBUG:asyncssh:[conn=0, chan=2] Set write buffer limits: low-water=16384, high-water=65536
INFO:asyncssh:[conn=0, chan=2] Requesting new SSH session
INFO:asyncssh:[conn=0, chan=2]   Command: arp -n
INFO:asyncssh:[conn=0, chan=2] Received exit status 127
INFO:asyncssh:[conn=0, chan=2] Received channel close
INFO:asyncssh:[conn=0, chan=2] Channel closed
DEBUG:__main__:['']
DEBUG:asyncssh:[conn=0, chan=3] Set write buffer limits: low-water=16384, high-water=65536
INFO:asyncssh:[conn=0, chan=3] Requesting new SSH session
INFO:asyncssh:[conn=0, chan=3]   Command: arp -n
INFO:asyncssh:[conn=0, chan=3] Received exit status 127
INFO:asyncssh:[conn=0, chan=3] Received channel close
INFO:asyncssh:[conn=0, chan=3] Channel closed
DEBUG:__main__:{}
DEBUG:__main__:neigh
DEBUG:asyncssh:[conn=0, chan=4] Set write buffer limits: low-water=16384, high-water=65536
INFO:asyncssh:[conn=0, chan=4] Requesting new SSH session
INFO:asyncssh:[conn=0, chan=4]   Command: ip neigh
INFO:asyncssh:[conn=0, chan=4] Received exit status 127
INFO:asyncssh:[conn=0, chan=4] Received channel close
INFO:asyncssh:[conn=0, chan=4] Channel closed
DEBUG:__main__:['']
DEBUG:asyncssh:[conn=0, chan=5] Set write buffer limits: low-water=16384, high-water=65536
INFO:asyncssh:[conn=0, chan=5] Requesting new SSH session
INFO:asyncssh:[conn=0, chan=5]   Command: ip neigh
INFO:asyncssh:[conn=0, chan=5] Received exit status 127
INFO:asyncssh:[conn=0, chan=5] Received channel close
INFO:asyncssh:[conn=0, chan=5] Channel closed
DEBUG:__main__:{}
DEBUG:__main__:leases
DEBUG:asyncssh:[conn=0, chan=6] Set write buffer limits: low-water=16384, high-water=65536
INFO:asyncssh:[conn=0, chan=6] Requesting new SSH session
INFO:asyncssh:[conn=0, chan=6]   Command: cat /var/lib/misc/dnsmasq.leases
INFO:asyncssh:[conn=0, chan=6] Received exit status 1
INFO:asyncssh:[conn=0, chan=6] Received channel close
INFO:asyncssh:[conn=0, chan=6] Channel closed
DEBUG:__main__:['']
DEBUG:asyncssh:[conn=0, chan=7] Set write buffer limits: low-water=16384, high-water=65536
INFO:asyncssh:[conn=0, chan=7] Requesting new SSH session
INFO:asyncssh:[conn=0, chan=7]   Command: cat /var/lib/misc/dnsmasq.leases
INFO:asyncssh:[conn=0, chan=7] Received exit status 1
INFO:asyncssh:[conn=0, chan=7] Received channel close
INFO:asyncssh:[conn=0, chan=7] Channel closed
DEBUG:__main__:{}

Output for the single commands:

admin@(none):/tmp/home/root# for dev in `nvram get wl_ifnames`; do wl -i $dev assoclist; done
-sh: wl: not found
-sh: wl: not found
admin@(none):/tmp/home/root# dev in `nvram get wl_ifnames`; do wl -i $dev assoclist; done
-sh: dev: not found
-sh: wl: not found
admin@(none):/tmp/home/root# arp -n
? (192.168.1.1) at 84:16:xx:xx:xx:xx [ether]  on br0
? (192.168.1.11) at 30:5a:xx:xx:xx:xx [ether]  on br0
? (192.168.1.4) at b8:27:xx:xx:xx:xx [ether]  on br0
admin@(none):/tmp/home/root# ip neigh
192.168.1.11 dev br0 lladdr 30:5a:xx:xx:xx:xx REACHABLE
192.168.1.4 dev br0 lladdr b8:27:xx:xx:xx:xx REACHABLE
admin@(none):/tmp/home/root# cat /var/lib/misc/dnsmasq.leases
cat: can't open '/var/lib/misc/dnsmasq.leases': No such file or directory

The test script somehow doesn't work while the commands do.

kennedyshead commented 6 years ago

I have 0 ideas left for this atm :/ I need a router that dont work to test on.

maweki commented 6 years ago

Okay, I think I kinda got it.

$ ssh admin@192.168.1.3 env
admin@192.168.1.3's password: 
SSH_CLIENT=192.168.1.11 43456 22
USER=admin
HOME=/root
LOGNAME=admin
PATH=/usr/bin:/bin
SHELL=/bin/sh
PWD=/tmp/home/root
SSH_CONNECTION=192.168.1.11 43456 192.168.1.3 22

logging in:

$ ssh admin@192.168.1.3
admin@192.168.1.3's password: 
admin@(none):/tmp/home/root# env
SSH_CLIENT=192.168.1.11 43496 22
USER=admin
HOME=/root
SSH_TTY=/dev/pts/0
PS1=\u@\h:\w\$ 
LOGNAME=admin
TERM=xterm-256color
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/admin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin
SHELL=/bin/sh
PWD=/tmp/home/root
SSH_CONNECTION=192.168.1.11 43496 192.168.1.3 22
TMOUT=1200

If you don't login and only execute the commands, you have the wrong $PATH. The commands need to be fully qualified.

$ ssh admin@192.168.1.3 /sbin/arp -n
admin@192.168.1.3's password: 
? (192.168.1.1) at 84:16:xx:xx:xx:xx [ether]  on br0
kennedyshead commented 6 years ago

I just started writing stderr and that would have told me this! Thank you 110... ill sort this now.

kennedyshead commented 6 years ago

stupid me :D that wont work

kennedyshead commented 6 years ago

It will be in next bump!