diff --git a/software/openvisualizer/bin/openVisualizerApp/web_files/templates/moteview.tmpl b/software/openvisualizer/bin/openVisualizerApp/web_files/templates/moteview.tmpl index 0fcbfc2d9..425f2fb87 100644 --- a/software/openvisualizer/bin/openVisualizerApp/web_files/templates/moteview.tmpl +++ b/software/openvisualizer/bin/openVisualizerApp/web_files/templates/moteview.tmpl @@ -356,13 +356,13 @@ // Neighbors responsive table if (hasJson) { - var tbl_body = ""; + var tbl_body = "
UsedInsecuref6PNORESsixtopGENsixtopSeqNumParentStableStabilityAddressDAG RankJPRSSRXTXTX ACKWrapASNbackoffExponentbackoff
"; $.each(nbrsJson, function() { var tbl_row = ""; tbl_row += ""; tbl_row += ""; - tbl_row += ""; + tbl_row += ""; tbl_row += ""; tbl_row += ""; tbl_row += ""; diff --git a/software/openvisualizer/openvisualizer/RPL/topology.py b/software/openvisualizer/openvisualizer/RPL/topology.py index b7a1161a4..d7cc1e32d 100644 --- a/software/openvisualizer/openvisualizer/RPL/topology.py +++ b/software/openvisualizer/openvisualizer/RPL/topology.py @@ -31,7 +31,8 @@ def __init__(self): self.dataLock = threading.Lock() self.parents = {} self.parentsLastSeen = {} - self.NODE_TIMEOUT_THRESHOLD = 150 + self.parentsDelay = {} + self.NODE_TIMEOUT_THRESHOLD = 900 eventBusClient.eventBusClient.__init__( self, @@ -82,7 +83,11 @@ def updateParents(self,sender,signal,data): self.parents.update({data[0]:data[1]}) self.parentsLastSeen.update({data[0]: time.time()}) - self._clearNodeTimeout() + with open("dagRecord.txt",'a') as f: + f.write("\ntotal nodes number: {0}\n".format(len(self.parents))) + for addr, timestamp in self.parentsLastSeen.iteritems(): + f.write('--addr {0} timestamp {1}\n'.format(''.join(['%02X' % x for x in addr[-2:]]), time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(timestamp)))) + # self._clearNodeTimeout() def _clearNodeTimeout(self): threshold = time.time() - self.NODE_TIMEOUT_THRESHOLD diff --git a/software/openvisualizer/openvisualizer/moteConnector/ParserStatus.py b/software/openvisualizer/openvisualizer/moteConnector/ParserStatus.py index b7098a3d3..a9d2ee378 100644 --- a/software/openvisualizer/openvisualizer/moteConnector/ParserStatus.py +++ b/software/openvisualizer/openvisualizer/moteConnector/ParserStatus.py @@ -143,6 +143,7 @@ def __init__(self): 'lastUsedAsn_4', # B 'lastUsedAsn_2_3', # H 'lastUsedAsn_0_1', # H + ], ) self._addFieldsParser ( @@ -209,7 +210,7 @@ def __init__(self): 'asn_0_1', # H 'joinPrio', # B 'f6PNORES', # B - 'sixtopGEN', # B + 'inBlacklist', # B 'sixtopSeqNum', # B 'backoffExponent', # B 'backoff', # B diff --git a/software/openvisualizer/openvisualizer/moteConnector/StackDefines.py b/software/openvisualizer/openvisualizer/moteConnector/StackDefines.py index a3f95ff3e..f1695818a 100644 --- a/software/openvisualizer/openvisualizer/moteConnector/StackDefines.py +++ b/software/openvisualizer/openvisualizer/moteConnector/StackDefines.py @@ -1,6 +1,6 @@ # DO NOT EDIT DIRECTLY! # This file was generated automatically by GenStackDefines.py -# on Mon, 14 Aug 2017 10:37:31 +# on Mon, 12 Mar 2018 10:55:53 # components = { @@ -20,35 +20,32 @@ 13: "NEIGHBORS", 14: "SCHEDULE", 15: "SIXTOP_RES", - 16: "SF", - 17: "OPENBRIDGE", - 18: "IPHC", - 19: "FORWARDING", - 20: "ICMPv6", - 21: "ICMPv6ECHO", - 22: "ICMPv6ROUTER", - 23: "ICMPv6RPL", - 24: "OPENTCP", - 25: "OPENUDP", - 26: "OPENCOAP", - 27: "C6T", - 28: "CEXAMPLE", - 29: "CINFO", - 30: "CLEDS", - 31: "CSENSORS", - 32: "CSTORM", - 33: "CWELLKNOWN", - 34: "TECHO", - 35: "TOHLONE", - 36: "UECHO", - 37: "UINJECT", - 38: "RRT", - 39: "SECURITY", - 40: "USERIALBRIDGE", - 41: "UEXPIRATION", - 42: "UMONITOR", - 43: "CJOIN", - 44: "OPENOSCOAP", + 16: "OPENBRIDGE", + 17: "IPHC", + 18: "FORWARDING", + 19: "ICMPv6", + 20: "ICMPv6ECHO", + 21: "ICMPv6ROUTER", + 22: "ICMPv6RPL", + 23: "OPENUDP", + 24: "OPENCOAP", + 25: "C6T", + 26: "CEXAMPLE", + 27: "CINFO", + 28: "CLEDS", + 29: "CSENSORS", + 30: "CSTORM", + 31: "CWELLKNOWN", + 32: "UECHO", + 33: "UINJECT", + 34: "RRT", + 35: "SECURITY", + 36: "USERIALBRIDGE", + 37: "UEXPIRATION", + 38: "UMONITOR", + 39: "CJOIN", + 40: "OPENOSCOAP", + 41: "CINFRARED", } errorDescriptions = { @@ -129,15 +126,15 @@ sixtop_returncode = { 0: "RC_SUCCESS", - 1: "RC_ERROR", - 2: "RC_EOL", + 1: "RC_EOL", + 2: "RC_ERROR", 3: "RC_RESET", 4: "RC_VER_ERR", 5: "RC_SFID_ERR", - 6: "RC_GEN_ERR", - 7: "RC_BUSY", - 8: "RC_NORES", - 9: "RC_CELLLIST_ERR", + 6: "RC_SEQNUM_ERR", + 7: "RC_CELLLIST_ERR", + 8: "RC_BUSY", + 9: "RC_LOCKED", } sixtop_statemachine = { diff --git a/software/openvisualizer/openvisualizer/moteProbe/moteProbe.py b/software/openvisualizer/openvisualizer/moteProbe/moteProbe.py index e98f1cd76..d21dc3858 100644 --- a/software/openvisualizer/openvisualizer/moteProbe/moteProbe.py +++ b/software/openvisualizer/openvisualizer/moteProbe/moteProbe.py @@ -32,6 +32,7 @@ BAUDRATE_TELOSB = 115200 BAUDRATE_GINA = 115200 BAUDRATE_WSN430 = 115200 +BAUDRATE_IOTLAB = 500000 def findSerialPorts(): ''' @@ -68,25 +69,27 @@ def findSerialPorts(): if platform.system() == 'Darwin': portMask = ['/dev/tty.usbserial-*'] else: - portMask = ['/dev/ttyUSB*', '/dev/ttyAMA*', '/dev/ttyA8_M3'] + portMask = ['/dev/ttyUSB*'] for mask in portMask : - serialports += [(s,BAUDRATE_GINA) for s in glob.glob(mask)] + serialports += [(s,BAUDRATE_IOTLAB) for s in glob.glob(mask)] # Find all OpenWSN motes that answer to TRIGGERSERIALECHO commands # Also test for 500000 to find IoT Lab M3 motes mote_ports = [] - for port in serialports: - for baudrate in [port[1], 500000]: - probe = moteProbe(serialport=(port[0],baudrate)) - tester = SerialTester(probe.portname) - tester.setNumTestPkt(1) - tester.setTimeout(2) - tester.test(blocking=True) - if tester.getStats()['numOk'] >= 1: - mote_ports.append((port[0],baudrate)); - probe.close() - probe.join() + # for port in serialports: + # for baudrate in [port[1], BAUDRATE_IOTLAB]: + # probe = moteProbe(serialport=(port[0],baudrate)) + # tester = SerialTester(probe.portname) + # tester.setNumTestPkt(1) + # tester.setTimeout(2) + # tester.test(blocking=True) + # if tester.getStats()['numOk'] >= 1: + # mote_ports.append((port[0],baudrate)); + # probe.close() + # probe.join() + + mote_ports = serialports # log log.info("discovered following COM port: {0}".format(['{0}@{1}'.format(s[0],s[1]) for s in mote_ports])) @@ -246,6 +249,8 @@ def run(self): try: tempBuf = self.inputBuf + with open(socket.gethostname()+'.log','a') as f: + f.write(self.inputBuf) self.inputBuf = self.hdlc.dehdlcify(self.inputBuf) if log.isEnabledFor(logging.DEBUG): log.debug("{0}: {2} dehdlcized input: {1}".format(self.name, u.formatStringBuf(self.inputBuf), u.formatStringBuf(tempBuf))) diff --git a/software/openvisualizer/openvisualizer/moteState/moteState.py b/software/openvisualizer/openvisualizer/moteState/moteState.py index b9156b1c2..690331305 100644 --- a/software/openvisualizer/openvisualizer/moteState/moteState.py +++ b/software/openvisualizer/openvisualizer/moteState/moteState.py @@ -269,7 +269,7 @@ def update(self,notif): notif.asn_2_3, notif.asn_4) self.data[0]['f6PNORES'] = notif.f6PNORES - self.data[0]['sixtopGEN'] = notif.sixtopGEN + self.data[0]['inBlacklist'] = notif.inBlacklist self.data[0]['sixtopSeqNum'] = notif.sixtopSeqNum self.data[0]['backoffExponent'] = notif.backoffExponent self.data[0]['backoff'] = notif.backoff @@ -534,7 +534,7 @@ def __init__(self,moteConnector): 'asn', 'joinPrio', 'f6PNORES', - 'sixtopGEN', + 'inBlacklist', 'sixtopSeqNum', 'backoffExponent', 'backoff', diff --git a/software/openvisualizer/openvisualizer/openLbr/openLbr.py b/software/openvisualizer/openvisualizer/openLbr/openLbr.py index 4e093a3ec..cfc19a4b0 100644 --- a/software/openvisualizer/openvisualizer/openLbr/openLbr.py +++ b/software/openvisualizer/openvisualizer/openLbr/openLbr.py @@ -1106,4 +1106,4 @@ def _formatWireshark(self,pkt): # increment index index += NUM_BYTES_PER_LINE - return '\n'.join(output) + return '\n'.join(output) \ No newline at end of file diff --git a/software/openvisualizer/openvisualizer/openType/typeComponent.py b/software/openvisualizer/openvisualizer/openType/typeComponent.py index effebf076..fd256346b 100644 --- a/software/openvisualizer/openvisualizer/openType/typeComponent.py +++ b/software/openvisualizer/openvisualizer/openType/typeComponent.py @@ -64,6 +64,8 @@ class typeComponent(openType.openType): COMPONENT_USERIALBRIDGE = 0x27 COMPONENT_UEXPIRATION = 0x28 COMPONENT_UMONITOR = 0x29 + COMPONENT_CJOIN = 0x2a + COMPONENT_OPENOSCOAP = 0x2b def __init__(self): # log diff --git a/software/openvisualizer/openvisualizer/remoteConnectorRover/coapserver.py b/software/openvisualizer/openvisualizer/remoteConnectorRover/coapserver.py index 88e8f1c10..6e009fa10 100644 --- a/software/openvisualizer/openvisualizer/remoteConnectorRover/coapserver.py +++ b/software/openvisualizer/openvisualizer/remoteConnectorRover/coapserver.py @@ -57,8 +57,6 @@ def PUT(self,options=[],payload=None): def listmotes(self): - serialList = glob.glob('/dev/ttyUSB*') # Get all Serial ports - serialList += glob.glob('/dev/ttyAMA*') - serialList += glob.glob('/dev/ttyA8_M3') + serialList = glob.glob('/dev/ttyUSB*') return json.dumps([serial for serial in serialList]) \ No newline at end of file
UsedInsecuref6PNORESinBlacklistsixtopSeqNumParentStableStabilityAddressDAG RankJPRSSRXTXTX ACKWrapASNbackoffExponentbackoff
" + this['used'] + "" + this['insecure'] + "" + this['f6PNORES'] + "" + this['sixtopGEN'] + "" + this['inBlacklist'] + "" + this['sixtopSeqNum'] + "" + this['parentPreference'] + "" + this['stableNeighbor'] + "