hagaygo / OpenWrtManager

Mobile app for interacting with your OpenWrt device.
GNU General Public License v3.0
145 stars 10 forks source link

WiFi Status -> Error parsing reply from device when WDS client is connected #22

Closed apdeboer closed 2 years ago

apdeboer commented 2 years ago

Hello,

I've been using OpenWRTManager to manage various devices. Retrieving Wifi status works on all devices, except for a TP-Link Archer C6, which acts as an WDS enabled Access-point. I didn't really bother, because I guessed it might be due to some device interoperability issue. However, recently I bought another TP-Link Archer C6, which works fine. This one acts as a WDS client towards the other TP-Link.

In trying to figure out what might be the problem, I came across Issue #20 (xyza) and was inspired. After some trial and error using the new menu option to copy debug data to the clipboard, if figured that WDS STA interface is causing the issue. If device wlan0.sta3 is discovered with the getWirelessDevices method AND if the returned assoclist is NOT empty (see "id":5 in the debug traces), it results in a "Error parsing reply from device".

From my experiments I have attached two debug traces. In the working example, I have forced the WDS-client to disconnect in order to make sure that there is no association. In the non-working example, the WDS-client is connected.

It might be an easy fix to exclude WDS client interfaces from parsing. So, in my case neglect device "wlan0.sta3".

I hope this helps to improve your product.

12-Menu-Debug-OK-wlan0.sta3_DOWN.txt 13-Debug-Trace-NOK-wlan0.sta3_UP.txt

hagaygo commented 2 years ago

Hi,

Thank you for your thorough description.

The debug trace does give me some lead to try ignoring the data and to avoid the parsing error , I'll post a test apk soon so you could test it.

As you suggested it might be better to ignore the WDS on the first place instead of requesting his data and then ignore it. So , if you can supply it , I need your JSON response for the "Update Devices" option on the drawer (menu). Press it , wait for it to finish and then copy the debug data to the clipboard and paste here (Check for sensitive data before).

hagaygo commented 2 years ago

Attached is a test apk that suppose to ignore the "bad" interface.

Test it and let me know about the results (If you still get a an error , a debug data like you previously attached would be needed of course)

openwrt_manager-testing.zip

apdeboer commented 2 years ago

I verified the test apk. I have added all other Openwrt devices, besides the one that was having the problem. Everything works now as expected. This is a very quick fix. Thanks! Keep up the good work.