From e26287ffcb53437a952d09c9e4f1eb50c79bb567 Mon Sep 17 00:00:00 2001 From: changtengfei Date: Tue, 7 Jun 2022 08:53:10 -0700 Subject: [PATCH 1/4] FW-892. disable iot-lab related requirement. --- openvisualizer/main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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: From 2be4de442de40006d60cd9899adc430c8793710d Mon Sep 17 00:00:00 2001 From: changtengfei Date: Tue, 6 Jun 2023 16:45:35 +0800 Subject: [PATCH 2/4] FW-892. fix the parsing for uinject packet. --- .../moteconnector/openparser/parserdata.py | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/openvisualizer/motehandler/moteconnector/openparser/parserdata.py b/openvisualizer/motehandler/moteconnector/openparser/parserdata.py index d1aa0e4e..4fbda9c0 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(' Date: Tue, 6 Jun 2023 17:00:57 +0800 Subject: [PATCH 3/4] FW-892. don't print stuff over screen for uinject packet. --- .../motehandler/moteconnector/openparser/parserdata.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openvisualizer/motehandler/moteconnector/openparser/parserdata.py b/openvisualizer/motehandler/moteconnector/openparser/parserdata.py index 4fbda9c0..117b7ad1 100644 --- a/openvisualizer/motehandler/moteconnector/openparser/parserdata.py +++ b/openvisualizer/motehandler/moteconnector/openparser/parserdata.py @@ -162,8 +162,6 @@ def parse_input(self, data): 'avg_pdr': 0.0, } - print(self.avg_kpi) - if self.mqtt_connected: self.publish_kpi(src_id) From 16176f8507f556e8333c58a9b631b5dbf745e455 Mon Sep 17 00:00:00 2001 From: changtengfei Date: Fri, 1 Dec 2023 17:46:12 +0800 Subject: [PATCH 4/4] FW-892. add ACM type device mask --- openvisualizer/motehandler/moteprobe/serialmoteprobe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvisualizer/motehandler/moteprobe/serialmoteprobe.py b/openvisualizer/motehandler/moteprobe/serialmoteprobe.py index 2084dd37..7eb22e3d 100644 --- a/openvisualizer/motehandler/moteprobe/serialmoteprobe.py +++ b/openvisualizer/motehandler/moteprobe/serialmoteprobe.py @@ -132,7 +132,7 @@ def _get_ports_from_mask(port_mask=None): if platform.system() == 'Darwin': port_mask = ['/dev/tty.usbserial-*'] else: - port_mask = ['/dev/ttyUSB*'] + port_mask = ['/dev/ttyUSB*', '/dev/ttyACM*'] for mask in port_mask: ports += [s for s in glob.glob(mask)] else: