-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
1799 lines (1565 loc) · 77.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>RNode Flasher</title>
<script src="./js/rnode.js"></script>
<script src="./js/nrf52_dfu_flasher.js"></script>
<script src="./js/zip.min.js"></script>
<!-- tailwind css -->
<script src="./js/tailwindcss/tailwind-v3.4.3-forms-v0.5.7.js"></script>
<!-- vue js -->
<script src="./js/[email protected]/dist/vue.global.js"></script>
<script src="./js/[email protected]/core.js"></script>
<script src="./js/[email protected]/md5.js"></script>
</head>
<body class="bg-slate-300">
<div id="app" class="space-y-2 p-3">
<!-- header -->
<div class="flex border bg-gray-50 p-3 rounded shadow">
<div class="mr-3">
<img src="reticulum_logo_512.png" class="w-14 h-14"/>
</div>
<div class="my-auto">
<div class="font-bold">RNode Flasher</div>
<div class="text-sm">Developed by <a target="_blank" href="https://liamcottle.com" class="text-blue-500 hover:underline">Liam Cottle</a></div>
</div>
</div>
<div class="border bg-gray-50 rounded shadow">
<div class="border-b px-2 py-1">
1. Select your device
</div>
<div class="p-3">
<div class="flex mb-1 space-x-1">
<div class="min-w-[70px] my-auto text-right">Product</div>
<select v-model="selectedProduct" class="w-full sm:w-min sm:min-w-[250px] bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block pl-2 pr-8">
<option :value="null" disabled>Select a Product</option>
<option v-for="product of products" :value="product">{{ product.name }}</option>
</select>
</div>
<div class="flex space-x-1">
<div class="min-w-[70px] my-auto text-right">Model</div>
<select v-model="selectedModel" class="w-full sm:w-min sm:min-w-[250px] bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block pl-2 pr-8">
<option :value="null" disabled>Select a Model</option>
<option v-if="selectedProduct" v-for="model of selectedProduct.models" :value="model">{{ model.name }}</option>
</select>
</div>
</div>
<!-- button to enter dfu mode on PLATFORM_NRF52 -->
<div v-if="selectedProduct?.platform === 0x70" class="p-3 border-t">
<button @click="enterDfuMode" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Enter DFU Mode
</button>
</div>
<div class="border-t px-2 py-1">
<div class="text-sm space-x-1">
<span>Can't find your device? Open an issue on</span>
<a target="_blank" href="https://github.com/liamcottle/rnode-flasher" class="text-blue-500 hover:underline">GitHub</a>
</div>
</div>
</div>
<div class="border bg-gray-50 rounded shadow">
<div class="border-b px-2 py-1">
2. Select firmware to flash (.zip)
</div>
<div class="p-3">
<div class="mb-2">
<input ref="file" type="file"/>
</div>
<div v-if="!isFlashing" class="space-x-1">
<button @click="flash" :disabled="isFlashing" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Flash Now
</button>
</div>
<div v-else>
<span v-if="flashingProgress > 0">Flashing: {{flashingProgress}}%</span>
<span v-else>Flashing: please wait...</span>
<div class="mt-1 w-[200px] overflow-hidden rounded-full bg-gray-200">
<div class="h-2 rounded-full bg-blue-600" :style="{ 'width': `${flashingProgress}%`}"></div>
</div>
</div>
</div>
<div class="border-t px-2 py-1 text-sm">
<div>
<span>Download Firmware</span>
<span v-if="selectedProduct && selectedModel && recommendedFirmwareFilename">: {{ recommendedFirmwareFilename }}</span>
</div>
<div class="space-x-1">
<a target="_blank" href="https://github.com/markqvist/RNode_Firmware/releases" class="text-blue-500 hover:underline">Official Firmware</a>
<span>•</span>
<a target="_blank" href="https://github.com/liberatedsystems/RNode_Firmware_CE/releases" class="text-blue-500 hover:underline">CE Firmware</a>
<span>•</span>
<a target="_blank" href="https://github.com/attermann/microReticulum_Firmware/releases" class="text-blue-500 hover:underline">Transport Node Firmware</a>
</div>
</div>
<div class="border-t px-2 py-1 text-sm">
<div>Common error messages</div>
<div>• Hardware Failure: You need to provision the eeprom in step 3.</div>
<div>• Firmware Corrupt: You need to set the firmware hash in step 4.</div>
</div>
</div>
<div class="border bg-gray-50 rounded shadow">
<div class="border-b px-2 py-1">
3. Provision EEPROM (sets device info, checksum and blank signature)
</div>
<div class="p-3">
<button v-if="!isProvisioning" @click="provision" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Provision
</button>
<div v-else class="flex items-center space-x-1">
<div class="mr-1">
<svg class="animate-spin h-5 w-5 text-gray-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
</div>
<div>Provisioning: please wait...</div>
</div>
</div>
</div>
<div class="border bg-gray-50 rounded shadow">
<div class="border-b px-2 py-1">
4. Set Firmware Hash (uses hash from board, will fix later)
</div>
<div class="p-3">
<button v-if="!isSettingFirmwareHash" @click="setFirmwareHash" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Set Firmware Hash
</button>
<div v-else class="flex items-center space-x-1">
<div class="mr-1">
<svg class="animate-spin h-5 w-5 text-gray-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
</div>
<div>Setting Firmware Hash: please wait...</div>
</div>
</div>
</div>
<div class="border bg-gray-50 rounded shadow">
<div class="border-b px-2 py-1">
5. Done
</div>
<div class="px-2 py-1 text-sm">
<div>• If you made it this far, and all previous steps were successful, your RNode should be ready to use.</div>
<div>• To use RNode with <a target="_blank" href="https://github.com/liamcottle/reticulum-meshchat" class="text-blue-500 hover:underline">MeshChat</a>, you will need to add an <u>RNodeInterface</u> in the <u>Interfaces → Add Interface</u> page.</div>
<div>• To use RNode with <a target="_blank" href="https://github.com/markqvist/Sideband/" class="text-blue-500 hover:underline">Sideband</a>, you will need to configure it in <u>Hardware → RNode</u> and enable <u>Connectivity → Connect via RNode</u>.</div>
<div>• You must restart MeshChat and Sideband for interface setting changes to take effect, otherwise nothing will happen!</div>
</div>
</div>
<div class="border bg-gray-50 rounded shadow">
<div class="border-b px-2 py-1">
Advanced Tools
</div>
<div class="p-3">
<div class="space-x-1">
<button @click="detect" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Detect RNode
</button>
<button @click="reboot" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Reboot RNode
</button>
<button @click="readDisplay" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Read Display
</button>
<button @click="dumpEeprom" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Dump EEPROM
</button>
<button @click="wipeEeprom" class="border border-gray-500 px-2 bg-red-100 hover:bg-red-200 rounded">
Wipe EEPROM
</button>
</div>
<div class="text-sm text-gray-500">EEPROM dumps are shown in dev tools console.</div>
<!-- show rnode display if available -->
<div v-if="rnodeDisplayImage">
<img :src="rnodeDisplayImage" class="h-28"/>
</div>
</div>
</div>
<div class="border bg-gray-50 rounded shadow">
<div class="border-b px-2 py-1">
Configure Bluetooth (optional)
</div>
<div class="border-b px-2 py-1 text-sm">
<div>• Bluetooth is not supported on all devices.</div>
<div>• Some devices use Bluetooth Classic, and some use BLE (Bluetooth Low Energy)</div>
<div>• Put the RNode into Bluetooth Pairing mode, then connect to it from Android Bluetooth settings.</div>
<div>• Once you have initiated a pair request from Android, a PIN should show on the RNode display.</div>
<div>• In Sideband you will need to enable <u>Connect using Bluetooth</u> in <u>Hardware → RNode</u>.</div>
<div>• If your device uses BLE you will also need to enable <u>Device requires BLE</u> in <u>Hardware → RNode</u>.</div>
<div>• Don't forget to restart Sideband for the setting changes to take effect, otherwise nothing will happen!</div>
</div>
<div class="p-3">
<div class="space-x-1">
<button @click="enableBluetooth" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Enable
</button>
<button @click="disableBluetooth" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Disable
</button>
<button @click="startBluetoothPairing" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Start Pairing
</button>
</div>
</div>
</div>
<div class="border bg-gray-50 rounded shadow">
<div class="border-b px-2 py-1">
Configure TNC Mode (optional)
</div>
<div class="border-b px-2 py-1 text-sm">
<div>• TNC mode allows an RNode to be used as a KISS compatible TNC over the Serial Port.</div>
<div>• This mode makes it usable with amateur radio software that can talk to a KISS TNC over a serial port.</div>
<div>• You must leave TNC mode disabled when using RNode with apps like MeshChat or Sideband.</div>
</div>
<div class="p-3">
<div class="flex mb-1 space-x-1">
<div class="min-w-[125px] my-auto text-right">Frequency (Hz)</div>
<input v-model="configFrequency" type="number" class="w-full sm:w-min sm:min-w-[250px] bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block px-2">
</div>
<div class="flex mb-1 space-x-1">
<div class="min-w-[125px] my-auto text-right">Bandwidth</div>
<select v-model="configBandwidth" class="w-full sm:w-min sm:min-w-[250px] bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block pl-2 pr-8">
<option v-for="bandwidth in RNodeInterfaceDefaults.bandwidths" :value="bandwidth">{{ bandwidth / 1000 }} KHz</option>
</select>
</div>
<div class="flex mb-1 space-x-1">
<div class="min-w-[125px] my-auto text-right">Tx Power (dBm)</div>
<input v-model="configTxPower" type="number" class="w-full sm:w-min sm:min-w-[250px] bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block px-2">
</div>
<div class="flex mb-1 space-x-1">
<div class="min-w-[125px] my-auto text-right">Spreading Factor</div>
<select v-model="configSpreadingFactor" class="w-full sm:w-min sm:min-w-[250px] bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block pl-2 pr-8">
<option v-for="spreadingfactor in RNodeInterfaceDefaults.spreadingfactors" :value="spreadingfactor">{{ spreadingfactor }}</option>
</select>
</div>
<div class="flex mb-1 space-x-1">
<div class="min-w-[125px] my-auto text-right">Coding Rate</div>
<select v-model="configCodingRate" class="w-full sm:w-min sm:min-w-[250px] bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block pl-2 pr-8">
<option v-for="codingrate in RNodeInterfaceDefaults.codingrates" :value="codingrate">{{ codingrate }}</option>
</select>
</div>
<div class="space-x-1">
<button @click="enableTncMode" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Enable
</button>
<button @click="disableTncMode" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Disable
</button>
</div>
</div>
</div>
</div>
<!-- setup web-serial-polyfill -->
<script type="module">
import { serial } from "./js/[email protected]/dist/serial.js";
if(!navigator.serial && navigator.usb){
navigator.serial = serial;
}
</script>
<!-- setup esptool-js -->
<script type="module">
import { ESPLoader, Transport } from "./js/[email protected]/bundle.js";
window.ESPLoader = ESPLoader;
window.Transport = Transport;
</script>
<script>
Vue.createApp({
data() {
return {
isFlashing: false,
flashingProgress: 0,
isProvisioning: false,
isSettingFirmwareHash: false,
rnodeDisplayImage: null,
selectedProduct: null,
selectedModel: null,
products: [
{
name: "Heltec LoRa32 v2",
id: ROM.PRODUCT_H32_V2,
platform: ROM.PLATFORM_ESP32,
models: [
{
id: ROM.MODEL_C4,
name: "433 MHz",
},
{
id: ROM.MODEL_C9,
name: "868 MHz / 915 MHz / 923 MHz",
},
],
firmware_filename: "rnode_firmware_heltec32v2.zip",
flash_config: {
flash_size: "8MB",
flash_files: {
"0xe000": "rnode_firmware_heltec32v2.boot_app0",
"0x1000": "rnode_firmware_heltec32v2.bootloader",
"0x10000": "rnode_firmware_heltec32v2.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_heltec32v2.partitions",
},
},
},
{
name: "Heltec LoRa32 v3",
id: ROM.PRODUCT_H32_V3,
platform: ROM.PLATFORM_ESP32,
models: [
{
id: ROM.MODEL_C5,
name: "433 MHz",
},
{
id: ROM.MODEL_CA,
name: "868 MHz / 915 MHz / 923 MHz",
},
],
firmware_filename: "rnode_firmware_heltec32v3.zip",
flash_config: {
flash_size: "8MB",
flash_files: {
"0xe000": "rnode_firmware_heltec32v3.boot_app0",
"0x0": "rnode_firmware_heltec32v3.bootloader",
"0x10000": "rnode_firmware_heltec32v3.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_heltec32v3.partitions",
},
},
},
{
name: "Heltec T114",
id: ROM.PRODUCT_HELTEC_T114,
platform: ROM.PLATFORM_NRF52,
models: [
{
id: ROM.MODEL_C6,
name: "470-510 MHz (HT-n5262-LF)",
},
{
id: ROM.MODEL_C7,
name: "863-928 MHz (HT-n5262-HF)",
},
],
firmware_filename: "rnode_firmware_heltec_t114.zip",
},
{
name: "LilyGO LoRa32 v1.0",
id: ROM.PRODUCT_T32_10,
platform: ROM.PLATFORM_ESP32,
models: [
{
id: ROM.MODEL_BA,
name: "433 MHz",
},
{
id: ROM.MODEL_BB,
name: "868 MHz / 915 MHz / 923 MHz",
},
],
firmware_filename: "rnode_firmware_lora32v10.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_lora32v10.boot_app0",
"0x1000": "rnode_firmware_lora32v10.bootloader",
"0x10000": "rnode_firmware_lora32v10.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_lora32v10.partitions",
},
},
},
{
name: "LilyGO LoRa32 v2.0",
id: ROM.PRODUCT_T32_20,
platform: ROM.PLATFORM_ESP32,
models: [
{
id: ROM.MODEL_B3,
name: "433 MHz",
},
{
id: ROM.MODEL_B8,
name: "868 MHz / 915 MHz / 923 MHz",
},
],
firmware_filename: "rnode_firmware_lora32v20.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_lora32v20.boot_app0",
"0x1000": "rnode_firmware_lora32v20.bootloader",
"0x10000": "rnode_firmware_lora32v20.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_lora32v20.partitions",
},
},
},
{
name: "LilyGO LoRa32 v2.1",
id: ROM.PRODUCT_T32_21,
platform: ROM.PLATFORM_ESP32,
models: [
{
id: ROM.MODEL_B4,
name: "433 MHz",
firmware_filename: "rnode_firmware_lora32v21.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_lora32v21.boot_app0",
"0x1000": "rnode_firmware_lora32v21.bootloader",
"0x10000": "rnode_firmware_lora32v21.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_lora32v21.partitions",
},
},
},
{
id: ROM.MODEL_B9,
name: "868/915/923 MHz",
firmware_filename: "rnode_firmware_lora32v21.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_lora32v21.boot_app0",
"0x1000": "rnode_firmware_lora32v21.bootloader",
"0x10000": "rnode_firmware_lora32v21.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_lora32v21.partitions",
},
},
},
// The TCXO model codes are only used here to select the correct firmware,
// actual model codes in firmware is still 0xB4 and 0xB9.
// https://github.com/markqvist/Reticulum/blob/master/RNS/Utilities/rnodeconf.py#L156
// https://github.com/markqvist/Reticulum/blob/master/RNS/Utilities/rnodeconf.py#L3283
{
id: ROM.MODEL_B4_TCXO,
mapped_id: ROM.MODEL_B4, // this device uses the same model code, but different firmware file
name: "433 MHz, with TCXO",
firmware_filename: "rnode_firmware_lora32v21_tcxo.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_lora32v21_tcxo.boot_app0",
"0x1000": "rnode_firmware_lora32v21_tcxo.bootloader",
"0x10000": "rnode_firmware_lora32v21_tcxo.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_lora32v21_tcxo.partitions",
},
},
},
{
id: ROM.MODEL_B9_TCXO,
mapped_id: ROM.MODEL_B9, // this device uses the same model code, but different firmware file
name: "868/915/923 MHz, with TCXO",
firmware_filename: "rnode_firmware_lora32v21_tcxo.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_lora32v21_tcxo.boot_app0",
"0x1000": "rnode_firmware_lora32v21_tcxo.bootloader",
"0x10000": "rnode_firmware_lora32v21_tcxo.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_lora32v21_tcxo.partitions",
},
},
},
],
},
{
name: "LilyGO LoRa T3S3",
id: ROM.PRODUCT_RNODE,
platform: ROM.PLATFORM_ESP32,
models: [
{
id: ROM.MODEL_A5,
name: "433 MHz (with SX1278 chip)",
firmware_filename: "rnode_firmware_t3s3_sx127x.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_t3s3_sx127x.boot_app0",
"0x0": "rnode_firmware_t3s3_sx127x.bootloader",
"0x10000": "rnode_firmware_t3s3_sx127x.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_t3s3_sx127x.partitions",
},
},
},
{
id: ROM.MODEL_AA,
name: "868/915/923 MHz (with SX1276 chip)",
firmware_filename: "rnode_firmware_t3s3_sx127x.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_t3s3_sx127x.boot_app0",
"0x0": "rnode_firmware_t3s3_sx127x.bootloader",
"0x10000": "rnode_firmware_t3s3_sx127x.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_t3s3_sx127x.partitions",
},
},
},
{
id: ROM.MODEL_A1,
name: "433 MHz (with SX1268 chip)",
firmware_filename: "rnode_firmware_t3s3.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_t3s3.boot_app0",
"0x0": "rnode_firmware_t3s3.bootloader",
"0x10000": "rnode_firmware_t3s3.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_t3s3.partitions",
},
},
},
{
id: ROM.MODEL_A6,
name: "868/915/923 MHz (with SX1262 chip)",
firmware_filename: "rnode_firmware_t3s3.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_t3s3.boot_app0",
"0x0": "rnode_firmware_t3s3.bootloader",
"0x10000": "rnode_firmware_t3s3.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_t3s3.partitions",
},
},
},
],
},
{
name: "LilyGO T-Beam",
id: ROM.PRODUCT_TBEAM,
platform: ROM.PLATFORM_ESP32,
models: [
{
id: ROM.MODEL_E4,
name: "433 MHz (with SX1278 chip)",
firmware_filename: "rnode_firmware_tbeam.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_tbeam.boot_app0",
"0x1000": "rnode_firmware_tbeam.bootloader",
"0x10000": "rnode_firmware_tbeam.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_tbeam.partitions",
},
},
},
{
id: ROM.MODEL_E9,
name: "868/915/923 MHz (with SX1276 chip)",
firmware_filename: "rnode_firmware_tbeam.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_tbeam.boot_app0",
"0x1000": "rnode_firmware_tbeam.bootloader",
"0x10000": "rnode_firmware_tbeam.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_tbeam.partitions",
},
},
},
{
id: ROM.MODEL_E3,
name: "433 MHz (with SX1268 chip)",
firmware_filename: "rnode_firmware_tbeam_sx1262.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_tbeam_sx1262.boot_app0",
"0x1000": "rnode_firmware_tbeam_sx1262.bootloader",
"0x10000": "rnode_firmware_tbeam_sx1262.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_tbeam_sx1262.partitions",
},
},
},
{
id: ROM.MODEL_E8,
name: "868/915/923 MHz (with SX1262 chip)",
firmware_filename: "rnode_firmware_tbeam_sx1262.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_tbeam_sx1262.boot_app0",
"0x1000": "rnode_firmware_tbeam_sx1262.bootloader",
"0x10000": "rnode_firmware_tbeam_sx1262.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_tbeam_sx1262.partitions",
},
},
},
],
},
{
name: "LilyGO T-Beam Supreme",
id: ROM.PRODUCT_TBEAM_S_V1,
platform: ROM.PLATFORM_ESP32,
models: [
{
id: ROM.MODEL_DB,
name: "433 MHz (with SX1268 chip)",
},
{
id: ROM.MODEL_DC,
name: "868/915/923 MHz (with SX1262 chip)",
},
],
firmware_filename: "rnode_firmware_tbeam_supreme.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_tbeam_supreme.boot_app0",
"0x0": "rnode_firmware_tbeam_supreme.bootloader",
"0x10000": "rnode_firmware_tbeam_supreme.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_tbeam_supreme.partitions",
},
},
},
{
name: "LilyGO T-Deck",
id: ROM.PRODUCT_TDECK,
platform: ROM.PLATFORM_ESP32,
models: [
{
id: ROM.MODEL_D4,
name: "433 MHz (with SX1268 chip)",
},
{
id: ROM.MODEL_D9,
name: "868/915/923 MHz (with SX1262 chip)",
},
],
firmware_filename: "rnode_firmware_tdeck.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_tdeck.boot_app0",
"0x0": "rnode_firmware_tdeck.bootloader",
"0x10000": "rnode_firmware_tdeck.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_tdeck.partitions",
},
},
},
{
name: "LilyGO T-Echo",
id: ROM.PRODUCT_TECHO,
platform: ROM.PLATFORM_NRF52,
models: [
{
id: ROM.MODEL_T4,
name: "433 MHz",
},
{
id: ROM.MODEL_T9,
name: "868 MHz / 915 MHz / 923 MHz",
},
],
firmware_filename: "rnode_firmware_techo.zip",
},
{
name: "RAK4631",
id: ROM.PRODUCT_RAK4631,
platform: ROM.PLATFORM_NRF52,
models: [
{
id: ROM.MODEL_11,
name: "433 MHz",
},
{
id: ROM.MODEL_12,
name: "868 MHz / 915 MHz / 923 MHz",
},
],
firmware_filename: "rnode_firmware_rak4631.zip",
},
{
name: "RNode",
id: ROM.PRODUCT_RNODE,
platform: ROM.PLATFORM_ESP32,
models: [
{
id: ROM.MODEL_A2,
name: "Handheld v2.1 RNode, 410 - 525 MHz",
firmware_filename: "rnode_firmware_ng21.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_ng21.boot_app0",
"0x1000": "rnode_firmware_ng21.bootloader",
"0x10000": "rnode_firmware_ng21.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_ng21.partitions",
},
},
},
{
id: ROM.MODEL_A7,
name: "Handheld v2.1 RNode, 820 - 1020 MHz",
firmware_filename: "rnode_firmware_ng21.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_ng21.boot_app0",
"0x1000": "rnode_firmware_ng21.bootloader",
"0x10000": "rnode_firmware_ng21.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_ng21.partitions",
},
},
},
{
id: ROM.MODEL_A1,
name: "Prototype v2.2 RNode, 410 - 525 MHz",
firmware_filename: "rnode_firmware_t3s3.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_t3s3.boot_app0",
"0x0": "rnode_firmware_t3s3.bootloader",
"0x10000": "rnode_firmware_t3s3.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_t3s3.partitions",
},
},
},
{
id: ROM.MODEL_A6,
name: "Prototype v2.2 RNode, 820 - 1020 MHz",
firmware_filename: "rnode_firmware_t3s3.zip",
flash_config: {
flash_size: "4MB",
flash_files: {
"0xe000": "rnode_firmware_t3s3.boot_app0",
"0x0": "rnode_firmware_t3s3.bootloader",
"0x10000": "rnode_firmware_t3s3.bin",
"0x210000": "console_image.bin",
"0x8000": "rnode_firmware_t3s3.partitions",
},
},
},
],
},
],
// Liam's default config for New Zealand / LongFast on Slot 10
configFrequency: 917375000,
configBandwidth: 250000,
configTxPower: 22,
configSpreadingFactor: 11,
configCodingRate: 5,
RNodeInterfaceDefaults: {
bandwidths: [ // bandwidth in hz
7800, // 7.8 kHz
10400, // 10.4 kHz
15600, // 15.6 kHz
20800, // 20.8 kHz
31250, // 31.25 kHz
41700, // 41.7 kHz
62500, // 62.5 kHz
125000, // 125 kHz
250000, // 250 kHz
500000, // 500 kHz
],
codingrates: [
5, // 4:5
6, // 4:6
7, // 4:7
8, // 4:8
],
spreadingfactors: [
7,
8,
9,
10,
11,
12,
],
},
};
},
mounted() {
},
methods: {
async askForSerialPort() {
if(!navigator.serial){
alert("Web Serial is not supported in this browser");
return null;
}
// ask user to select device
return await navigator.serial.requestPort({
filters: [],
});
},
async enterDfuMode() {
// ask for serial port
const serialPort = await this.askForSerialPort();
if(!serialPort){
return;
}
// enter dfu mode
console.log("entering dfu mode");
const flasher = new Nrf52DfuFlasher(serialPort);
await flasher.enterDfuMode();
console.log("entering dfu mode: done");
alert("Device should now be in DFU mode.");
},
async flash() {
switch(this.selectedProduct?.platform){
case ROM.PLATFORM_ESP32: {
await this.flashEsp32();
break;
}
case ROM.PLATFORM_NRF52: {
await this.flashNrf52();
break;
}
default: {
alert("Please select a device first");
break;
}
}
},
async flashNrf52() {
// ensure firmware file selected
const file = this.$refs["file"].files[0];
if(!file){
alert("Select a firmware file first");
return;
}
// ask for serial port
const serialPort = await this.askForSerialPort();
if(!serialPort){
return;
}
// update progress
this.isFlashing = true;
this.flashingProgress = 0;
try {
// flash file
const flasher = new Nrf52DfuFlasher(serialPort);
await flasher.flash(file, (percentage, message) => {
this.flashingProgress = percentage;
});
// flashing successful
alert("Firmware has been flashed!");
} catch(e) {
alert("Firmware flashing failed: " + e);
console.log(e);
} finally {
this.isFlashing = false;
}
// close port
console.log("Closing serial port");
try {
await this.serialPort.close();
} catch(e) {
console.log("failed to close serial port, ignoring...", e);
}
},
async flashEsp32() {
// ensure ESPLoader is available
if(!window.ESPLoader){
alert("esptool-js could not be loaded.");
return;
}
// ensure flash config is known, use from selected model, or fallback to selected product
const flashConfig = this.selectedModel?.flash_config ?? this.selectedProduct?.flash_config;
if(!flashConfig){
alert("Flash config is not available for the selected device.");
return;
}
// ensure firmware file selected
const file = this.$refs["file"].files[0];
if(!file){
alert("Select a firmware file first");
return;
}
// ask for serial port
const serialPort = await this.askForSerialPort();
if(!serialPort){
return;
}
// update progress
this.isFlashing = true;
this.flashingProgress = 0;
try {
// read zip file
const blobReader = new window.zip.BlobReader(file);
const zipReader = new window.zip.ZipReader(blobReader);
const zipEntries = await zipReader.getEntries();