Lab 25. Switch to slave mode

Expected completion time of this lab: 10 min

.


Overview of Master/Slave modes

The default firmware on your SmartMesh IP Mote has two modes of operation:

  • In “master” mode, the mote is autonomous: it joins the network, and allows a user to interact with it through the OAP protocol. This is the mode you have been using up to now.

  • In “slave” mode, the mote is driven by an external micro-controller, through a serial API. In this lab, we will explore this mode, and interact with a SmartMesh IP Mote using the APIExplorer.

In the same network, you can have some motes operating in master mode, others in slave mode.

 

It is important to understand that the OAP protocol is disabled when the mote is in slave mode. The table below summarizes the differences between the two modes of operation:


 

 

master mode

slave mode

OAP

enabled

disabled

serial API

disabled

enabled

need an external microcontroller?

NO

YES

Switching your motes to slave mode

  • Connect your SmartMesh IP Manager to your computer using an interface board.

    If you only have one interface board, simply switch the manager on without connecting it to your computer.

  • Switch your SmartMesh IP Manager on.
  • Connect a SmartMesh IP Mote to your computer using an interface board.
  • Open PuTTY, and connect to your mote’s CLI interface.
  • Switch on your mote. The banner appears:

    SmartMesh IP mote, ver 1.3.0.24 (0x400)
    >

    Since your mote is in master mode by default, it will join your SmartMesh IP Manager after a couple of seconds. This is OK.

  • On your mote’s CLI, enter the following command to see what mode your mote is in:

    > get mode
  • What mode is your mote currently in?

     

  • Enter the following command to switch to “slave” mode:

    > set mode slave
  • Power cycle the mote. When the banner appears, enter the command to see what mode the mote is in. What mode is your mote currently in?

  • Congratulations! You have switched your mote to slave mode.

In slave mode , the mote does NOT attempt to join the network. You can verify that the mote is indeed in “Lost” state of the manager’s CLI:

> login user
> sm
MAC MoteId State Nbrs Links Joins Age StateTime
00-17-0D-00-00-38-0F-B3 1 Oper 0 19 1 0 0-00:07:16
00-17-0D-00-00-60-05-69 2 Lost 1 14 1 92 0-00:00:32
Number of motes (max 33): Total 2, Live 1, Joining 0