Changes for page 2 Script

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

From version 20.1
edited by Hunter
on 2022/07/29 16:47
Change comment: There is no comment for this version
To version 10.1
edited by Jim(Forgotten)
on 2022/07/09 16:52
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.Hunter
1 +XWiki.Jim
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.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  
... ... @@ -154,280 +154,152 @@
154 154  
155 155  (% class="mark" %)2.If your server requires SSL certificate to log in,please use OpenCloud.Because only OpenCloud platform can support to upload certificate
156 156  
157 -(% class="wikigeneratedid" %)
158 -**✎Note: **Before program the script of MQTT, please make sure the server(MQTT broker) can be connected through MQTT Client tool.
157 +== **2.1 V-Box connect with customer server:grouprobotinfo.com** ==
159 159  
160 -(% class="wikigeneratedid" %)
161 -Tool link: **[[MQTT.fx>>http://mqttfx.jensd.de/index.php/download]]**
162 -
163 -== **2.1 V-Box connect with test server(General Example)** ==
164 -
165 -{{code language="lua"}}
166 ---MQTT configuration table
167 -local MQTT_CFG={}
168 -MQTT_CFG.username = "weconsupport"
169 -MQTT_CFG.password = "123456"
170 -MQTT_CFG.netway = 0
171 -MQTT_CFG.keepalive = 60
172 -MQTT_CFG.cleansession = 1
173 ---TCP URL
174 -MQTT_URL = "tcp://mq.tongxinmao.com:1883"
175 ---Client ID
176 -MQTT_CLIENT_ID = "V-BOXH-AG"
177 -
178 ---Generate UUID
179 -function uuid()
180 - local seed = {'e','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}
181 - local tb = {}
182 - for i=1, 32 do
183 - table.insert(tb, seed[math.random(1,16)])
184 - end
185 - local sid=table.concat(tb)
186 - return string.format('%s',
187 - string.sub(sid,1,32)
188 - )
189 -end
190 -
191 -
192 ---Topic name to subscribed
193 -local SUBSCRIBE_TOPIC = 'testtopic/test/no1/123456'
194 -
195 ---Topic name to be published
196 -local PUBLISH_TOPIC = 'testtopic/test/no1/7890'
197 -
198 -
199 ---real time
200 -local LAST_TIME = 0
201 -
202 -
203 ---initialize mqtt
204 -function mqtt_init()
205 - print(string.format("mqtt init mqtt_url:%s mqtt_clientid:%s", MQTT_URL, MQTT_CLIENT_ID))
206 - g_mq, err = mqtt.create(MQTT_URL, MQTT_CLIENT_ID) -- create mqtt object,and declare it as a global variable
207 - if g_mq then
208 - g_mq:on("message", mqtt_msg_callback) -- Register a callback for receiving messages
209 - print("mqtt init success")
210 - else
211 - print("mqtt init failed:", err)
212 - end
213 -end
214 -
215 --- connect to mqtt
216 -function mqtt_connect()
217 - print("mqtt connecting...")
218 - local stat, err = g_mq:connect(MQTT_CFG)
219 - if stat == nil then
220 - print("mqtt connect failed:", err)
221 - return
222 - else
223 - print("mqtt connected")
224 - end
225 - g_mq:subscribe(SUBSCRIBE_TOPIC, 0)
226 -end
227 -
228 --- Received message callback function
229 -function mqtt_msg_callback(topic, msg)
230 - print("topic:", topic)
231 - print("msg:", msg)
232 - local objMsg = json.decode(msg)
233 - local water = objMsg.data.waterlevel
234 - local temp = objMsg.data.temperature
235 - addr_setword("@HDW20",water)
236 - addr_setword("@HDW10",temp)
237 -end
238 -
239 ---Send data (data upload to platform and encapsulate it with custom functions)
240 -function send_data()
241 - local pub_data = {
242 - timestamp = os.time(),
243 - messageId = 1,
244 - event = 'test_data',
245 - mfrs = 'V-Box',
246 - data = {
247 - id = uuid(),
248 - waterlevel = addr_getword("@HDW10"),
249 - temperature = addr_getword("@HDW20")
250 - }
251 - }
252 - return g_mq:publish(PUBLISH_TOPIC, json.encode(pub_data), 0, 0)
253 -end
254 -
255 -
256 ---main function fixed timed execution
257 -function MQTT.main()
258 - --dosomething
259 - print(os.date("%Y-%m-%d %H:%M %S", os.time()) .. " main start")
260 - --determine the mqtt object whether exist
261 - if g_mq then
262 - --determine the mqtt object whether has been connected or not
263 - if g_mq:isconnected() then
264 - send_data()
265 - else
266 - --if exceed 20 sec not connect, reconnect once
267 - if os.time() - LAST_TIME > 20 then
268 - LAST_TIME = os.time()
269 - --connect to mqtt or reconnect
270 - mqtt_connect()
271 - end
272 - end
273 - else
274 - --mqtt object does not exist so create new one
275 - mqtt_init()
276 - end
277 - print(os.date("%Y-%m-%d %H:%M %S", os.time()) .. " main end")
278 -end
279 -{{/code}}
280 -
281 -== **2.2 V-Box connect with customer server:grouprobotinfo.com** ==
282 -
283 283  This demo does not use SSL certification. Script is as below
284 284  
285 285  Demo1:
286 286  
287 -{{code language="lua"}}
288 --- Meta class
289 ---main
163 +(% class="box infomessage" %)
164 +(((
165 +~-~- Meta class
166 +~-~-main
290 290  function mq.main()
291 - if not mq.m then
292 -  local err = ""
168 + if not mq.m then
169 + local err = ""
170 +\\ mq.m, err = mqtt.create("tcp:~/~/grouprobotinfo.com:1883", "ClienID") ~-~- create connection
171 + if mq.m then
172 + mq.config = {
173 + username = "",~-~- ID
174 + password = "",~-~- password
175 + netway = 1, ~-~- Ethernet connection, WIFI=1
176 + ~-~- keepalive = 100, ~-~- Optional, set the connection heartbeat interval for 100 seconds.
177 + ~-~- cleansession = 0, ~-~- Optional, keep session
178 + }
179 + mq.m:on("message", function(topic, msg) ~-~- Register for receiving message callbacks
180 + local str = string.format("%s:%s", topic, msg)
181 + ~-~- print("mqtt msg:", str) ~-~- Print out the received topics and content
182 + end
183 + )
184 + mq.m:on("offline", function (cause) ~-~- Register for lost connection callbacks
185 + ~-~- addr_setstring("@xxx", "cause"..(cause or " got nil"))
186 + end)
187 + mq.m:on("arrived", function() ~-~- Registration for sending messages to callbacks 
188 + print("msg arrived")
189 + end)
190 + else
191 + print("mqtt create failed:", err) ~-~- Create object failed
192 + end
193 + else
194 + if mq.m:isconnected() then ~-~- If online, post a message
195 + local phaseStatus ="unknow"
196 + if addr_getbit("@Standby")== 1 then
197 + phaseStatus = "Standby"
198 + elseif addr_getbit("@Pre-Freeze")==1 then
199 + phaseStatus= "Pre-Freeze"
200 + elseif addr_getbit("@Prepare")==1 then
201 + phaseStatus ="Prepare"
202 + elseif addr_getbit("@Primary Dry")==1 then
203 + phaseStatus = "Primary dry"
204 + elseif addr_getbit("@Secondary Dry")==1 then
205 + phaseStatus = "Secondary Dry"
206 + end
207 +~-~- print(addr_getbit("@Primary Dry"))
208 +~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
209 + local activating ="unknow"
210 + if addr_getbit("@Compressor")==1 then
211 + activating = ",".."Compressor"
212 + end
213 + if addr_getbit("@Silicone Pump")==1 then
214 + activating = activating..",".."Silicone Pump"
215 + end
216 + if addr_getbit("@Vacuum Pump")==1 then
217 + activating = activating..",".."Vacuum Pump"
218 + end
219 + if addr_getbit("@Root Pump")==1 then
220 + activating = activating..",".."Root Pump"
221 + end
222 + if addr_getbit("@Heater")==1 then
223 + activating = activating..",".."Heater"
224 + end
225 + if addr_getbit("@Valve Silicone")==1 then
226 + activating = activating..",".."Valve Silicone"
227 + end
228 + if addr_getbit("@Valve Ice Condenser")==1 then
229 + activating = activating..",".."Valve Ice Condenser"
230 + end
231 + if addr_getbit("@Valve Vacuum Pump")==1 then
232 + activating = activating..",".."Valve Vacuum Pump"
233 + end
234 + local pr_activating =string.sub(activating,2)
235 + ~-~- print(pr_activating) 
293 293  
294 -  mq.m, err = mqtt.create("tcp://grouprobotinfo.com:1883", "ClienID")  -- create connection
295 -  if mq.m then
296 -   mq.config = {
297 -    username = "",-- ID
298 -    password = "",-- password
299 -    netway = 1, -- Ethernet connection, WIFI=1
300 -    -- keepalive = 100, -- Optional, set the connection heartbeat interval for 100 seconds.
301 -    -- cleansession = 0, -- Optional, keep session
302 -   }
303 -   mq.m:on("message", function(topic, msg) -- Register for receiving message callbacks
304 -    local str = string.format("%s:%s", topic, msg)
305 -    -- print("mqtt msg:", str) -- Print out the received topics and content
306 -   end
307 -   )
308 -   mq.m:on("offline", function (cause) -- Register for lost connection callbacks
309 -    -- addr_setstring("@xxx", "cause"..(cause or " got nil"))
310 -   end)
311 -   mq.m:on("arrived", function() -- Registration for sending messages to callbacks 
312 -    print("msg arrived")
313 -   end)
314 -  else
315 -   print("mqtt create failed:", err) -- Create object failed
316 -  end
317 - else
318 -  if mq.m:isconnected() then -- If online, post a message
319 -     local phaseStatus ="unknow"
320 -     if addr_getbit("@Standby")== 1 then
321 -         phaseStatus = "Standby"
322 -     elseif addr_getbit("@Pre-Freeze")==1 then
323 -         phaseStatus= "Pre-Freeze"
324 -     elseif addr_getbit("@Prepare")==1 then
325 -         phaseStatus ="Prepare"
326 -     elseif addr_getbit("@Primary Dry")==1 then
327 -         phaseStatus = "Primary dry"
328 -     elseif addr_getbit("@Secondary Dry")==1 then
329 -         phaseStatus = "Secondary Dry"
330 -     end
331 ---   print(addr_getbit("@Primary Dry"))
332 --------------------------------------------------------------------------------------------------------------------------
333 -     local activating ="unknow"
334 -     if addr_getbit("@Compressor")==1 then
335 -         activating = ",".."Compressor"
336 -     end
337 -     if addr_getbit("@Silicone Pump")==1 then
338 -         activating = activating..",".."Silicone Pump"
339 -     end
340 -     if addr_getbit("@Vacuum Pump")==1 then
341 -         activating = activating..",".."Vacuum Pump"
342 -     end
343 -     if addr_getbit("@Root Pump")==1 then
344 -         activating = activating..",".."Root Pump"
345 -     end
346 -     if addr_getbit("@Heater")==1 then
347 -         activating = activating..",".."Heater"
348 -     end
349 -     if addr_getbit("@Valve Silicone")==1 then
350 -         activating = activating..",".."Valve Silicone"
351 -     end
352 -     if addr_getbit("@Valve Ice Condenser")==1 then
353 -         activating = activating..",".."Valve Ice Condenser"
354 -     end
355 -     if addr_getbit("@Valve Vacuum Pump")==1 then
356 -         activating = activating..",".."Valve Vacuum Pump"
357 -     end
358 -     local pr_activating =string.sub(activating,2)
359 -    --  print(pr_activating)  
360 360  
361 -
362 -
363 -     local status_text ="unknow"
364 -     if addr_getbit("@Status Run")==1 then
365 -         status_text = "RUNNING"
366 -     else
367 -         status_text = "STOP"
368 -     end
369 --------------------------------------------------------------------------------------------------------------------------      
370 -
371 -     local js =  {type="status",
372 -                  mc_name ="FD300",
373 -                  status=status_text,
374 -                  elapsed_time={
375 -                                hour=addr_getword("@Elapsed Time (Hour)"),
376 -                                min=addr_getword("@Elapsed Time (Minute)"),
377 -                                sec=addr_getword("@Elapsed Time (Second)")
378 -                                },
379 -                   phase = phaseStatus,
380 -                   step = addr_getword("@Step"),
381 -                   activating_output = pr_activating,
382 -                   sv=addr_getshort("@SV Silicone")/10,
383 -                   pv=addr_getshort("@PV Silicone")/10,
384 -                   product1=addr_getshort("@Product 1")/10,
385 -
386 -                   product2=addr_getshort("@Product 2")/10,
387 -                   product3=addr_getshort("@Product 3")/10,
388 -                   product4=addr_getshort("@Product 4")/10,
389 -                   ice1=addr_getshort("@Ice condenser 1")/10,
390 -                   ice2=addr_getshort("@Ice condenser 2")/10,
391 -                   vacuum=addr_getfloat("@Vacuum")
392 -
393 -                }
394 -     local jsAlarm = {  HPC = addr_getbit("@B_25395#W0.00"),
395 -                        ODPC = addr_getbit("@B_25395#W0.01"),
396 -                        MTPC=addr_getbit("@B_25395#W0.02"),
397 -                        HTT = addr_getbit("@B_25395#W1.03"),
398 -                        CPC = addr_getbit("@B_25395#W0.08"),
399 -                        CPSP =addr_getbit("@B_25395#W1.00"),
400 -                        CPVP =addr_getbit("@B_25395#W0.10"),
401 -                        CPRP =addr_getbit("@B_25395#W0.11"),
402 -                        HP =addr_getbit("@B_25395#W1.01"),
403 -                        PP= addr_getbit("@B_25395#W1.02"),
404 -                        PO=addr_getbit("@B_25395#W0.07"),
405 -                        FSE=addr_getbit("@B_25395#W2.04"),
406 -                        AVVSVV=addr_getbit("@B_25395#W1.12"),
407 -                        ICHT=addr_getbit("@B_25395#W3.06")
408 -
409 -                }
410 -
411 -    -- ("@B_25395#CIO1.02")
412 -     mq.m:publish("mqtt-v-box-epsilon-fd300", json.encode(js) , 0, 0)
413 -     mq.m:publish("mqtt-v-box-epsilon-alarm-fd300", json.encode(jsAlarm) , 0, 0)
414 -  else
415 -   local stat, err = mq.m:connect(mq.config) -- connection
416 -   if stat == nil then --Determine whether to connect
417 -    print("mqtt connect failed:", err)
418 -    return -- Connection failed, return directly
419 -   end
420 -   mq.m:subscribe("mqtt-v-box-epsilon", 0)-- Subscribe to topics
421 -
422 -  end
423 -  -- mq.m:unsubscribe("stc/test")
424 -  -- mq.m:disconnect() -- close matt
425 -  -- mq.m:close() -- close clase
426 - end
238 + local status_text ="unknow"
239 + if addr_getbit("@Status Run")==1 then
240 + status_text = "RUNNING"
241 + else
242 + status_text = "STOP"
243 + end
244 +~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
245 +\\ local js = {type="status",
246 + mc_name ="FD300",
247 + status=status_text,
248 + elapsed_time={
249 + hour=addr_getword("@Elapsed Time (Hour)"),
250 + min=addr_getword("@Elapsed Time (Minute)"),
251 + sec=addr_getword("@Elapsed Time (Second)")
252 + },
253 + phase = phaseStatus,
254 + step = addr_getword("@Step"),
255 + activating_output = pr_activating,
256 + sv=addr_getshort("@SV Silicone")/10,
257 + pv=addr_getshort("@PV Silicone")/10,
258 + product1=addr_getshort("@Product 1")/10,
259 +
260 + product2=addr_getshort("@Product 2")/10,
261 + product3=addr_getshort("@Product 3")/10,
262 + product4=addr_getshort("@Product 4")/10,
263 + ice1=addr_getshort("@Ice condenser 1")/10,
264 + ice2=addr_getshort("@Ice condenser 2")/10,
265 + vacuum=addr_getfloat("@Vacuum")
266 +
267 + }
268 + local jsAlarm = { HPC = addr_getbit("@B_25395#W0.00"),
269 + ODPC = addr_getbit("@B_25395#W0.01"),
270 + MTPC=addr_getbit("@B_25395#W0.02"),
271 + HTT = addr_getbit("@B_25395#W1.03"),
272 + CPC = addr_getbit("@B_25395#W0.08"),
273 + CPSP =addr_getbit("@B_25395#W1.00"),
274 + CPVP =addr_getbit("@B_25395#W0.10"),
275 + CPRP =addr_getbit("@B_25395#W0.11"),
276 + HP =addr_getbit("@B_25395#W1.01"),
277 + PP= addr_getbit("@B_25395#W1.02"),
278 + PO=addr_getbit("@B_25395#W0.07"),
279 + FSE=addr_getbit("@B_25395#W2.04"),
280 + AVVSVV=addr_getbit("@B_25395#W1.12"),
281 + ICHT=addr_getbit("@B_25395#W3.06")
282 +
283 + }
284 +\\ ~-~- ("@B_25395#CIO1.02")
285 + mq.m:publish("mqtt-v-box-epsilon-fd300", json.encode(js) , 0, 0)
286 + mq.m:publish("mqtt-v-box-epsilon-alarm-fd300", json.encode(jsAlarm) , 0, 0)
287 + else
288 + local stat, err = mq.m:connect(mq.config) ~-~- connection
289 + if stat == nil then ~-~-Determine whether to connect
290 + print("mqtt connect failed:", err)
291 + return ~-~- Connection failed, return directly
292 + end
293 + mq.m:subscribe("mqtt-v-box-epsilon", 0)~-~- Subscribe to topics
294 +\\ end
295 + ~-~- mq.m:unsubscribe("stc/test")
296 + ~-~- mq.m:disconnect() ~-~- close matt
297 + ~-~- mq.m:close() ~-~- close clase
298 + end
427 427  end
428 -{{/code}}
300 +)))
429 429  
430 -== **2.3 V-Box connect with Azure platform** ==
302 +== **2.2 V-Box connect with Azure platform** ==
431 431  
432 432  In this demo,V-Box connects with Azure by SSL certification.
433 433  
... ... @@ -558,7 +558,7 @@
558 558  end
559 559  )))
560 560  
561 -== **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)** ==
433 +== **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)** ==
562 562  
563 563  1.Register a account: [[https:~~/~~/www.huaweicloud.com/intl/en-us/s/JUlPVERNJQ>>https://www.huaweicloud.com/intl/en-us/s/JUlPVERNJQ]]
564 564  
... ... @@ -707,7 +707,7 @@
707 707  (% style="text-align:center" %)
708 708  [[image:1624441186851-536.png||height="434" width="700" class="img-thumbnail"]]
709 709  
710 -== **2.5 V-Box connect with Huawei platform** ==
582 +== **2.4 V-Box connect with Huawei platform** ==
711 711  
712 712  In this demo,V-Box connects with Huawei by SSL certification.
713 713  
... ... @@ -828,124 +828,144 @@
828 828  (% style="text-align:center" %)
829 829  [[image:1624506666650-161.png||height="547" width="1000" class="img-thumbnail"]]
830 830  
831 -== **2.6 V-Box connect with AWS platform** ==
703 +== **2.5 V-Box connect with AWS platform** ==
832 832  
833 833  === **Log in AWS** ===
834 834  
835 835  Login aws account and click“Connect an IoT device”
836 836  
837 -[[image:image-20220709165402-1.png]]
838 838  
839 -[[image:image-20220709165402-2.png]]
710 +[[image:image-20220709165226-1.png]]
840 840  
841 -
842 842  === **Create policy** ===
843 843  
844 844  Click “Secure”~-~-->“Policies”~-~-->“Create policy”~-~-->Click “Create”
845 845  
846 -[[image:image-20220709165402-3.png]]
716 +[[image:image-20220709163750-5.png]]
847 847  
848 848  Name the policy~-~-->Click “JSON”~-~-->Copy the following content~-~-->Click “Create”
849 849  
850 -[[image:image-20220709165402-5.png]]
720 +[[image:image-20220709163750-7.png]]
851 851  
852 -[[image:image-20220709165402-4.png]]
722 +[[image:image-20220709163750-6.png]]
853 853  
854 -{{code language="java"}}
855 855  {
856 856  
857 -  "Version": "2012-10-17",
726 + "Version": "2012-10-17",
858 858  
859 -  "Statement": [
728 + "Statement": [
860 860  
861 -    {
730 + {
862 862  
863 -      "Effect": "Allow",
732 + "Effect": "Allow",
864 864  
865 -      "Action": [
734 + "Action": [
866 866  
867 -        "iot:Connect",
736 + "iot:Connect",
868 868  
869 -        "iot:Publish",
738 + "iot:Publish",
870 870  
871 -        "iot:Subscribe",
740 + "iot:Subscribe",
872 872  
873 -        "iot:Receive",
742 + "iot:Receive",
874 874  
875 -        "greengrass:Discover"
744 + "greengrass:Discover"
876 876  
877 -      ],
746 + ],
878 878  
879 -      "Resource": "*"
748 + "Resource": "*"
880 880  
881 -    }
750 + }
882 882  
883 -  ]
752 + ]
884 884  
885 885  }
886 -{{/code}}
887 887  
888 888  === **Create things** ===
889 889  
890 890  Click “Manage”~-~-->“Things”~-~-->“Create things”~-~-->“Create single thing”
891 891  
892 -[[image:image-20220709165402-6.png]]
760 +[[image:image-20220709163750-8.png]]
893 893  
894 -[[image:image-20220709165402-7.png]]
762 +[[image:image-20220709163750-9.png]]
895 895  
896 896  Name the thing~-~-->Click “Next”
897 897  
898 -[[image:image-20220709165402-8.png]]
766 +[[image:image-20220709163750-10.png]]
899 899  
900 900  Select the way to create certificate
901 901  
902 -[[image:image-20220709165402-9.png]]
770 +[[image:image-20220709163750-11.png]]
903 903  
904 904  Select policy
905 905  
906 -[[image:image-20220709165402-10.png]]
907 907  
908 -[[image:image-20220709165402-11.png]]
909 909  
910 910  
911 -=== **Test with MQTT.fx tool** ===
912 912  
778 +
779 +
780 +
781 +
782 +
783 +
784 +
785 +|
786 +| |[[image:image-20220709163750-13.png]]
787 +
788 +1. **Test with MQTT.fx tool**
789 +
913 913  Click “View Setting” to get the “Broker Adress”
914 914  
915 -[[image:image-20220709165402-13.png]]
916 916  
917 -[[image:image-20220709165402-12.png]]
793 +|
794 +| |[[image:image-20220709163750-14.png]]
918 918  
919 -Create one connection in MQTT.fx tool, set broker port as 8883.
796 +|
797 +| |[[image:image-20220709163750-15.png]]
920 920  
921 -[[image:image-20220709165402-14.png]]
799 +|
800 +| |[[image:image-20220709163750-16.png]]
922 922  
802 +Create one connection in MQTT.fx tool, set broker port as 8883.
803 +
923 923  Upload the CA File, Client Certificate File, Client Key File
924 924  
925 -[[image:image-20220709165402-15.png]]
926 926  
807 +|
808 +| |[[image:image-20220709163750-17.png]]
809 +
927 927  Publish message to topic “TEST”
928 928  
929 -[[image:image-20220709165402-17.png]]
930 930  
931 -Click”Test”~-~-->”MQTT test client”~-~-->”Subscrible to a topic”, to get message publish from MQTT.fx tool.
813 +|
814 +| |[[image:image-20220709163750-18.png]]
932 932  
933 -[[image:image-20220709173500-1.png]]
816 +|
817 +| |[[image:image-20220709163750-19.png]]
934 934  
819 +Click”Test”~-~-->”MQTT test client”~-~-->”Subscrible to a topic”, to get message publish from MQTT.fx tool.
820 +
935 935  And we can also send message form AWS platform to MQTT.fx tool.
936 936  
937 -[[image:image-20220709165402-18.png]]
938 938  
939 -=== **Configurate in CloudTool** ===
824 +|
825 +| |[[image:image-20220709163750-20.png]]
940 940  
827 +1. **Configurate in CloudTool**
828 +
941 941  Copy the same setting in MQTT.fx to MQTT configuration
942 942  
943 -[[image:image-20220709165402-19.png]]
944 944  
832 +|
833 +| |[[image:image-20220709163750-21.png]]
834 +
945 945   Add a lua script and copy the lua demo into it.
946 946  
947 -[[image:image-20220709165402-20.png]]
948 948  
838 +|
839 +| |[[image:image-20220709163750-22.png]]
840 +
949 949  sprint = print
950 950  
951 951  ~-~-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)
... ... @@ -1126,6 +1126,10 @@
1126 1126  
1127 1127  end
1128 1128  
1021 +
1022 +
1129 1129  Get message in AWS
1130 1130  
1131 -[[image:image-20220709165402-21.png]]
1025 +
1026 +|
1027 +| |[[image:image-20220709163750-23.png]]
image-20220709165402-1.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -200.2 KB
Content
image-20220709165402-10.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -19.0 KB
Content
image-20220709165402-11.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -105.9 KB
Content
image-20220709165402-12.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -29.0 KB
Content
image-20220709165402-13.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -158.8 KB
Content
image-20220709165402-14.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -48.1 KB
Content
image-20220709165402-15.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -46.9 KB
Content
image-20220709165402-16.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -140.7 KB
Content
image-20220709165402-17.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -12.5 KB
Content
image-20220709165402-18.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -32.2 KB
Content
image-20220709165402-19.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -66.6 KB
Content
image-20220709165402-2.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -188.5 KB
Content
image-20220709165402-20.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -33.3 KB
Content
image-20220709165402-21.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -124.8 KB
Content
image-20220709165402-3.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -103.9 KB
Content
image-20220709165402-4.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -4.0 KB
Content
image-20220709165402-5.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -66.5 KB
Content
image-20220709165402-6.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -110.0 KB
Content
image-20220709165402-7.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -25.4 KB
Content
image-20220709165402-8.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -64.2 KB
Content
image-20220709165402-9.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -37.5 KB
Content
image-20220709173500-1.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Jim
Size
... ... @@ -1,1 +1,0 @@
1 -1.5 MB
Content