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