Changes for page 2 Script

Last modified by Devin Chen on 2025/06/06 14:03

From version 62.1
edited by Theodore Xu
on 2023/08/24 17:27
Change comment: There is no comment for this version
To version 51.1
edited by Hunter
on 2023/05/06 10:19
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.AiXia
1 +XWiki.Hunter
Content
... ... @@ -1,9 +1,9 @@
1 1  = **1 General Script Demo** =
2 2  
3 -== **1.1 Address Operation** ==
3 +== **1.1 Address Operation:Write/Read data from address A to B** ==
4 4  
5 5  (((
6 -Write/Read data from address A to B**. **For example:transfer D2 to D0
6 +For example:transfer D2 to D0
7 7  )))
8 8  
9 9  (% style="text-align:center" %)
... ... @@ -343,7 +343,7 @@
343 343  end
344 344  {{/code}}
345 345  
346 -== **1.8 HTTP response body** ==
346 +== **1.8 How to parse value from HTTP response body** ==
347 347  
348 348  This example use [[https:~~/~~/www.weatherapi.com/>>https://www.weatherapi.com/]] as example, to show how to parse value from HTTP response body. When we input the city name into address "@HDW5050":
349 349  
... ... @@ -472,7 +472,7 @@
472 472  end
473 473  {{/code}}
474 474  
475 -= **2 Third part server** =
475 += **2 V-Box connect with third part server** =
476 476  
477 477  V-Box have two mode.One is for V-Net,User need to use WECON server to store data.We call this V-NET platform.
478 478  
... ... @@ -497,7 +497,7 @@
497 497  (% class="wikigeneratedid" %)
498 498  Tool link: **[[MQTT.fx>>http://mqttfx.jensd.de/index.php/download]]**
499 499  
500 -== **2.1 Test server(General Example)** ==
500 +== **2.1 V-Box connect with test server(General Example)** ==
501 501  
502 502  The following example is trying to publish to the topic "testtopic/test/no1/7890", and subscribe the topic "testtopic/test/no1/123456".
503 503  
... ... @@ -521,7 +521,6 @@
521 521  {{code language="lua"}}
522 522  --MQTT configuration table
523 523  local MQTT_CFG={}
524 ---if there is no need the username and password, please put them as ""
525 525  MQTT_CFG.username = "weconsupport"
526 526  MQTT_CFG.password = "123456"
527 527  MQTT_CFG.netway = 0
... ... @@ -561,7 +561,7 @@
561 561  function mqtt_init()
562 562   print(string.format("mqtt init mqtt_url:%s mqtt_clientid:%s", MQTT_URL, MQTT_CLIENT_ID))
563 563   if g_mq then
564 - mqtt.close(g_mq) --Close mqtt object
563 + mqtt.close() --Close mqtt object
565 565   end
566 566   g_mq, err = mqtt.create(MQTT_URL, MQTT_CLIENT_ID) -- create mqtt object,and declare it as a global variable
567 567   if g_mq then
... ... @@ -646,7 +646,7 @@
646 646  end
647 647  {{/code}}
648 648  
649 -== **2.2 Customer server:grouprobotinfo.com** ==
648 +== **2.2 V-Box connect with customer server:grouprobotinfo.com** ==
650 650  
651 651  This demo does not use SSL certification. Script is as below
652 652  
... ... @@ -787,7 +787,7 @@
787 787  end
788 788  {{/code}}
789 789  
790 -== **2.3 Azure platform** ==
789 +== **2.3 V-Box connect with Azure platform** ==
791 791  
792 792  In this demo,V-Box connects with Azure by SSL certification.
793 793  
... ... @@ -918,12 +918,8 @@
918 918  end
919 919  )))
920 920  
921 -== **2.4 Huawei platform** ==
920 +== **2.4 How 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)** ==
922 922  
923 -{{info}}
924 -**✎Note**:**Huawei IOT DA function is only in China area.If you want this function,you need to use chinese mobile to register**
925 -{{/info}}
926 -
927 927  1.Register a account: [[https:~~/~~/www.huaweicloud.com/intl/en-us/s/JUlPVERNJQ>>https://www.huaweicloud.com/intl/en-us/s/JUlPVERNJQ]]
928 928  
929 929  2.log in the Huawei IOTDA
... ... @@ -1071,8 +1071,10 @@
1071 1071  (% style="text-align:center" %)
1072 1072  [[image:1624441186851-536.png||height="434" width="700" class="img-thumbnail"]]
1073 1073  
1074 -=== Huawei by SSL certification. ===
1069 +== **2.5 V-Box connect with Huawei platform** ==
1075 1075  
1071 +In this demo,V-Box connects with Huawei by SSL certification.
1072 +
1076 1076  1.Create a project access for Huawei IOT
1077 1077  
1078 1078  2.configure MQTT configuration
... ... @@ -1190,7 +1190,7 @@
1190 1190  (% style="text-align:center" %)
1191 1191  [[image:1624506666650-161.png||height="547" width="1000" class="img-thumbnail"]]
1192 1192  
1193 -== **2.6 AWS platform** ==
1190 +== **2.6 V-Box connect with AWS platform** ==
1194 1194  
1195 1195  === **Log in AWS** ===
1196 1196  
... ... @@ -1255,7 +1255,7 @@
1255 1255  [[image:image-20220709165402-11.png]]
1256 1256  
1257 1257  
1258 -=== **MQTT.fx tool** ===
1255 +=== **Test with MQTT.fx tool** ===
1259 1259  
1260 1260  Click “View Setting” to get the “Broker Adress”
1261 1261  
... ... @@ -1283,7 +1283,7 @@
1283 1283  
1284 1284  [[image:image-20220709165402-18.png]]
1285 1285  
1286 -=== **CloudTool** ===
1283 +=== **Configurate in CloudTool** ===
1287 1287  
1288 1288  Copy the same setting in MQTT.fx to MQTT configuration
1289 1289  
... ... @@ -1481,67 +1481,3 @@
1481 1481  Get message in AWS
1482 1482  
1483 1483  [[image:image-20220709165402-21.png]]
1484 -
1485 -= **2.7 Mysql** =
1486 -
1487 -
1488 -
1489 -=== 1.Install Mysql software ===
1490 -
1491 -Download the latest version of Mysql.
1492 -
1493 -(% style="text-align:center" %)
1494 -[[image:Mysql的软件版本.png||height="673" width="894"]]
1495 -
1496 -=== 2.Navicat connect Mysql ===
1497 -
1498 -Connecting to Mysql with navicat.
1499 -
1500 -(% style="text-align:center" %)
1501 -[[image:连接到mysql.png]]
1502 -
1503 -=== 3.Create a database ===
1504 -
1505 -Character set should be choose utf8mb3/utf8mb4 and Collation choose utf8mb3_danish_ci/utf8mb4_danish_ci.
1506 -
1507 -(% style="text-align:center" %)
1508 -[[image:创建数据库.png||height="585" width="818"]]
1509 -
1510 -=== 4.Create a data table ===
1511 -
1512 -Create a table, enter the fields you need.
1513 -
1514 -(% style="text-align:center" %)
1515 -[[image:创建表1.png||height="484" width="737"]]
1516 -
1517 -Save, enter table name.
1518 -
1519 -(% style="text-align:center" %)
1520 -[[image:创建表2.png]]
1521 -
1522 -=== 5.Input Table Data ===
1523 -
1524 -(% style="text-align:center" %)
1525 -[[image:输入或者导入数据.png]]
1526 -
1527 -=== 6.Modifying scripts and debug:**[[Mysql script>>https://docs.we-con.com.cn/bin/view/V-BOX/V-Net/Manual/04%20Lua%20Script/01%20Lua%20Functions/\#H11MySQLdatabaseoperation]]** ===
1528 -
1529 -(% style="text-align:center" %)
1530 -[[image:调试结果.png]]
1531 -
1532 -=== 7.Problem ===
1533 -
1534 -During our debugging process it may there are some problems about Mysql, such as
1535 -
1536 -* MySQL: Host  192.168.XXX.XXX  is not allowed to connect.
1537 -* MySQL: Host  192.168.XXX.XXX  is blocked because of many connection errors.
1538 -* MySQL: SSL connection error: unknown error number.
1539 -* (((
1540 -1449-The user specified as a definer(‘mysql.infoschema‘@localhost‘) does not exist.
1541 -)))
1542 -
1543 -This type of problem has nothing to do with scripts or devices, it is a Mysql configuration issue. If you have any of these problems, please look for a solution online.
1544 -
1545 -{{info}}
1546 -✎Note: If you want to use CMD to access Mysql, you need to add the bin file to the environment variable, please check online for details of the operation.
1547 -{{/info}}