forked from meshtastic/protobufs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
radioconfig.proto
861 lines (713 loc) · 19.7 KB
/
radioconfig.proto
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
syntax = "proto3";
option java_package = "com.geeksville.mesh";
option java_outer_classname = "RadioConfigProtos";
option optimize_for = LITE_RUNTIME;
option go_package = "github.com/meshtastic/gomeshproto";
/*
* The frequency/regulatory region the user has selected.
* Note: In 1.0 builds (which must still be supported by the android app for a
* long time) this field will be unpopulated.
* If firmware is ever upgraded from an old 1.0ish build, the old
* MyNodeInfo.region string will be used to set UserPreferences.region and the
* old value will be no longer set.
*/
enum RegionCode {
/*
* TODO: REPLACE
*/
Unset = 0;
/*
* TODO: REPLACE
*/
US = 1;
/*
* TODO: REPLACE
*/
EU433 = 2;
/*
* TODO: REPLACE
*/
EU868 = 3;
/*
* TODO: REPLACE
*/
CN = 4;
/*
* TODO: REPLACE
*/
JP = 5;
/*
* TODO: REPLACE
*/
ANZ = 6;
/*
* TODO: REPLACE
*/
KR = 7;
/*
* TODO: REPLACE
*/
TW = 8;
/*
* TODO: REPLACE
*/
RU = 9;
/*
* TODO: REPLACE
*/
IN = 10;
/*
* TODO: REPLACE
*/
NZ865 = 11;
/*
* TODO: REPLACE
*/
TH = 12;
}
/*
* Defines the device's role on the Mesh network
* unset
* Behave normally.
* Router
* Functions as a router
*/
enum Role {
/*
* Client device role
*/
Client = 0;
/*
* ClientMute device role
* This is like the client but packets will not hop over this node. Would be
* useful if you want to save power by not contributing to the mesh.
*/
ClientMute = 1;
/*
* Router device role.
* Uses an agressive algirithem for the flood networking so packets will
* prefer to be routed over this node. Also assume that this will be generally
* unattended and so will turn off the wifi/ble radio as well as the oled screen.
*/
Router = 2;
/*
* RouterClient device role
* Uses an agressive algirithem for the flood networking so packets will
* prefer to be routed over this node. Similiar power management as a regular
* client, so the RouterClient can be used as both a Router and a Client. Useful
* as a well placed base station that you could also use to send messages.
*/
RouterClient = 3;
}
/*
* Sets the charge control current of devices with a battery charger that can be
* configured. This is passed into the axp power management chip like on the tbeam.
*/
enum ChargeCurrent {
/*
* TODO: REPLACE
*/
MAUnset = 0;
/*
* TODO: REPLACE
*/
MA100 = 1;
/*
* TODO: REPLACE
*/
MA190 = 2;
/*
* TODO: REPLACE
*/
MA280 = 3;
/*
* TODO: REPLACE
*/
MA360 = 4;
/*
* TODO: REPLACE
*/
MA450 = 5;
/*
* TODO: REPLACE
*/
MA550 = 6;
/*
* TODO: REPLACE
*/
MA630 = 7;
/*
* TODO: REPLACE
*/
MA700 = 8;
/*
* TODO: REPLACE
*/
MA780 = 9;
/*
* TODO: REPLACE
*/
MA880 = 10;
/*
* TODO: REPLACE
*/
MA960 = 11;
/*
* TODO: REPLACE
*/
MA1000 = 12;
/*
* TODO: REPLACE
*/
MA1080 = 13;
/*
* TODO: REPLACE
*/
MA1160 = 14;
/*
* TODO: REPLACE
*/
MA1240 = 15;
/*
* TODO: REPLACE
*/
MA1320 = 16;
}
/*
* How the GPS coordinates are displayed on the OLED screen.
*/
enum GpsCoordinateFormat {
/*
* GPS coordinates are displayed in the normal decimal degrees format:
* DD.DDDDDD DDD.DDDDDD
*/
GpsFormatDec = 0;
/*
* GPS coordinates are displayed in the degrees minutes seconds format:
* DD°MM'SS"C DDD°MM'SS"C, where C is the compass point representing the locations quadrant
*/
GpsFormatDMS = 1;
/*
* GPS coordinates are displayed in Universal Transverse Mercator format:
* ZZB EEEEEE NNNNNNN, where Z is zone, B is band, E is easting, N is northing
*/
GpsFormatUTM = 2;
/*
* GPS coordinates are displayed in Military Grid Reference System format:
* ZZB CD EEEEE NNNNN, where Z is zone, B is band, C is the east 100k square, D is the north 100k square,
* E is easting, N is northing
*/
GpsFormatMGRS = 3;
/*
* GPS coordinates are displayed in Open Location Code (aka Plus Codes).
*/
GpsFormatOLC = 4;
/*
* GPS coordinates are displayed in Ordnance Survey Grid Reference (the National Grid System of the UK).
* Format: AB EEEEE NNNNN, where A is the east 100k square, B is the north 100k square, E is the easting,
* N is the northing
*/
GpsFormatOSGR = 5;
}
/*
* Bit field of boolean configuration options, indicating which optional
* fields to include when assembling POSITION messages
* Longitude and latitude are always included (also time if GPS-synced)
* NOTE: the more fields are included, the larger the message will be -
* leading to longer airtime and a higher risk of packet loss
*/
enum PositionFlags {
/*
* Required for compilation
*/
POS_UNDEFINED = 0x0000;
/*
* Include an altitude value (if available)
*/
POS_ALTITUDE = 0x0001;
/*
* Altitude value is MSL
*/
POS_ALT_MSL = 0x0002;
/*
* Include geoidal separation
*/
POS_GEO_SEP = 0x0004;
/*
* Include the DOP value ; PDOP used by default, see below
*/
POS_DOP = 0x0008;
/*
* If POS_DOP set, send separate HDOP / VDOP values instead of PDOP
*/
POS_HVDOP = 0x0010;
/*
* Include battery level
*/
POS_BATTERY = 0x0020;
/*
* Include number of "satellites in view"
*/
POS_SATINVIEW = 0x0040;
/*
* Include a sequence number incremented per packet
*/
POS_SEQ_NOS = 0x0080;
/*
* Include positional timestamp (from GPS solution)
*/
POS_TIMESTAMP = 0x0100;
}
/*
* TODO: REPLACE
*/
enum InputEventChar {
/*
* TODO: REPLACE
*/
KEY_NONE = 0;
/*
* TODO: REPLACE
*/
KEY_UP = 17;
/*
* TODO: REPLACE
*/
KEY_DOWN = 18;
/*
* TODO: REPLACE
*/
KEY_LEFT = 19;
/*
* TODO: REPLACE
*/
KEY_RIGHT = 20;
/*
* '\n'
*/
KEY_SELECT = 10;
/*
* TODO: REPLACE
*/
KEY_BACK = 27;
/*
* TODO: REPLACE
*/
KEY_CANCEL = 24;
}
/*
* The entire set of user settable/readable settings for our radio device.
* Includes both the current channel settings and any preferences the user has
* set for behavior of their node
*/
message RadioConfig {
/*
* See [software design](/docs/software/other/sw-design) for more information on these preferences
*/
message UserPreferences {
/*
* We should send our position this often (but only if it has changed significantly)
* Defaults to 15 minutes
*/
uint32 position_broadcast_secs = 1;
/*
* We should send our position this often (but only if it has changed significantly)
*/
bool position_broadcast_smart_disabled = 17;
/*
* If we miss this many owner messages from a node, we declare the node
* offline (defaults to 3 - to allow for some lost packets) (FIXME not yet used)
* uint32 num_missed_to_fail = 3;
TODO: REMOVE/INTEGRATE
*/
/*
* Power management state machine option.
* See [power management](/docs/software/other/power) for details.
* 0 for default of 1 minute
*/
uint32 wait_bluetooth_secs = 4;
/*
* Power management state machine option.
* See [power management](/docs/software/other/power) for details.
* 0 for default of one minute
*/
uint32 screen_on_secs = 5;
/*
* Power management state machine option.
* See [power management](/docs/software/other/power) for details.
* 0 for default of 15 minutes
* IMPORTANT NOTE FOR DEVICE CLIENTS: YOU MUST SEND SOME SORT OF PACKET TO THE PHONE AT LEAST THIS OFTEN OR THE DEVICE WILL DECIDE YOU ARE GONE!
*/
uint32 phone_timeout_secs = 6;
/*
* Power management state machine option.
* See [power management](/docs/software/other/power) for details.
* 0 for default of two hours, MAXUINT for disabled
*/
uint32 mesh_sds_timeout_secs = 8;
/*
* Power management state machine option.
* See [power management](/docs/software/other/power) for details.
* 0 for default of one year
*/
uint32 sds_secs = 9;
/*
* Power management state machine option.
* See [power management](/docs/software/other/power) for details.
* 0 for default of 3600
*/
uint32 ls_secs = 10;
/*
* Power management state machine option.
* See [power management](/docs/software/other/power) for details.
* 0 for default of 10 seconds
*/
uint32 min_wake_secs = 11;
/*
* If set, this node will try to join the specified wifi network and
* acquire an address via DHCP
*/
string wifi_ssid = 12;
/*
* If set, will be use to authenticate to the named wifi
*/
string wifi_password = 13;
/*
* If set, the node will operate as an AP (and DHCP server), otherwise it
* will be a station
*/
bool wifi_ap_mode = 14;
/*
* The region code for my radio (US, CN, EU433, etc...)
*/
RegionCode region = 15;
/*
* Sets the current of the battery charger
*/
ChargeCurrent charge_current = 16;
/*
* Sets the role of node
*/
Role role = 18;
/*
* If set, we are powered from a low-current source (i.e. solar), so even if it looks like we have power flowing in
* we should try to minimize power consumption as much as possible.
* YOU DO NOT NEED TO SET THIS IF YOU'VE set is_router (it is implied in that case).
*/
bool is_low_power = 38;
/*
* If set, this node is at a fixed position.
* We will generate GPS position updates at the regular interval, but use whatever the last lat/lon/alt we have for the node.
* The lat/lon/alt can be set by an internal GPS or with the help of the app.
*/
bool fixed_position = 39;
/*
* If set, this will disable the SerialConsole by not initilizing the StreamAPI
*/
bool serial_disabled = 40;
/*
* Should we disbale location sharing with other nodes (or the local phone)
*/
bool location_share_disabled = 32;
/*
* Should the GPS be disabled for this node?
*/
bool gps_disabled = 33;
/*
* How often should we try to get GPS position (in seconds)
* or zero for the default of once every 30 seconds
* or a very large value (maxint) to update only once at boot.
*/
uint32 gps_update_interval = 34;
/*
* How long should we try to get our position during each gps_update_interval attempt? (in seconds)
* Or if zero, use the default of 30 seconds.
* If we don't get a new gps fix in that time, the gps will be put into sleep until the next gps_update_rate
* window.
*/
uint32 gps_attempt_time = 36;
/*
* Shall we accept 2D GPS fixes? By default, only 3D fixes are accepted
* (during a 2D fix, altitude values are unreliable and will be excluded)
*/
bool gps_accept_2d = 45;
/*
* GPS maximum DOP accepted (dilution of precision)
* Set a rejection threshold for GPS readings based on their precision,
* relative to the GPS rated accuracy (which is typically ~3m)
* Solutions above this value will be treated as retryable errors!
* Useful range is between 1 - 64 (3m - <~200m)
* By default (if zero), accept all GPS readings
*/
uint32 gps_max_dop = 46;
/*
* This parameter is for advanced users with advanced test equipment, we do not recommend most users use it.
* A frequency offset that is added to to the calculated band center frequency.
* Used to correct for crystal calibration errors.
*/
float frequency_offset = 41;
/*
* The server to use for our MQTT global message gateway feature.
* If not set, the default server will be used
*/
string mqtt_server = 42;
/*
* If a meshtastic node is able to reach the internet it will normally attempt to gateway any channels that are marked as
* is_uplink_enabled or is_downlink_enabled.
* But if this flag is set, all MQTT features will be disabled and no servers will be contacted.
*/
bool mqtt_disabled = 43;
/*
* How the GPS coordinates are displayed on the OLED screen.
*/
GpsCoordinateFormat gps_format = 44;
/*
* This setting is never saved to disk, but if set, all device settings will be returned to factory defaults.
* (Region, serial number etc... will be preserved)
*/
bool factory_reset = 100;
/*
* By default we turn off logging as soon as an API client connects (to keep shared serial link quiet).
* Set this to true to leave the debug log outputting even when API is active.
*/
bool debug_log_enabled = 101;
/*
* If true, radio should not try to be smart about what packets to queue to
* the phone
* bool keep_all_packets = 101;
* If true, we will try to capture all the packets sent on the mesh, not just the ones destined to our node.
* bool promiscuous_mode = 102;
* For testing it is useful sometimes to force a node to never listen to
* particular other nodes (simulating radio out of range). All nodenums listed
* in ignore_incoming will have packets they send droped on receive (by router.cpp)
*/
repeated uint32 ignore_incoming = 103;
/*
* Preferences for the SerialModule
* FIXME - Move this out of UserPreferences and into a section for module configuration.
*/
bool serial_module_enabled = 120;
/*
* TODO: REPLACE
*/
bool serial_module_echo = 121;
/*
* TODO: REPLACE
*/
uint32 serial_module_rxd = 122;
/*
* TODO: REPLACE
*/
uint32 serial_module_txd = 123;
/*
* TODO: REPLACE
*/
enum Serial_Baud {
BAUD_Default = 0;
BAUD_2400 = 1;
BAUD_4800 = 2;
BAUD_9600 = 3;
BAUD_19200 = 4;
BAUD_38400 = 5;
BAUD_57600 = 6;
BAUD_115200 = 7;
BAUD_230400 = 8;
BAUD_460800 = 9;
BAUD_576000 = 10;
BAUD_921600 = 11;
BAUD_110 = 12;
BAUD_300 = 13;
BAUD_600 = 14;
BAUD_1200 = 15;
};
/*
* TODO: REPLACE
*/
Serial_Baud serial_module_baud = 176;
/*
* TODO: REPLACE
*/
uint32 serial_module_timeout = 124;
/*
* TODO: REPLACE
*/
enum Serial_Mode {
MODE_Default = 0;
MODE_SIMPLE = 1;
MODE_PROTO = 2;
};
/*
* TODO: REPLACE
*/
Serial_Mode serial_module_mode = 125;
/*
* Preferences for the ExternalNotificationModule
* FIXME - Move this out of UserPreferences and into a section for module configuration.
*/
bool ext_notification_module_enabled = 126;
/*
* TODO: REPLACE
*/
uint32 ext_notification_module_output_ms = 127;
/*
* TODO: REPLACE
*/
uint32 ext_notification_module_output = 128;
/*
* TODO: REPLACE
*/
bool ext_notification_module_active = 129;
/*
* TODO: REPLACE
*/
bool ext_notification_module_alert_message = 130;
/*
* TODO: REPLACE
*/
bool ext_notification_module_alert_bell = 131;
/*
* Preferences for the RangeTestModule
* FIXME - Move this out of UserPreferences and into a section for module configuration.
*/
bool range_test_module_enabled = 132;
/*
* TODO: REPLACE
*/
uint32 range_test_module_sender = 133;
/*
* TODO: REPLACE
*/
bool range_test_module_save = 134;
/*
* Preferences for the StoreForwardModule
*FIXME - Move this out of UserPreferences and into a section for module configuration. (was 136)
*/
bool store_forward_module_enabled = 148;
/*
* TODO: REPLACE
*/
bool store_forward_module_heartbeat = 149;
/*
* TODO: REPLACE
*/
uint32 store_forward_module_records = 137;
/*
* TODO: REPLACE
*/
uint32 store_forward_module_history_return_max = 138;
/*
* TODO: REPLACE
*/
uint32 store_forward_module_history_return_window = 139;
/*
* TODO: REPLACE
*/
reserved 136;
/*
* Bit field of boolean configuration options for POSITION messages
* (bitwise OR of PositionFlags)
*/
uint32 position_flags = 150;
/*
* Circumvents the logic block for determining whether the device is powered or not.
* Useful for devices with finicky ADC issues on the battery sense pins.
*/
bool is_always_powered = 151;
/*
* Automatically toggles to the next page on the screen like a carousel, based the specified interval in seconds.
* Potentially useful for devices without user buttons.
*/
uint32 auto_screen_carousel_secs = 152;
/*
* If non-zero, the device will fully power off this many seconds after external power is removed.
*/
uint32 on_battery_shutdown_after_secs = 153;
/*
* Overrides HOPS_RELIABLE and sets the maximum number of hops. This can't be greater than 7.
*/
uint32 hop_limit = 154;
/*
* MQTT username to use (most useful for a custom MQTT server).
* If using a custom server, this will be honoured even if empty.
* If using the default server, this will only be honoured if set, otherwise the device will use the default username
*/
string mqtt_username = 155;
/*
* MQTT password to use (most useful for a custom MQTT server).
* If using a custom server, this will be honoured even if empty.
* If using the default server, this will only be honoured if set, otherwise the device will use the default password
*/
string mqtt_password = 156;
/*
* Disable TX from the LoRa radio. Useful for hot-swapping antennas and other tests.
* Defaults to false
*/
bool is_lora_tx_disabled = 157;
/*
* If set to true, enable power saving features of the esp32
*/
bool is_power_saving = 158;
/*
* Enable the rotary encoder #1. This is a 'dumb' encoder sending pulses on both A and B pins while rotating.
*/
bool rotary1_enabled = 160;
/*
* GPIO pin for rotary encoder A port.
*/
uint32 inputbroker_pin_a = 161;
/*
* GPIO pin for rotary encoder B port.
*/
uint32 inputbroker_pin_b = 162;
/*
* GPIO pin for rotary encoder Press port.
*/
uint32 inputbroker_pin_press = 163;
/*
* Generate input event on CW of this kind.
*/
InputEventChar inputbroker_event_cw = 164;
/*
* Generate input event on CCW of this kind.
*/
InputEventChar inputbroker_event_ccw = 165;
/*
* Generate input event on Press of this kind.
*/
InputEventChar inputbroker_event_press = 166;
/*
* Enable the Up/Down/Select input device. Can be RAK rotary encoder or 3 buttons. Uses the a/b/press definitions from inputbroker.
*/
bool updown1_enabled = 167;
/*
* Enable/disable CannedMessageModule.
*/
bool canned_message_module_enabled = 170;
/*
* Input event origin accepted by the canned message module.
* Can be e.g. "rotEnc1", "upDownEnc1" or keyword "_any"
*/
string canned_message_module_allow_input_source = 171;
/*
* CannedMessageModule also sends a bell character with the messages.
* ExternalNotificationModule can benefit from this feature.
*/
bool canned_message_module_send_bell = 173;
/*
* Whether to send encrypted or decrypted packets to MQTT.
* This parameter is only honoured if you also set mqtt_server
* (the default official mqtt.meshtastic.org server can handle encrypted packets)
* Decrypted packets may be useful for external systems that want to consume meshtastic packets
*/
bool mqtt_encryption_enabled = 174;
/*
* Ratio of voltage divider for battery pin eg. 3.20 (R1=100k, R2=220k)
* Overrides the ADC_MULTIPLIER defined in variant for battery voltage calculation.
*/
float adc_multiplier_override = 175;
}
/*
* TODO: REPLACE
*/
UserPreferences preferences = 1;
}