Controls: Input and Response

From RasPiConnect/ArduinoConnect
Jump to: navigation, search

Contents

The Controls: Input and Response

Control Panel Tab
Panel Setup Tab


The ArduinoConnect and the RasPiConnect App use the same Input and Response system on Controls. The transmission method is different (JSON versus XML) and the JSON requests are sent and dealt with individually in the ArduinoConnect Server rather than in groups as in the RaPiConnect Server. Raw mode uses a single line format.

Below is a listing of all the currently supported controls on the RasPiConnect / ArduinoConnect App and the RasPiConnect / ArduinoConnect Server. The required response values and the input fields for each are defined below.

LIVE Control Pack 1

LIVE Control Pack 1


The LIVE control pack has the LIVE response in common. You can refresh them independently of each other and of the page. They can individually be set to query the server for new data periodically. They can make your displays come alive with realtime graphs and data feeds. The Slider Live control allows you to send values to the server dynamically as well as displaying values from the server.

SparkLine LIVE

SparkLine LIVE Control


A SparkLine LIVE plot contains a thin plot line with the last value displayed to the right of the control. It uses the following:

Input
None
Response
Returns string values of data to generate the graph
Returns A^^....||

Where:

A^^.... are the values of data delimited by "^^

note the "||" at the end of the data line!

example return:

68672.000000^^17457.000000^^16954.000000^^723.000000^^10874.000000^^10367.000000^^59561.000000^^56276.000000^^6379.000000^^40763.000000||

Interface ID
SPARKLINE_LIVE_UITYPE 46

Dynamic SparkLine LIVE

Dynamic SparkLine LIVE Control


A Dynamic SparkLine LIVE plot contains a thin plot line with the last value displayed to the right of the control. The control has two modes. The Event driven plot updates the graph each time it receives a new value from the server. The Dynamic option advances the plot line with time and updates the values as they come in based on the time received. The control uses the following:

Input
None
Response
Returns a string value to set for the last value on the graph
Return A
  • A - String floating point number (can be integer)

example return:

"4330.0"


Interface ID
SPARKLINE_DYNAMIC_LIVE_UITYPE 47

Simple Gauge LIVE

Simple Gauge LIVE Control


A Simple Gauge LIVE in the RasPiConnect or ArduinoConnect App uses the following:

Input
None
Response
Returns a string value to set for the gauge position
Return A
  • A String floating point number (can be integer)

example return:

"4"

Interface ID
SIMPLE_GAUGE_VIEW_LIVE_UITYPE 37

Simple Graph LIVE

Simple Graph LIVE Control


A Simple Graph LIVE in the RasPiConnect or ArduinoConnect App uses the following:

Input
None
Response
Returns string values of data and labels to generate the graph
Returns A^^....||N^^.....

Where:

A... is floating point data
N... are labels for the X Axis

example return:

68672.000000^^17457.000000^^16954.000000^^723.000000^^10874.000000^^10367.000000^^59561.000000^^56276.000000^^6379.000000^^40763.000000||1^^2^^3^^4^^5^^6^^7^^8^^9^^10

Interface ID
SIMPLE_LINE_GRAPH_LIVE_UITYPE 38

Bubble Talk LIVE

Bubble Talk LIVE Control


The Bubble Talk Control generates scrolling strings in Bubble format:

Input
None
Response
Returns string for display in bubble
Returns A^^....||N^^.....


example returns:

"New Data = 30.4" or "Power is 4.3W" or "Temperature Alarm"

Interface ID
BUBBLE_TABLE_VIEW_LIVE_UITYPE 43

Activity Indicator LIVE

Activity Indicator LIVE Control



The Activity Indictator LIVE uses the following:

Input
None
Response
"YES" if server is live, anything else (like "NO" or blank string) indicates server is not live.
Interface ID
ACTIVITY_INDICATOR_VIEW_LIVE_UITYPE 44

Slider LIVE

Slider LIVE Control



The Slider LIVE uses the following:

Input
floating point Value of Slider
Response
Floating point value to set the Slider in the app or "" for don't set the value
Interface ID
SLIDER_LIVE_UITYPE 45

Dynamic Label LIVE

Dynamic Label LIVE Control



The Dynamic Label LIVE uses the following:

Input
Current Text of the Dynamic Label
Response
New Text for the Label
Interface ID
LABEL_DYNAMIC_LIVE_UITYPE 48

Standard Controls

Action Button

Action Button Control



Action Buttons in the RasPiConnect / ArduinoConnect App use the following:

Input
None
Response
"OK" if successful, "FAIL" if not
Interface ID
ACTION_BUTTON_UITYPE = 16

Feedback Action Button

Feedback Action Button Control



Feedback Action Buttons in the RasPiConnect / ArduinoConnect App use the following:

Input
None
Response
Returns a string label to be used by the App button (for example: "Lights On" toggling to "Lights Off")
Interface ID
FEEDBACK_ACTION_BUTTON_UITYPE = 17


Alarm Control

Alarm Control



Alarms in the RasPiConnect / ArduinoConnect App use the following:

Input
None
Response
Returns a string to describe the alarm, sounds and frequency
titletext, alarmtext, alarmstate, soundvalue, how often in seconds, how many times
Return A,B,C,D,E,F
  • A String value title for top of alarm
  • B String value for the bottom of the alarm (usually used for alarm description)
  • C Alarm state: YES or NO (no spaces!!!!)
  • E How often to play the sound (every how many seconds), 0 means not at all
  • F How many times to play the alarm song, 0 means forever.

example return:

"alarm 1, Reason1-1,YES, 1005, 1, 10"

This would toggle the LED on the RasPiConnect / ArduinoConnect App every 0.5 seconds.

Interface ID
SOUND_ALARM_UITYPE 35

Single LED

Single LED Control


Single LED controls in the RasPiConnect / ArduinoConnect App use the following:

Input
None
Response
single digit integer from 0 - 6


The Response indicates the resulting color of the LED on the RasPiConnect / ArduinoConnect App.

The supported colors are:

LED_BLACK 0 
LED_BLUE 1 
LED_GREEN 2 
LED_ORANGE 3 
LED_PURPLE 4 
LED_RED 5 
LED_YELLOW 6
Interface ID
SINGLE_LED_DISPLAY = 32

Voltmeter Type

Voltmeter Type Control


Voltmeter type controls in the RasPiConnect / ArduinoConnect App use the following:

Input
None
Response
integer or float number to set value on meter
Interface ID
VOLTMETER_UITYPE = 128

Speedometer Type

Speedometer Type Control


Speedometer type controls in the RasPiConnect / ArduinoConnect App use the following:

Input
None
Response
float or integer number to set value on meter
Interface ID
SPEEDOMETER_UITYPE = 64

Server Status

Server Status Type Control


Server Status controls in the RasPiConnect / ArduinoConnect App use the following:

Input
None
Response
Return "2" to indicate the server is present
Interface ID
SERVER_STATUS_UITYPE = 256

Bar Meter

Frequency Modulated Type Control


Frequency Modulated LED controls in the RasPiConnect / ArduinoConnect App use the following:

Input
None
Response
Return A
  • A is the float value used to determine the height or width of the lighted bar (according to min/max values set in the app)


example return:

3.5

This would show 3 bars if min and max were set to 0 and 10 respectively

Interface ID
BARMETER_UITYPE = 129

Frequency Modulated LED

Frequency Modulated Type Control


Frequency Modulated LED controls in the RasPiConnect / ArduinoConnect App use the following:

Input
None
Response
Return A,B,C
  • A is the float value indicating how fast to flash the LED in seconds
  • B is the float value to display on the RasPiConnect / ArduinoConnect Frequency Modulated Control
  • C is a string value (not containing any commas) to display on the RasPiConnect / ArduinoConnect Frequency Modulated Control

example return:

0.5, 32.3, Greenhouse Temperature (C)

This would toggle the LED on the RasPiConnect / ArduinoConnect App every 0.5 seconds.

Interface ID
FM_BLINK_LED_UITYPE = 2048

Label and Text Display

Label and Text Display Type Control


Label and Text Display controls in the RasPiConnect / ArduinoConnect App use the following:

Input
None
Response
Return A,A,C


  • A is a string value to display in the text box on the RasPiConnect / ArduinoConnect Label and Text Control
  • C is a string value (not containing any commas) to display as the Title on the RasPiConnect / ArduinoConnect Label and Text Control

Example return:

43.31, 43.31, CPU Temp (deg C)

Interface ID
TEXT_DISPLAY_UITYPE = 4096

Remote Webview

Remote Webview Type Control



The Remote Web View controls in the RasPiConnect / ArduinoConnect App use the following:

Input
None
Response
HTML formatted string

The response to this command is a full webpage. The example ("W-1") given in ExecuteWebView.py reads an HTML from a file into a string and then replaces certain fields in the HTML string with values to form an entire web page with graphics. The example file shows how to select and display graphics as well as displaying fields.

Interface ID
REMOTE_WEBVIEW_UITYPE = 1

Remote Picture Webview

Remote Webview Picture Type Control


Remote Picture Webview controls in the RasPiConnect / ArduinoConnect App use the following:

Input
None
Response
HTML page designed to display a single image

The response to this command is a special webpage. The example ("W-2") given in ExecuteWebView.py places an image in a webview (which could come from a webcam, camera or other device).

Interface ID
PICTURE_REMOTE_WEBVIEW_UITYPE = 512

Send Server Text

Send Text to Server Type Control


Send Server Text controls in the RasPiConnect / ArduinoConnect App use the following:

Input
String from the RasPiConnect / ArduinoConnect App
Response
"OK"

This control is used to send arbitrary text input to the server. The example ("ST-1") in the file ExecuteSendText.py writes text to a file ("ST-1.txt" in the local directory) which is then used by the Remote WebView ("W-1") to put on the web display and then send it back to the RasPiConnect / ArduinoConnect App as part of a webpage.

Interface ID
SEND_TEXT_UITYPE = 34

Static Label

Static Label Control


Static Labels in the RasPiConnect / ArduinoConnect App use the following:

Input
None
Response
None
Interface ID
NONE
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox