Changes for page 2 Script

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

From version 22.1
edited by Hunter
on 2022/09/08 18:57
Change comment: There is no comment for this version
To version 14.1
edited by Leo Wei
on 2022/07/09 17:42
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.Hunter
1 +XWiki.admin
Content
... ... @@ -13,7 +13,7 @@
13 13  for example. addr_setshort(addr,num) Function: Write 16-bit signed decimal address
14 14  addr_getshort(addr) Function:Read 16-bit signed decimal address
15 15  addr_getword(string addr)Function: Read 16-bit unsigned decimal address
16 -More script function are in the second section of [[“V-BOX Script Interface Manual”>>doc:V-BOX.V-Net.Manual.04 Lua Script.01 Lua Functions.WebHome]]
16 +More script function are in the second section of [[“V-BOX Script Interface Manual”>>doc:V-BOX.V-Net.1\.User Manual.04 Lua Script.01 Lua Functions.WebHome]]
17 17  
18 18  == **1.2 Arithmetic** ==
19 19  
... ... @@ -36,35 +36,34 @@
36 36  
37 37  Script is as below:
38 38  
39 -(% class="box infomessage" %)
40 -(((
39 +{{code language="Lua"}}
41 41  function sms.main()
42 -~-~-~-~-~-~-send condition~-~-~-~-~-~-
41 +------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~-~-~-~-~-~-
47 +------lasting time------
49 49  if temp1 > 5 and temp2 > 10 and temp3 < 20 then
50 - timer = timer + 1
51 - addr_setword("@Timer",timer)
49 +    timer = timer + 1
50 +    addr_setword("@Timer",timer)
52 52  else
53 - timer = 0
54 - addr_setword("@Timer",timer)
52 +    timer = 0
53 +    addr_setword("@Timer",timer)
55 55  end
56 -~-~-~-~-~-~-send sms & output Y0~-~-~-~-~-~-
55 +------send sms & output Y0------
57 57  if timer > 5 then
58 - if tag == 0 then
59 - send_sms_ira("19859254700","alarm trigger")
60 - addr_setbit("@Tag",1)
61 - end
57 +    if tag == 0 then
58 +        send_sms_ira("19859254700","alarm trigger")
59 +        addr_setbit("@Tag",1)
60 +    end
62 62  elseif tag == 1 then
63 63  send_sms_ira("19859254700","alarm release")
64 64  addr_setbit("@Tag",0)
65 65  end
66 66  end
67 -)))
66 +{{/code}}
68 68  
69 69  == **1.5 Telegram notification** ==
70 70  
... ... @@ -135,85 +135,7 @@
135 135  end
136 136  {{/code}}
137 137  
138 -== **1.6 LINE Notify** ==
139 139  
140 -This example shows how to use the LINE Notify to send message into LINE group. When monitoring bit "@test" changes, it will trigger and send the message. Please replace with your own Token.
141 -
142 -{{code}}
143 -local tempBit = 0
144 -local tempWord = 0
145 -
146 -local LineToken = "08XCpubkOdwGdGgRTXF0x8umiyrALtoM0v6lBFUV6PC"
147 -
148 -local https = require("https")
149 -local json = require("json")
150 -local ltn12 = require("ltn12")
151 -
152 --- Send http.get request and return response result
153 -function getHttpsUrl(url,header,reqbody)
154 - local body = {}
155 - local bodyJson = json.encode(body)
156 - local result_table, code, headers, status = https.request{
157 - method = "POST",
158 - url = url,
159 - source = ltn12.source.string(reqbody),
160 - headers = header,
161 - sink = ltn12.sink.table(body)
162 - }
163 - print("code:"..code)
164 - if code~= 200 then
165 - return
166 - else
167 - return body
168 - end
169 -end
170 -
171 -function getMessageUrl(lineMessage)
172 - local url = "https://notify-api.line.me/api/notify"
173 - local reqMess = "message="..lineMessage
174 - local headers =
175 - {
176 - ["Authorization"] = "Bearer "..LineToken,
177 - ["Content-Type"] = "application/x-www-form-urlencoded",
178 - ["Content-Length"] = #reqMess
179 - }
180 -
181 - print("Get the link:"..url)
182 - getHttpsUrl(url, headers, reqMess)
183 -end
184 -
185 -
186 -function linenotify.main()
187 - local bitValue = addr_getbit("@test");
188 - local message = ''
189 - print("b=="..bitValue)
190 - if bitValue == 1 and bitValue ~= tempBit then
191 - message = 'Alarm V-Box triggered, the output is '.. bitValue
192 - getMessageUrl(message)
193 - print("Notification pushed of triggering alarm,"..bitValue)
194 - elseif bitValue == 0 and bitValue ~= tempBit then
195 - message = 'Alarm V-Box dismissed, the output is '.. bitValue
196 - getMessageUrl(message)
197 - print("Notification pushed of dismissing alarm,"..bitValue)
198 - end
199 - tempBit = bitValue----Prevent monitoring values from continuous being sent to the platform
200 -
201 - local wordValue = addr_getword("@t2")
202 - print("w=="..wordValue)
203 - --dosomething
204 - if wordValue >= 100 and wordValue ~= tempWord and tempWord <= 100 then
205 - message = 'Alarm V-Box triggered, the temperature is '.. wordValue
206 - getMessageUrl(message)
207 - print("Notification pushed of triggering alarm,"..wordValue)
208 - elseif wordValue < 100 and wordValue ~= tempWord and tempWord >= 100 then
209 - message = 'Alarm V-Box dismissed, the temperature is '.. wordValue
210 - getMessageUrl(message)
211 - print("Notification pushed of dismissing alarm,"..wordValue)
212 - end
213 - tempWord = wordValue----Prevent monitoring values from continuous being sent to the platform
214 -end
215 -{{/code}}
216 -
217 217  = **2 V-Box connect with third part server** =
218 218  
219 219  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.
... ... @@ -232,137 +232,13 @@
232 232  
233 233  (% class="mark" %)2.If your server requires SSL certificate to log in,please use OpenCloud.Because only OpenCloud platform can support to upload certificate
234 234  
235 -(% class="wikigeneratedid" %)
236 -**✎Note: **Before program the script of MQTT, please make sure the server(MQTT broker) can be connected through MQTT Client tool.
156 +== **2.1 V-Box connect with customer server:grouprobotinfo.com** ==
237 237  
238 -(% class="wikigeneratedid" %)
239 -Tool link: **[[MQTT.fx>>http://mqttfx.jensd.de/index.php/download]]**
240 -
241 -== **2.1 V-Box connect with test server(General Example)** ==
242 -
243 -{{code language="lua"}}
244 ---MQTT configuration table
245 -local MQTT_CFG={}
246 -MQTT_CFG.username = "weconsupport"
247 -MQTT_CFG.password = "123456"
248 -MQTT_CFG.netway = 0
249 -MQTT_CFG.keepalive = 60
250 -MQTT_CFG.cleansession = 1
251 ---TCP URL
252 -MQTT_URL = "tcp://mq.tongxinmao.com:1883"
253 ---Client ID
254 -MQTT_CLIENT_ID = "V-BOXH-AG"
255 -
256 ---Generate UUID
257 -function uuid()
258 - local seed = {'e','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}
259 - local tb = {}
260 - for i=1, 32 do
261 - table.insert(tb, seed[math.random(1,16)])
262 - end
263 - local sid=table.concat(tb)
264 - return string.format('%s',
265 - string.sub(sid,1,32)
266 - )
267 -end
268 -
269 -
270 ---Topic name to subscribed
271 -local SUBSCRIBE_TOPIC = 'testtopic/test/no1/123456'
272 -
273 ---Topic name to be published
274 -local PUBLISH_TOPIC = 'testtopic/test/no1/7890'
275 -
276 -
277 ---real time
278 -local LAST_TIME = 0
279 -
280 -
281 ---initialize mqtt
282 -function mqtt_init()
283 - print(string.format("mqtt init mqtt_url:%s mqtt_clientid:%s", MQTT_URL, MQTT_CLIENT_ID))
284 - g_mq, err = mqtt.create(MQTT_URL, MQTT_CLIENT_ID) -- create mqtt object,and declare it as a global variable
285 - if g_mq then
286 - g_mq:on("message", mqtt_msg_callback) -- Register a callback for receiving messages
287 - print("mqtt init success")
288 - else
289 - print("mqtt init failed:", err)
290 - end
291 -end
292 -
293 --- connect to mqtt
294 -function mqtt_connect()
295 - print("mqtt connecting...")
296 - local stat, err = g_mq:connect(MQTT_CFG)
297 - if stat == nil then
298 - print("mqtt connect failed:", err)
299 - return
300 - else
301 - print("mqtt connected")
302 - end
303 - g_mq:subscribe(SUBSCRIBE_TOPIC, 0)
304 -end
305 -
306 --- Received message callback function
307 -function mqtt_msg_callback(topic, msg)
308 - print("topic:", topic)
309 - print("msg:", msg)
310 - local objMsg = json.decode(msg)
311 - local water = objMsg.data.waterlevel
312 - local temp = objMsg.data.temperature
313 - addr_setword("@HDW20",water)
314 - addr_setword("@HDW10",temp)
315 -end
316 -
317 ---Send data (data upload to platform and encapsulate it with custom functions)
318 -function send_data()
319 - local pub_data = {
320 - timestamp = os.time(),
321 - messageId = 1,
322 - event = 'test_data',
323 - mfrs = 'V-Box',
324 - data = {
325 - id = uuid(),
326 - waterlevel = addr_getword("@HDW10"),
327 - temperature = addr_getword("@HDW20")
328 - }
329 - }
330 - return g_mq:publish(PUBLISH_TOPIC, json.encode(pub_data), 0, 0)
331 -end
332 -
333 -
334 ---main function fixed timed execution
335 -function MQTT.main()
336 - --dosomething
337 - print(os.date("%Y-%m-%d %H:%M %S", os.time()) .. " main start")
338 - --determine the mqtt object whether exist
339 - if g_mq then
340 - --determine the mqtt object whether has been connected or not
341 - if g_mq:isconnected() then
342 - send_data()
343 - else
344 - --if exceed 20 sec not connect, reconnect once
345 - if os.time() - LAST_TIME > 20 then
346 - LAST_TIME = os.time()
347 - --connect to mqtt or reconnect
348 - mqtt_connect()
349 - end
350 - end
351 - else
352 - --mqtt object does not exist so create new one
353 - mqtt_init()
354 - end
355 - print(os.date("%Y-%m-%d %H:%M %S", os.time()) .. " main end")
356 -end
357 -{{/code}}
358 -
359 -== **2.2 V-Box connect with customer server:grouprobotinfo.com** ==
360 -
361 361  This demo does not use SSL certification. Script is as below
362 362  
363 363  Demo1:
364 364  
365 -{{code language="lua"}}
162 +{{code language="Lua"}}
366 366  -- Meta class
367 367  --main
368 368  function mq.main()
... ... @@ -483,7 +483,7 @@
483 483                          FSE=addr_getbit("@B_25395#W2.04"),
484 484                          AVVSVV=addr_getbit("@B_25395#W1.12"),
485 485                          ICHT=addr_getbit("@B_25395#W3.06")
486 -
283 +  
487 487                  }
488 488  
489 489      -- ("@B_25395#CIO1.02")
... ... @@ -505,7 +505,7 @@
505 505  end
506 506  {{/code}}
507 507  
508 -== **2.3 V-Box connect with Azure platform** ==
305 +== **2.2 V-Box connect with Azure platform** ==
509 509  
510 510  In this demo,V-Box connects with Azure by SSL certification.
511 511  
... ... @@ -515,128 +515,131 @@
515 515  
516 516  Script is as below
517 517  
518 -(% class="box infomessage" %)
519 -(((
520 -~-~-https:~/~/support.huaweicloud.com/qs-IoT/iot_05_0005.html mqtt.fx monitor to connect azure iot
315 +{{code language="Lua"}}
316 +--https://support.huaweicloud.com/qs-IoT/iot_05_0005.html  mqtt.fx monitor to connect azure iot
521 521  sprint = print
522 522  
523 -~-~-Get custom configuration parameters (vbox custom information)
524 -~-~-local CUSTOM = bns_get_config("bind")
525 -~-~-local DS_ID = CUSTOM.DSID or "60a71ccbbbe12002c08f3a1a_WECON"
319 +--Get custom configuration parameters (vbox custom information)
320 +--local CUSTOM = bns_get_config("bind")
321 +--local DS_ID = CUSTOM.DSID or "60a71ccbbbe12002c08f3a1a_WECON"
526 526  
527 527  
528 -~-~-Cloud mode interface to obtain the MQTT information configured by the cloud platform: (5 returns, namely the server address, client ID, connection table, last word table, certificate table)
324 +
325 +--Cloud mode interface to obtain the MQTT information configured by the cloud platform: (5 returns, namely the server address, client ID, connection table, last word table, certificate table)
529 529  local MQTT_URL, MQTT_CLIENTID, MQTT_CFG, MQTT_LWT, MQTT_CART = mqtt.setup_cfg()
530 530  
531 -~-~-MQTT_CFG.username = '60a71ccbbbe12002c08f3a1a_WECON'
532 -~-~-MQTT_CFG.password='wecon123'
533 -~-~-MQTT_CLIENTID = '60a71ccbbbe12002c08f3a1a_WECON_0_0_2021052110usernxame:60a71ccbbbe12002c08f3a1a_WECONpassword:a0a951581855aa8e0262129da6cf1b43f2c0ecfac4fa56117fc5a20c90be169a'
328 +--MQTT_CFG.username = '60a71ccbbbe12002c08f3a1a_WECON'
329 +--MQTT_CFG.password='wecon123'
330 +--MQTT_CLIENTID = '60a71ccbbbe12002c08f3a1a_WECON_0_0_2021052110usernxame:60a71ccbbbe12002c08f3a1a_WECONpassword:a0a951581855aa8e0262129da6cf1b43f2c0ecfac4fa56117fc5a20c90be169a'
534 534  
535 -~-~-publish to topics
332 +--publish to topics
536 536  local pub_RE_TOPIC = string.format('devices/wecon_02/messages/events/')
537 -~-~-Subscribe topics
334 +--Subscribe topics
538 538  local Subscribe_RE_TOPIC1 = string.format('devices/wecon_02/messages/devicebound/#')
539 539  
540 -~-~-variable
337 +--variable
541 541  local last_time = 0
542 542  
543 543  
544 -~-~-Timing main function
341 +
342 +--Timing main function
545 545  function Azure.main()
546 546  
547 - sprint(os.date("%Y-%m-%d %H:%M %S", os.time()) .. " Azureiot.main start")
548 - if g_mq then
549 - if g_mq:isconnected() then
550 - send_Data()
551 - else
552 - if os.time() - last_time > 20 then
553 - last_time = os.time()
554 - mymqtt_connect()
555 - end
556 - end
557 - else
558 - mymqtt_init()
559 - end
560 - sprint(os.date("%Y-%m-%d %H:%M %S", os.time()) .. " Azureiot.main end")
345 +   sprint(os.date("%Y-%m-%d %H:%M %S", os.time()) .. " Azureiot.main start")
346 +   if g_mq then
347 +        if g_mq:isconnected() then
348 +            send_Data()
349 +        else
350 +            if os.time() - last_time > 20 then
351 +                last_time = os.time()
352 +                mymqtt_connect()
353 +            end
354 +        end
355 +    else
356 +        mymqtt_init()
357 +    end
358 +    sprint(os.date("%Y-%m-%d %H:%M %S", os.time()) .. " Azureiot.main end")
561 561  end
562 562  
563 -~-~- Initialize MQTT
361 +-- Initialize MQTT
564 564  function mymqtt_init()
565 - sprint(string.format("mqtt init mqtt_url:%s mqtt_clientid:%s", MQTT_URL, MQTT_CLIENTID))
566 - g_mq, err = mqtt.create(MQTT_URL, MQTT_CLIENTID) ~-~- Create the object and declare it as a global variable
567 - if g_mq then
568 - g_mq:on("message", mymqtt_msg_callback) ~-~- Register to receive message callbacks
569 - sprint("mqtt init success")
570 - else
571 - sprint("mqtt init failed:", err)
572 - end
363 +    sprint(string.format("mqtt init mqtt_url:%s mqtt_clientid:%s", MQTT_URL, MQTT_CLIENTID))
364 +    g_mq, err = mqtt.create(MQTT_URL, MQTT_CLIENTID) -- Create the object and declare it as a global variable
365 +    if g_mq then
366 +        g_mq:on("message", mymqtt_msg_callback) -- Register to receive message callbacks
367 +        sprint("mqtt init success")
368 +    else
369 +        sprint("mqtt init failed:", err)
370 +    end
573 573  end
574 574  
575 -~-~- Connect to MQTT server
373 +-- Connect to MQTT server
576 576  function mymqtt_connect()
577 - sprint("mqtt connecting...")
578 - local stat, err = g_mq:connect(MQTT_CFG,MQTT_LWT, MQTT_CART)
579 - if stat == nil then
580 - sprint("mqtt connect failed:", err)
581 - return
582 - else
583 - sprint("mqtt connected")
584 - end
585 - g_mq:subscribe(Subscribe_RE_TOPIC1, 0) 
375 +    sprint("mqtt connecting...")
376 +    local stat, err = g_mq:connect(MQTT_CFG,MQTT_LWT, MQTT_CART)
377 +    if stat == nil then
378 +        sprint("mqtt connect failed:", err)
379 +        return
380 +    else
381 +        sprint("mqtt connected")
382 +    end
383 +    g_mq:subscribe(Subscribe_RE_TOPIC1, 0) 
586 586  end
587 587  
588 -~-~- Receive MQTT message callback function
386 +-- Receive MQTT message callback function
589 589  function mymqtt_msg_callback(topic, msg)
590 - print("topic:",topic)
591 - print("revdata:",msg)
592 - ~-~- local revData = json.decode(msg)
593 - ~-~- if topic == Subscribe_RE_TOPIC1 then ~-~-Process topic information subscribed from the cloud
594 -~-~- if string.match(topic,Subscribe_RE_TOPIC1) then
595 - ~-~- print("topi11:",topic)
596 - setValue(revData)
597 - ~-~- end
388 +    print("topic:",topic)
389 +    print("revdata:",msg)
390 +   -- local revData = json.decode(msg)
391 + --  if topic == Subscribe_RE_TOPIC1 then --Process topic information subscribed from the cloud
392 +-- if string.match(topic,Subscribe_RE_TOPIC1) then
393 +     --   print("topi11:",topic)
394 +       setValue(revData)
395 +   -- end
598 598  end
599 599  
600 -~-~-Process the received data
601 -~-~-function setValue(revData)
602 - ~-~- if revData ~~=nil then 
603 - ~-~- for i,v in pairs(revData) do
604 - ~-~- print("Data received:",i,v)
605 - ~-~- end
606 - ~-~- end
607 -~-~-end
398 +--Process the received data
399 +--function setValue(revData)
400 +   -- if revData ~=nil then 
401 + --       for i,v in pairs(revData) do
402 +  --          print("Data received:",i,v)
403 +  --      end
404 +   -- end
405 +--end
608 608  
609 -~-~-Get real-time data
407 +--Get real-time data
610 610  function getData()
611 - local jdata = {}
612 - local addr = bns_get_alldata()
613 - print(json.encode(addr))
614 - for i,v in pairs(addr) do
615 - if v[2] == 1 then
616 - jdata[v[3]] = v[4]
617 - end
618 - end
619 - return jdata
620 -end
409 +    local jdata = {}
410 +    local addr = bns_get_alldata()
411 +    print(json.encode(addr))
412 +    for i,v in pairs(addr) do
413 +        if v[2] == 1 then
414 +           jdata[v[3]] = v[4]
415 +        end
416 +    end
417 +    return jdata
418 +end 
621 621  
622 622  
623 -~-~-send data
421 +
422 +--send data
624 624  function send_Data()
625 - local pub_data = {100
626 - ~-~- services=~{~{
627 -\\ ~-~-serviceId ='Temperature',
628 - ~-~- properties={
629 - ~-~- value = 55
630 - ~-~- },
631 - ~-~- }}
424 +    local pub_data = {100
425 +     --   services={{
426 +
427 +            --serviceId ='Temperature',
428 +           -- properties={
429 +               -- value = 55
430 +           -- },
431 +       -- }}
632 632  }
633 633  sprint(json.encode(pub_data))
634 634  print("..........",pub_RE_TOPIC)
635 - return g_mq:publish(pub_RE_TOPIC, json.encode(pub_data), 0, 0)
435 +    return g_mq:publish(pub_RE_TOPIC, json.encode(pub_data), 0, 0)
636 636  end
637 -)))
437 +{{/code}}
638 638  
639 -== **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)** ==
439 +== **2.3 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)** ==
640 640  
641 641  1.Register a account: [[https:~~/~~/www.huaweicloud.com/intl/en-us/s/JUlPVERNJQ>>https://www.huaweicloud.com/intl/en-us/s/JUlPVERNJQ]]
642 642  
... ... @@ -785,7 +785,7 @@
785 785  (% style="text-align:center" %)
786 786  [[image:1624441186851-536.png||height="434" width="700" class="img-thumbnail"]]
787 787  
788 -== **2.5 V-Box connect with Huawei platform** ==
588 +== **2.4 V-Box connect with Huawei platform** ==
789 789  
790 790  In this demo,V-Box connects with Huawei by SSL certification.
791 791  
... ... @@ -906,7 +906,7 @@
906 906  (% style="text-align:center" %)
907 907  [[image:1624506666650-161.png||height="547" width="1000" class="img-thumbnail"]]
908 908  
909 -== **2.6 V-Box connect with AWS platform** ==
709 +== **2.5 V-Box connect with AWS platform** ==
910 910  
911 911  === **Log in AWS** ===
912 912  
... ... @@ -963,67 +963,105 @@
963 963  }
964 964  {{/code}}
965 965  
966 -=== **Create things** ===
766 +1. **Create things**
967 967  
968 968  Click “Manage”~-~-->“Things”~-~-->“Create things”~-~-->“Create single thing”
969 969  
970 -[[image:image-20220709165402-6.png]]
971 971  
972 -[[image:image-20220709165402-7.png]]
771 +|
772 +| |[[image:image-20220709165402-6.png]]
973 973  
774 +|
775 +| |[[image:image-20220709165402-7.png]]
776 +
777 +|
778 +| |[[image:image-20220709165402-8.png]]
779 +
974 974  Name the thing~-~-->Click “Next”
975 975  
976 -[[image:image-20220709165402-8.png]]
977 977  
978 978  Select the way to create certificate
979 979  
980 -[[image:image-20220709165402-9.png]]
981 981  
786 +|
787 +| |[[image:image-20220709165402-9.png]]
788 +
982 982  Select policy
983 983  
984 -[[image:image-20220709165402-10.png]]
985 985  
986 -[[image:image-20220709165402-11.png]]
792 +|
793 +| |[[image:image-20220709165402-10.png]]
987 987  
988 988  
989 -=== **Test with MQTT.fx tool** ===
990 990  
797 +
798 +
799 +
800 +
801 +|
802 +| |[[image:image-20220709165402-11.png]]
803 +
804 +
805 +
806 +
807 +1. **Test with MQTT.fx tool**
808 +
991 991  Click “View Setting” to get the “Broker Adress”
992 992  
993 -[[image:image-20220709165402-13.png]]
994 994  
995 -[[image:image-20220709165402-12.png]]
812 +|
813 +| |[[image:image-20220709165402-12.png]]
996 996  
997 -Create one connection in MQTT.fx tool, set broker port as 8883.
815 +|
816 +| |[[image:image-20220709165402-13.png]]
998 998  
999 -[[image:image-20220709165402-14.png]]
1000 1000  
819 +
820 +
821 +
822 +
823 +|
824 +| |[[image:image-20220709165402-14.png]]
825 +
826 +Create one connection in MQTT.fx tool, set broker port as 8883.
827 +
1001 1001  Upload the CA File, Client Certificate File, Client Key File
1002 1002  
1003 -[[image:image-20220709165402-15.png]]
1004 1004  
831 +|
832 +| |[[image:image-20220709165402-15.png]]
833 +
1005 1005  Publish message to topic “TEST”
1006 1006  
1007 -[[image:image-20220709165402-17.png]]
1008 1008  
1009 -Click”Test”~-~-->”MQTT test client”~-~-->”Subscrible to a topic”, to get message publish from MQTT.fx tool.
837 +|
838 +| |[[image:image-20220709165402-16.png]]
1010 1010  
1011 -[[image:image-20220709173500-1.png]]
840 +|
841 +| |[[image:image-20220709165402-17.png]]
1012 1012  
843 +Click”Test”~-~-->”MQTT test client”~-~-->”Subscrible to a topic”, to get message publish from MQTT.fx tool.
844 +
1013 1013  And we can also send message form AWS platform to MQTT.fx tool.
1014 1014  
1015 -[[image:image-20220709165402-18.png]]
1016 1016  
1017 -=== **Configurate in CloudTool** ===
848 +|
849 +| |[[image:image-20220709165402-18.png]]
1018 1018  
851 +1. **Configurate in CloudTool**
852 +
1019 1019  Copy the same setting in MQTT.fx to MQTT configuration
1020 1020  
1021 -[[image:image-20220709165402-19.png]]
1022 1022  
856 +|
857 +| |[[image:image-20220709165402-19.png]]
858 +
1023 1023   Add a lua script and copy the lua demo into it.
1024 1024  
1025 -[[image:image-20220709165402-20.png]]
1026 1026  
862 +|
863 +| |[[image:image-20220709165402-20.png]]
864 +
1027 1027  sprint = print
1028 1028  
1029 1029  ~-~-Cloud mode interface to obtain the MQTT information configured by the cloud platform: (5 returns, namely the server address, client ID, connection table, last word table, certificate table)
... ... @@ -1204,6 +1204,10 @@
1204 1204  
1205 1205  end
1206 1206  
1045 +
1046 +
1207 1207  Get message in AWS
1208 1208  
1209 -[[image:image-20220709165402-21.png]]
1049 +
1050 +|
1051 +| |[[image:image-20220709165402-21.png]]
image-20220709173500-1.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -1.5 MB
Content