kennedyshead / aioasuswrt

MIT License
24 stars 24 forks source link

On 4G-AC53U it still does not work (no wl command) #13

Closed quarcko closed 5 years ago

quarcko commented 5 years ago

Most probably newest asus routers simply do not have a 'wl' command at all. Even your 1.1.9 patch does not work (actually on this router it even breaks nvram, because on my router it is in /bin/nvram not /usr/sbin/nvram.

Another thing is that your script does not scan guest networks for clients (which might hand there). So here is line for all these fixes:

for dev in nvram get wl1_vifs && nvram get wl0_vifs && nvram get wl_ifnames; do wlanconfig $dev list | awk 'FNR > 1 {print substr($1 , 0, 18)}'; done

kennedyshead commented 5 years ago

Might be more versatile to set PATH when connecting

kennedyshead commented 5 years ago

Please test the PR so that I can confirm that it works ;)

kennedyshead commented 5 years ago

on my router there is no wlanconfig, we have to fix it with alias or something if wl not exist

quarcko commented 5 years ago

Maybe, but it works even without full path. Main issue is tho, that i have to replace 'iw' with 'iwconfig' Otherwise it wont work at all... Hope it gets somehow integrated into next hassio...

⁣Sent from BlueMail ​

On Nov 13, 2018, 01:00, at 01:00, kennedyshead notifications@github.com wrote:

Might be more versatile to set PATH when connecting

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/kennedyshead/aioasuswrt/issues/13#issuecomment-438059796

kennedyshead commented 5 years ago

Well, if you open a pull-request for a solution that is backwards compatible you could have it in by next or the one after :)

quarcko commented 5 years ago

Let's see... i don't have my router now (im at work), but here we have a different ASUS BRT-AC828 on this router there is a 'wl' command, but it does not work, exits with message: 'Usage : wl clm_data_ver'

But my code still works okay, let's see how we can distinguish between routers...

Also on a side note: Can you test on your router the first part of command: nvram get wl1_vifs && nvram get wl0_vifs && nvram get wl_ifnames This longer version checks for guest wifi networks, if this part works for all, maybe it could be integrated...

in the meantime i will try to upgrade cmd...

kennedyshead commented 5 years ago

My router don't like the && in the for loop :/

$ nvram get wl1_vifs && nvram get wl0_vifs && nvram get wl_ifnames

eth1 eth2
kennedyshead commented 5 years ago

It's parse error with `

kennedyshead commented 5 years ago
$ for dev in `nvram get wl1_vifs && nvram get wl0_vifs && nvram get wl_ifnames`; do wlanconfig $dev list | awk 'FNR > 1 {print substr($1, 0, 18)}'; done
-sh: wlanconfig: not found
-sh: wlanconfig: not found
quarcko commented 5 years ago

So your last comment it seems that first part is okay? just fails at wlanconfig. ok....

But now the harder part.. we can't test for 'wl' presence, because this router that i'm on now has this command but it has different syntax or smth... :/

quarcko commented 5 years ago

okay.... test this out:

for dev in `nvram get wl1_vifs && nvram get wl0_vifs && nvram get wl_ifnames`; do if type wlanconfig > /dev/null; then wlanconfig $dev list | awk 'FNR > 1 {print substr($1, 0, 18)}'; else wl -i $dev assoclist; fi; done

maweki commented 5 years ago

nvram show might shed some light on how we can distuinguish the devices and we might be able to group them according to capabilities

wps_device_name=RT-AC53
daapd_friendly_name=RT-AC53-A68C
wps_modelnum=RT-AC53

My model uses nvram to set networkmap_fullscan to 1 and then reads client_info_tmp from nvram to show the networkmap in the web client.

quarcko commented 5 years ago

I tested your suggested set networkmap_fullscan=1 & get client_info_tmp afterwards but output is empty on BRT-AC828

so far we have here only 2 commands at play wl & wlanconfig i think it is enough to test just for presence of wlanconfig and use it otherwise fallback to wl

kennedyshead commented 5 years ago
wps_device_name=RT-AC88U
daapd_friendly_name=RT-AC88U-2780
wps_modelnum=RT-AC88U

I'm on merlin though, and I think we should use the wl wlanconfig approach for now and do some more advanced things later if needed.

I'm on the learning curve with the capabilities at this point ;)

kennedyshead commented 5 years ago

Success

$ for dev in `nvram get wl1_vifs && nvram get wl0_vifs && nvram get wl_ifnames`; do if type wlanconfig > /dev/null; then wlanconfig $dev list | awk 'FNR > 1 {print substr($1, 0, 18)}'; else wl -i $dev assoclist; fi; done
assoclist KO:80:63:DD:59:A0
assoclist 0C:80:63:NJ:5D:4F
assoclist 0C:80:IN:DD:5A:42
assoclist 00:0E:00:02:PO:51
assoclist 9C:5C:F9:GT:C7:50
assoclist 78:IO:DC:7D:E1:94
assoclist D4:BE:9C:E1:2F:37
assoclist D4:38:9C:PT:F5:E8
assoclist B8:RQ:EB:F8:9C:FA
assoclist BC:DD:C2:PF:75:19
assoclist A0:RS:28:E5:62:A1
assoclist AC:CF:75:BA:90:56
assoclist 78:4F:43:70:01:24
assoclist C0:97:11:54:49:06
quarcko commented 5 years ago

One more thing that i did not test (because i couldn't see 'wl' output...) is that 'wl' version returns: 'assoclist KO:80:63:DD:59:A0' ...

wlanconfig version returns just MAC's: 'KO:80:63:DD:59:A0' ...

does your code later on relies on 'assoclist ' prefix before MAC?

kennedyshead commented 5 years ago

Aha! Yes it uses regex to get the mac (not my code though ;) ) hm... you could just echo with assoclist?

quarcko commented 5 years ago

just tested your regex with regex101.com and it seems to catch both output versions, it does not matter whether there is 'assoclist' or no :)

kennedyshead commented 5 years ago

Gr8 In that case we are good to go! Thank you for all help

quarcko commented 5 years ago

No problem :) let's hope that rest of the commands work, though! :laughing:

kennedyshead commented 5 years ago

Well if they don’t this will work anyway, and the code just appends a list of devices based on new output so if one works that will be used.

On 13 Nov 2018, at 10:31, quarcko notifications@github.com wrote:

No problem :) let's hope that rest of the commands work, though! 😆

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kennedyshead/aioasuswrt/issues/13#issuecomment-438197621, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMaauW00FQoLORPFaeZGKGabnX0qbKAks5uupFXgaJpZM4Yak1n.