MtM

MTMA Machine To Machine Api's


SgneepBox MTMA is able to make any SgneepBox device communicate without using public IP, both in the subnet and on the network. Works with any DHCP router.

With MTMA you can send any file or data.


MTMA Server Access

set Username and Password for custom wrapper:

mtm_user *value *username ( for your personal wrapper and .htaccess)

mtm_pass *value *password ( for your personal wrapper and .htaccess)

note: the value assigned by mtm_user and mtm_pass are passed to mtm_node

....POST: [value=*username][*value=*password][*MTM_NODE DATA]


set Node name:

mtm_node *key *server_url

Example

#...
mtm_user your_usr
mtm_pass your_pwd
mtm_node 25143673-rmfgehhf-5483465-enfhjfg https://www.sgneep.com/mtm
#...


Create Node if not exist.

mtm_create_node *key

Example

#...
mtm_create_node 25143673-rmfgehhf-5483465-enfhjfg
#...


Send Variables to MTM server

mtm_send *key data *var


Receive Variables to MTM server

mtm_load *key *var data

*key = access key

*var = sgneepBox Variables


Example

#...
# SEND AND LOAD DATA
mtm_send 25143673-rmfgehhf-5483465-enfhjfg dht11 gtest2
mtm_load 25143673-rmfgehhf-5483465-enfhjfg gtest2 dht11
#...


Send image or file to MTM server

mtm_send *key *type *var *filenameDir

*type: file imgage | data

*key = access key

*var = variable or filename with any extension...

*path = directory of image to save


Load image from MTM server

mtm_load_img *key *ImageServerName *ImageLocalName *option

*key = access key

*ImageServerName = filename of image stored in your remote server

*ImageLocalName = filename of image stored in your RaspBerry pi3

*option = backup *dirfolder ( backup home/pi/Desktop/CBOT/DS/your_dir )


Example

#...
# SEND IMAGE OR FILE TO MTM SERVER
mtm_send 25143673-rmfgehhf-5483465-enfhjfg file mywebcam.jpg /home/pi/Desktop/CBOT/DS/slider/myfolder
mtm_send 25143673-rmfgehhf-5483465-enfhjfg file office.txt /home/pi/Desktop/CBOT/DS/slider/myfolder
mtm_load 25143673-rmfgehhf-5483465-enfhjfg mywebcam.jpg /slider/localname.jpg null null #...


Backup Node Data with another name in the same mtm_server

mtm_backup_node *key [BACKUP_NAME]

Example

#...
mtm_backup_node 25143673-rmfgehhf-5483465-enfhjfg NEW_BLOCK
#...
Powered by Sgneep.com