Upstream

Introduction

The Upstream application takes the SmartMesh IP Mote through the joining, service request, and socket binding state machines, and allows the user to enter dummy "sensor" data and send it to the SmartMesh IP Manager or any Internet host.
It connects to:
  •  The SmartMesh IP Mote running in slave mode.

Running

You can run the Upstream application:

  • by double-clicking on the Windows executable at /win/Upstream.exe
  • by double-clicking on its source files at /src/bin/Upstream/Upstream.py

Description

Upstream consists of three frames:

  • the mote connection frame allows you to connect the application to a SmartMesh IP Mote.
  • the join state machine frame shows the current state of the mote as it joins (states described below). The right-most column shows the time spent in each state.
  • the sensor data to send frame allows the user to choose a 16-bit value (mimicking a sensor), and to send that data to either the manager, or a host on the Internet.

Joining states

 

For the SmartMesh IP Mote to go to all following states, you need to reset it before connecting this Upstream application. You can do so by

  • sending a reset command using the APIExplorer application, or
  • using the reset CLI command, or
  • powering the SmartMesh IP Mote off, then on.
name of the statedescription
WAITFORINITIALNOTIFWait for possible notifications, such as a BOOT notification is the SmartMesh IP Mote was just reset. This state is left after a given timeout, regardless of whether a notification was received.
ASSESSMOTESTATE

Evaluate the current mote's state:

  • retrieve the mote's status; if it's operational, jump to the state READYTOSEND
  • retrieve the services already in place in this mote; jump to the state READYTOSEND of the services are already in place.
  • otherwise, proceed to the CONFIGURE step.
CONFIGUREA transition state.
CONFIGURING_DCConfigure the join duty cycle to 100%.
CONFIGUREDA transition state. When reaching this state, the SmartMesh IP Mote is configured and ready to join the network.
SEARCHINGIssue a join command. Wait to receive an advertisement from the network (a JOINSTART event notification).
JOINREQUESTSENTWait for the SmartMesh IP Mote to become operational (an OPERATIONAL event notification).
OPERATIONALWait for the base bandwidth to be in place (a SVC_CHG event notification).
JOINEDA transition state. When reaching this state, the SmartMesh IP Mote is part of the network.
REQUESTINGSERVICE

Request service to the manager. Wait to receive an indication that the service was installed (a SVC_CHG event notification).

SERVICEGRANTEDA transition state. When reaching this state, the SmartMesh IP Mote has obtained its service and can start sending data.
OPENSOCKETOpen a UDP socket.
BINDSOCKETBind that socket to UDP port 60000.
READYTOSENDThe final state of the joining process.

Sending sensor data

The "sensor data to send" frame is only active when the mote has reached the READYTOSEND state. Once that state is reached, you can set a sensor value, and decide to send:

  • to the manager by pressing the sendto manager button.
  • to a host on the Internet by specifying its IPv6 address, and pressing the send to host button.

 

Sending to the manager simply means sending data to the manager's well-known IPv6 address (ff02::2, or ff020000000000000000000000000002 when written out).

 

 

This application is meant to be used in conjunction with the SensorDataReceiver application connected to the Manager.

For the data to be able to be sent into the Internet, the manager needs to be connected the Low-Power Border Router using the LBRConnection application.