Commit Graph

1859 Commits

Author SHA1 Message Date
Ben Meadors
777bcf691a
Initial PhoneAPI rate-limiting of messages on certain ports (#4756) 2024-09-18 10:13:07 -05:00
github-actions[bot]
923458bc18
[create-pull-request] automated change (#4754)
Co-authored-by: jp-bennett <5630967+jp-bennett@users.noreply.github.com>
2024-09-17 17:55:16 -05:00
Ben Meadors
50fb4ab22a
Implement optional hops_away on NodeInfo/Lite (#4747)
* Implement optional hops_away on NodeInfo/Lite

* Trunk
2024-09-17 12:08:04 -05:00
Thomas Göttgens
f5016763fd
change evaluation order to silence warning about "found" (#4749) 2024-09-17 10:33:21 -05:00
github-actions[bot]
a47570d65a
[create-pull-request] automated change (#4746)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-09-17 06:52:42 -05:00
Jonathan Bennett
a967dd52f3
More useful PKC logging (#4742) 2024-09-17 06:31:39 -05:00
Thomas Göttgens
4b5bcf52d2
Merge pull request #4691 from S5NC/rak11200-pin-name-correction
Rak11200 pin name correction
2024-09-17 11:42:40 +02:00
Thomas Göttgens
bc753e6903 trunk fmt 2024-09-17 15:24:11 +08:00
S5NC
06cd9abd81 Update SX126xInterface.cpp 2024-09-17 15:24:11 +08:00
jp-bennett
39c90dd581 [create-pull-request] automated change 2024-09-17 02:53:44 +00:00
github-actions[bot]
f37276d5fc
[create-pull-request] automated change (#4736)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-09-16 10:32:21 -05:00
Jonathan Bennett
ff8baa1c85
Don't use PKC on a non-primary channel unless specifically requested (#4715)
* Don't use PKC on a non-primary channel unless specifically requested

* Don't change from channel 0 if we can send a PKC packet.
2024-09-15 09:26:43 -05:00
Ben Meadors
9ac0e26d42
Add option to preserve private key for factory reset (config) (#4679)
* Add option to preserve private key for factory reset (config)

* Typo fix

* Copy the key in the right direction, and set the size.

* Don't set the key size back to 0 right after setting it to 32.

* Set the key size before using it to do a memcpy.

* Use the right key_size for backing up private_key

* Don't factoryReset() for a missing nodeDB

* Disable Bluetooth in AdminModule when resetting device settings or nodeDB to avoid race

* Add checks for valid objects before deinit bluetooth

* Add disableBluetooth to handleSetConfig, handleSetModuleConfig, and commit settings

---------

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
2024-09-11 08:42:26 -05:00
Jonathan Bennett
4e850296b6
Fix repeatedly getting new NodeNum and add more debug (#4674)
* All the debug

* Change `memccpy()` to `memcpy()`

* Brint all the bytes of the MAC Address from the NodeDB

* Check for blank MAC Address in ourown NodeDB entry

* One more `memccpy()`

* Clean-up debug log

---------

Co-authored-by: GUVWAF <thijs@havinga.eu>
2024-09-10 13:24:57 -05:00
GUVWAF
4ed12bf21d
Try fix repeatedly getting a new NodeNum (#4670) 2024-09-09 14:22:32 -05:00
Jonathan Bennett
bf34329033
Adds the data bitfield and ok_to_mqtt bit (#4643)
* Don't filter PKI packets just for being encrypted.

* Add ok_to_mqtt config and bit

* Bitfield

* Adjust dontmqttmebro logic.

* Manipulate bitfield only in router.cpp

* Want_ack is not want_response

* Bitfield macros

* Use new Bitfield macro in MQTT.cpp

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-09-07 18:21:59 -05:00
github-actions[bot]
c77b89d85c
[create-pull-request] automated change (#4645) 2024-09-06 18:51:22 -05:00
caveman99
b8cee51e84 [create-pull-request] automated change 2024-09-06 20:27:28 +00:00
Thomas Göttgens
35b47467c7
Merge pull request #4639 from zerolint/master
RAK13800 Ethernet improvements
2024-09-06 15:11:10 +02:00
Thomas Göttgens
8f35a42f4f
tryfix #4384 (#4642)
* tryfix #4384 - don't assume we want that functionality if the Accelerometer was found. This is only for T-Watch

* Add  config.display.wake_on_tap_or_motion default to RAK

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-09-06 06:55:56 -05:00
zerolint
d72a836e07 RAK13800 Ethernet improvements
Fixes (#3618) by allowing more time for slower requests.
Resolve Syslog not maintaining client causing issues on RAK13800.
Resolve Ethernet static IP setting subnet as gateway IP.
Reduce comment and log message ambiguity around API.
Remove duplicate #if !MESHTASTIC_EXCLUDE_WEBSERVER block.
2024-09-06 11:45:43 +02:00
Thomas Göttgens
011e640e95 Add LR11x0 firmware version to init. 2024-09-06 09:47:43 +02:00
Thomas Göttgens
7c6454f171
bring 2.4G back in line with preset bandwidth (#4634) 2024-09-05 15:49:08 -05:00
gitbisector
bb9ddcf2b5
Same priority packets processed in enqueue order (#4608)
* Same priority packets processed in enqueue order

* Prefer same prio pkts on mesh over new ones.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-09-04 08:31:30 -05:00
Thomas Göttgens
ff40a3f120
fix RF switch for Tracker E (#4621)
* fix RF switch for Tracker E

* fix all flags for Radiolib

* hopefully fix LR1110

* update to latest radiolib master - thanks @GUVWAF
2024-09-03 14:21:40 -05:00
Thomas Göttgens
6fc4a1754b Radiolib API Changes 2024-09-03 13:12:39 +02:00
Thomas Göttgens
f9e513f4fd Merge branch 'Tracker-1000E' of github.com:meshtastic/firmware into Tracker-1000E
# Conflicts:
#	src/mesh/LR11x0Interface.cpp
2024-09-03 09:59:44 +02:00
Thomas Göttgens
7dad2286e2 trunk fmt 2024-09-03 09:58:27 +02:00
Thomas Göttgens
8598645931 - use setRfSwitchTable
- ditch Godmode
- fixes Signedness Error in Loop.
- add V3 factory erase for 7.3.0 softdevice
2024-09-03 09:26:41 +02:00
Ben Meadors
b526a3ad53
Own node should be favorited and have zero hops away (#4618) 2024-09-02 17:51:02 -05:00
Thomas Göttgens
2f0c19ebea - use setRfSwitchTable
- ditch Godmode
- fixes Signedness Error in Loop.
- add V3 factory erase for 7.3.0 softdevice
2024-09-02 15:06:06 +02:00
GUVWAF
56223710b5
More priorities for different types of MeshPackets (#4606) 2024-09-01 10:29:53 -05:00
github-actions[bot]
e45a358de0
[create-pull-request] automated change (#4594)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-09-01 09:20:10 -05:00
Jonathan Bennett
b71e12c5e5
Phone admin work (#4599)
* Don't throw an error on the sessionkey admin tag

* Throw an error on packet sent to 0
2024-08-31 15:04:35 -05:00
GUVWAF
eb071ec80d
Set high priority for text messages (#4592) 2024-08-30 14:54:44 -05:00
github-actions[bot]
8144dcbc25
[create-pull-request] automated change (#4591)
Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com>
2024-08-30 13:46:51 -05:00
Manuel
6a24566efb
Lilygo T3S3 E-Paper support (#4569)
* t3s3 e-paper support

* remove GPS autodetect (which leads to crashes during startup when no GPS present)

* update EINK defines

* keep definitions for external GPS connector but disable GPS auto scan by default
2024-08-30 05:53:06 -05:00
Jonathan Bennett
5bc17a9911
Key regen and MQTT fix (#4585)
* Add public key regen

* Properly label and handle PKI MQTT packets

* Extra debug message to indicate PKI_UNKNOWN_PUBKEY

* Ternary!

* Don't call non-existant function on stm32

* Actually fix STM32 compilation
2024-08-29 16:28:03 -05:00
Ben Meadors
171512d2f6 Fixed buzzer 2024-08-29 11:42:27 -05:00
Ben Meadors
a34170654c
Fix T1000-E default to turn on buzzer for Ext. Notification (#4575) 2024-08-28 07:24:41 -05:00
Jonathan Bennett
ada61ae178
Don't compare nodeDB macaddr to owner.macaddr, because in rare cases that may be unset. (#4562)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-27 14:49:58 -05:00
Jonathan Bennett
b9a8683a4b
Mask out random bits when doing queue ordering (#4561)
* Mask out random bits when doing queue ordering

* Parenthesis
2024-08-26 15:48:47 -05:00
Jonathan Bennett
5824a8f4c1
Deal with admin_key being repeated (#4558) 2024-08-26 12:29:44 -05:00
Ben Meadors
d0fd17134e Protos 2024-08-26 07:48:07 -05:00
Ben Meadors
d6dac1737a
Userlite mem comparison (#4552) 2024-08-24 12:19:31 -05:00
github-actions[bot]
23844389ac
[create-pull-request] automated change (#4544)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-08-23 20:44:14 -05:00
geeksville
aa54335e21
remove deprecated serial/bt logging options and unify in the new (#4516)
security option.  Per discussion in https://github.com/meshtastic/firmware/issues/4375
no need to preserve the old options when changing to this new simpler
single boolean because they were newish, rarely used and only for 'advanced'
developers.
2024-08-23 20:18:36 -05:00
Ben Meadors
2a279c7f3d Dum dum zero comparision 2024-08-23 07:07:28 -05:00
Ben Meadors
7abc194ef5
Found more places to set explicit has_optional on position (#4542) 2024-08-23 07:04:34 -05:00
Michael Gjelsø
0850ad6c8d
Initial support for RadioMaster Bandit. (#4523)
* Initial support for RadioMaster Bandit.

* Different lighting can be made for Button 1 & 2 on the Bandit.
Changes to AmbientLighting will turn off af shutdown().

* Trunk

* Trunk again.
2024-08-23 06:28:23 -05:00
Jonathan Bennett
00ea9182a4
Fix copyPasta in NodeDB (#4538) 2024-08-23 06:26:19 -05:00
Jonathan Bennett
ab7de7f6a0
Add handling for sessionkey config (#4513)
* Add handling for sessionkey config

* Protos

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-20 13:36:24 -05:00
Nestpebble
ee9e46ec92
Make it possible to define TCXO and XTAL radio modules within one variant (#4492)
* Update main.cpp

Add in TCXO_OPTIONAL variable for tcxoVoltage and a double-check for working in both modes.

* Update SX126xInterface.cpp

Make a change to the tcxoVoltage setting so that TCXO_OPTIONAL works if defined.

* Update variant.h

Added define for TCXO_OPTIONAL and the tcxoVoltage variable.

Added detail on the compatible boards.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-20 06:54:18 -05:00
Tom Fifield
2472c7cdc7
JP frequency - 20mW limit, change freqs to avoid duty cycle (#4446)
Thanks to user Goyath on Discord, we discovered that in Japan the
250mW radio level requires licensing, and 20mW is the practical
limit. We also discovered that a duty cycle of 10% is needed on
most frequencies.

    CH 24-38 920.5-923.5 20mW no airtime restrictions
    CH 39-61 923.5-928.1 20mW 10% airtime
2024-08-20 06:20:01 -05:00
Jonathan Bennett
273beef148 Re-set the extra-nonce value 2024-08-18 22:25:08 -05:00
Jonathan Bennett
7b64c4a5bf
Merge branch 'master' into 2.5-changes 2024-08-18 19:14:21 -05:00
Jonathan Bennett
f439081674 Don't segfault on PKI from unknown nodes 2024-08-18 14:11:39 -05:00
GUVWAF
7a65c8838d
Fall back to default modem preset if requested bandwidth is too large (#4497) 2024-08-18 09:14:23 -05:00
Rafael Cortês
7129cee944
feature: default to fuzzy GPS location on the Default Channel (#4467)
* feature: default to fuzzy GPS location on the Default Channel

* Default to 13

* 13 default

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-18 07:38:54 -05:00
Jonathan Bennett
23e3e6db92
Add 4 bytes of random nonce to PKI (#4493) 2024-08-18 07:23:56 -05:00
GUVWAF
33ced7e87a
Add two-way traceroute result with SNR per hop (#4485)
* Add two-way traceroute result with SNR per hop

* Update protos
2024-08-17 17:34:32 -05:00
Jonathan Bennett
daddaf7146
Merge branch 'master' into 2.5-changes 2024-08-17 12:24:19 -05:00
Ben Meadors
5ff1078c8c
Move NeighborInfo interval default to 6 hours (double NodeInfo) (#4483)
* Move NeighborInfo in line with NodeInfo

* Set default to 6 hours and cap minimum at 2 hours
2024-08-17 11:51:53 -05:00
Ben Meadors
9dad62e3c4
Set time-only admin command (#4479) 2024-08-17 05:52:36 -05:00
Jonathan Bennett
cec8233cd1 Don't attempt PKI decryption on broadcast packets 2024-08-16 19:33:06 -05:00
Ben Meadors
e61bd84116
Send local stats telemetry to phone every 15 minutes (#4475)
* Send local stats telemetry to phone every 10 minutes

* Add debug log and bump to 15 minutes

* Tronk

* Explicit has_ optional
2024-08-16 17:15:51 -05:00
Ben Meadors
390de724ba Update 2.5 protos 2024-08-16 06:09:02 -05:00
Ben Meadors
6f1dae1b1b
Re-compute correct timeslot on applyModemConfig (#4469)
* Re-compute correct timeslot on applyModemConfig

* Cap contention window max at 7
2024-08-15 15:05:38 -05:00
Ben Meadors
96cf78aadd
Short turbo preset (#4465) 2024-08-14 21:16:21 -05:00
Jonathan Bennett
1be635a797 Merge remote-tracking branch 'origin/master' into 2.5-changes 2024-08-14 19:01:06 -05:00
Jonathan Bennett
8ef72a5c08
Shorter nodeinfo timeout redux (#4458)
* Add shorterTimeout bool to sendOurNodeInfo

* Respond to likely PKI decode errors with a quick nodeinfo

* Protbufs

* Move to PKI_UNKNOWN_PUBKEY for PKI decode error
2024-08-14 17:17:53 -05:00
Christopher Hoover
181325103a
Improves ignore messages in Router.cpp (#4442)
Signed-off-by: Christopher Hoover <ch@murgatroid.com>

.
2024-08-14 07:51:32 -05:00
Jonathan Bennett
8ce1c07c4e Check for blank key coming from client 2024-08-13 22:34:21 -05:00
Jonathan Bennett
b528290fde Failure returns PKI_FAILED message if client requested PKI 2024-08-13 18:45:40 -05:00
Jonathan Bennett
ff89dca5b3 Add PKI indicator to printPacket 2024-08-13 18:45:40 -05:00
Jonathan Bennett
80fd121d87 Add meshtastic_Routing_Error_NO_CHANNEL 2024-08-13 18:45:40 -05:00
Jonathan Bennett
f3fa8daedf Revert "Add Routing_Error_NONE"
This reverts commit e1985fa0f9.
2024-08-13 18:45:40 -05:00
Jonathan Bennett
bcd77c4523 Cleanup public_keys (#4450) 2024-08-13 18:45:40 -05:00
Jonathan Bennett
308c0a6bb8 Add Routing_Error_NONE 2024-08-13 18:45:40 -05:00
Jonathan Bennett
754db3f2bc Finish fixing config migrate 2024-08-13 18:45:40 -05:00
Jonathan Bennett
c16f20de21 Make "Alloc an error" a LOG_WARN 2024-08-13 18:45:40 -05:00
Jonathan Bennett
b4cbea1b3d Move security migrate to if has_security 2024-08-13 18:45:40 -05:00
Ben Meadors
0e7253d309 Protos 2024-08-13 18:45:38 -05:00
Jonathan Bennett
b91d66b436 Don't forget public_key.size in converting back 2024-08-13 18:44:27 -05:00
Jonathan Bennett
7537b55586 Ungoober oldestBoring 2024-08-13 18:44:27 -05:00
Jonathan Bennett
2d18130235 Don't goober public_key in Userlite conversion 2024-08-13 18:44:27 -05:00
Jonathan Bennett
67ddae2851 Add logic to nodeDB to prefer evicting boring nodes (#4441) 2024-08-13 18:44:27 -05:00
Ben Meadors
8f3614d66c User to UserLite in NodeDB (#4438)
* User to UserLite in the nodedb

* Tronkdor the burninator
2024-08-13 18:43:37 -05:00
Jonathan Bennett
e7dfabc20f Exclude position packets from PKI (at least for now) 2024-08-13 18:43:19 -05:00
Jonathan Bennett
185eb318ad Manual protobuf update 2024-08-13 18:43:19 -05:00
Jonathan Bennett
c86a3200f0 Add missed function rename. (Thanks VSCode) 2024-08-13 18:43:19 -05:00
Jonathan Bennett
c3aa56ef30 Refactor platform cryptography, add tests 2024-08-13 18:43:19 -05:00
Jonathan Bennett
192af05a25 Fix compile on STM32 2024-08-13 18:43:19 -05:00
Jonathan Bennett
26d0b2b477 Add DH25519 unit test 2024-08-13 18:43:19 -05:00
Jonathan Bennett
b726792efd Re-implement PKI from #1509 (#4379)
* Re-implement PKI from #1509
co-authored-by: edinnen <ethanjdinnen@protonmail.com>

* Set the key lengnth to actually make PKI work.

* Remove unused variable and initialize keys to null

* move printBytes() to meshUtils

* Don't reset PKI key son reboot unless needed.

* Remove double encryption for PKI messages

* Cleanup encrypt logic

* Add the MESHTASTIC_EXCLUDE_PKI option, and set it for minimal builds. Required for STM32 targets for now.

* Use SHA-256 for PKI key hashing, and add MESHTASTIC_EXCLUDE_PKI_KEYGEN for STM32

* Fix a crash when node is null

* Don't send PKI encrypted packets while licensed

* use chIndex 8 for PKI

* Don't be so clever, that you corrupt incoming packets

* Pass on channel 8 for now

* Typo

* Lock keys once non-zero

* We in fact need 2 scratch buffers, to store the encrypted bytes, unencrypted bytes, and decoded protobuf.

* Lighter approach to retaining known key

* Attach the public key to PKI decrypted packets in device memory

* Turn PKI back off for STM32 :(

* Don't just memcp over a protobuf

* Don't PKI encrypt nodeinfo packets

* Add a bit more memory logging around nodeDB

* Use the proper macro to refer to NODENUM_BROADCAST

* Typo fix

* Don't PKI encrypt ROUTING (naks and acks)

* Adds SecurityConfig protobuf

* Add admin messages over PKI

* Disable PKI for the WIO-e5

* Add MINIMUM_SAFE_FREE_HEAP macro and set to safe 1.5k

* Add missed "has_security"

* Add the admin_channel_enabled option

* STM32 again

* add missed configuration.h at the top of files

* Add EXCLUDE_TZ and RTC

* Enable PKI build on STM32 once again

* Attempt 1 at moving PKI to aes-ccm

* Fix buffers for encrypt/decrypt

* Eliminate unused aes variable

* Add debugging lines

* Set hash to 0 for PKI

* Fix debug lines so they don't print pointers.

* logic fix and more debug

* Rather important typo

* Check for short packets before attempting decrypt

* Don't forget to give cryptoEngine the keys!

* Use the right scratch buffer

* Cleanup

* moar cleanups

* Minor hardening

* Remove some in-progress stuff

* Turn PKI back off on STM32

* Return false

* 2.5 protos

* Sync up protos

* Add initial cryptography test vector tests

* re-add MINIMUM_SAFE_FREE_HEAP

* Housekeeping and comment fixes

* Add explanatory comment about weak dh25519 keys

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-13 18:43:19 -05:00
Ben Meadors
c451db3a3f Get in the trunk! 2024-08-13 18:43:19 -05:00
Ben Meadors
95682c9095 Add ClientNotification hello world 2024-08-13 18:43:19 -05:00
Ben Meadors
da53b8152d Protos 2024-08-13 18:43:17 -05:00
Ben Meadors
8d1a34a4bf Protobufs 2024-08-13 18:42:40 -05:00
Ben Meadors
e85a2e827b Update protos 2024-08-13 06:49:32 -05:00