Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Necessary Hardware

  • Microcontroller/development board of your choice
    • With necessary programmer
  • SmartMesh IP Mote (DC9003A-B)
    • With 6 female-female jumper cables
  • SmartMesh IP Manager (DC2274A-A)
  • SmartMesh Interface Board (DC9006A)
    • With USB-A to USB-micro cable
  • Computer (should support Python and Java)

...

In addition to the files in these folders, you need to implement a handful of functions, as discussed in the next section.

Port to Your Hardware

The QSL and the underlying C Library are written to be used as-is in any C-based platform; however, you have to implement a handful of functions to adapt them to a specific platform. These functions are implemented in the example code provided for certain platforms (presented in later chapters), so you can skip the details of this section for now if you plan on using these (or simply wish to have a look at the examples first).

 The necessary functions are declared in following header files:

  • dn_uart.h: These functions allow the SmartMesh C Library to send bytes over the serial port, and receive bytes from the serial port. A "flush" function is provided in case the serial (UART) driver of the user platform is frame-oriented rather than byte-oriented.
  • dn_lock.h: These functions allow the SmartMesh C Library to operate in a multi-threaded environment. If this is the case in the user system, the implementation of these functions would typically consist of pending/posting a mutual exclusion semaphore (mutex); if not, simply use stub functions (i.e. "empty functions").
  • dn_endianness.h: These functions are used to match multi-byte API fields (which are big-endian) to the endianness of the platform.
  • dn_time.h: These functions allows the QSL to perform timing and schedule tasks.
  • dn_watchdog.h: These functions allow the QSL to make sure any watchdog in the user application is fed during processes that can take some time (e.g. searching for a network). If no watchdog is present, simply use stub functions.

The QSL is currently meant to be run in a single threaded environment, thus you can just use stub functions for the prototypes in dn_lock.h. If you wish to run the QSL in a multi-threaded environment, you should create your own mutex (separate from the prototypes in dn_lock.h) to be locked/unlocked before/after calls to the QSL API.

 

Expand
titleClick here to expand more details about the functions you have to implement...
Panel

C Library Specific

Refer to the dustcloud documentation for further details on how to port the prototypes in these headers.

QuickStart Library Specific

Code Block
languagecpp
titledn_time.h
uint32_t dn_time_ms(void):
void dn_sleep_ms(uint32_t milliseconds);

These functions allows the QSL to perform timing, schedule tasks and sleep to save power.

  • time_ms: Simply needs to return time in milliseconds. The absolute value is irrelevant; as long as the time returned from subsequent calls will differ by the actual time passed between them.
  • sleep_ms: Make the CPU sleep for the set number of milliseconds.

 

Code Block
languagecpp
titledn_watchdog.h
void dn_watchdog_feed(void);

This function allows the QSL to make sure any watchdog in the user application is fed during processes that can take some time (e.g. searching for a network).

  • watchdog_feed: Feed any watchdog that might be implemented in the platform; simply use stub function if none.

 

Install FTDI Serial Drivers

To be able to connect to and configure the mote and manager, your computer will need the necessary FTDI Serial Drivers. Most modern OSes come with FTDI drivers pre-installed (e.g. Linux), but you may have to install them manually if they do not configure automatically when you plug in the interface board or manager. Follow the installation guide corresponding to your OS if you have any trouble.

...

Figure 2: The DC9003A (mote) with the P1 pin header marked in red.

 

Prepare Manager

Image Removed
Figure 3: The DC2274A SmartMesh IP USB Manager

If you installed the correct drivers, you only have to insert the USB port in your computer: The manager will power up and start creating a network automatically.

Similar to the mote via the interface board, you should now see 4 new serial ports, where the third and fourth give you access to the CLI and API, respectively.

5.1 Factory Default Values

By default the manager is shipped with a well-known network ID and join key that your application will need to connect to its network, so you do not need to configure anything. However, it is useful to know about certain commands available through the CLI. These commands are presented in the next section, while relevant default values for its configuration parameters are listed in Table 4.

 

 

...

Parameter

...

Comment

...

Default Value

...

 

Table 4: Relevant factory default values for the SmartMesh IP Manager

Refer to the SmartMesh IP User's Guide for a complete list of default configuration parameters for the manager.

 

5.2 Useful CLI Commands

With the manager connected to your computer via USB:

...

Unlike the mote, you will first have to login to have access to the commands we want:

...

 

...

> login user
  

...

titleClick here to expand the CLI commands...

...

  • sm: Displays information about the motes in the network. The manager itself will always be the first one listed (with MoteID 1)

    Code Block
    languagetext
    titleShow Motes
    > sm
         MAC                MoteId  State Nbrs Links Joins    Age StateTime
    00-17-0D-00-00-60-39-35    1     Oper    1    21     1      0    4-05:25:14
    00-17-0D-00-00-58-63-C1    2     Oper    1     9    49      4    0-00:28:39
  • trace motest on: Turns on a trace which shows mote state transitions as they connect to or drop from the network.

    Code Block
    languagetext
    titleTrace Mote States On
    > trace motest on
    
    > 103190771 : Mote #2 State:   Lost -> Negot1
    > 103192421 : Mote #2 State: Negot1 -> Negot2
    > 103195937 : Mote #2 State: Negot2 ->  Conn1
    > 103197989 : Mote #2 State:  Conn1 ->  Conn2
    > 103202092 : Mote #2 State:  Conn2 ->   Oper
  • set config <param>=<value>: Set a configuration parameter in the Manager. This change is persistent, but only takes affect after a reboot.

    Code Block
    languagetext
    titleSet Configuration Parameter: Network ID
    > set config netid=1229
  • show config: Show the persistent configuration parameters

    Code Block
    languagetext
    titleShow Configuration
    > show config
    netid = 1229
    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
  • set acl mac=<macAddr> key=<joinKey>: Add an Access Control List entry for the given MAC address and mote specific join key. This change is persistent, but only takes affect after a reboot.

    Code Block
    languagetext
    titleAdd ACL Entry
    > set acl mac=01-23-45-67-89-AB-CD-EF key=000102030405060708090A0B0C0D0E0F
    Set OK
  • show acl: Show the motes currently whitelisted on the manager Access Control List.

    Code Block
    languagetext
    titleShow ACL
    > show acl
    ACL:
        MAC: 01-23-45-67-89-AB-CD-EF
    ----
  • delete acl <macAddress | all>: Remove all entries in the Access Control List or the one specified by the given MAC address.

    Code Block
    languagetext
    titleDelete ACL Entry
    > delete acl all
    Delete all ACL records
  • reset system: Software reset (reboot) of the manager.

    Code Block
    languagetext
    titleReset Manager
    > reset system
    Reset initiating. Please wait
    
    > Disconnecting; 1
     70978 : Lost
     71702 : Lost
     72425 : Lost
     73148 : Lost
     73871 : Lost
     74594 : Lost
     75318 : Lost
    SmartMesh IP Manager ver 1.2.4.1.  (x100)
       829 : **** AP connected. Network started

...

.