diff --git a/openvisualizer/main.py b/openvisualizer/main.py index b633e96d..6724205c 100644 --- a/openvisualizer/main.py +++ b/openvisualizer/main.py @@ -25,7 +25,7 @@ import coloredlogs import pkg_resources import verboselogs -from iotlabcli.parser import common +# from iotlabcli.parser import common from openvisualizer import PACKAGE_NAME, WINDOWS_COLORS, UNIX_COLORS, DEFAULT_LOGGING_CONF, APPNAME from openvisualizer.eventbus import eventbusmonitor @@ -34,7 +34,7 @@ from openvisualizer.motehandler.moteconnector import moteconnector from openvisualizer.motehandler.moteprobe import emulatedmoteprobe from openvisualizer.motehandler.moteprobe import testbedmoteprobe -from openvisualizer.motehandler.moteprobe.iotlabmoteprobe import IotlabMoteProbe +# from openvisualizer.motehandler.moteprobe.iotlabmoteprobe import IotlabMoteProbe from openvisualizer.motehandler.moteprobe.serialmoteprobe import SerialMoteProbe from openvisualizer.motehandler.motestate import motestate from openvisualizer.motehandler.motestate.motestate import MoteState @@ -881,7 +881,7 @@ def main(): parser = ArgumentParser() _add_parser_args(parser) - _add_iotlab_parser_args(parser) + # _add_iotlab_parser_args(parser) args = parser.parse_args() # create directories to store logs and application data @@ -985,9 +985,9 @@ def main(): auto_boot=args.auto_boot, root=args.set_root, topo_file=args.topo_file, - iotlab_motes=args.iotlab_motes, - iotlab_user=args.username, - iotlab_passwd=args.password, + iotlab_motes=None, + iotlab_user=None, + iotlab_passwd=None, ) try: diff --git a/openvisualizer/motehandler/moteconnector/openparser/parserdata.py b/openvisualizer/motehandler/moteconnector/openparser/parserdata.py index d1aa0e4e..117b7ad1 100644 --- a/openvisualizer/motehandler/moteconnector/openparser/parserdata.py +++ b/openvisualizer/motehandler/moteconnector/openparser/parserdata.py @@ -101,9 +101,10 @@ def parse_input(self, data): # cross layer trick here. capture UDP packet from udpLatency and get ASN to compute latency. offset = 0 if len(data) > 37: - offset -= 7 - if self.UINJECT_MASK == ''.join(chr(i) for i in data[offset:]): + offset += 31 + if self.UINJECT_MASK == ''.join(chr(i) for i in data[offset:offset+len(self.UINJECT_MASK)]): + offset += len(self.UINJECT_MASK) pkt_info = \ { 'asn': 0, @@ -115,30 +116,30 @@ def parse_input(self, data): 'dutyCycle': 0, } - offset -= 2 - pkt_info['counter'] = data[offset - 2] + 256 * data[offset - 1] # counter sent by mote + pkt_info['counter'] = data[offset] + 256 * data[offset+1] # counter sent by mote + offset += 2 - pkt_info['asn'] = struct.unpack('