Skip to content
haukepetersen edited this page Oct 30, 2014 · 5 revisions

RIOT-TV Wiki

Introduction

RIOT-TV is a distributed tool for real-time visualization of network hierarchy and network traffic between connected nodes running RIOT. It is build as a node.js application and written in Javascript.

Architecture

RIOT-TV is split into three main components, the central anchor, front-end code that is running in the browser and reporters that collect information directly from embedded nodes running RIOT:

RIOT-TV Architecture

As illustrated above, the communication between these components is based on TCP and web-sockets. For this the instances can be run on either the same or different hosts.

The Anchor

Found in: RIOT-TV/anchor/anchor.js

The anchor is the central instance of RIOT-TV. Once started, it will do two things:

  1. Open a TCP server to which reporters can collect
  2. Start a web-server

Once running, the anchor parses incoming data from the reporters and pushes it to all connected front-ends.

Currently the anchor is programmed in a way, that certain type of pre-defined strings will trigger changes to the displayed graph.

Example: The string p_s: ID n4 selected ID n8 as parent will trigger a link in a certain color to be shown between nodes n4 and n8.

The Reporters

Found in: RIOT-TV/reporter/reporter.js

Reporters are simple proxies that forward data from connected RIOT nodes to the anchor. For this reporter instance is required for each node that should be visualized.

Once running, a reporter is parsing all characters from a given UART interface into lines. Each line read is then saved into a JSON object, augmented with a timestamp and subsequently piped into the TCP connection with the anchor.

The (Web)Front-end

Found in: RIOT-TV/anchor/root/js/root.js

The front-end is displaying the network hierarchy in from of a graph using sigma.js. On the initial connection to the anchor a pre-defined layout is displayed and a web-socket connection is opened. Following the front-end will receive commands from the anchor that trigger changes in the displayed graph.

Running RIOT-TV

As prerequisite for running RIOT-TV node.js needs to be installed on each host that is running one or more reporters as well as on the host running the reporter.

To actually run RIOT-TV, the following steps are needed:

1 - On the host running the anchor:

$ cd PATH/TO/RIOT-TV/anchor
$ npm install
$ node anchor.js

2 - For each RIOT node start one reporter:

$ cd RIOT-TV/reporter
$ npm install
$ node reporter.js

3 - Connect with a browser to the anchor on the port as printed by the anchor at start-up.