This is an old revision of the document!


Streams nodes

Run

The nodes which will start the payload. This is practically the first data flow sent towards the rest of the nodes you use in an application.

In its settings you have three fields.

If no payload is specified the payload is set to the current time in milliseconds since 1970. This allows subsequent functions to perform time based actions. You can write it yourself if you chose for it to be a string.

The topic field can hold data to be used later, in other functions.

The repeat function does what it says on the tin and continuously sends the payload every x seconds.

The Fire once at start option actually waits 50mS before firing to give other nodes a chance to instantiate properly.

Any node can have a name given by the user.

Print

The print node can be connected to the output of any node. It will display msg.payload field of any messages it receives.

The button to the right of the node will toggle it's output on and off so you can de-clutter the console window.

If the payload is an object it will be converted to String first for display and indicate that by saying ”(Object) ”.

By connecting the two blocks you send the output of run as input for print.

Functions

Function

A function block where you can write code to do many other interesting things. By convention it will have a msg.payload property containing the body of the message. If you double click on it, you will find the name field, the second field, where you write the code and the last one, where you specify how many outputs the node has. For this node you can find an usage example in Course 3: Software for the Internet of Things .

Visual

This node is similar to the function block, only that the second field will consist of visual blocks.

Look up an example in Lab. 03 - Blink an LED .

Delay

Introduces a delay into a flow or rate limited messages.

Default delay is 5 seconds and rate limit of 1 msg/second, but both can be configured.

The delay node is placed in an example in Course 3: Software for the Internet of Things as well.

Switch

A function node which will evaluate the message received and pass it on after filtering it though a set of ruled. You can create the rules in the node's settings. Find an example of how to use the node in Course 3: Software for the Internet of Things .

Social: Send and receive

You can make board communicate. The message that they exchange will be in the payload. The Send node needs the label, which is the identification of the expected message. It should be the same one in the receive message node. The third field asks for the board ID. In send you need the receiver board ID.

Say

You can make the board speak. Just insert this node and specify the message and the language. It will be saved in the payload.

I/O pins

  • digitalWrite - it will write 0 or 1 on a digital pin, the one that you choose in the settings.
  • digitalRead- reads 0 or 1 from a digital pin demanded in its settings and saves this value in the payload.

  • analogWrite - reads the value from the analog pin mentioned in the settings
  • analogRead - writes a value on an analog/ PMM pin. Said value will be in the payload.

  • Shift in/ out- When it receives an input, shifts in/out a byte value from a pin using the clock pin as clock. The value read/written is in payload. If no data pin is specified, the pin number is the topic field of the message.

Signals

  • receiveSignal- puts in the payload the value received though the signal, from the dashboard. Write in the settings the name of the signal you expect, which should be identical with the one in the dashboard.
  • sendSignal- sends the value of the payload to the signal with the same name in the dashboard or to a certain number of boards.

Web servers

  • http request - this block can either get, post, pull, delete the data from a web page depending on what method you choose

  • Web route - will start a web server which listens on the port you choose and has a method for the configured route
  • Web response- it will set the response of the server. In status you configure it. Default is 200 which is page found.

iot/res/streams.1437395957.txt.gz · Last modified: 2015/07/20 15:39 by madalina.tanea
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0