Hide last authors
Xiaoling 19.3 1 (% class="wikigeneratedid" %)
2 **Table of Contents:**
Xiaoling 19.2 3
Xiaoling 19.3 4 {{toc/}}
Xiaoling 19.2 5
6
7
Xiaoling 19.3 8
Edwin Chen 20.1 9 = 1. Python Examples =
Xiaoling 19.3 10
11
Edwin Chen 20.1 12 == Step 1: Configure Python Simulator ==
Xiaoling 19.3 13
Edwin Chen 20.1 14 * Download and run **[[BLE_Positioning.exe>>https://github.com/dragino/TrackerD/tree/main/Example/BLE_Indoor_Positioning_Software/BLE_Positioning]]**
Xiaoling 19.4 15
Edwin Chen 20.1 16
Xiaoling 19.3 17 (% style="color:blue" %)**Enter the following information:**
18
19 (% style="color:#037691" %)**Subscribe to topics:**(%%)**MQTT Subscription Topic of TTN-V3**
20
Edwin Chen 20.1 21 **Example: **v3/**litest@ttn**/devices/**eui-70b3d57ed0058a17**/up
Xiaoling 19.3 22
Xiaoling 19.2 23 * v3: Unchanging
24
Xiaoling 19.5 25 * litest@ttn: 'litest' is the ID of the application, '@ttn' unchanging.If you use your own TTN platform, @ ttn doesn't need
Xiaoling 19.2 26
Xiaoling 19.3 27 * devices: Unchanging
Xiaoling 19.2 28
Edwin Chen 20.1 29 * eui-70b3d57ed0058a17: TrackerD End Device ID
Xiaoling 19.2 30
Xiaoling 19.3 31 * Up: Unchanging
Xiaoling 19.2 32
Edwin Chen 20.1 33 (% style="color:#037691" %)**server address:**(%%)**Server address of TTN-V3**
Xiaoling 19.2 34
Edwin Chen 20.1 35 (% style="color:#037691" %)**Application ID:**(%%)**Application ID of TTN-V3**
Xiaoling 19.2 36
Edwin Chen 20.1 37 (% style="color:#037691" %)**APIKEY:            **(%%)**APIKEY of your own account**
Xiaoling 19.3 38
39
Xiaoling 19.2 40 [[image:image-20221221144423-1.png]]
41
42
43 [[image:image-20221221144423-2.png||height="534" width="1081"]]
44
45
46 [[image:image-20221221144423-3.png]]
47
48
Xiaoling 19.4 49 == Step 2: Click the save button after writing ==
Xiaoling 19.2 50
51
52 [[image:image-20221221144423-4.png]]
53
Xiaoling 19.4 54
Xiaoling 19.3 55 (% style="background-color:yellow" %)**Warning:**
Xiaoling 19.2 56
Xiaoling 19.7 57 (% style="color:red" %)**When the save button is pressed, it cannot be pressed again to prevent data confusion.**
Xiaoling 19.2 58
Xiaoling 19.7 59 (% style="color:red" %)**If you want to modify the subscription topic, you need to restart the application.**
Xiaoling 19.2 60
61
Xiaoling 19.4 62 == Step 3: Click the location button ==
Xiaoling 19.2 63
64
65 Just press once
66
Xiaoling 19.3 67 [[image:image-20221221144423-5.png]]
Xiaoling 19.2 68
69
Xiaoling 19.4 70 When the BLE node sends information, the application will display the located base station.
Xiaoling 19.2 71
72
Xiaoling 19.4 73 == Step 4: About how to set the base station point and insert the floor plan ==
Xiaoling 19.2 74
75
76 Place the floor plan in the same path as the python script
77
Edwin Chen 20.1 78 Change the file name to office_map(The picture pixel is 800x600)
Xiaoling 19.2 79
80 [[image:image-20221221144423-7.png]]
81
82
Xiaoling 19.3 83 (% style="color:blue" %)**Open source code**
Xiaoling 19.2 84
85 [[image:image-20221221144423-8.png]]
86
87
Xiaoling 19.3 88 (% style="color:blue" %)**Remove comments**
Xiaoling 19.2 89
90 [[image:image-20221221144423-9.png]]
91
92
Xiaoling 19.3 93 (% style="color:blue" %)**Run Script**
Xiaoling 19.2 94
95 The cursor position is the data pointed by the arrow, x=323 y=503
96
97 [[image:image-20221221144423-10.png]]
98
99 cv. create_ Image is changed to (323,483)~-~-(x y-20 above)
100
101 cv. create_ Image is changed to (323,503)~-~--(x y above)
102
103 [[image:image-20221221144423-11.png]]
104
105
106
Xiaoling 19.3 107 After clicking Save, a (% style="color:blue" %)**log.txt** (%%)will be generated in the same directory as the script
Xiaoling 19.2 108
109 [[image:image-20221221144423-12.png]]
110
111
112 [[image:image-20221221144423-13.png||height="176" width="1080"]]
113
114
Xiaoling 19.3 115 (% style="color:blue" %)**Back to script**
Xiaoling 19.2 116
Xiaoling 19.3 117 Modify (% style="display:none" %) (%%)the data obtained in (% style="color:blue" %)**log.txt**(%%) to the script
Xiaoling 19.2 118
Xiaoling 19.3 119 (% style="color:#037691" %)**“0” Changed to “10006”**
Xiaoling 19.2 120
Xiaoling 19.3 121 (% style="color:#037691" %)**“60245” Changed to “79”**
Xiaoling 19.2 122
123 [[image:image-20221221144423-14.png]]
124
125
Xiaoling 19.4 126 == Step 5: Package the py file into an exe ==
Xiaoling 19.2 127
128
Xiaoling 19.3 129 (% style="color:blue" %)**Step 1:**(%%)Installing the pyinstaller module
Xiaoling 19.2 130
Xiaoling 19.3 131 (% style="color:blue" %)**Step 2:**(%%)Open cmd and switch to the directory where the script is located
132
Xiaoling 19.2 133 [[image:image-20221221144423-15.png]]
134
135
Xiaoling 19.3 136 (% style="color:blue" %)**Step 3:**(%%)Enter the following command
Xiaoling 19.2 137
138 [[image:image-20221221144423-16.png]]
139
140
141 See the following certificate packaging completed.
142
143 [[image:image-20221221144423-17.png]]
144
145
146 The following files will be generated in the same directory of the script.
147
148 In addition to dist, the other two files can be deleted.
149
150 [[image:image-20221221144423-18.png]]
151
Xiaoling 19.3 152 (% style="color:blue" %)**Finally**(%%), put the office_ Map.png and icon.png Put the into the dist folder.
Xiaoling 19.2 153
154 Just run the program in dist.
155
156
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0