Changes for page 2 Script

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

From version 10.1
edited by Jim(Forgotten)
on 2022/07/09 16:52
Change comment: There is no comment for this version
To version 18.1
edited by Stone Wu
on 2022/07/25 11:32
Change comment: Renamed back-links.

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.Jim
1 +XWiki.Stone
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.1\.User 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.04 Lua Script.01 Lua Functions.WebHome]]
17 17  
18 18  == **1.2 Arithmetic** ==
19 19  
... ... @@ -256,15 +256,13 @@
256 256   sv=addr_getshort("@SV Silicone")/10,
257 257   pv=addr_getshort("@PV Silicone")/10,
258 258   product1=addr_getshort("@Product 1")/10,
259 -
260 - product2=addr_getshort("@Product 2")/10,
259 +\\ product2=addr_getshort("@Product 2")/10,
261 261   product3=addr_getshort("@Product 3")/10,
262 262   product4=addr_getshort("@Product 4")/10,
263 263   ice1=addr_getshort("@Ice condenser 1")/10,
264 264   ice2=addr_getshort("@Ice condenser 2")/10,
265 265   vacuum=addr_getfloat("@Vacuum")
266 -
267 - }
265 +\\ }
268 268   local jsAlarm = { HPC = addr_getbit("@B_25395#W0.00"),
269 269   ODPC = addr_getbit("@B_25395#W0.01"),
270 270   MTPC=addr_getbit("@B_25395#W0.02"),
... ... @@ -279,8 +279,7 @@
279 279   FSE=addr_getbit("@B_25395#W2.04"),
280 280   AVVSVV=addr_getbit("@B_25395#W1.12"),
281 281   ICHT=addr_getbit("@B_25395#W3.06")
282 -
283 - }
280 +\\ }
284 284  \\ ~-~- ("@B_25395#CIO1.02")
285 285   mq.m:publish("mqtt-v-box-epsilon-fd300", json.encode(js) , 0, 0)
286 286   mq.m:publish("mqtt-v-box-epsilon-alarm-fd300", json.encode(jsAlarm) , 0, 0)
... ... @@ -706,138 +706,118 @@
706 706  
707 707  Login aws account and click“Connect an IoT device”
708 708  
706 +[[image:image-20220709165402-1.png]]
709 709  
710 -[[image:image-20220709165226-1.png]]
708 +[[image:image-20220709165402-2.png]]
711 711  
710 +
712 712  === **Create policy** ===
713 713  
714 714  Click “Secure”~-~-->“Policies”~-~-->“Create policy”~-~-->Click “Create”
715 715  
716 -[[image:image-20220709163750-5.png]]
715 +[[image:image-20220709165402-3.png]]
717 717  
718 718  Name the policy~-~-->Click “JSON”~-~-->Copy the following content~-~-->Click “Create”
719 719  
720 -[[image:image-20220709163750-7.png]]
719 +[[image:image-20220709165402-5.png]]
721 721  
722 -[[image:image-20220709163750-6.png]]
721 +[[image:image-20220709165402-4.png]]
723 723  
723 +{{code language="java"}}
724 724  {
725 725  
726 - "Version": "2012-10-17",
726 +  "Version": "2012-10-17",
727 727  
728 - "Statement": [
728 +  "Statement": [
729 729  
730 - {
730 +    {
731 731  
732 - "Effect": "Allow",
732 +      "Effect": "Allow",
733 733  
734 - "Action": [
734 +      "Action": [
735 735  
736 - "iot:Connect",
736 +        "iot:Connect",
737 737  
738 - "iot:Publish",
738 +        "iot:Publish",
739 739  
740 - "iot:Subscribe",
740 +        "iot:Subscribe",
741 741  
742 - "iot:Receive",
742 +        "iot:Receive",
743 743  
744 - "greengrass:Discover"
744 +        "greengrass:Discover"
745 745  
746 - ],
746 +      ],
747 747  
748 - "Resource": "*"
748 +      "Resource": "*"
749 749  
750 - }
750 +    }
751 751  
752 - ]
752 +  ]
753 753  
754 754  }
755 +{{/code}}
755 755  
756 756  === **Create things** ===
757 757  
758 758  Click “Manage”~-~-->“Things”~-~-->“Create things”~-~-->“Create single thing”
759 759  
760 -[[image:image-20220709163750-8.png]]
761 +[[image:image-20220709165402-6.png]]
761 761  
762 -[[image:image-20220709163750-9.png]]
763 +[[image:image-20220709165402-7.png]]
763 763  
764 764  Name the thing~-~-->Click “Next”
765 765  
766 -[[image:image-20220709163750-10.png]]
767 +[[image:image-20220709165402-8.png]]
767 767  
768 768  Select the way to create certificate
769 769  
770 -[[image:image-20220709163750-11.png]]
771 +[[image:image-20220709165402-9.png]]
771 771  
772 772  Select policy
773 773  
775 +[[image:image-20220709165402-10.png]]
774 774  
777 +[[image:image-20220709165402-11.png]]
775 775  
776 776  
780 +=== **Test with MQTT.fx tool** ===
777 777  
778 -
779 -
780 -
781 -
782 -
783 -
784 -
785 -|
786 -| |[[image:image-20220709163750-13.png]]
787 -
788 -1. **Test with MQTT.fx tool**
789 -
790 790  Click “View Setting” to get the “Broker Adress”
791 791  
784 +[[image:image-20220709165402-13.png]]
792 792  
793 -|
794 -| |[[image:image-20220709163750-14.png]]
786 +[[image:image-20220709165402-12.png]]
795 795  
796 -|
797 -| |[[image:image-20220709163750-15.png]]
798 -
799 -|
800 -| |[[image:image-20220709163750-16.png]]
801 -
802 802  Create one connection in MQTT.fx tool, set broker port as 8883.
803 803  
790 +[[image:image-20220709165402-14.png]]
791 +
804 804  Upload the CA File, Client Certificate File, Client Key File
805 805  
794 +[[image:image-20220709165402-15.png]]
806 806  
807 -|
808 -| |[[image:image-20220709163750-17.png]]
809 -
810 810  Publish message to topic “TEST”
811 811  
798 +[[image:image-20220709165402-17.png]]
812 812  
813 -|
814 -| |[[image:image-20220709163750-18.png]]
815 -
816 -|
817 -| |[[image:image-20220709163750-19.png]]
818 -
819 819  Click”Test”~-~-->”MQTT test client”~-~-->”Subscrible to a topic”, to get message publish from MQTT.fx tool.
820 820  
802 +[[image:image-20220709173500-1.png]]
803 +
821 821  And we can also send message form AWS platform to MQTT.fx tool.
822 822  
806 +[[image:image-20220709165402-18.png]]
823 823  
824 -|
825 -| |[[image:image-20220709163750-20.png]]
808 +=== **Configurate in CloudTool** ===
826 826  
827 -1. **Configurate in CloudTool**
828 -
829 829  Copy the same setting in MQTT.fx to MQTT configuration
830 830  
812 +[[image:image-20220709165402-19.png]]
831 831  
832 -|
833 -| |[[image:image-20220709163750-21.png]]
834 -
835 835   Add a lua script and copy the lua demo into it.
836 836  
816 +[[image:image-20220709165402-20.png]]
837 837  
838 -|
839 -| |[[image:image-20220709163750-22.png]]
840 -
841 841  sprint = print
842 842  
843 843  ~-~-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)
... ... @@ -1018,10 +1018,6 @@
1018 1018  
1019 1019  end
1020 1020  
1021 -
1022 -
1023 1023  Get message in AWS
1024 1024  
1025 -
1026 -|
1027 -| |[[image:image-20220709163750-23.png]]
1000 +[[image:image-20220709165402-21.png]]
image-20220709165402-1.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +200.2 KB
Content
image-20220709165402-10.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +19.0 KB
Content
image-20220709165402-11.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +105.9 KB
Content
image-20220709165402-12.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +29.0 KB
Content
image-20220709165402-13.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +158.8 KB
Content
image-20220709165402-14.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +48.1 KB
Content
image-20220709165402-15.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +46.9 KB
Content
image-20220709165402-16.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +140.7 KB
Content
image-20220709165402-17.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +12.5 KB
Content
image-20220709165402-18.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +32.2 KB
Content
image-20220709165402-19.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +66.6 KB
Content
image-20220709165402-2.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +188.5 KB
Content
image-20220709165402-20.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +33.3 KB
Content
image-20220709165402-21.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +124.8 KB
Content
image-20220709165402-3.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +103.9 KB
Content
image-20220709165402-4.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +4.0 KB
Content
image-20220709165402-5.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +66.5 KB
Content
image-20220709165402-6.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +110.0 KB
Content
image-20220709165402-7.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +25.4 KB
Content
image-20220709165402-8.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +64.2 KB
Content
image-20220709165402-9.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +37.5 KB
Content
image-20220709173500-1.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Jim
Size
... ... @@ -1,0 +1,1 @@
1 +1.5 MB
Content