Interactive Serial Output

It may be useful to have access to the FlowCloud command line interface (CLI) for debugging purposes and to reconfigure it. It is suggested that you use a dedicated program for accessing the CLI such as PuTTY (see the page on console setup for how to connect PuTTY to the WiFire) however MPIDE's Serial Monitor may suffice. The FlowCloud framework in Arduino uses the same serial port as is used in the Arduino sketches, so once it has finished using the port during configuration and boot it will relinquish control back to Arduino.

To re-allow Flow to use the serial we first need to bring it up from within our sketch. Adding the line

Serial.begin(115200);

in the setup() method will allow us to write to the serial port. Adding

g_EnableConsole = true;

will then allow FlowCloud to also use the same port and

g_EnableConsoleInput = true;

will allow FlowCloud to take input to the command handler. More information on what you can do with the command handler can be found here or in the FlowCloud specification

Writing to the serial port will be shared, and messages from both FlowCloud and our sketch will be sent over the serial port.

The Baud Rate

Using

Serial.begin(115200);

we run the serial port at 115200 bytes per second. This is not required and some tutorials use other rates such as 9600.

115200 has the advantage in this case that it is the same as what is used during the boot process, so we can see the boot log at the same time as anything printed out after the sketch started.

Console Input

Issuing

g_EnableConsoleInput = true;

Allows the FlowCloud framework to receive input, but if we want to use functions such as

Serial.read()

and other commands that read from the serial port we can add

g_EnableConsoleInput = false;

beforehand and then re-enable FlowCloud's access afterwards.

Alternately we could simply never enable console input in the first place.