Machine To Machine functions

Connection


Set MTM Node Name and Server:

mtm_node [NODE_NAME] [API_SERVER]

Example

#...
mtm_node MTM_BLOCK https://www.yourservername/folder
#...

Create Node if not exist.

mtm_create_node [NODE_NAME]

Example

#...
mtm_create_node MTM_BLOCK
#...

Send data to MTM server

mtm_send [NODE_NAME] [SENSOR_TYPE] [CONNECTION]

mtm_load [NODE_NAME] [CONNECTION] [SENSOR_TYPE]

NODE_NAME = name of the NODE

SENSOR_TYPE= HCSR04 | DHT11 | FileData | Data | I/O | Image


Options:

CONNECTION= name of the gauge

Example

#...
# SEND AND LOAD DATA
mtm_send MTM_BLOCK dht11 gtest2
mtm_load MTM_BLOCK gtest2 dht11
#...

Backup Node Data with another name in the same mtm_server

mtm_backup_node [NODE_NAME] [BACKUP_NAME]

Example

#...
mtm_backup_node MTM_BLOCK NEW_BLOCK
#...

Complete Example:

#Sgneep-Box Script v2.0
#Set Background
ds_background space1.jpg
#
#Create Gauge Indicator
gauge_range gtest2 -30 90
gauge_position gtest2 500 0
gauge_dimension gtest2 200 180
gauge_label gtest2 Temp
gauge_sensor gtest2 dht11
gauge_connection gtest2 dht11 18
# VIEW GAUGE
gauge_run gtest2
#
# MTM SETUP
mtm_node MTM_BLOCK https://www.exampleserver.com/api
mtm_create_node MTM_BLOCK
#
# SET FOR LOOP 10 seconds make_sub door1
sub door1 mtm_send MTM_BLOCK dht11 gtest2
loop readSensor 10 call door1
#
end_script
Powered by Sgneep.com