My wtp is NetGear 4300, and wifiloadbalancing.py does not work for me. The following is the situations I have met.
There are no member functions: lvapjoin and wtpup, wifistats.
AttributeError: 'WifiLoadBalancing' object has no attribute 'lvapjoin'
AttributeError: 'WifiLoadBalancing' object has no attribute 'wtpup'
Then I changed lvapjoin and wtpup to be following functions and comment self.lvapjoin and self.wtpup, and changed wifistats to be wifi_stats.
def lvap_join(self, lvap):
self.lvap_join_callback(self.lvap)
print("join")
def wtp_up(self, wtp):
print("----------------------------------------")
self.wtp_up_callback(wtp)
print("wtp_up")
Then, I got:
ERROR:lvapp.lvappconnection:('expected 300, found 207', FieldError(FieldError('expected 4, found 0',),))
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/construct/core.py", line 358, in _parse
return self.packer.unpack(_read_stream(stream, self.length))[0]
File "/usr/local/lib/python3.5/dist-packages/construct/core.py", line 300, in _read_stream
raise FieldError("expected %d, found %d" % (length, len(data)))
construct.core.FieldError: expected 4, found 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/construct/core.py", line 437, in _parse
obj.append(self.subcon._parse(stream, context))
File "/usr/local/lib/python3.5/dist-packages/construct/core.py", line 728, in _parse
subobj = sc._parse(stream, context)
File "/usr/local/lib/python3.5/dist-packages/construct/core.py", line 360, in _parse
raise FieldError(sys.exc_info()[1])
construct.core.FieldError: expected 4, found 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/lin/empower-runtime/empower/lvapp/lvappconnection.py", line 178, in _on_read
self._trigger_message(hdr.type)
File "/home/lin/empower-runtime/empower/lvapp/lvappconnection.py", line 196, in _trigger_message
msg = self.server.pt_types[msg_type].parse(self.__buffer)
File "/usr/local/lib/python3.5/dist-packages/construct/core.py", line 183, in parse
return self.parse_stream(BytesIO(data))
File "/usr/local/lib/python3.5/dist-packages/construct/core.py", line 193, in parse_stream
return self._parse(stream, Container())
File "/usr/local/lib/python3.5/dist-packages/construct/core.py", line 665, in _parse
subobj = sc._parse(stream, context)
File "/usr/local/lib/python3.5/dist-packages/construct/core.py", line 440, in _parse
raise ArrayError("expected %d, found %d" % (count, c), sys.exc_info()[1])
construct.core.ArrayError: ('expected 300, found 207', FieldError(FieldError('expected 4, found 0',),))
INFO:lvapp.lvappconnection:WTP disconnected: A2:5C:4E:1A:F0:6A
INFO:core.pnfdev:PNFDev A2:5C:4E:1A:F0:6A mode online->disconnected
INFO:core.module:WTP A2:5C:4E:1A:F0:6A not connected
INFO:core.module:Removing wifi_stats (id=2)
There error comes from function _trigger_message, the msg_type for the errors is 56
def _trigger_message(self, msg_type):
if msg_type not in self.server.pt_types:
self.log.error("Unknown message type %u", msg_type)
return
if self.server.pt_types[msg_type]:
msg_name = self.server.pt_types[msg_type].name
msg = self.server.pt_types[msg_type].parse(self.__buffer)