Syncing tags via M2Web API

I want to read a tag “TankLevel” from eWON A to eWON B through m2web API, suppose my eWON and talk2m account details are below.

Talk2mDeveloper ID : ABC
Talk2m Account : DEF
User name : GHI
Password : JKL

eWONA:
username: adm
password: adm

eWONB:
username: adm
password: adm

  1. Please guide me where I need to use script either in eWON A or eWONB

  2. Please update below script as per my above eWON and Talk2m account information.

Script
INIT Section:
TSET 1, 5
ONTIMER 1, “GOTO UpdateRemote”

UpdateRemote Section:
UpdateRemote:
//Account info
account$ = “youraccount”
username$ = “yourusername”
password$ = “yourpassword”
developerid$ = “yourdeveloperid”

//ewon specific info
devicename$ = “yourewonname”
deviceusername$ = “yourdeviceusername”
devicepassword$ = “yourdevicepassword”
method$ = “GET”

tagName$ = “YourTagName”
tagValue$ = STR$ YourTagName@

url$ = “https://m2web.talk2m.com/t2mapi/get/"+devicename$+"/rcgi.bin/UpdateTagForm?TagName1=” + tagName$ + “&TagValue1=” + tagValue$

url$ = url$ + “&t2maccount=”+account$+"&t2musername="+username$+"&t2mpassword="+password$
url$ = url$ +"&t2mdeveloperid="+developerid$+"&t2mdeviceusername="+deviceusername$+"&t2mdevicepassword=" + devicepassword$
REQUESTHTTPX url$, method$, “”, “”
END

Hello,
Over all you need to replace the yourXXXXXX in the parenthesis with what is setup for your account or device.

Below the //Account info line you need to replace words in parenthesis with to matches what you have set for your account. The line account$ = “youraccount” would be account$ = “DEF”

This script is sending or writing to a remote flexy so you need to set the remote devices name, user name and password below the //ewon specific info.

Finally you will need to set up the tag name that you will be writing to on the remote device. We are using the Update Tag call in the API, this is writing the tag value to a matching tag on the remote device. This means you need to have matching tags on both devices. This script is setup for only one tag so you will need to update the script to add more tag variables as needed. See page 18 of the m2web API for details on how the call works.

Deryck

UpdateRemote:
REQUESTHTTPX “https://m2web.talk2m.com/t2mapi/get/eWON B Meydan/rcgi.bin/UpdateTagForm?
eWONATagName=eWONBTagName&eWONATagName@=STR$ eWONBTagName@&t2maccount=“MY ACCOUNT”&t2musername=“MY USER NAME”&t2mpassword=“MY PASSWORD”
word&t2mdeveloperid=“ID”&
t2mdeviceusername=adm&t2mdevicepassword=adm”, “GET”,
END

Please check the above script is correct or wrong, I used the same but its not working.

UpdateRemote:
REQUESTHTTPX “https://m2web.talk2m.com/t2mapi/get/MyeWON/rcgi.bin/UpdateTagForm?
TagName1=Tank&TagValue1=12&t2maccount=MyAccount&t2musername=MyName&t2mpassword=MyPass
word&t2mdeveloperid=DeveloperID&t2mdeviceusername=MyeWONUser&t2mdevicepassword=MyeWONPassword”, “GET”
END

Please check my above script is correct and also let me know what is TagName1 & TagValue1 in above script.

Hello,

I just tested the call in this script and had no issues. You use TagName1 to set the name of the first tag you want to update. It is then paired with TagValue1 to set that value. You can add TagName2 and TagValue2 then TagName3 and TagValue3 etc. to send multiple tags at once.

Deryck

Hello!

I would like to implement this with 3 ewon flexys. Lets say Ewon A, B and C.

Ewon B to be the master. A sends to and receives from B, C sends to B.

Just would like to confirm that this does not require Static or Public IPs whatsoever. As I consider employing standard SIM cards.

Thank you!