Difference between revisions of "IoTGateway/LinearDust"

From ESS-WIKI
Jump to: navigation, search
 
Line 4: Line 4:
 
This guide describes some basic commands that you can send to a SmartMesh IP Manager by logging on to its Command Line Interface (CLI). The CLI is available by connecting a serial terminal program to the Manager. The CLI is intended for human interaction with a manger, e.g. during development, or for interactive troubleshooting. Most commands are atomic – a command and its arguments are typed into the CLI, and a response is returned. For example, the help command returns a list of possible commands. Traces are not atomic - once started, they generate output asynchronously until cancelled.
 
This guide describes some basic commands that you can send to a SmartMesh IP Manager by logging on to its Command Line Interface (CLI). The CLI is available by connecting a serial terminal program to the Manager. The CLI is intended for human interaction with a manger, e.g. during development, or for interactive troubleshooting. Most commands are atomic – a command and its arguments are typed into the CLI, and a response is returned. For example, the help command returns a list of possible commands. Traces are not atomic - once started, they generate output asynchronously until cancelled.
  
<big>Note:</big> If you need more CLI information, Please refer to SmartMesh_IP_Manager_CLI_Guide” which can be downloaded from Linear Technology website.
+
<big>Note:</big> If you need more CLI information, Please refer to [http://cds.linear.com/docs/en/design-note/SmartMesh_IP_Embedded_Manager_CLI_Guide.pdf "SmartMesh_IP_Embedded_Manager_CLI_Guide”] which can be downloaded from Linear Technology website.
  
 
==== CLI Access ====
 
==== CLI Access ====

Latest revision as of 04:25, 2 March 2016

Basic COM Port Setting

Introduction

This guide describes some basic commands that you can send to a SmartMesh IP Manager by logging on to its Command Line Interface (CLI). The CLI is available by connecting a serial terminal program to the Manager. The CLI is intended for human interaction with a manger, e.g. during development, or for interactive troubleshooting. Most commands are atomic – a command and its arguments are typed into the CLI, and a response is returned. For example, the help command returns a list of possible commands. Traces are not atomic - once started, they generate output asynchronously until cancelled.

Note: If you need more CLI information, Please refer to "SmartMesh_IP_Embedded_Manager_CLI_Guide” which can be downloaded from Linear Technology website.

CLI Access

There are two dedicated serial ports on the SmartMesh IP manager: one is for API communication with an external application, and the other is dedicated to this command line interface. You can log on to the CLI from any serial terminal program (such as HyperTerminal or Tera Term):

Serial 0 — If connecting to an evaluation board integrated with an FTDI serial-to-usb interface, the CLI will be found on the 3rd COM port mapped onto your system.

The following is the steps to log on to CLI by using minicom:

  1. Establish a console connection to WISE-3310.
  2. freescale login: root
  3. root@freescale -$ minicom –s
  4. In configuration menu, select “serial port setup” and press Enter
  5. A→/dev/ttyUSB2; E→9600 8N1; F→No (/dev/ttyUSB2 -> WSN1,/dev/ttyUSB3 -> WSN2)
  6. Select Exit to leave


There are two sets of privileges on this system, namely user and viewer. The user privilege allows for system settings to be set and the viewer privilege only allows the viewing of manager and network information. For example, to login to the manager CLI from the terminal program, enter either of the following usernames and passwords:

 login viewer
 login user

To logout of the Manager CLI:

 logout

Managing user and viewer Passwords

The default passwords should be changed with the following commands (after logging in with "user" privileges):

 set config pwdviewer <newpassword>
 set config pwduser <newpassword>

Mote Commands

Commands beginning with an 'm' such as mtrace or minfo are specific to the Access Point "mote" and are described in the WISE-1020_User_Manual documentation.

Commands

This manual describes the CLI commands available in the SmartMesh IP manager. The CLI is case-insensitive. In most cases a command will be recognized by the shortest unambiguous string, so the following are all equivalent:

 > trace rawio_enc on
 > trace rawio on
 > trace raw on

Login

  • Description

The CLI interface requires a login, and the password entered determines the privilege used for the session. The default passwords match the two privilege levels: viewer and user. The viewer cannot make any configuration changes to the manager. The user has access to all commands. The login command can be used repeatedly without logging out to switch between privilege levels. Passwords for the two privilege levels can be changed using the set config command.

  • Syntax
 login [<user>:] <password>
  • Parameters
Parameter Description
user viewer or user
password password for the privilege level.

default passwords as shipped are "user" for user and "viewer" for viewer note: passwords can be changed with the set config command

  • Example
 login user: me$h
 login me$h

Logout

  • Description

Logout from the current CLI session.

  • Syntax
 logout
  • Example
 logout

Reset

  • Description

Reset a specified entity in the network: either a mote or the manager. This command requires user privilege.

  • Syntax
 reset <entity>
  • Parameters
Parameter Description
entity
  • When called with "system", resets the manager and by extension the entire network.
  • When called with "mote", mote can be referenced by Mote ID or MAC address.
  • Example
 reset mote 2
 reset system

Show Config & Show curconfig

 > show config
 netid = 302
 txpower = 8
 frprofile = 1
 maxmotes = 33
 basebw = 9000
 dnfr_mult = 1
 numparents = 2
 cca = 0
 channellist = 00:00:7f:ff
 autostart = 1
 locmode = 0
 bbmode = 0
 bbsize = 1
 license = 00:00:00:00:00:00:00:00:00:00:00:00:00
 ip6prefix = fe:80:00:00:00:00:00:00:00:00:00:00:00:00:00:00
 ip6mask = ff:ff:ff:ff:ff:ff:ff:ff:00:00:00:00:00:00:00:00
 radiotest = 0
 bwmult = 300
 onechannel = 255

Both of these commands return the same data structure. The show config command will display the persistent parameters, i.e. the ones used after the next boot. The show curconfig command displays the current parameters being used.

Show mote

 > show mote 2
 Mote #2, mac: 00-17-0D-00-00-38-16-6B
 State: Oper, Hops: 1.1, Uptime: 0-00:30:39, Age: 1
 Regular. Route/TplgRoute.
 Power Cost: Max 65534, FullTx 110, FullRx 65
 Capacity links: 200, neighbours 31
 Number of neighbors (parents, descendants): 8 (2, 15)
 Bandwidth total / mote exist (requested): 90 / 954 (987)
 Links total / mote exist (requested): 64.0 / 6.0 (5.8)
 Link Utilization : 1.0
 Number of total TX links (exist / extra): 64 / 0
 Number of links : 130
 Compressed : 5
 Upstream tx/rx : 122 (64/58) (Rx10=58.0)
 Downstream rx : 3
 Neighbors:
 -> # 1 Q: 71% RSSI: -59/0
 -> # 7 Q: 55% RSSI: -55/-49
 <- # 9 Q: 97% RSSI: -39/-40
 <- #15 Q: 94% RSSI: -37/-39
 <- #17 Q: 87% RSSI: -40/-43
 <- #18 Q: 91% RSSI: -44/-44
 <- #20 Q: 29% RSSI: -76/-74
 <- #24 Q: 29% RSSI: -76/-75

Description of fields:

  • Mote: Short address of mote
  • mac: EUI-64 of mote
  • State: Manager-assigned current state for the mote, one of Idle, Negot1-2, Conn1-5, Oper, or Lost
  • Hops: The average number of hops taken by this mote's upstream packets, as measured by the TTL when received at the AP
  • Uptime: Time since the mote's most recent state change
  • Age: Time, in seconds, since the manager received the most recent upstream packet from this mote
  • Power type: Power (maxStCurrent in powerSrcInfo param = 0xffff), Regular, or Low Power (maxStCurrent less than needed for routing)
  • Route type reported by the mote: Route, No-route (from routingMode param)
  • Route type as assigned by the manager: TplgRoute, TplgNo-Route
  • Power Cost: powerSrcInfo parameters reported by mote during joining
  • Number of neighbors: first entry is # parents + # children = # nbrs, first entry in parentheses is # parents, second entry in parentheses is descendants. From this # children = # nbrs - # parentsmac: EUI-64 of mote
  • Bandwidth (ms/packet): the bandwidth section is devoted to upstream traffic and upstream links only; the total shows the combination of mote-local and descendant traffic; the mote exist value shows the bandwidth that the mote itself is
  • responsible for; the requested value in parentheses shows the bandwidth that the mote asked for through service requests. Lower values here represent more bandwidth. In general, the mote exist value will be slightly less than the requested value since there is some roundoff as the manager cannot add fractional links.
  • Links (links/superframe): the total shows the combination of links added to support mote-local and descendant traffic; the mote exist value shows the number of links added specifically for this mote's service requests; the requested value in parentheses shows a floating point number of links that could support the traffic, so the mote exist value is the requested value rounded up to the nearest integer.
  • Link Utilization: a number between 0 and 1 representing how close to the provisioning limit the manager thinks the mote is. For example, if the manager expects the mote to send 1 pkt/s, the provisioning is 3x, and the mote has 10 link/s upstream, the utilization would be 1*3/10 = 0.3. This value is used to scale traffic requirements to the mote's parent to keep link numbers down in low-traffic networks.
  • Number of total TX links: the exist value shows how many upstream links are currently assigned, and the extra value shows how many will be deleted during the next optimization cycle Number of links: Total links across all slotframes, not just the upstream links; also this is the sum of the next three rows
  • Compressed: Number of compressed links, which are used for advertising, join listen, and discovery; these are assigned during the mote's join and never changed, so the manager saves memory by storing them in a compressed format
  • Upstream: Total, (# Tx / # Rx as an integer), (# Rx needed, not rounded up)
  • Downstream: # Rx links from parents; note that 1-hop motes may have two downstream Rx links from the AP, one broadcast and one multicast
  • Neighbors: relationship (-> to parent, <- to child, – discovered), neighbor's mote ID, path quality (30% or 74% until path stability is measured), RSSI as measured by this mote, RSSI as measured by the neighbor mote

Note that "routing type" can be set either on the mote or on the manager. If either the mote or the manager declares a mote to be non-routing, then the mote will not be assigned children or advertisement links.

Show stat

 > show stat
 Manager Statistics --------------------------------
 established connections: 1
 dropped connections : 0
 transmit OK : 0
 transmit error : 0
 transmit repeat : 0
 receive OK : 0
 receive error : 0
 acknowledge delay avrg : 0 msec
 acknowledge delay max : 0 msec
 Network Statistics --------------------------------
 reliability: 100% (Arrived/Lost: 7217/0)
 stability: 99% (Transmit/Fails: 14304/204)
 latency: 200 msec
 Motes Statistics -----------------------------------
 Mote Received Lost Reliability Latency Hops
 #2 257 0 100% 580 1.3
 #3 249 0 100% 450 1.0
 #4 6463 0 100% 250 2.4
 #5 248 0 100% 150 1.2

This command displays the mote and network statistics. The counters here are incremented or averaged over the lifetime of the network, or since they have actively been cleared using an exec clearStat CLI command or a clearStatistics API command.

In this example, mote 4 is generating data much more often than the other motes. It is also at 2.4 hops, so all its packets are being forwarded through other motes. Mote 3 is at 1.0 hops, so all its packets are going straight to the AP (it is the "single parent" mote). Motes 2 and 5 are forwarding a fraction of their traffic through mote 3.

Analyzing the numbers:

Reliability: Arrived = 7217 = 257 + 249 + 6463 + 248, Lost = 0. The arrived/lost counters and reliability are kept real-time on the manager so will always be up-to-the-second accurate.

Stability: Transmit = 14304 ≈ 7217 (the packets that arrived) + 204 (the packets that failed and needed to be retransmitted) + 6463 (the packets from mote 4 that needed to be forwarded by 2, 3, & 5) + 50 (20% of mote 5's packets forwarded by mote 3) + 77 (30% of mote 2's packets forwarded by mote 3) + 293 (packets from mote 4 that went to motes 2 and 5 and needed to be forwarded through mote 3). The stability counters and average stability are calculated based on mote health reports so they lag the reliability statistics by up to 15 minutes.

Set Netid & Set Commonjoinkey

  • Description

Set a new Network ID and common join key in the Manager. The change will take effect upon the next system start (after reset or power cycle). This change is persistent. Note that features that require a license will take two resets - once for the license to take effect (and enable the settings change), and once for the setting to take effect.

  • Syntax
 set config <param>=<value>
  • Parameters
Parameter Description
param
  • netid: network id
  • commonjoinkey: common join key
value Value (refer to the configuration parameter table)
  • Example
 set config netid=100

exec exchNetId

  • Description

Exchange the Network ID. This command will change the Network ID of the manager and all motes connected to the network. The new Network ID takes effect the next time the network is restarted. Network IDs 0 and 65535 are reserved and should not be used. This change is persistent.

  • Syntax
 exec exchNetId <netId>
  • Parameters
Parameter Description
netId Integer between 1 and 65534
  • Example
 exec exchNetId 100

exec exchJoinKey

  • Description

Replace the join key for a specified mote. The message is sent to the mote and is also changed in the ACL. This change is persistent.

  • Syntax
 exec exchJoinKey <address> <joinKey>
  • Parameters
Parameter Description
address Mote ID or MAC address of mote to be changed
joinkey 16-byte join key
  • Example
 exec exchJoinKey 00-17-0D-00-00-38-00-21 000102030405060708090A0B0C0D0E0F

Note: The joinkey showing on CLI is Hex code while in WebUI, it is presented as ASCII code

sm

  • Description

Show motes in the network

  • Syntax
 sm [-v]
  • Parameters
Parameter Description
-v verbose
  • Example
 > sm
 MAC MoteId State Nbrs Links Joins Age StateTime
 00-17-0D-00-00-38-07-13 1 Oper 2 25 1 0 0-00:45:39
 00-17-0D-00-00-38-06-28 2 Oper 2 15 1 1 0-00:45:21
 00-17-0D-00-00-38-04-2F 3 Oper 2 15 2 1 0-00:28:49
 Number of motes (max 33): Total 3, Live 3, Joining 0

This command lists all the motes currently or previously in the network.

  • MAC: EUI-64 of the mote
  • MoteID: short address assigned to this mote by the manager. MoteID 1 is always the AP.
  • State: Current state of each mote (Negot, Conn, Oper, Lost)
  • Nbrs: Number of neighbors with which this mote has active links.
  • Links: Total number of links, compressed and normal.
  • Joins: Shows how many times the mote has advanced to the Operational state.
  • Age: Seconds since the most recent packet was received by the manager from this mote.
  • StateTime: Time (d-hh:mm:ss) since the mote was advanced to its current state. When a mote is Operational, StateTime shows how long the mote has been in the network.