Wiki source code of Instruction for LA66 Peer to Peer firmware
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | (% class="wikigeneratedid" %) | ||
2 | **Table of Contents:** | ||
3 | |||
4 | {{toc/}} | ||
5 | |||
6 | |||
7 | |||
8 | = 1. Overview = | ||
9 | |||
10 | |||
11 | This instruction is for how to use Peer to Peer firmware in LA66. | ||
12 | |||
13 | |||
14 | |||
15 | = 2. Firmware Location = | ||
16 | |||
17 | |||
18 | Click[[ here>>https://www.dropbox.com/sh/dq03kkfdrqnhy66/AACpHIcKYMa4o1IySKtVoeENa?dl=0]] to download the firmware and update it to LA66 according to the instruction for different boards. | ||
19 | |||
20 | |||
21 | |||
22 | = 3. How to use? = | ||
23 | |||
24 | |||
25 | == 3.1 AT command == | ||
26 | |||
27 | |||
28 | (% style="color:blue" %)**1). Lora parameter configuration:** | ||
29 | |||
30 | |||
31 | AT+FRE: Get or Set TX and RX frequency | ||
32 | |||
33 | AT+BW: Get or Set TX and RX BandWidth | ||
34 | |||
35 | AT+SF: Get or Set TX and RX Spreading Factor | ||
36 | |||
37 | AT+POWER: Get or Set Tx Power Range | ||
38 | |||
39 | AT+CRC: Get or Set TX and RX CRC Type | ||
40 | |||
41 | AT+HEADER: Get or Set TX and RX Header Type | ||
42 | |||
43 | AT+CR: Get or Set TX and RX Header Type | ||
44 | |||
45 | AT+IQ: Get or Set TX and RX InvertIQ | ||
46 | |||
47 | AT+PREAMBLE: Get or Set TX and RX Preamble Length | ||
48 | |||
49 | AT+SYNCWORD: Get or Set sync word | ||
50 | |||
51 | |||
52 | |||
53 | (% style="color:blue" %)**2). General configuration:** | ||
54 | |||
55 | |||
56 | ATZ: Trig a reset of the MCU | ||
57 | |||
58 | AT+FDR: Reset Parameters to Factory Default | ||
59 | |||
60 | AT+CFG: Print all configurations | ||
61 | |||
62 | AT+FCU: Get or Set the Frame Counter Uplink | ||
63 | |||
64 | AT+FCD: Get or Set the Frame Counter Downlink | ||
65 | |||
66 | AT+GROUPMOD: Get or Set TX and RX group | ||
67 | |||
68 | AT+RXMOD: Get or Set Rx Timeout and Reply mode | ||
69 | |||
70 | AT+SEND: Send text data or hex along with the application port and confirm status | ||
71 | |||
72 | AT+RECV: Print last receive message, RSSI and SNR | ||
73 | |||
74 | |||
75 | |||
76 | == 3.2 Serial port information == | ||
77 | |||
78 | |||
79 | (% style="color:blue" %)**1). Information initialized at reset:** | ||
80 | |||
81 | [[image:image-20220926112125-1.png]] | ||
82 | |||
83 | |||
84 | (% style="color:blue" %)**2). In retransmission, the Uplinkcounter does not accumulate. The following figure shows that the third count packet is retransmitted twice when the ACK packet is not received.** | ||
85 | |||
86 | |||
87 | [[image:image-20220926112125-2.png]] | ||
88 | |||
89 | |||
90 | (% style="color:blue" %)**3). In the figure below, the receiver sends an ACK to the sender after receiving the packet, and the sender stops retransmission after receiving the ACK.** | ||
91 | |||
92 | |||
93 | (% style="color:red" %)**Receiver: (configured as AT+RXMOD=65535,2)** | ||
94 | |||
95 | [[image:image-20220926112125-3.png]] | ||
96 | |||
97 | |||
98 | |||
99 | (% style="color:red" %)**Sender:** | ||
100 | |||
101 | [[image:image-20220926112125-4.png]] | ||
102 | |||
103 | |||
104 | |||
105 | == 3.3 Data Format == | ||
106 | |||
107 | |||
108 | 1 byte of TXGROUPMOD +n payload + 4 bytes of checksum | ||
109 | |||
110 | |||
111 | Payload(S12, SF11, SF10 maximum length is 59, SF9 maximum length is 123, SF8, SF7 maximum length is 230): | ||
112 | |||
113 | (% border="1" style="background-color:#ffffcc; color:green; width:316px" %) | ||
114 | |=(% style="width: 105px;" %)**Size (bytes)**|=(% style="width: 109px;" %)** 1**|=(% style="width: 99px;" %)**payloadsize** | ||
115 | |(% style="width:105px" %)**Value**|(% style="width:109px" %)TXGroupmod|(% style="width:99px" %)Send data | ||
116 | |||
117 | |||
118 | |||
119 | |||
120 | = 4. AT Command Set = | ||
121 | |||
122 | |||
123 | == 4.1 Set TX and RX Bandwidth == | ||
124 | |||
125 | |||
126 | **Set TX and RX BandWidth (0 ~~ 9), (% style="color:blue" %)AT Command : AT+BW(%%)** | ||
127 | |||
128 | 0: 125 kHz | ||
129 | |||
130 | 1: 250 kHz | ||
131 | |||
132 | 2: 500 kHz | ||
133 | |||
134 | 3: 62.5 kHz | ||
135 | |||
136 | 4: 41.67 kHz | ||
137 | |||
138 | 5: 31.25 kHz | ||
139 | |||
140 | 6: 20.83 kHz | ||
141 | |||
142 | 7: 15.63 kHz | ||
143 | |||
144 | 8: 10.42 kHz | ||
145 | |||
146 | 9: 7.81 kHz | ||
147 | |||
148 | |||
149 | (% style="color:red" %)**Default Value: AT+BW=0,0** (%%) ~/~/ BandWidth: 125kHz ,125kHz | ||
150 | |||
151 | (% style="color:red" %)**Range: (0 ~~ 9)** | ||
152 | |||
153 | |||
154 | |||
155 | == 4.2 Set TX and RX frequency == | ||
156 | |||
157 | |||
158 | **Set TX and RX frequency (MHz), (% style="color:blue" %)AT Command : AT+FRE(%%)** | ||
159 | |||
160 | |||
161 | (% style="color:red" %)**Default Value: AT+FRE=868.100,868.100** (%%) ~/~/ Frequency: 868.100MHz, 868.100MHz | ||
162 | |||
163 | |||
164 | |||
165 | == 4.3 Set TX and RX Spreading Factor == | ||
166 | |||
167 | |||
168 | **Set TX and RX Spreading Factor ( 5 ~~ 12), (% style="color:blue" %)AT Command : AT+SF(%%)** | ||
169 | |||
170 | |||
171 | (% style="color:red" %)**Default Value: AT+SF=12,12** (%%) ~/~/ Spreading Factor : 12,12 | ||
172 | |||
173 | (% style="color:red" %)**Range: (5 ~~ 12)** | ||
174 | |||
175 | |||
176 | |||
177 | == 4.4 Set Tx Power Range == | ||
178 | |||
179 | |||
180 | **Set Tx Power Range( 0 ~~ 22 dBm), (% style="color:blue" %)AT Command : AT+POWER(%%)** | ||
181 | |||
182 | |||
183 | (% style="color:red" %)**Default Value: AT+POWER=20** (%%) ~/~/ Output Power: 20dBm | ||
184 | |||
185 | (% style="color:red" %)**Range: (0 ~~ 22)** | ||
186 | |||
187 | |||
188 | |||
189 | == 4.5 Set TX and RX Coding Rate == | ||
190 | |||
191 | |||
192 | **Set TX and RX Coding Rate ( 1 ~~ 4 ), (% style="color:blue" %)AT Command :AT+CR(%%)** | ||
193 | |||
194 | 1: 4/5 | ||
195 | |||
196 | 2: 4/6 | ||
197 | |||
198 | 3: 4/7 | ||
199 | |||
200 | 4: 4/8 | ||
201 | |||
202 | |||
203 | (% style="color:red" %)**Default Value: AT+CR=1,1** (%%) ~/~/ Coding Rate: 4/5, 4/5 | ||
204 | |||
205 | (% style="color:red" %)**Range: (1 ~~ 4)** | ||
206 | |||
207 | |||
208 | |||
209 | == 4.6 Set TX and RX Header Type == | ||
210 | |||
211 | |||
212 | **Set TX and RX Header Type ( 0,1 ), (% style="color:blue" %)AT Command : AT+HEADER(%%)** | ||
213 | |||
214 | 0: Variable length packet (explicit header) | ||
215 | |||
216 | 1: Fixed length packet (implicit header) | ||
217 | |||
218 | |||
219 | (% style="color:red" %)**Default Value: AT+HEADER=1,1** (%%) ~/~/ Header Type: explicit, explicit | ||
220 | |||
221 | (% style="color:red" %)**Range: (0 ~~ 1)** | ||
222 | |||
223 | |||
224 | |||
225 | == 4.7 Set TX and RX CRC Type == | ||
226 | |||
227 | |||
228 | **Set TX and RX CRC Type ( 0,1) ,(% style="color:blue" %)AT Command:AT+CRC(%%)** | ||
229 | |||
230 | 0: CRC OFF | ||
231 | |||
232 | 1: CRC ON | ||
233 | |||
234 | |||
235 | (% style="color:red" %)**Default Value: AT+CRC=0,0** (%%) ~/~/ CRC: OFF, OFF | ||
236 | |||
237 | (% style="color:red" %)**Range: (0 ~~ 1)** | ||
238 | |||
239 | |||
240 | |||
241 | == 4.8 Set TX and RX InvertIQ == | ||
242 | |||
243 | |||
244 | **Set TX and RX InvertIQ ( 0,1) , (% style="color:blue" %)AT Command:AT+IQ(%%)** | ||
245 | |||
246 | 0: Standard IQ setup | ||
247 | |||
248 | 1: Inverted IQ setup | ||
249 | |||
250 | |||
251 | (% style="color:red" %)**Default Value: AT+IQ=0,0** (%%) ~/~/ Invert IQ: 0,0 | ||
252 | |||
253 | (% style="color:red" %)**Range: (0 ~~ 1)** | ||
254 | |||
255 | |||
256 | |||
257 | == 4.9 Set TX and RX Preamble Length == | ||
258 | |||
259 | |||
260 | **Set TX and RX Preamble Length ( 0 ~~ 65535 ) , (% style="color:blue" %)AT Command: AT+PREAMBLE(%%)** | ||
261 | |||
262 | |||
263 | (% style="color:red" %)**Default Value: AT+PREAMBLE=8,8** (%%) ~/~/ Preamble: 8,8 | ||
264 | |||
265 | (% style="color:red" %)**Range: ( 0 ~~ 65535 )** | ||
266 | |||
267 | |||
268 | |||
269 | == 4.10 Set Syncword == | ||
270 | |||
271 | |||
272 | **Set Syncword(0: private,1: public), (% style="color:blue" %)AT Command : AT+SYNCWORD(%%)** | ||
273 | |||
274 | |||
275 | (% style="color:red" %)**Default Value: AT+SYNCWORD=0** (%%) ~/~/ 0x3444 for Public Network | ||
276 | |||
277 | (% style="color:red" %)**Range: ( 0 ~~ 1 )** | ||
278 | |||
279 | |||
280 | |||
281 | == 4.11 Set TX and RX group == | ||
282 | |||
283 | |||
284 | **Set TX and RX group. (0 ~~ 255),(% style="color:blue" %)AT Command:AT+GROUPMOD(%%)** | ||
285 | |||
286 | Group > 0: Device only accept same group transmision | ||
287 | |||
288 | Group = 0: Accept Any group | ||
289 | |||
290 | |||
291 | (% style="color:red" %)**Default Value: AT+GROUPMOD=0,0** (%%) ~/~/ Group: 0,0 | ||
292 | |||
293 | (% style="color:red" %)**Range: ( 0 ~~ 255 )** | ||
294 | |||
295 | |||
296 | |||
297 | |||
298 | == 4.12 Set Rx Timeout and Reply mode == | ||
299 | |||
300 | |||
301 | **Set Rx Timeout and Reply mode, Parameter 1, Parameter2, (% style="color:blue" %)AT Command:AT+RXMOD(%%)** | ||
302 | |||
303 | **Parameter 1: ** | ||
304 | |||
305 | 0: Always no RX | ||
306 | |||
307 | 1 ~~ 65534: Open RX window and last for specify seconds. | ||
308 | |||
309 | 65535: RX window always open. | ||
310 | |||
311 | |||
312 | **~ Parameter 2: ** | ||
313 | |||
314 | 0: No ACK | ||
315 | |||
316 | 1: Send an ACK once got a message from another device. ACK Content is same as receive message | ||
317 | |||
318 | 2: Send an ACK once got a message from another device. ACK Content is 0x00 FF | ||
319 | |||
320 | |||
321 | (% style="color:red" %)**Default Value: AT+RXMOD=65535,2** (%%) ~/~/ RX Mode: 65535, 2 | ||
322 | |||
323 | |||
324 | |||
325 | == 4.13 Send Message == | ||
326 | |||
327 | |||
328 | **Send Message, (% style="color:blue" %)AT Command:AT+SEND(%%)** | ||
329 | |||
330 | **Parameter 1:** send hex or text | ||
331 | |||
332 | 0: Send hex | ||
333 | |||
334 | 1: Send text | ||
335 | |||
336 | |||
337 | **Parameter 2:** Content | ||
338 | |||
339 | |||
340 | **Parameter 3 :** ACK Type | ||
341 | |||
342 | 0: No ACK | ||
343 | |||
344 | 1: Wait for ACK (Same as what we sent) | ||
345 | |||
346 | 2: Wait for ACK ( 0x00 FF) | ||
347 | |||
348 | |||
349 | **Parameter 4 :** Retransmission ( 0 ~~ 8 ) | ||
350 | |||
351 | 0: No re-transmission | ||
352 | |||
353 | 1 ~~ 8: total sends 1~~8 transmission, interval 5 seconds | ||
354 | |||
355 | |||
356 | Example: AT+SEND=1,hello world,0,3 | ||
357 | |||
358 | (% style="color:red" %)**Notice: RX reply (Defined by AT+RXMOD) won't ask for TX ACK** | ||
359 | |||
360 | |||
361 | |||
362 | == 4.14 Print last receive message with RSSI and SNR == | ||
363 | |||
364 | |||
365 | **Print last receive message with RSSI and SNR,(% style="color:blue" %)AT+Command:AT+RECV(%%)** | ||
366 | |||
367 | 0: Print in Hex | ||
368 | |||
369 | 1: Print in text | ||
370 | |||
371 | |||
372 | Example: AT+RECV=0 | ||
373 | \\The recevied message will be clear after this command. | ||
374 | |||
375 | |||
376 | |||
377 | |||
378 | |||
379 | |||
380 | |||
381 | |||
382 | |||
383 |