This application was added in SmartMesh SDK 1.0.5
The Timelapse application consists of 2 scripts:
Timelapse1Collect.py
connects to a SmartMesh IP manager and logs all network activity inNetworkActivity.txt
Timelapse2Analyze.py
analyzes the contents ofNetworkActivity.txt
running Timelapse1Collect.py
Start the Timelapse1Collect.py
application and connect to the SmartMesh IP manager. The application subscribes to all notifications and displays the number of notifications it has received:"
In the background, Timelapse1Collect.py
logs all that activity in the file NetworkActivity.txt
. You can open that file with any text editor:
[Thu, 18 Feb 2016 15:08:46 UTC] [startLogging] [Thu, 18 Feb 2016 15:08:51 UTC] [moteConfig] [{"macAddress": [0, 23, 13, 0, 0, 56, 4, 59], "state": 4, "isRouting": true, "reserved": 1, "RC": 0, "moteId": 1, "isAP": true}, {"macAddress": [0, 23, 13, 0, 0, 56, 4, 53], "state": 4, "isRouting": true, "reserved": 0, "RC": 0, "moteId": 2, "isAP": false}, {"macAddress": [0, 23, 13, 0, 0, 56, 3, 202], "state": 4, "isRouting": true, "reserved": 0, "RC": 0, "moteId": 3, "isAP": false}, {"macAddress": [0, 23, 13, 0, 0, 56, 6, 201], "state": 4, "isRouting": true, "reserved": 0, "RC": 0, "moteId": 4, "isAP": false}, {"macAddress": [0, 23, 13, 0, 0, 56, 7, 12], "state": 4, "isRouting": true, "reserved": 0, "RC": 0, "moteId": 5, "isAP": false}] [Thu, 18 Feb 2016 15:08:51 UTC] [moteInfo] [{"macAddress": [0, 23, 13, 0, 0, 56, 4, 59], "assignedBw": 0, "state": 4, "numGoodNbrs": 4, "packetsReceived": 22, "totalNeededBw": 96, "requestedBw": 57180, "avgLatency": 0, "RC": 0, "numNbrs": 4, "packetsLost": 0}, {"macAddress": [0, 23, 13, 0, 0, 56, 4, 53], "assignedBw": 99, "state": 4, "numGoodNbrs": 4, "packetsReceived": 378, "totalNeededBw": 99, "requestedBw": 99, "avgLatency": 40, "RC": 0, "numNbrs": 4, "packetsLost": 0}, {"macAddress": [0, 23, 13, 0, 0, 56, 3, 202], "assignedBw": 7149, "state": 4, "numGoodNbrs": 4, "packetsReceived": 247, "totalNeededBw": 8169, "requestedBw": 8169, "avgLatency": 1000, "RC": 0, "numNbrs": 4, "packetsLost": 0}, {"macAddress": [0, 23, 13, 0, 0, 56, 6, 201], "assignedBw": 3576, "state": 4, "numGoodNbrs": 4, "packetsReceived": 245, "totalNeededBw": 3366, "requestedBw": 8169, "avgLatency": 530, "RC": 0, "numNbrs": 4, "packetsLost": 0}, {"macAddress": [0, 23, 13, 0, 0, 56, 7, 12], "assignedBw": 7149, "state": 4, "numGoodNbrs": 4, "packetsReceived": 245, "totalNeededBw": 8169, "requestedBw": 8169, "avgLatency": 510, "RC": 0, "numNbrs": 4, "packetsLost": 0}] [Thu, 18 Feb 2016 15:08:51 UTC] [topology] [{"toMAC": [0, 23, 13, 0, 0, 56, 4, 53], "quality": 97, "fromMAC": [0, 23, 13, 0, 0, 56, 4, 59]}, {"toMAC": [0, 23, 13, 0, 0, 56, 3, 202], "quality": 100, "fromMAC": [0, 23, 13, 0, 0, 56, 4, 59]}, {"toMAC": [0, 23, 13, 0, 0, 56, 6, 201], "quality": 97, "fromMAC": [0, 23, 13, 0, 0, 56, 4, 59]}, {"toMAC": [0, 23, 13, 0, 0, 56, 7, 12], "quality": 97, "fromMAC": [0, 23, 13, 0, 0, 56, 4, 59]}, {"toMAC": [0, 23, 13, 0, 0, 56, 4, 59], "quality": 97, "fromMAC": [0, 23, 13, 0, 0, 56, 4, 53]}, {"toMAC": [0, 23, 13, 0, 0, 56, 3, 202], "quality": 81, "fromMAC": [0, 23, 13, 0, 0, 56, 4, 53]}, {"toMAC": [0, 23, 13, 0, 0, 56, 6, 201], "quality": 94, "fromMAC": [0, 23, 13, 0, 0, 56, 4, 53]}, {"toMAC": [0, 23, 13, 0, 0, 56, 7, 12], "quality": 100, "fromMAC": [0, 23, 13, 0, 0, 56, 4, 53]}, {"toMAC": [0, 23, 13, 0, 0, 56, 4, 59], "quality": 100, "fromMAC": [0, 23, 13, 0, 0, 56, 3, 202]}, {"toMAC": [0, 23, 13, 0, 0, 56, 4, 53], "quality": 81, "fromMAC": [0, 23, 13, 0, 0, 56, 3, 202]}, {"toMAC": [0, 23, 13, 0, 0, 56, 6, 201], "quality": 74, "fromMAC": [0, 23, 13, 0, 0, 56, 3, 202]}, {"toMAC": [0, 23, 13, 0, 0, 56, 7, 12], "quality": 74, "fromMAC": [0, 23, 13, 0, 0, 56, 3, 202]}, {"toMAC": [0, 23, 13, 0, 0, 56, 4, 59], "quality": 97, "fromMAC": [0, 23, 13, 0, 0, 56, 6, 201]}, {"toMAC": [0, 23, 13, 0, 0, 56, 4, 53], "quality": 94, "fromMAC": [0, 23, 13, 0, 0, 56, 6, 201]}, {"toMAC": [0, 23, 13, 0, 0, 56, 3, 202], "quality": 74, "fromMAC": [0, 23, 13, 0, 0, 56, 6, 201]}, {"toMAC": [0, 23, 13, 0, 0, 56, 7, 12], "quality": 74, "fromMAC": [0, 23, 13, 0, 0, 56, 6, 201]}, {"toMAC": [0, 23, 13, 0, 0, 56, 4, 59], "quality": 97, "fromMAC": [0, 23, 13, 0, 0, 56, 7, 12]}, {"toMAC": [0, 23, 13, 0, 0, 56, 4, 53], "quality": 100, "fromMAC": [0, 23, 13, 0, 0, 56, 7, 12]}, {"toMAC": [0, 23, 13, 0, 0, 56, 3, 202], "quality": 74, "fromMAC": [0, 23, 13, 0, 0, 56, 7, 12]}, {"toMAC": [0, 23, 13, 0, 0, 56, 6, 201], "quality": 74, "fromMAC": [0, 23, 13, 0, 0, 56, 7, 12]}] [Thu, 18 Feb 2016 15:08:52 UTC] [notifData] {"utcSecs": 1025671899, "utcUsecs": 297250, "macAddress": [0, 23, 13, 0, 0, 56, 4, 53], "srcPort": 61625, "dstPort": 61625, "data": [0, 2, 5, 0, 255, 1, 5, 0, 0, 0, 0, 61, 34, 130, 219, 0, 4, 157, 198, 0, 0, 117, 48, 1, 16, 9, 154]} [Thu, 18 Feb 2016 15:09:03 UTC] [notifData] {"utcSecs": 1025671910, "utcUsecs": 505750, "macAddress": [0, 23, 13, 0, 0, 56, 7, 12], "srcPort": 61625, "dstPort": 61625, "data": [0, 2, 5, 0, 255, 1, 5, 0, 0, 0, 0, 61, 34, 130, 230, 0, 7, 184, 62, 0, 0, 117, 48, 1, 16, 7, 151]} [Thu, 18 Feb 2016 15:09:06 UTC] [notifData] {"utcSecs": 1025671913, "utcUsecs": 369500, "macAddress": [0, 23, 13, 0, 0, 56, 3, 202], "srcPort": 61625, "dstPort": 61625, "data": [0, 2, 5, 0, 255, 1, 5, 0, 0, 0, 0, 61, 34, 130, 233, 0, 5, 172, 44, 0, 0, 117, 48, 1, 16, 9, 217]} [Thu, 18 Feb 2016 15:09:11 UTC] [notifData] {"utcSecs": 1025671917, "utcUsecs": 523750, "macAddress": [0, 23, 13, 0, 0, 56, 6, 201], "srcPort": 61625, "dstPort": 61625, "data": [0, 2, 5, 0, 255, 1, 5, 0, 0, 0, 0, 61, 34, 130, 237, 0, 8, 13, 107, 0, 0, 117, 48, 1, 16, 9, 132]}
In this file, each line contains one notification, and starts with a timestamp of when that line was written to the file.
running Timelapse2Analyze.py
Before you can run Timelapse2Analyze.py
, you need to create a file called MotePositions.txt
which indicates the position of each of the motes in the network. An example contents of this file is:
00-17-0D-00-00-38-04-3B 0 0 00-17-0D-00-00-38-04-35 2 1 00-17-0D-00-00-38-03-CA 4 0 00-17-0D-00-00-38-06-C9 1 5 00-17-0D-00-00-38-07-0C 3 3
In which:
- the first column is the MAC address of the different motes and manager in the network
- the second column is the position of the mote/manager on the X-axis
- the second column is the position of the mote/manager on the Y-axis
Once this file is created, double-click on Timelapse2Analyze.py
. This will create two files:
allMoteInfo.html
contains a table which contains statistics for each motetopology.html
draws the topology of the nodes. Hovering over a node displays the same information as contained inallMoteInfo.html
.