Changes for page 2 Script
Last modified by Devin Chen on 2025/06/06 14:03
From version 50.1
edited by Hunter
on 2023/05/06 10:12
on 2023/05/06 10:12
Change comment:
There is no comment for this version
To version 56.1
edited by Theodore Xu
on 2023/08/24 17:12
on 2023/08/24 17:12
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. Hunter1 +XWiki.AiXia - Content
-
... ... @@ -27,25 +27,19 @@ 27 27 28 28 == **1.4 Short message** == 29 29 30 - When the alarm condition is reached: temp1 > 5 & temp2 >10 & temp3 < 20(lasts more than 5 seconds) , then send an "alarm trigger" sms.30 +The following demo shows that when the alarm condition is reached: temp1 > 5 & temp2 >10 & temp3 < 20(lasts more than 5 seconds) , then send an "alarm trigger" sms. 31 31 32 -When the alarm condition is released,then send an "alarm release" sms. 32 +When the alarm condition is released,then send an "alarm release" sms. Script is as below: 33 33 34 -(% style="text-align:center" %) 35 -[[image:1645535936750-316.png||height="385" width="400" class="img-thumbnail"]] 36 - 37 -Script is as below: 38 - 39 -(% class="box infomessage" %) 40 -((( 34 +{{code language="lua"}} 41 41 function sms.main() 42 - ~-~-~-~-~-~-send condition~-~-~-~-~-~-36 +------send condition------ 43 43 local temp1 = addr_getword("@Temperature1") 44 44 local temp2 = addr_getword("@Temperature2") 45 45 local temp3 = addr_getword("@Temperature3") 46 46 local timer = addr_getword("@Timer") 47 47 local tag = addr_getbit("@Tag") 48 - ~-~-~-~-~-~-lasting time~-~-~-~-~-~-42 +------lasting time------ 49 49 if temp1 > 5 and temp2 > 10 and temp3 < 20 then 50 50 timer = timer + 1 51 51 addr_setword("@Timer",timer) ... ... @@ -53,7 +53,7 @@ 53 53 timer = 0 54 54 addr_setword("@Timer",timer) 55 55 end 56 - ~-~-~-~-~-~-send sms & output Y0~-~-~-~-~-~-50 +------send sms & output Y0------ 57 57 if timer > 5 then 58 58 if tag == 0 then 59 59 send_sms_ira("19859254700","alarm trigger") ... ... @@ -64,7 +64,7 @@ 64 64 addr_setbit("@Tag",0) 65 65 end 66 66 end 67 - )))61 +{{/code}} 68 68 69 69 == **1.5 Telegram notification** == 70 70 ... ... @@ -503,7 +503,7 @@ 503 503 (% class="wikigeneratedid" %) 504 504 Tool link: **[[MQTT.fx>>http://mqttfx.jensd.de/index.php/download]]** 505 505 506 -== **2.1 V-Box connect with test server(General Example)** ==500 +== **2.1 Test server(General Example)** == 507 507 508 508 The following example is trying to publish to the topic "testtopic/test/no1/7890", and subscribe the topic "testtopic/test/no1/123456". 509 509 ... ... @@ -527,6 +527,7 @@ 527 527 {{code language="lua"}} 528 528 --MQTT configuration table 529 529 local MQTT_CFG={} 524 +--if there is no need the username and password, please put them as "" 530 530 MQTT_CFG.username = "weconsupport" 531 531 MQTT_CFG.password = "123456" 532 532 MQTT_CFG.netway = 0 ... ... @@ -566,7 +566,7 @@ 566 566 function mqtt_init() 567 567 print(string.format("mqtt init mqtt_url:%s mqtt_clientid:%s", MQTT_URL, MQTT_CLIENT_ID)) 568 568 if g_mq then 569 - mqtt.close() --Close mqtt object 564 + mqtt.close(g_mq) --Close mqtt object 570 570 end 571 571 g_mq, err = mqtt.create(MQTT_URL, MQTT_CLIENT_ID) -- create mqtt object,and declare it as a global variable 572 572 if g_mq then ... ... @@ -651,7 +651,7 @@ 651 651 end 652 652 {{/code}} 653 653 654 -== **2.2 V-Box connect with customer server:grouprobotinfo.com** ==649 +== **2.2 Customer server:grouprobotinfo.com** == 655 655 656 656 This demo does not use SSL certification. Script is as below 657 657 ... ... @@ -792,7 +792,7 @@ 792 792 end 793 793 {{/code}} 794 794 795 -== **2.3 V-Box connect withAzure platform** ==790 +== **2.3 Azure platform** == 796 796 797 797 In this demo,V-Box connects with Azure by SSL certification. 798 798 ... ... @@ -923,8 +923,14 @@ 923 923 end 924 924 ))) 925 925 926 -== **2.4 H ow to configure the Huawei platform?(✎Note: Huawei IOT DA function is only in China area.If you want this function,you need to use chinese mobile to register)** ==921 +== **2.4 Huawei platform** == 927 927 923 + 924 + 925 +{{info}} 926 +**✎Note**:**Huawei IOT DA function is only in China area.If you want this function,you need to use chinese mobile to register** 927 +{{/info}} 928 + 928 928 1.Register a account: [[https:~~/~~/www.huaweicloud.com/intl/en-us/s/JUlPVERNJQ>>https://www.huaweicloud.com/intl/en-us/s/JUlPVERNJQ]] 929 929 930 930 2.log in the Huawei IOTDA ... ... @@ -1193,7 +1193,7 @@ 1193 1193 (% style="text-align:center" %) 1194 1194 [[image:1624506666650-161.png||height="547" width="1000" class="img-thumbnail"]] 1195 1195 1196 -== **2.6 V-Box connect withAWS platform** ==1197 +== **2.6 AWS platform** == 1197 1197 1198 1198 === **Log in AWS** === 1199 1199 ... ... @@ -1258,7 +1258,7 @@ 1258 1258 [[image:image-20220709165402-11.png]] 1259 1259 1260 1260 1261 -=== ** Test withMQTT.fx tool** ===1262 +=== **MQTT.fx tool** === 1262 1262 1263 1263 Click “View Setting” to get the “Broker Adress” 1264 1264 ... ... @@ -1286,7 +1286,7 @@ 1286 1286 1287 1287 [[image:image-20220709165402-18.png]] 1288 1288 1289 -=== **C onfigurate in CloudTool** ===1290 +=== **CloudTool** === 1290 1290 1291 1291 Copy the same setting in MQTT.fx to MQTT configuration 1292 1292