kbr / fritzconnection

Python-Tool to communicate with the AVM Fritz!Box by the TR-064 protocol and the AHA-HTTP-Interface
MIT License
304 stars 59 forks source link

Error message using cli fritzwlan #58

Closed Warmink closed 3 years ago

Warmink commented 4 years ago

fritzwlan throws error

Hosts registered at WLANConfiguration1: WLAN name: Boromir6 channel : 1 index active mac ip signal speed Traceback (most recent call last): File "/usr/local/bin/fritzwlan", line 10, in sys.exit(main()) File "/usr/local/lib/python3.7/dist-packages/fritzconnection/cli/fritzwlan.py", line 85, in main report_devices(fw, args) File "/usr/local/lib/python3.7/dist-packages/fritzconnection/cli/fritzwlan.py", line 67, in report_devices report_wlanconfiguration(fw, n) File "/usr/local/lib/python3.7/dist-packages/fritzconnection/cli/fritzwlan.py", line 52, in report_wlanconfiguration print(f'{index:>5}{status:>8}{mac:>20}{ip:>18}{signal:>8}{speed:>8}') TypeError: unsupported format string passed to NoneType.format

Most likely caused by the fact that ip returns a None instead of an ip-number

http://192.168.2.30:49000/upnp/control/wlanconfig1 <?xml version="1.0" encoding="utf-8"?>5</s:NewAssociatedDeviceIndex></u:GetGenericAssociatedDeviceInfo></s:Body></s:Envelope> {'soapaction': 'urn:dslforum-org:service:WLANConfiguration:1#GetGenericAssociatedDeviceInfo', 'content-type': 'text/xml', 'charset': 'utf-8'} [{'service': 1, 'index': 0, 'status': True, 'mac': '64:27:37:44:F7:2C', 'ip': None, 'signal': 93, 'speed': 0}, {'service': 1, 'index': 1, 'status': True, 'mac': '12:81:2B:76:92:EC', 'ip': '192.168.2.24', 'signal': 91, 'speed': 72}, {'service': 1, 'index': 2, 'status': True, 'mac': 'EE:CE:1E:E0:CD:21', 'ip': None, 'signal': 65, 'speed': 0}, {'service': 1, 'index': 3, 'status': True, 'mac': '48:0B:B2:51:2E:FE', 'ip': '192.168.2.33', 'signal': 41, 'speed': 6}, {'service': 1, 'index': 4, 'status': True, 'mac': '84:F3:EB:E3:9C:1F', 'ip': '192.168.2.83', 'signal': 65, 'speed': 70}]

Issue appears between on connection between 2 Fritz!wlan 1750 repeaters. In Fritz web-interface this shows up as 1 up-number on 2 MAC addresses (1 mac for 2,4 and one for 5

Henri

kbr commented 4 years ago

Indeed, this looks like an edge case parsing the soap response. Will make it as a bugfix into the next release. Thanks for reporting.

Warmink commented 3 years ago

Hi kbr, Thanks I am looking looking forward towards the next release, I like your project, gives a nice option to monitor and control my Fritz

Henri

Warmink commented 3 years ago

Indeed problem solved, thanks

kbr commented 3 years ago

Fix was done in 1.3.2