Commit Graph

4784 Commits

Author SHA1 Message Date
Thomas Göttgens
50631f96fc trunk fmt 2024-08-29 21:51:06 +02:00
And137
a6cc7041d3
Merge branch 'master' into polish-oled 2024-08-29 20:04:03 +02:00
Ben Meadors
171512d2f6 Fixed buzzer 2024-08-29 11:42:27 -05:00
David
47e1580a62 Integration test 2024-08-29 16:40:17 +02:00
David
fc1e60ac58 Initial upload 2024-08-29 16:40:17 +02:00
And137
f1f66cf54a
Merge branch 'master' into polish-oled 2024-08-29 12:54:06 +02:00
Jonathan Bennett
92eae39a1b
Move Time set from system to main (#4583) 2024-08-29 05:39:30 -05:00
Kevin Hester
dc9f6e1360 fix CI warnings (and change CI comment to be correct) 2024-08-28 11:25:54 -07:00
Ben Meadors
f5633bf0c5 Fix T1000-E default to turn on buzzer for Ext. Notification (#4575) 2024-08-28 11:25:54 -07:00
Ben Meadors
3ad0af5ce8 Fix super tiny T1114 tft font size and fork repo to fix compiler warnings (#4573) 2024-08-28 11:25:54 -07:00
Thomas Göttgens
94c3bb4a56 fix #4390 (#4571) 2024-08-28 11:25:54 -07:00
Power Li
cc93df27a5 set current time to system time in portduino build (#4556)
* set current time to system time in portduino build

* fix includes order

---------

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
2024-08-28 11:25:54 -07:00
Jonathan Bennett
e3ce3a3a4f 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-28 11:25:54 -07:00
Jonathan Bennett
3c4d964334 Mask out random bits when doing queue ordering (#4561)
* Mask out random bits when doing queue ordering

* Parenthesis
2024-08-28 11:25:54 -07:00
Jonathan Bennett
574124aee5 Deal with admin_key being repeated (#4558) 2024-08-28 11:25:54 -07:00
John Milton
1fe80e0f30 Add support for Adafruit Feather RP2040 with RFM95. (#4451)
* Add support for Adafruit Feather RP2040 with RFM95.

* Update mesh.pb.h

dropping this change from the file generated by the protobuf

* Update mesh.pb.h

remove these reverting changes

* Update mesh.pb.h

oops, missed a comma
2024-08-28 11:25:54 -07:00
Ben Meadors
927a35ef51 Protos 2024-08-28 11:25:54 -07:00
Ben Meadors
c11a66030f Userlite mem comparison (#4552) 2024-08-28 11:25:54 -07:00
github-actions[bot]
059d5582d1 [create-pull-request] automated change (#4544)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-08-28 11:25:54 -07:00
geeksville
9631a1be38 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-28 11:25:54 -07:00
Kevin Hester
8a9cc727a8 for #4154 use a binary gpio transformer to manage vext on heltec-tracker (saves power) 2024-08-28 11:25:54 -07:00
Kevin Hester
cdafa87cef add lateInitVariant() as a concept. see below for docs
(from src/extra_variants/README.md)

This directory tree is designed to solve two problems.

- The ESP32 arduino/platformio project doesn't support the nice "if initVariant() is found, call that after init" behavior of the nrf52 builds (they use initVariant() internally).
- Over the years a lot of 'board specific' init code has been added to init() in main.cpp. It would be great to have a general/clean mechanism to allow developers to specify board specific/unique code in a clean fashion without mucking in main.

So we are borrowing the initVariant() ideas here (by using weak gcc references). You can now define lateInitVariant() if your board needs it.

If you'd like a board specific variant to be run, add the variant.cpp file to an appropriately named
subdirectory and check for \_VARIANT_boardname in the cpp file (so that your code is only built for your board).
You'll need to define \_VARIANT_boardname in your corresponding variant.h file.
See existing boards for examples.

This approach has no added runtime cost.
2024-08-28 11:25:54 -07:00
Kevin Hester
5ce5b7b08b Older variant.h files (IMO sloppily) don't define VEXT_ON_VALUE
But in an attempt to avoid updating lots of files, make it default to LOW
2024-08-28 11:25:54 -07:00
Ben Meadors
b285aa5bd6 Dum dum zero comparision 2024-08-28 11:25:54 -07:00
Ben Meadors
9de0b7cfac Found more places to set explicit has_optional on position (#4542) 2024-08-28 11:25:54 -07:00
Ian McEwen
fe9a80a4e0 Use the '+' wildcard for MQTT rather than '#', to subscribe only to topics one nesting level deep (#4528) 2024-08-28 11:25:54 -07:00
Michael Gjelsø
de41a054b0 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-28 11:25:54 -07:00
Jonathan Bennett
9b2ef971c2 Fix copyPasta in NodeDB (#4538) 2024-08-28 11:25:54 -07:00
Jonathan Bennett
710fdbd4e5 Adds has_x bools to position packet. (#4540) 2024-08-28 11:25:54 -07:00
Ben Meadors
06175737cc Save nodedb after favoriting (or removing) (#4537) 2024-08-28 11:25:54 -07:00
And137
6660aec79a
Merge branch 'meshtastic:master' into polish-oled 2024-08-28 14:29:26 +02:00
Ben Meadors
a34170654c
Fix T1000-E default to turn on buzzer for Ext. Notification (#4575) 2024-08-28 07:24:41 -05:00
And137
d611a38ce2
Merge branch 'meshtastic:master' into polish-oled 2024-08-28 13:59:30 +02:00
Ben Meadors
f27281d3fa
Fix super tiny T1114 tft font size and fork repo to fix compiler warnings (#4573) 2024-08-28 06:43:30 -05:00
FW\AM5
b8609ff130 Support for Polish OLED characters
Added support for Polish OLED characters.

- Custom FONT_SMALL ArialMT_Plain_10_PL

- Automatic selection between Polish and Ukrainian/Russian characters mapping depending on the -D OLED_{LANG_NAME} flage
2024-08-28 13:11:22 +02:00
Thomas Göttgens
0ee9d375b3
fix #4390 (#4571) 2024-08-28 05:43:19 -05:00
Power Li
ab62590aa9
set current time to system time in portduino build (#4556)
* set current time to system time in portduino build

* fix includes order

---------

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
2024-08-27 16:26:02 -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
John Milton
777ae2b99c
Add support for Adafruit Feather RP2040 with RFM95. (#4451)
* Add support for Adafruit Feather RP2040 with RFM95.

* Update mesh.pb.h

dropping this change from the file generated by the protobuf

* Update mesh.pb.h

remove these reverting changes

* Update mesh.pb.h

oops, missed a comma
2024-08-26 10:28:08 -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
Ian McEwen
f99b81acf7
Use the '+' wildcard for MQTT rather than '#', to subscribe only to topics one nesting level deep (#4528) 2024-08-23 07:03:29 -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
601ae29fe9
Adds has_x bools to position packet. (#4540) 2024-08-23 06:25:40 -05:00
Ben Meadors
ff500bc5a9
Save nodedb after favoriting (or removing) (#4537) 2024-08-22 20:57:03 -05:00
Kevin Hester
f77c5f6a5b Don't create backlight instances when the variant hasn't specified a pin 2024-08-22 10:50:44 -07:00
Kevin Hester
2a7cf9d387 Remove redundant defintions of ST7789_BACKLIGHT_EN 2024-08-22 10:40:12 -07:00
Kevin Hester
db6e591c07 For #4154 - change TFT driver to use virtual GPIO for backlight enable 2024-08-22 10:38:19 -07:00
Kevin Hester
02c34e6214 Merge remote-tracking branch 'root/master' into pr-fix4154 2024-08-22 10:19:18 -07:00
Kevin Hester
5570b6bbc6 change GPS to use virtual GPIOs (for #4154) 2024-08-22 10:15:23 -07:00
Kevin Hester
5ccb6df142 Remove all sorts of redundant VEXT_ENABLE ifdefs 2024-08-22 09:28:41 -07:00
Kevin Hester
3ae8aadaf0 Merge the three redundant backlight enables into the single TFT_BL flag 2024-08-22 09:15:59 -07:00
Kevin Hester
7fb9b094d5 Remove redundant ST7735_BL variant defs.
No need for _V05 and _V03 definitions - I think there was a slight misunderstanding
on how variant files are supposed to _decrease_ #ifdef code in the cpp files.
2024-08-22 08:59:46 -07:00
Mark Trevor Birss
1e655052fc
Fixes for ME25LS01_4Y10TD and ESP32-PICO (#4522)
* Update platformio.ini

* Update variant.h

* Update architecture.h

* Update variant.h
2024-08-22 07:00:19 -05:00
Kevin Hester
d017fc7a5d for #4154 use internal pull-ups to power ADC_Ctrl
* Currently only on heltec tracker, but could use ADC_USE_PULLUP on other boards that could benefit
* Thanks @todd-herbert and @StevenCellist for the instructions ;-)
* Remove nasty Heltec_wireless #ifdefs that got somehow added to Power.cpp, instead use proper variant defs
* Cleanup adc enable/disable code a bit for less copy-paste cruft
2024-08-21 16:53:12 -07:00
Mark Trevor Birss
d556ae762c
Update ScanI2CTwoWire.cpp (#4520) 2024-08-21 06:04:03 -05:00
geeksville
48e0fd7ed0
fix #4448 (by seeing there is actually no problem) (#4517)
Print directory names when listing directories
2024-08-20 17:38:39 -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
Mictronics
6ee30043c3
Fix array out of bounds read. (#4514)
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28

* Merge PR #420

* Fixed double and missing Default class.

* Use correct format specifier and fixed typo.

* Removed duplicate code.

* Fix error: #if with no expression

* Fix warning: extra tokens at end of #endif directive.

* Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board.

* Fix deprecated macros.

* Set RP2040 in dormant mode when deep sleep is triggered.

* Fix array out of bounds read.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-20 13:36:10 -05:00
Ben Meadors
d404a49336 Trunk 2024-08-20 07:08:42 -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
Tom Fifield
3b2c37c47f
Remove heltec-specific gps code from main.cpp (#4508)
After the recent GPS power work we have an clear set of
definitions for turning GPS on and off. Rather than manipulating
specific heltec tracker-related pins in main setu, the relevant
power management code in the GPS module will turn things
on/off later as needed.
2024-08-20 06:19:02 -05:00
Mictronics
ef5279e85e
Set RP2040 in dormant mode when deep sleep is triggered. (#4510)
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28

* Merge PR #420

* Fixed double and missing Default class.

* Use correct format specifier and fixed typo.

* Removed duplicate code.

* Fix error: #if with no expression

* Fix warning: extra tokens at end of #endif directive.

* Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board.

* Fix deprecated macros.

* Set RP2040 in dormant mode when deep sleep is triggered.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-20 06:04:39 -05:00
Jonathan Bennett
48dc222b75
Merge branch 'master' into 2.5-changes 2024-08-19 11:28:20 -05:00
Jonathan Bennett
ab9268cba9 Admin session key debugging messages 2024-08-19 11:12:42 -05:00
Mictronics
6de3ca4301
Fix deprecated macros. (#4505)
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28

* Merge PR #420

* Fixed double and missing Default class.

* Use correct format specifier and fixed typo.

* Removed duplicate code.

* Fix error: #if with no expression

* Fix warning: extra tokens at end of #endif directive.

* Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board.

* Fix deprecated macros.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-19 07:09:09 -05:00
Ben Meadors
14146d6ff5 Ms! 2024-08-19 07:04:48 -05:00
Jonathan Bennett
273beef148 Re-set the extra-nonce value 2024-08-18 22:25:08 -05:00
Jonathan Bennett
94d5ee9fe6 Deal with adminModule session_time of 0 2024-08-18 22:22:21 -05:00
Jonathan Bennett
7b64c4a5bf
Merge branch 'master' into 2.5-changes 2024-08-18 19:14:21 -05:00
Jonathan Bennett
ecb4fb72db Don't break EXCLUDE_PKI 2024-08-18 15:51:43 -05:00
Jonathan Bennett
f439081674 Don't segfault on PKI from unknown nodes 2024-08-18 14:11:39 -05:00
Jonathan Bennett
bfbc4bf93a Set the private_key in crypto when changed by admin 2024-08-18 14:11:17 -05:00
Jonathan Bennett
22e129e716 bluetooth != security; security = security 2024-08-18 13:00:52 -05:00
GUVWAF
a85df199a5
Only accept PKI messages for MQTT downlink if we know transmitter and receiver (#4498) 2024-08-18 12:15:50 -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
Andre K
e3e36e23f9
add admin getter for SECURITY_CONFIG (#4499) 2024-08-18 09:13:53 -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
todd-herbert
a8999d7759
Don't manually clear runAsap flag (#4496) 2024-08-18 07:22:16 -05:00
Jonathan Bennett
c7c620ac69
Merge branch 'master' into 2.5-changes 2024-08-17 17:38:39 -05:00
Jonathan Bennett
1bbc273ba6
Don't reject network time updates unintentionally (#4489) 2024-08-17 17:35:05 -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
Jonathan Bennett
0b010b4fd8 Get STM32 building again by disabling admin module 2024-08-17 11:06:00 -05:00
Jonathan Bennett
f86dde3c40
AdminModule session_passkey (#4478)
* Protobuf

* Adds session_passkey for remote admin changes
2024-08-17 08:41:12 -05:00
Ben Meadors
fdaaf71366
Merge branch 'master' into 2.5-changes 2024-08-17 08:01:15 -05:00
Ben Meadors
9dad62e3c4
Set time-only admin command (#4479) 2024-08-17 05:52:36 -05:00
todd-herbert
e0b4a8e31e
Radio Master Joystick (#4476)
* Radio Master Bandit 5-Way Joystick: first draft
Untested on genuine hardware

* "Okay" moves to next frame, even when canned message disabled

* Refactor to allow easier customization

* Implement feedback from testing
* guard toggleGPS()
* show "Shutting down.." screen
* split adhoc ping alert onto two lines

* Don't block while waiting for shutdown
Was preventing the alert from showing
2024-08-17 05:51:53 -05:00
Jonathan Bennett
7cbae56e6c
Merge branch 'master' into 2.5-changes 2024-08-16 19:39:10 -05:00
Jonathan Bennett
6eabbaf432 Add PKI logiv to KNOWN_ONLY and LOCAL_ONLY routing modes. 2024-08-16 19:37:28 -05:00
Jonathan Bennett
cec8233cd1 Don't attempt PKI decryption on broadcast packets 2024-08-16 19:33:06 -05:00
Mark Trevor Birss
0ebdc7ab0c
Update architecture.h add Minewsemi ME25LS01 LR1110 breakout ME25LE01_V1.0 and fix buzzer (#4472)
* Update architecture.h

* Update variant.h

* Update variant.h

* Update architecture.h

* Update architecture.h

* Delete src/platform/nrf52/architecture.h

* Add files via upload

* Update architecture.h

* Update architecture.h

* Update architecture.h
2024-08-16 17:37:22 -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
Jonathan Bennett
b0c1b7b7b5 MQTT PKI fixes 2024-08-16 10:10:08 -05:00
Ben Meadors
eefe9efa9f
Adds ASCII log option needed by portudino (#4443) (#4474)
* Adds ASCII logs useful to portudino

Activates ASCII log option when stdout is not a terminal.  This is
generally the right thing to do; if not, the behavior can be
overridden in config.yaml using AsciiLogs under Logging.  The result
is reasonable system logs for portudino when running under systemd or
the like.

Signed-off-by: Christopher Hoover <ch@murgatroid.com>
Co-authored-by: Christopher Hoover <ch@murgatroid.com>
2024-08-16 07:42:19 -05:00
Ben Meadors
390de724ba Update 2.5 protos 2024-08-16 06:09:02 -05:00
Christopher Hoover
85176756ec
Adds ASCII log option needed by portudino (#4443)
* Adds ASCII logs useful to portudino

Activates ASCII log option when stdout is not a terminal.  This is
generally the right thing to do; if not, the behavior can be
overridden in config.yaml using AsciiLogs under Logging.  The result
is reasonable system logs for portudino when running under systemd or
the like.

Signed-off-by: Christopher Hoover <ch@murgatroid.com>
2024-08-15 19:09:06 -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
Jonathan Bennett
ef56fae976
Merge branch 'master' into 2.5-changes 2024-08-15 11:21:25 -05:00
Ben Meadors
d398419aef
Router and sensor are impolite (#4468) 2024-08-15 08:47:49 -05:00
Ben Meadors
96cf78aadd
Short turbo preset (#4465) 2024-08-14 21:16:21 -05:00
Jonathan Bennett
ced87596cb
Add PKI channel for MQTT (#4464)
* Add PKI channel for MQTT
2024-08-14 19:32:45 -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
Ben Meadors
efc27f2051
Initial telemetry with time and variant tags (#4463) 2024-08-14 16:24:28 -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
Ben Meadors
207b9b49a5
Always attempt to set NTP or GPS time on a fresh position packet (#4460) 2024-08-14 07:42:30 -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
464f270b12
More explicit guards for attempting to set RTC (#4452)
* Guard against timesources from the mesh if we have good time

* Trunk

* Consider phone time in the past 24 hours authoritative as well

* Rename

* GPS can be null

* Declaration

* Remove RemoteHardware

* Explicitly remove GPS

* Exclude GPS earlier for RAK2560
2024-08-13 06:56:20 -05:00
Ben Meadors
7740b4bccd Sweep up some missed trunk formatting 2024-08-13 06:52:03 -05:00
Ben Meadors
e85a2e827b Update protos 2024-08-13 06:49:32 -05:00
geeksville
62a0321c7d
Fixes for #4395: nrf52 flash filesystem reliability (#4406)
* bug #4184: fix config file loss due to filesystem write errors
* Use SafeFile for atomic file writing (with xor checksum readback)
* Write db.proto last because it could be the largest file on the FS (and less critical)
* Don't keep a tmp file around while writing db.proto (because too big to fit two files in the filesystem)
* generate a new critial fault if we encounter errors writing to flash
either CriticalErrorCode_FLASH_CORRUPTION_RECOVERABLE or CriticalErrorCode_FLASH_CORRUPTION_UNRECOVERABLE
(depending on if the second write attempt worked)
* reformat the filesystem if we detect it is corrupted (then rewrite our config files) (only on nrf52 - not sure
yet if we should bother on ESP32)
* If we have to format the FS, make sure to preserve the oem.proto if it exists

* add logLegacy() so old C code in libs can log via our logging

* move filesList() to a better location (used only in developer builds)

* Reformat with "trunk fmt" to match our coding conventions

* for #4395: don't use .exists() to before attempting file open
If a LFS filesystem is corrupted, .exists() can fail when a mere .open()
attempt would have succeeded.  Therefore better to do the .open() in hopes that
we can read the file (in case we need to reformat to fix the FS).
(Seen and confirmed in stress testing)

* for #4395 more fixes, see below for details:
* check for LFS assertion failures during file operations (needs customized lfs_util.h to provide suitable hooks)
* Remove fsCheck() because checking filesystem by writing to it is very high risk, it makes likelyhood that we will
be able to read the config protobufs quite low.
* Update the LFS inside of adafruitnrf52 to 1.7.2 (from their old 1.6.1) to get the following fix:
97d8d5e96a

* use disable_adafruit_usb.py now that we are (temporarily?) using a forked adafruit lib
We need to reach inside the adafruit project and turn off USE_TINYUSB, just doing that
from platformio.ini is no longer sufficient.

Tested on a wio-sdk-wm1110 board (which is the only board that had this problem)

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-13 06:45:39 -05:00
Aaron.Lee
6e8300287b
Heltec boards sensor and low power features update (#4418)
* Update sensor drive and low power features.

* Update ST7789 TFT control logic.

* Update Heltec nRF board low power features.

* Update the GPS UART port pointer
2024-08-13 06:30:35 -05:00
GUVWAF
f97ae52263
STM32WL improvements (#4449)
* STM32WL: Enable DeviceTelemetry

* Add long/short name user preference options

* Add new STM32WL-based hardware models
2024-08-12 20:31:45 -05:00
Ben Loomis
c74bce9360
Detect UM600 as UC6580 (#4444) 2024-08-12 06:40:57 -05:00
github-actions[bot]
6cd1882aaa
[create-pull-request] automated change (#4439)
Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com>
2024-08-11 17:22:01 -05:00
Tom Fifield
cf392a4c20
Address some FIXME comments (#4435)
* Address some FIXME comments

These comments have since been addressed by more modern code.
Remove them to reduce the clutter in the codebase.

* Remove 'dumb idea' from SimpleAllocator

4 year old code that was set never to run can probably be safely
deleted.
2024-08-11 07:06:38 -05:00
Mictronics
8daebf80dd
Fix warning: extra tokens at end of #endif directive. (#4432) 2024-08-10 12:32:52 -05:00
GUVWAF
debf4b934f
Fix for "has default channel" with empty channel name (#4430) 2024-08-09 15:26:22 -05:00
Ben Meadors
3878e025e4
Split factory reset into config and device variants (#4427)
* Split factory reset into config and device variants

* Trunk

* Default only in header
2024-08-09 08:38:29 -05:00
github-actions[bot]
3ab4bebdcb
[create-pull-request] automated change (#4426)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-08-09 06:37:49 -05:00
Tom Fifield
e38aca3cba
NimbleBluetooth.h is not required in MeshService. (#4419)
There are no calls to the functions defined in Nimble from this
class. See also older comment on line 8 about the dream to seperate
mesh and bluetooth :)
2024-08-09 06:35:42 -05:00
Jonathan Bennett
c6a9edf8c7
Move printBytes to meshUtils (#4424) 2024-08-09 01:43:13 -05:00
Jonathan Bennett
a7da3537e2
Adds MESHTASTIC_EXCLUDE_TZ option (#4423) 2024-08-09 00:52:31 -05:00
Ben Meadors
5b4530325f Short circuit while the probe code does not auto-detect 2024-08-08 20:53:26 -05:00
Tom Fifield
b498c0bfbf
[WIP] Add support for Airoha AG3335 GPS (#4394)
* Add GPS detection code for Airoha AG3335

Airoha AG3335 is used in Seeed T-1000E Tracker

* Add support for Airoha AG3335

Airoha AG3335 is used in Seeed T-1000E Tracker. This adds
detection code, and code to configure its use.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-08 20:18:18 -05:00
Tom Fifield
02ae24b6fa
Remove outdated comments (#4417)
These comments from four years ago no longer reflect how things
work.
2024-08-08 20:08:14 -05:00
Tilen Komel
5111bd703a
Updted protobuf url (#4411) 2024-08-07 07:23:31 -05:00
Jonathan Bennett
789e8f02bf
Add more exclude options to save program ram/flash (#4408)
* Add PowerFSM Exclude option

* Add TEXTMESSAGE module exclude option

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-06 18:48:55 -05:00
todd-herbert
92526fca23
"Scan and Select" input for Canned Messages (#4365)
* Add "Scan and Select" input method for canned messages

* Adapt canned message drawing if USE_EINK
* Indicate current selection with indent rather than inverse text
* Avoid large text on "sending" and delivery report pop-ups
* Fit SNR and RSSI details on screen

* Change hash function which detects changes in E-Ink images
The old function struggled to distingush between images on the canned-message frame, failing to update when scrolling between messages. No real justification for the new algorithm, other than "it works" and doesn't seem "too expensive". For context, this function runs once a second.

* Use canned messages (scan and select) by default with HT-VME213 and HT-VME290

* Guard for HAS_SCREEN
2024-08-06 17:16:56 -05:00
geeksville
66c41e683d
bug #4184: fix config file loss due to filesystem write errors (#4397)
* Use SafeFile for atomic file writing (with xor checksum readback)
* Write db.proto last because it could be the largest file on the FS (and less critical)
* Don't keep a tmp file around while writing db.proto (because too big to fit two files in the filesystem)
* generate a new critial fault if we encounter errors writing to flash
either CriticalErrorCode_FLASH_CORRUPTION_RECOVERABLE or CriticalErrorCode_FLASH_CORRUPTION_UNRECOVERABLE
(depending on if the second write attempt worked)
* reformat the filesystem if we detect it is corrupted (then rewrite our config files) (only on nrf52 - not sure
yet if we should bother on ESP32)
* If we have to format the FS, make sure to preserve the oem.proto if it exists

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-06 13:59:06 -05:00
geeksville
c1870f91fc
Finish powermon/powerstress (#4230)
* Turn off vscode cmake prompt - we don't use cmake on meshtastic

* Add rak4631_dap variant for debugging with NanoDAP debug probe device.

* The rak device can also run freertos (which is underneath nrf52 arduino)

* Add semihosting support for nrf52840 devices
Initial platformio.ini file only supports rak4630
Default to non TCP for the semihosting log output for now...
Fixes https://github.com/meshtastic/firmware/issues/4135

* powermon WIP (for https://github.com/meshtastic/firmware/issues/4136 )

* oops - mean't to mark the _dbg variant as an 'extra' board.

* powermon wip

* Make serial port on wio-sdk-wm1110 board work
By disabling the (inaccessible) adafruit USB

* Instrument (radiolib only for now) lora for powermon
per https://github.com/meshtastic/firmware/issues/4136

* powermon gps support
https://github.com/meshtastic/firmware/issues/4136

* Add CPU deep and light sleep powermon states
https://github.com/meshtastic/firmware/issues/4136

* Change the board/swversion bootstring so it is a new "structured" log msg.

* powermon wip

* add example script for getting esp S3 debugging working
Not yet used but I didn't want these nasty tricks to get lost yet.

* Add PowerMon reporting for screen and bluetooth pwr.

* make power.powermon_enables config setting work.

* update to latest protobufs

* fix bogus shellcheck warning

* make powermon optional (but default enabled because tiny and no runtime impact)

* tell vscode, if formatting, use whatever our trunk formatter wants
without this flag if the user has set some other formatter (clang)
in their user level settings, it will be looking in the wrong directory
for the clang options (we want the options in .trunk/clang)

Note: formatOnSave is true in master, which means a bunch of our older
files are non compliant and if you edit them it will generate lots of
formatting related diffs.  I guess I'll start letting that happen with
my future commits ;-).

* add PowerStress module

* nrf52 arduino is built upon freertos, so let platformio debug it

* don't accidentally try to Segger ICE if we are using another ICE

* clean up RedirectablePrint::log so it doesn't have three very different implementations inline.

* remove NoopPrint - it is no longer needed

* when talking to API clients via serial, don't turn off log msgs instead encapsuate them

* fix the build - would loop forever if there were no files to send

* don't use Segger code if not talking to a Segger debugger

* when encapsulating logs, make sure the strings always has nul terminators

* nrf52 soft device will watchdog if you use ICE while BT on...
so have debugger disable bluetooth.

* Important to not print debug messages while writing to the toPhone scratch buffer

* don't include newlines if encapsulating log records as protobufs

* update to latest protobufs (needed for powermon goo)

* PowerStress WIP

* for #4154 and #4136 add concept of dependent gpios...
Which is currently only tested with the LED but eventually
will be used for shared GPIO/screen power rail enable
and LED forcing (which is a sanity check in the power stress
testing)

* fix linter warning

* Transformer is a better name for the LED input > operation > output classes

* PMW led changes to work on esp32-s3

* power stress improvements

* allow ble logrecords to be fetched either by NOTIFY or INDICATE ble types

This allows 'lossless' log reading.  If client has requested INDICATE
(rather than NOTIFY) each log record emitted via log() will have to fetched
by the client device before the meshtastic node can continue.

* Fix serious problem with nrf52 BLE logging.
When doing notifies of LogRecords it is important to use the
binary write routines - writing using the 'string' write won't work.
Because protobufs can contain \0 nuls inside of them which if being
parsed as a string will cause only a portion of the protobuf to be sent.
I noticed this because some log messages were not getting through.

* fix gpio transformer stuff to work correctly with LED_INVERTED

Thanks @todd-herbert for noticing this and the great stack trace.
The root cause was that I had accidentially shadowed outPin in a subclass
with an unneeded override.  It would break on any board that had inverted
LED power.

fixes
https://github.com/meshtastic/firmware/pull/4230#pullrequestreview-2217389099

* Support driving multiple output gpios from one input.

While investigating https://github.com/meshtastic/firmware/pull/4230#pullrequestreview-2217389099
I noticed in variant.h that there are now apparently newer TBEAMs than mine
that have _both_ a GPIO based power LED and the PMU based LED.  Add a splitter
so that we can drive two output GPIOs from one logical signal.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-06 12:35:54 -05:00
github-actions[bot]
4a79a690db
[create-pull-request] automated change (#4400)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-08-05 20:14:07 -05:00
geeksville
02231fd487
fix minor type comparison warning that I saw in the build (#4398) 2024-08-05 17:07:43 -05:00
Tom Fifield
e509a91019
Fix UC6580 ifdefs (#4393)
meshtastic/firmware#4319 added autodetect code for UC6580, and
removed these ifdefs. However, they were inadvertantly re-added
by #4328 .
2024-08-05 10:00:32 -05:00
geeksville
d8f3c3324c
Make lora radio reset reliable on wio-tracker-1100 and lower lr11x0 power consumption in sleep (#4383)
* Fix wio-tracker-1110 lora radio reset GPIO assignment
This fixes flaky lora radio init on this board.

* No need to keep lr11x0 radio config during sleep anymore, also stop TCXO

I think the problem (at least on the board I'm using for power testing
a wio tracker 1110) was that actually the RESET GPIO was not correct for
the radio.  This led to the radio not being properly reinited after exiting
sleep mode.

Now that the GPIO is fixed I can enter deep sleep (fully shutting down
radio) and then later when the CPU resets, it can successfully init the
radio and send packets.

After this seeming success, I also turned off the TCXO during sleep and that
worked as well.
2024-08-05 06:47:04 -05:00
geeksville
1a38c4e51d
Remove LED_INVERTED, see below for why ;-) (#4382)
While working on #4378 I noticed a funny problem: the blinking system
LED was on during deep-sleep.  Initially I thought it was some weird
sleep hw config thing but it turns out it was easier but more pervasive.

We had two different preprocessor symbols which both meant approximately the same
thing LED_INVERTED and LED_STATE_ON (though their polarity was opposite).
Some variant files were setting one, others were setting the other, and others were
setting both. heh.

In the case of the board I was testing (seeed tracker wio 1100) it was only setting one
and the default behavior for the other (for all boards) was incorrect.  So I did a grep
and it seems like LED_STATE_ON was used more often, so I kept that one and removed
LED_INVERTED everywhere.
2024-08-05 06:02:32 -05:00
Mark Trevor Birss
40d6b99911
Add Minewsemi LR1110+nRF52840-ME25LS01 [both 4.2inch e-ink and non e-ink varaint] (#4387)
* Add files via upload

* Update EInkDisplay2.cpp

* Add files via upload

* Update platformio.ini

* Update platformio.ini

* Update platformio.ini

* Update platformio.ini
2024-08-05 05:59:57 -05:00
Jonathan Bennett
7d00e1cef9
Output more useful log message when the NodeDB is full (#4389) 2024-08-04 18:52:10 -05:00
Ken Piper
5bbafdfd31
Configure pin modes of selected pins before attempting to write to them (#4385) 2024-08-04 06:06:36 -05:00
Jonathan Bennett
5453c495e2
Actually set the rand() seed for Portduino (#4380) 2024-08-03 13:12:22 -05:00
geeksville
dd552a99e1
fix #4367 make USB power detection work correctly on seeed trackers (#4376)
for wio tracker 1110 and 1000-E and possibly other nrf52 boards.
The problem was that nrf52 power stuff wasn't generating regular
powerstatus notifications (because that code was guarded by a batteryLevel
check which was null for those boards).  So I've cleaned up the battery status stuff
a bit and we now have fewer special cases.
Tested on a 1000-E, tracker 1110 and a rak4631 board.

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-02 20:20:44 -05:00
Tom Fifield
48c0635188
Remove OSTimer (#4373)
This code is not included anywhere, and none of the functions are
called by code elsewhere in meshtastic.
2024-08-02 10:10:55 -05:00
Tom Fifield
8db6039264
Remove empty file, StatusHandler.h (#4372)
Was added 4 years ago, never used/modified.
2024-08-02 06:32:28 -05:00
todd-herbert
4b4c1669a9
Initial support for HT-VME290, sleep fixes for HT-VME213 (#4334)
* Fix I2C pindefs

* Initial driver testing for HT-VME290

* E-Ink full refresh after canned message pop up

* Tidy variant folders

* Clean ESP32 cpuDeepSleep method
Merge sections, and remove the random assortment of gpio holds left behind.

* Enable 32kHz in variant.h

* Orient E290 with LoRa antenna facing up

* Revert "Clean ESP32 cpuDeepSleep method"

This reverts commit cb8ee508ec2d6bc27a8e228021fd1efbd034c4a0.

* Reduce deep-sleep current for VME213 (non-intrusive)
Originally I made an attempt at tidying up the cpuDeepSleep method, but have reverted that. New commit makes only the changes needed to support VME213. Don't really want the headache of breaking sleep for other variants, especially when this PR is just about implementing new boards.

* Update lib_deps; remove board_level extra
2024-08-02 14:03:59 +12:00
Jonathan Bennett
d2ea430a3e
Make SPI frequency and TOPHONE queue size configurable on Native (#4369)
* Make SPI frequency configurable on Native

* Make the tophone queue size configurable for Portduino

* The modified SPISettings must be configured in setup(), after config.yaml is processed

* make MeshService a pointer, so we can configure MAX_RX_TOPHONE at run time

* Got a little over excited with refactoring

* Silence a warning
2024-08-01 19:29:49 -05:00
Michael Gjelsø
4c1c5b070e
Changed a RADIOMASTER_900_BANDIT_NANO to DISPLAY_FLIP_SCREEN (#4366)
* More compatible

Changed a RADIOMASTER_900_BANDIT_NANO to DISPLAY_FLIP_SCREEN that is responsible for flipping the OLED screen for better compatible with other devices.

* Update variant.h Radiomaster 

Remove a un-used SCREEN_ROTATE and added DISPLAY_FLIP_SCREEN
2024-08-01 11:53:38 -05:00
Ben Meadors
bcdda4de8a Missed some includes of userPrefs that would allow behavior we don't want 2024-07-31 08:53:59 -05:00
Ben Meadors
24ecfa1a45 Trunk fmt 2024-07-31 07:42:23 -05:00
Sylvain Migaud
106a50bce2
Adding support for Chatter keypad (#4022)
* Adding support for Chatter keypad

* Remove user button mapping since full keypad is now useable

* Adding TAB key and RIGHT to allow selecting a destination

* Fix shift bug (there's only three levels, not four)

* reformat file

* Fix bug with fast repeated keypresses

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-07-31 07:38:21 -05:00
Tom Fifield
103ab0c242
Cleanup - remove unused defines. (#4353)
* Cleanup - remove unused defines.

There were a number of defined variables that were carried over
from old code. - Removed.
Also a typo. - Fixed fix.
Also duplicate definitions of the number of seconds in a day.
-deduplicated.

* Cleanup - remove unused defines.

There were a number of defined variables that were carried over
from old code. - Removed.
Also a typo. - Fixed fix.
Also duplicate definitions of the number of seconds in a day.
-deduplicated.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-07-31 06:56:06 -05:00
Tom Fifield
ce1eb149ac
Cleanup for Air530z GPS (#4344)
It turns out that the Air530z is a GNSS_MODEL_MTK. Our existing
code detects and configures it properly. This patch removes a
couple of AIROHA ifdefs since they are not required for a
working GPS.

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-07-31 05:58:19 -05:00
Ben Meadors
29fe6e7448
Event mode: Block problematic portnums of traffic (#4362) 2024-07-31 05:52:17 -05:00
Tom Fifield
9f5f630dca
Remove unused define in NRF52 architecture (#4350)
The NRF52 architecture defaulted to setting GPS_UBLOX.
However, GPS_UBLOX is not used anywhere in the code.

Remove these lines.
2024-07-30 15:57:31 -05:00
Tom Fifield
1f9dacf486
Add support for ATGM332D series (#4351)
Adds detection code for the ATGM332D series of chips (11, 21, 31,
51, 71), and sets meshtastic to use GNSS_MODEL_ATGM336H for them.
2024-07-30 15:57:13 -05:00
Ben Meadors
5dde738a31 Trunk 2024-07-30 15:08:38 -05:00
Michael Gjelsø
1951569b1a
PA FAN Disable (#4355)
* PA FAN Disable

* PA FAN Disable

* Trunk

* Trunk

* Trunk

* Thunk .....
2024-07-30 15:05:51 -05:00
Ben Meadors
93ba19d1e1
Make LogRecord protobuf serial logging over Phone API opt-in instead (#4358)
* Make LogRecord protobuf serial logging over Phone API opt-in instead of enabled by default

* debug_log_enabled
2024-07-30 15:05:33 -05:00
github-actions[bot]
a1c998e7e0
[create-pull-request] automated change (#4361)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-07-30 14:57:24 -05:00
github-actions[bot]
302caa854a
[create-pull-request] automated change (#4354)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-07-30 09:13:25 -05:00
Ben Meadors
59cc57fc29
Event mode: Enforce reliable hop limit and disallow default public MQTT (#4343)
* Event mode: Enforce reliable hop limit

* Event mode: Short circuit wantsLink on MQTT for default broker address

* Just enforce at channels level since everything uses this

* For events never forward packets with excessive hop_limit

* In EVENT_MODE, don't respond with hop_limit set more then the configured max.

* Correct hop_start when correcting hop_limit in event mode.

* Make EVENT_MODE work from userPrefs.h

* Event mode: Disallow Router or Repeater roles

---------

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
2024-07-29 20:16:47 -05:00
Ben Meadors
811a9ae261
Macro to trace log all MeshPackets as JSON (#4336)
* Macro to trace log all MeshPackets as JSON

* Comment

* Add trace logging to file for native target

* bytes to hex

* Add time_ms

---------

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
2024-07-28 19:49:10 -05:00
Jonathan Bennett
1a1d545c38
Adds a userPrefs.h file, default blank, used for default settings for custom builds (#4325)
* add a userPrefs.h file, default blank, which can be used to easily set defaults on custom builds.

* Add Splash Screen to userPrefs

* Add channel 0 defaults to userPrefs.h

* CONFIG_LORA_IGNORE_MQTT_DEFAULT

* Unify naming for USERPREFS defines

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-07-28 14:12:30 -05:00
Ben Meadors
4ee15d8128 Trunk 2024-07-26 06:38:54 -05:00
Ben Meadors
394e0e1b3e T1000_E hw model 2024-07-26 06:30:28 -05:00
github-actions[bot]
755952c261
[create-pull-request] automated change (#4333)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-07-26 06:29:05 -05:00
Ben Meadors
f645ae943d
JSON serialization refactor (#4331) 2024-07-25 20:50:42 -05:00
Thomas Göttgens
4b0bbb8af1
Make STM compile again and update toolchain. (#2960)
* Make STM compile again and update toolchain. The binary is too big for the flash. WIP

* Making progress with OSFS, still WIP

* more progress, still too big. Adding RAK3172 to the equasion

* Make STM compile again and update toolchain. The binary is too big for the flash. WIP

* Making progress with OSFS, still WIP

* more progress, still too big. Adding RAK3172 to the equasion

* still too big

* minimize build

* trunk fmt

* fix a couple of symbol clashes

* trunk fmt

* down to 101% with a release vs. debug build and omitting the flash strings

* fix compilation

* fix compilation once more

* update protobufs linkage

* - Toolchain updated
- Fixed macro error

* silence compiler warning
note: do something about this assert...

* new toolkit and fix Power.cpp

* STM32WL make it fit (#4330)

* Add option to exclude I2C parts

The I2C hals and related code uses a significant amount of flash space and aren't required for a basic node.

* Add option to disable Admin and NodeInfo modules

Disabled by default in minimal build. This saves a significant amount of flash

* Disable unused hals

These use up significant flash

* Add float support for printf for debugging

Makes serial look nice for debugging

* This breaks my build for some reason

* These build flags can save a bit of flash

* Don't disable NodeInfo and Admin modules in minimal build

They fit in flash

* Don't include printf float support by default

Only useful for debugging

---------

Co-authored-by: Adam Lawson <dev@goshawk22.uk>

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Adam Lawson <dev@goshawk22.uk>
2024-07-25 20:16:21 -05:00
Ben Meadors
7ac64bd762 Trunk 2024-07-25 13:09:28 -05:00
Mark Trevor Birss
1481ce987e
Fix T1000-E GPS - some changes went missing from #4303? (#4328)
* Update GPS.cpp

* Update GPS.cpp

* Update GPS.cpp

* Update GPS.cpp

* Update GPS.cpp

* Update GPS.cpp

* Update GPS.cpp

* Update GPS.cpp

* Update GPS.cpp
2024-07-25 13:05:03 -05:00
Ben Meadors
c5f2d2736d Whitespace trunk grousing 2024-07-24 21:14:58 -05:00
dylanli
a000a8d347
Support Seeed Tracker-T1000-E (#4303)
* feature-T1000-E: add Added the board definition for T1000-E

-  integrate a script for rapid dependency download that is compatible with both Linux and Windows platforms.
-  add the pin definitions for UART, SPI, GPIO, and other peripherals have been ensured to be correct.
-  add the env configuration for PlatformIO.

* refact-T1000-E: redefine T1000-E board

* feature-T1000-E: add basic sensors

* feature-T1000-E: add button init

* feat: add DRADIOLIB_GODMODE defination for use function setDioAsRfSwitch to DIO LORA RF

* feat : add gps(GNSS_Airoha) sleep mode

* feat: add behavier when rec or send message

* chore: hang IIC bus usage to avoid sensor address conflict

* feat: add sensor data acquisition

* feat : support Airoha GPS

- add disable it in FSM
- update  lookForTime and lookForLocation function

* fix: fix a bug

* version: change version to 0.9.0

* Update tracker-t1000-e.json

Remove a space

* Delete variants/tracker-t1000-e/run_once.sh

Delete not need as we will change platformio.ini

* Update platformio.ini

Update SoftDevice 7.3.0 usage in line with other lr1110 targets

Do we need to keep GODMODE ?

* fix: Button behavier incorrect bug

* fix:remove some invaild code of TextMessageModule

* fix: remove invaild comment

* version: change version to 0.9.1

- update mark's patch
- remove some invaild code and comments
- fix button behavier

* trunk format

* fix:  HELTEC_CAPSULE_SENSOR_V3 block got accidentally deleted

* fix: EnvironmentTelemetry upstream merge went awry.

* fix: Added macro definitions to ensure correct operation of LORA section

* fix :GNSS_AIROHA macro defination in line with others

* fix: upstream backmerge accidentally.

* fix: wrap macro PIN_3V3_EN BUZZER_EN_PIN GNSS_AIROHA in the TRACKER_T1000_E macro guard

---------

Co-authored-by: Mark Trevor Birss <markbirss@gmail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2024-07-24 21:10:38 -05:00
Ben Meadors
01e089fd07
Ignore invalid service envelopes (#4326) 2024-07-24 08:23:04 -05:00
Jonathan Bennett
300c3d32aa
Just a bit of security hygiene. (#4313)
* Make sure to call randomSeed() on esp32

* Randomize the top 22 bits of the Message ID

* Make it clear that we are not calling randomSeed() on purpose

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-07-23 11:52:14 -05:00
Tom Fifield
316928deb0
Cleanup GPS, add UC6580 autodetect (#4319)
* Cleanup GPS, add UC6580 autodetect

Our GPS code autodetects devices by default. Previously UC6580 was
statically assigned, and had its own baudrate configuration inside
the GPS code.

This change adds autodetect functionality for the UC6580 and moves
any 'special' GPS baud rate requirements for a variant out into the
variant configuration. Thereby cleaning up core GPS code a little,
saving the whales, and curing global warming.

New Functionality:
* If GPS_BAUDRATE is defined in variant.h, GPS autodetection will
try that baudrate first.
* UC6580 GPS chips are now automatically detected

* Only run speedSelect skip the first time

* Cleanup GPS, add UC6580 autodetect

Our GPS code autodetects devices by default. Previously UC6580 was
statically assigned, and had its own baudrate configuration inside
the GPS code.

This change adds autodetect functionality for the UC6580 and moves
any 'special' GPS baud rate requirements for a variant out into the
variant configuration. Thereby cleaning up core GPS code a little,
saving the whales, and curing global warming.

New Functionality:
* If GPS_BAUDRATE is defined in variant.h, GPS autodetection will
try that baudrate first.
* UC6580 GPS chips are now automatically detected

* Cleanup GPS, add UC6580 autodetect

Our GPS code autodetects devices by default. Previously UC6580 was
statically assigned, and had its own baudrate configuration inside
the GPS code.

This change adds autodetect functionality for the UC6580 and moves
any 'special' GPS baud rate requirements for a variant out into the
variant configuration. Thereby cleaning up core GPS code a little,
saving the whales, and curing global warming.

New Functionality:
* If GPS_BAUDRATE is defined in variant.h, GPS autodetection will
try that baudrate first.
* UC6580 GPS chips are now automatically detected

* Remove Airoha baud rate code

It's no longer needed.
2024-07-23 06:18:27 -05:00
Ben Meadors
0d2a9b6282
Fix de/compression buffer overflows in TAK packets (#4317)
* Fix de/compression buffer overflows in TAK packets

* Log message
2024-07-23 06:16:53 -05:00
Thomas Göttgens
d8fd3f615d meesa jinxed it 2024-07-22 22:35:39 +02:00
Thomas Göttgens
7568a35372 fix build and probably break GPS 2024-07-22 17:09:46 +02:00
Thomas Göttgens
50238fbaf5
Merge branch 'master' into wio-lr1110-refresh 2024-07-22 17:03:09 +02:00
github-actions[bot]
646f5ad262
[create-pull-request] automated change (#4316)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-07-22 09:34:19 -05:00
Thomas Göttgens
2248ac51be Merge branch 'wio-lr1110-refresh' of https://github.com/meshtastic/firmware into wio-lr1110-refresh 2024-07-22 15:46:31 +02:00
Thomas Göttgens
5781149f88 *sigh* 2024-07-22 15:46:15 +02:00
Thomas Göttgens
94a10e011c
Merge branch 'master' into wio-lr1110-refresh 2024-07-22 15:37:34 +02:00
Thomas Göttgens
bdd1c53072 Revert "Sync Wio lr1110 refresh with master (#4288)"
This reverts commit 5cc8ca59a3.

Revert "Sync Wio lr1110 refresh with master (#4251)"

This reverts commit d97e6b86b8.

Revert "update SD_FLASH_SIZE to 0x27000 (#4232)"

This reverts commit 2df8093fef.
2024-07-22 15:30:36 +02:00
Lennart Buhl
1123223058
Fix a typo in src/mesh/MeshService.h (#4314) 2024-07-22 06:58:24 -05:00
Tavis
fa6624548b
Serial Mode for Ecowitt WS85 weather station. (#4296)
* protobufs

* initial mods, not tested

* manual telem packet creation, compiles.

* add gust and lull computation

* telem packet is getting fired off

* new pb ?

* pb and gust lull

* need to set the variant type for it to work.

* add gust and lull to mqtt json output.

* parse bat voltage and cap voltage and send the larger of the two in telem packet

also use the new ws85 serial mode (6).  must set it with cli. : meshtastic --set serial.mode 6

* set hard coded average/transmit interval to 5 minutes.

* proper direction averging with trig.

* Update protobufs

* sweep some crud

* read in 512 bytes at a time and break and clear serial input if we got wind data

* factor out sendTelemetry function

* Revert "factor out sendTelemetry function"

This reverts commit b61ba1a3c5.

* Reapply "factor out sendTelemetry function"

This reverts commit d0af9cfd7d.

* update protobufs

* put WS85 Serial2 is tcho and canaryone exclusion #ifdef

* include GeoCoord.h so dr-dev will compile.

* remove old TODO comment.

* breakout WS85 serial operation to it's own function called processWXSerial()

* canaryone and t-echo exclusion for Serial2

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-07-21 07:09:37 -05:00
Ben Meadors
dadf9234e5
Remove status topic (#4305) 2024-07-21 07:09:10 -05:00
Mictronics
f9d79964ef
Remove duplicate code and fix error: #if with no expression (#4307)
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28

* Merge PR #420

* Fixed double and missing Default class.

* Use correct format specifier and fixed typo.

* Removed duplicate code.

* Fix error: #if with no expression

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-07-20 06:47:04 -05:00
todd-herbert
54df153e9e
Wait for I2C power to stabilize on Heltec VME213; tidy variant folder (#4308)
* Tidy variant.h and pins_arduino.h (VME213)

* Wait for peripherals to stabilize after enabling I2C power
The 3.3V power for the I2C "quick link" connector is from Ve_3V3
2024-07-20 06:46:26 -05:00
Ben Meadors
46d7b82ac1
Migrate to new defaults (#4294)
* Upgrade module config state version but don't blow everything away

* ModuleConfig version intervals roll forward

* Be specific about version migration criteria

* initModuleConfigIntervals fix

* Don't forget power!
2024-07-16 09:37:50 -05:00
Ben Meadors
a04de8c6b3 Add PaxCounter to the mix 2024-07-14 06:27:16 -05:00
Tom Fifield
5cc8ca59a3
Sync Wio lr1110 refresh with master (#4288)
* Fix protobuf structs handling (#4140)

* Fix protobuf structs handling

* Log instead of assert

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* BLE based logging (#4146)

* WIP log characteristic

* Bluetooth logging plumbing

* Characteristic

* Callback

* Check for nullptr

* Esp32 bluetooth impl

* Formatting

* Add thread name and log level

* Add settings guard

* Remove comments

* Field name

* Fixes esp32

* Open it up

* Whoops

* Move va_end past our logic

* Use `upload_protocol = esptool` as with the other heltec devices instead of `esp-builtin` (#4151)

* Standardize lat/lon position logs (#4156)

* Standardize lat/lon position logs

* Missed sone and condensed logs

* [create-pull-request] automated change (#4157)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Pause BLE logging during want_config flow (#4162)

* Update NimBLE to 1.4.2 (#4163)

* Implement replies for all telemetry types based on variant tag (#4164)

* Implement replies for all telemetry types based on variant tag

* Remove check for `ignoreRequest`: modules can set this, don't need to check

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Esptool is better

* Explicitly set characteristic

* fix INA3221 sensor (#4168)

- pass wire to begin()
- remove redundant setAddr() (already set in header)

* Show compass on waypoint frame; clear when waypoint deleted (#4116)

* Clear expired or deleted waypoint frame

* Return 0 to CallbackObserver

* Add a missing comment

* Draw compass for waypoint frame

* Display our own waypoints

* [create-pull-request] automated change (#4171)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Add semihosting support for nrf52 devices (#4137)

* Turn off vscode cmake prompt - we don't use cmake on meshtastic

* Add rak4631_dap variant for debugging with NanoDAP debug probe device.

* The rak device can also run freertos (which is underneath nrf52 arduino)

* Add semihosting support for nrf52840 devices
Initial platformio.ini file only supports rak4630
Default to non TCP for the semihosting log output for now...
Fixes https://github.com/meshtastic/firmware/issues/4135

* fix my botched merge - keep board_level = extra flag for rak3631_dbg

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* [create-pull-request] automated change (#4174)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Display alerts (#4170)

* Move static functions into Screen.h, show compass during calibration

* Move to _fontHeight macro to avoid collision

* Move some alert functions to new alert handler

* Catch missed reboot code

* ESP32 fixes

* Bump esp8266-oled-ssd1306

* Fixes for when a device has no screen

* Use new startAlert(char*) helper class

* Add EINK bits back to alert handling

* Add noop class for no-display devices

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Send file system manifest up on want_config (#4176)

* Send file system manifest up on want_config

* Platform specific methods

* Helps to actually make the change

* Clear

* tell vscode, if formatting, use whatever our trunk formatter wants (#4186)

without this flag if the user has set some other formatter (clang)
in their user level settings, it will be looking in the wrong directory
for the clang options (we want the options in .trunk/clang)

Note: formatOnSave is true in master, which means a bunch of our older
files are non compliant and if you edit them it will generate lots of
formatting related diffs.  I guess I'll start letting that happen with
my future commits ;-).

* fix the build - would loop forever if there were no files to send (#4188)

* Show owner.short_name on boot (and E-Ink sleep screen) (#4134)

* Show owner.short_name on boot and sleep screen (on e-ink)

* Update Screen.cpp - new line for short_name

Boot screen short_name now below the region setting.
Looks better on small screens.

* Draw short_name on right

---------

Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* nrf52 soft device will watchdog if you use ICE while BT on... (#4189)

so have debugger disable bluetooth.

* correct xiao_ble build preventing sx1262 init (#4191)

* Force a compile time failur if FromRadio or ToRadio get larger than (#4190)

a BLE packet size. We are actually very close to this threshold so
important to make sure we don't accidentally pass it.

* Clear vector after complete config state (#4194)

* Clear after complete config

* Don't collect . entries

* Log file name and size

* [create-pull-request] automated change (#4200)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Make the logs Colorful! (#4199)

* Squash needlessly static functions (#4183)

* Trim extra vprintf and filter for unprintable characters

* Deprecate Router Client role (and make it Client) (#4201)

* [create-pull-request] automated change (#4205)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Move waypoint (#4202)

* Move waypoint screen draw into the waypoint module

* Get the observer set up for the waypoint screen draw

* Static squashing: screen dimensions
Macros moved back to Screen.cpp, as a band-aid until we eventually move all those static functions into the Screen class.

* Move getCompassDiam into Screen class
(supress compiler warnings)
At this stage, the method is still static, because it's used by drawNodeInfo, which has no tidy reference to our screen instance.
This is probably just another band-aid until these static functions all move.

* Use new getCompassDiam function in AccelerometerThread

* Properly gate display code in WaypointModule

---------

Co-authored-by: Todd Herbert <herbert.todd@gmail.com>

* Fix flakey phone api transition from file manifest to complete (#4209)

* Try fix flakey phone api transition from file manifest to complete

* Skip

* enable colors in platformio serial monitor (#4217)

* When talking via serial, encapsulate log messages in protobufs if necessary (#4187)

* clean up RedirectablePrint::log so it doesn't have three very different implementations inline.

* remove NoopPrint - it is no longer needed

* when talking to API clients via serial, don't turn off log msgs instead encapsuate them

* fix the build - would loop forever if there were no files to send

* don't use Segger code if not talking to a Segger debugger

* when encapsulating logs, make sure the strings always has nul terminators

* nrf52 soft device will watchdog if you use ICE while BT on...
so have debugger disable bluetooth.

* Important to not print debug messages while writing to the toPhone scratch buffer

* don't include newlines if encapsulating log records as protobufs

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* [create-pull-request] automated change (#4218)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Fix SHT41 support (#4222)

* Add SHT41 Serial to I2c Detection Code

On the Seeed Wio-WM1110 Dev Kit board, the SHT41 chip was being
incorrectly detected as SHT31.

This patch adds the necessary serial number for the SHT41 chip to
be correctly detected.

fixes meshtastic/firmware#4221

* Add missing sensor read for SHT41

* Typo fix in logs - mhz - MHz (#4225)

As reported by karamo, a few different places in our logs had
incorrect capitalization of MHz.

fixes meshtastic/firmware#4126

* New new BLE logging characteristic with LogRecord protos  (#4220)

* New UUID

* New log radio characteristic with LogRecord protobuf

* LogRecord

* Merge derp

* How did you get there

* Trunk

* Fix length

* Remove assert

* minor cleanup proposal (#4169)

* MESHTASTIC_EXCLUDE_WIFI and HAS_WIFI cleanup...
Our code was checking HAS_WIFI and the new MESHTASTIC_EXCLUDE_WIFI
flags in various places (even though EXCLUDE_WIFI forces HAS_WIFI
to 0).  Instead just check HAS_WIFI, only use EXCLUDE_WIFI inside
configuration.h

* cleanup: use HAS_NETWORKING instead of HAS_WIFI || HAS_ETHERNET
We already had HAS_NETWORKING as flag in MQTT to mean 'we have
tcpip'.  Generallize that and move it into configuration.h so that
we can use it elsewhere.

* Use #pragma once, because supported by gcc and all modern compilers
instead of #ifdef DOTHFILE_H etc...

---------

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>

* Add PowerMon support (#4155)

* Turn off vscode cmake prompt - we don't use cmake on meshtastic

* Add rak4631_dap variant for debugging with NanoDAP debug probe device.

* The rak device can also run freertos (which is underneath nrf52 arduino)

* Add semihosting support for nrf52840 devices
Initial platformio.ini file only supports rak4630
Default to non TCP for the semihosting log output for now...
Fixes https://github.com/meshtastic/firmware/issues/4135

* powermon WIP (for https://github.com/meshtastic/firmware/issues/4136 )

* oops - mean't to mark the _dbg variant as an 'extra' board.

* powermon wip

* Make serial port on wio-sdk-wm1110 board work
By disabling the (inaccessible) adafruit USB

* Instrument (radiolib only for now) lora for powermon
per https://github.com/meshtastic/firmware/issues/4136

* powermon gps support
https://github.com/meshtastic/firmware/issues/4136

* Add CPU deep and light sleep powermon states
https://github.com/meshtastic/firmware/issues/4136

* Change the board/swversion bootstring so it is a new "structured" log msg.

* powermon wip

* add example script for getting esp S3 debugging working
Not yet used but I didn't want these nasty tricks to get lost yet.

* Add PowerMon reporting for screen and bluetooth pwr.

* make power.powermon_enables config setting work.

* update to latest protobufs

* fix bogus shellcheck warning

* make powermon optional (but default enabled because tiny and no runtime impact)

* tell vscode, if formatting, use whatever our trunk formatter wants
without this flag if the user has set some other formatter (clang)
in their user level settings, it will be looking in the wrong directory
for the clang options (we want the options in .trunk/clang)

Note: formatOnSave is true in master, which means a bunch of our older
files are non compliant and if you edit them it will generate lots of
formatting related diffs.  I guess I'll start letting that happen with
my future commits ;-).

* add PowerStress module

* nrf52 arduino is built upon freertos, so let platformio debug it

* don't accidentally try to Segger ICE if we are using another ICE

* clean up RedirectablePrint::log so it doesn't have three very different implementations inline.

* remove NoopPrint - it is no longer needed

* when talking to API clients via serial, don't turn off log msgs instead encapsuate them

* fix the build - would loop forever if there were no files to send

* don't use Segger code if not talking to a Segger debugger

* when encapsulating logs, make sure the strings always has nul terminators

* nrf52 soft device will watchdog if you use ICE while BT on...
so have debugger disable bluetooth.

* Important to not print debug messages while writing to the toPhone scratch buffer

* don't include newlines if encapsulating log records as protobufs

* update to latest protobufs (needed for powermon goo)

* PowerStress WIP

* fix linter warning

* Cleanup buffer

* Merge hex for wm1110 target(s)

* Only sdk

* Sudo

* Fix exclude macros (#4233)

* fix MESHTASTIC_EXCLUDE_BLUETOOTH

* fix HAS_SCREEN=0

* fix MESHTASTIC_EXCLUDE_GPS

* fix typo in build-nrf52.sh (#4231)

chmod is the command, '+x' is the argument.

* Tidy Wireless Paper variant files (#4238)

* Quick tidy of pins_arduino.h
Matches requests made at https://github.com/meshtastic/firmware/pull/4226#discussion_r1664183480)

* Tidy variant.h

* Change deprecated ADC attenuation parameter
From 11dB to 12dB. Resolves compiler warning. Allegly, no impact on function: `This is deprecated, it behaves the same as `ADC_ATTEN_DB_12`

* Updated raspbian CI to update apt repository ahead of libbluetooth. (#4243)

* Fix BLE logging on nrf52 (#4244)

* allow ble logrecords to be fetched either by NOTIFY or INDICATE ble types

This allows 'lossless' log reading.  If client has requested INDICATE
(rather than NOTIFY) each log record emitted via log() will have to fetched
by the client device before the meshtastic node can continue.

* Fix serious problem with nrf52 BLE logging.
When doing notifies of LogRecords it is important to use the
binary write routines - writing using the 'string' write won't work.
Because protobufs can contain \0 nuls inside of them which if being
parsed as a string will cause only a portion of the protobuf to be sent.
I noticed this because some log messages were not getting through.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Fix build when HAS_NETWORKING is false on nrf52 (#4237)

(tested on a rak4631 by setting HAS_ETHERNET false when shrinking
image)

* If `toPhoneQueue` is full, still increment `fromNum` to avoid client never getting packets (#4246)

* Update to SoftDevice 7.3.0 for wio-sdk-wm1110 and wio-tracker-wm1110 (#4248)

* Update variant.h

* Update wio-tracker-wm1110.json

* Update wio-sdk-wm1110.json

* Update platformio.ini

* Update platformio.ini

* Add files via upload

* Add files via upload

* Update variant.h

* Cleanup NRF s140 Softdevice variants (#4252)

Note: This idea is originally from @caveman99 and should be
credited as such. Submitting as a separate PR so the work in
meshtastic/firmware#4148 can be a bit cleaner and Seeed boards
can build while that work is ongoing.

The nrf52 boards that depend on the v7 softdevice all use the same
code and linker files. Rather than duplicate the code, keep it
all together with the platform.

* Remove tracker variant specific soft device headers (#4255)

* [create-pull-request] automated change (#4247)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Add wio-sdk-wm1110 to build. (#4258)

The wio-sdk-wm1110 is distinct from the wio-tracker-wm1110, with
different platformio build options and pin config.

This change adds the wio-sdk-wm1110 to the CI matrix so firmware
is built as part of release.

* fix python warning in uf2conf (#4235)

the old regex worked but was technically incorrect.  fixes:
Generating NRF52 uf2 file
/home/kevinh/development/meshtastic/firmware/bin/uf2conv.py:195: SyntaxWarning: invalid escape sequence '\s'
  words = re.split('\s+', line)
Converting to uf2, output size: 1458688, start address: 0x26000

* Collect hex files and specifically wm1110 sdk

* Skip dfu file for sdk (for now)

* Helps if you remove the original clause

* Add Heltec new boards. (#4226)

* Add Heltec new boards

* Update variant.h

disable RTC by default

* Add Heltec New boards

* Add Heltec new boards

* Update Heltec Mesh Node definition.

* Update Heltec Vision Mater E290

* [create-pull-request] automated change (#4259)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Trunk fmt

* Fix macros

* Move e290 to board level extra while CI is broken

* Tell trunk to ignore bin folder

* Fix missing

* Update trunk.yaml, fix whitespace

* Update trunk.yaml

* Update build_raspbian_armv7l.yml --fix-missing

* [create-pull-request] automated change (#4263)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* GPS Power State tidy-up  (#4161)

* Refactor GPSPowerState enum
Identifies a case where the GPS hardware is awake, but an update is not yet desired

* Change terminology

* Clear old lock-time prediction on triple press

* Use exponential smoothing to predict lock time

* Rename averageLockTime to predictedLockTime

* Attempt: Send PMREQ with duration 0 on MCU deep-sleep

* Attempt 2: Send PMREQ with duration 0 on MCU deep-sleep

* Revert "Attempt 2: Send PMREQ with duration 0 on MCU deep-sleep"

This reverts commit 8b697cd2a4.

* Revert "Attempt: Send PMREQ with duration 0 on MCU deep-sleep"

This reverts commit 9d29ec7603.

* Remove unused notifyGPSSleep Observable
Handled with notifyDeepSleep, and enable() / disable()

* WIP: simplify GPS power management
An initial attempt only.

* Honor #3e9e0fd

* No-op when moving between GPS_IDLE and GPS_ACTIVE

* Ensure U-blox GPS is awake to receive indefinite sleep command

* Longer pause when waking U-blox to send sleep command

* Actually implement soft and hard sleep..

* Dynamically estimate the threshold for GPS_HARDSLEEP

* Fallback to GPS_HARDSLEEP, if GPS_SOFTSLEEP unsupported

* Move "excessive search time" behavior to scheduler class

* Minor logging adjustments

* Promote log to warning

* Gratuitous buffer clearing on boot

* Fix inverted standby pin logic
Specifically the standby pin for L76B, L76K and clones
Discovered during T-Echo testing: totally broken function, probe method failing.

* Remove redundant pin init
Now handled by setPowerState

* Replace max() with if statements
Avoid those platform specific implementations..

* Trunk formatting
New round of settings.json changes keep catching me out, have to remember to re-enable my "clang-format" for windows workaround.

* Remove some asserts from setPowerState
Original aim was to prevent sending a 0 second PMREQ to U-blox hardware as part of a timed sleep (GPS_HARDSLEEP, GPS_SOFTSLEEP). I'm not sure this is super important, and it feels tidier to just allow the 0 second sleeptime here, rather than fudge the sleeptime further up.

* Fix an error determining whether GPS_SOFTSLEEP is supported

* Clarify a log entry

* Set PIN_STANDBY for MCU deep-sleep
Required to reach TTGO's advertised 0.25mA sleep current for T-Echo. Without this change: ~6mA.

* Optimize the shutdown current of RAK10701 to around 25uA (#4260)

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>

* INA3221 sensor: use for bus voltage & environment metrics (#4215)

* use INA3221 for bus voltage; fixes for telemetry variants

- add to sensors available for environment telemetry
  (to report voltage/current)
- add vars to define channels to use for battery voltage
  (for getBusVoltage) and environment metrics (default
  to CH1 for both)
- write to the correct fields on the measurement struct
  depending on the measurement variant, and DRY up the
  sensor measurement collection code a bit
- this might be suitable for a common implementation for
  the INA* sensors in a future PR...

* formatting

* derp

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* WM1110 SDK kit enter serial DFU and add deployment packages (#4266)

* Switch default upload protocol to nrfutil so that pio generates zip deploy packages

* Enter serial DFU on SDK board

* Remove guard for DFU zip from SDK build

* NRF_USE_SERIAL_DFU macro instead

* Show specific frame when updating screen (#4264)

* Updated setFrames in Screen.cpp

Added code to attempt to revert back to the same frame that user was on prior to setFrame reload.

* Space added Screen.cpp

* Update Screen.cpp

Make screen to revert to Frame 0 if the originally displayed frame is no longer there.

* Update Screen.cpp

Inserted boolean holdPosition into setFrames to indicate the requirement to stay on the same frame ( if =true) or else it will switch to new frame .
Only Screen::handleStatusUpdate calls with setFrame(true). ( For Node Updates)
All other types of updates call as before setFrame(), so it will change focus as needed.

* Hold position, even if number of frames increases

* Hold position, if handling an outgoing text message

* Update Screen.cpp

* Reverted chnages related to devicestate.has_rx_text_message

* Reset to master

* CannedMessages only handles routing packets when waiting for ACK
Previously, this was calling Screen::setFrames at unexpected times

* Gather position info about screen frames while regenerating

* Make admin module observable
Notify only when relevant. Currently: only to handle remove_nodenum.

* Optionally specify which frame to focus when setFrames runs

* UIFrameEvent uses enum instead of multiple booleans

* Allow modules to request their own frame to be focussed
This is done internally by calling MeshModule::requestFocus()
Easier this way, insteady of passing the info in the UIFrameEvent:
* Modules don't always know whether they should be focussed until after the UIFrameEvent has been raised, in dramFrame
* Don't have to pass reference to module instance as parameter though several methods

* E-Ink screensaver uses FOCUS_PRESERVE
Previously, it had its own basic implementation of this.

* Spelling: regional variant

* trunk

* Fix HAS_SCREEN guarding

* More HAS_SCREEN guarding

---------

Co-authored-by: BIST <77391720+slash-bit@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: slash-bit <v-b2@live.com>

* Move up telemetry defaults to every 30 minutes (#4274)

* Don't send node info interrogation when ch. util is >25% (#4273)

* Moar LR1110 Targets

* update SD_FLASH_SIZE to 0x27000 (#4232)

The 7.3.0 softdevice needs the extra 1000 :)

* Fix spacing.

---------

Co-authored-by: Mike <mikhael.skvortsov@gmail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Mike G <mkgin@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com>
Co-authored-by: Warren Guy <5602790+warrenguy@users.noreply.github.com>
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
Co-authored-by: geeksville <kevinh@geeksville.com>
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
Co-authored-by: Alexander <156134901+Dorn8010@users.noreply.github.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: quimnut <github@dopegoat.com>
Co-authored-by: Manuel <71137295+mverch67@users.noreply.github.com>
Co-authored-by: Agent Blu, 006 <blu006@ucr.edu>
Co-authored-by: Mark Trevor Birss <markbirss@gmail.com>
Co-authored-by: Aaron.Lee <32860565+Heltec-Aaron-Lee@users.noreply.github.com>
Co-authored-by: Daniel.Cao <144674500+DanielCao0@users.noreply.github.com>
Co-authored-by: BIST <77391720+slash-bit@users.noreply.github.com>
Co-authored-by: slash-bit <v-b2@live.com>
2024-07-13 20:38:19 -05:00
GUVWAF
9e4ce86c2a
Let StoreForward server send history to phoneAPI (#4282)
* Send StoreForward history of the server to a connected client
To extend the ToPhoneQueue

* Add delay after sending history info

* Don't allow history request over LoRa on default channel

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-07-13 12:36:44 -05:00
Ben Meadors
c5d747cd3e
Scale default intervals based for *online* mesh size past 40 nodes (#4277)
* Add congestion scaling coefficient

* Added active mesh sized based interval scaling

* Moved back to bottom

* Format

* Add observers and use correct number of online nodes
2024-07-13 05:59:19 -05:00
Ben Meadors
0fa9974518
Don't send node info interrogation when ch. util is >25% (#4273) 2024-07-12 11:48:35 -05:00
Ben Meadors
699d37b04c
Move up telemetry defaults to every 30 minutes (#4274) 2024-07-12 09:24:42 -05:00
todd-herbert
eabec5ae34
Show specific frame when updating screen (#4264)
* Updated setFrames in Screen.cpp

Added code to attempt to revert back to the same frame that user was on prior to setFrame reload.

* Space added Screen.cpp

* Update Screen.cpp

Make screen to revert to Frame 0 if the originally displayed frame is no longer there.

* Update Screen.cpp

Inserted boolean holdPosition into setFrames to indicate the requirement to stay on the same frame ( if =true) or else it will switch to new frame .
Only Screen::handleStatusUpdate calls with setFrame(true). ( For Node Updates)
All other types of updates call as before setFrame(), so it will change focus as needed.

* Hold position, even if number of frames increases

* Hold position, if handling an outgoing text message

* Update Screen.cpp

* Reverted chnages related to devicestate.has_rx_text_message

* Reset to master

* CannedMessages only handles routing packets when waiting for ACK
Previously, this was calling Screen::setFrames at unexpected times

* Gather position info about screen frames while regenerating

* Make admin module observable
Notify only when relevant. Currently: only to handle remove_nodenum.

* Optionally specify which frame to focus when setFrames runs

* UIFrameEvent uses enum instead of multiple booleans

* Allow modules to request their own frame to be focussed
This is done internally by calling MeshModule::requestFocus()
Easier this way, insteady of passing the info in the UIFrameEvent:
* Modules don't always know whether they should be focussed until after the UIFrameEvent has been raised, in dramFrame
* Don't have to pass reference to module instance as parameter though several methods

* E-Ink screensaver uses FOCUS_PRESERVE
Previously, it had its own basic implementation of this.

* Spelling: regional variant

* trunk

* Fix HAS_SCREEN guarding

* More HAS_SCREEN guarding

---------

Co-authored-by: BIST <77391720+slash-bit@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: slash-bit <v-b2@live.com>
2024-07-11 18:51:26 -05:00
Ben Meadors
df194ca0f0
WM1110 SDK kit enter serial DFU and add deployment packages (#4266)
* Switch default upload protocol to nrfutil so that pio generates zip deploy packages

* Enter serial DFU on SDK board

* Remove guard for DFU zip from SDK build

* NRF_USE_SERIAL_DFU macro instead
2024-07-11 14:08:31 -05:00
Warren Guy
974fc31856
INA3221 sensor: use for bus voltage & environment metrics (#4215)
* use INA3221 for bus voltage; fixes for telemetry variants

- add to sensors available for environment telemetry
  (to report voltage/current)
- add vars to define channels to use for battery voltage
  (for getBusVoltage) and environment metrics (default
  to CH1 for both)
- write to the correct fields on the measurement struct
  depending on the measurement variant, and DRY up the
  sensor measurement collection code a bit
- this might be suitable for a common implementation for
  the INA* sensors in a future PR...

* formatting

* derp

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-07-11 08:34:55 -05:00
Daniel.Cao
e79a7dce07
Optimize the shutdown current of RAK10701 to around 25uA (#4260)
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
2024-07-11 08:34:33 -05:00
todd-herbert
33831cd41c
GPS Power State tidy-up (#4161)
* Refactor GPSPowerState enum
Identifies a case where the GPS hardware is awake, but an update is not yet desired

* Change terminology

* Clear old lock-time prediction on triple press

* Use exponential smoothing to predict lock time

* Rename averageLockTime to predictedLockTime

* Attempt: Send PMREQ with duration 0 on MCU deep-sleep

* Attempt 2: Send PMREQ with duration 0 on MCU deep-sleep

* Revert "Attempt 2: Send PMREQ with duration 0 on MCU deep-sleep"

This reverts commit 8b697cd2a4.

* Revert "Attempt: Send PMREQ with duration 0 on MCU deep-sleep"

This reverts commit 9d29ec7603.

* Remove unused notifyGPSSleep Observable
Handled with notifyDeepSleep, and enable() / disable()

* WIP: simplify GPS power management
An initial attempt only.

* Honor #3e9e0fd

* No-op when moving between GPS_IDLE and GPS_ACTIVE

* Ensure U-blox GPS is awake to receive indefinite sleep command

* Longer pause when waking U-blox to send sleep command

* Actually implement soft and hard sleep..

* Dynamically estimate the threshold for GPS_HARDSLEEP

* Fallback to GPS_HARDSLEEP, if GPS_SOFTSLEEP unsupported

* Move "excessive search time" behavior to scheduler class

* Minor logging adjustments

* Promote log to warning

* Gratuitous buffer clearing on boot

* Fix inverted standby pin logic
Specifically the standby pin for L76B, L76K and clones
Discovered during T-Echo testing: totally broken function, probe method failing.

* Remove redundant pin init
Now handled by setPowerState

* Replace max() with if statements
Avoid those platform specific implementations..

* Trunk formatting
New round of settings.json changes keep catching me out, have to remember to re-enable my "clang-format" for windows workaround.

* Remove some asserts from setPowerState
Original aim was to prevent sending a 0 second PMREQ to U-blox hardware as part of a timed sleep (GPS_HARDSLEEP, GPS_SOFTSLEEP). I'm not sure this is super important, and it feels tidier to just allow the 0 second sleeptime here, rather than fudge the sleeptime further up.

* Fix an error determining whether GPS_SOFTSLEEP is supported

* Clarify a log entry

* Set PIN_STANDBY for MCU deep-sleep
Required to reach TTGO's advertised 0.25mA sleep current for T-Echo. Without this change: ~6mA.
2024-07-11 15:26:43 +12:00
github-actions[bot]
11bca437fd
[create-pull-request] automated change (#4263)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-07-10 15:15:57 -05:00
Ben Meadors
ba8d17b9c1 Trunk fmt 2024-07-09 12:16:56 -05:00
github-actions[bot]
9ad0addbbf
[create-pull-request] automated change (#4259)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-07-09 12:07:23 -05:00
Aaron.Lee
1626667400
Add Heltec new boards. (#4226)
* Add Heltec new boards

* Update variant.h

disable RTC by default

* Add Heltec New boards

* Add Heltec new boards

* Update Heltec Mesh Node definition.

* Update Heltec Vision Mater E290
2024-07-09 11:56:57 -05:00
Tom Fifield
d97e6b86b8
Sync Wio lr1110 refresh with master (#4251)
* Fix protobuf structs handling (#4140)

* Fix protobuf structs handling

* Log instead of assert

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* BLE based logging (#4146)

* WIP log characteristic

* Bluetooth logging plumbing

* Characteristic

* Callback

* Check for nullptr

* Esp32 bluetooth impl

* Formatting

* Add thread name and log level

* Add settings guard

* Remove comments

* Field name

* Fixes esp32

* Open it up

* Whoops

* Move va_end past our logic

* Use `upload_protocol = esptool` as with the other heltec devices instead of `esp-builtin` (#4151)

* Standardize lat/lon position logs (#4156)

* Standardize lat/lon position logs

* Missed sone and condensed logs

* [create-pull-request] automated change (#4157)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Pause BLE logging during want_config flow (#4162)

* Update NimBLE to 1.4.2 (#4163)

* Implement replies for all telemetry types based on variant tag (#4164)

* Implement replies for all telemetry types based on variant tag

* Remove check for `ignoreRequest`: modules can set this, don't need to check

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Esptool is better

* Explicitly set characteristic

* fix INA3221 sensor (#4168)

- pass wire to begin()
- remove redundant setAddr() (already set in header)

* Show compass on waypoint frame; clear when waypoint deleted (#4116)

* Clear expired or deleted waypoint frame

* Return 0 to CallbackObserver

* Add a missing comment

* Draw compass for waypoint frame

* Display our own waypoints

* [create-pull-request] automated change (#4171)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Add semihosting support for nrf52 devices (#4137)

* Turn off vscode cmake prompt - we don't use cmake on meshtastic

* Add rak4631_dap variant for debugging with NanoDAP debug probe device.

* The rak device can also run freertos (which is underneath nrf52 arduino)

* Add semihosting support for nrf52840 devices
Initial platformio.ini file only supports rak4630
Default to non TCP for the semihosting log output for now...
Fixes https://github.com/meshtastic/firmware/issues/4135

* fix my botched merge - keep board_level = extra flag for rak3631_dbg

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* [create-pull-request] automated change (#4174)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Display alerts (#4170)

* Move static functions into Screen.h, show compass during calibration

* Move to _fontHeight macro to avoid collision

* Move some alert functions to new alert handler

* Catch missed reboot code

* ESP32 fixes

* Bump esp8266-oled-ssd1306

* Fixes for when a device has no screen

* Use new startAlert(char*) helper class

* Add EINK bits back to alert handling

* Add noop class for no-display devices

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Send file system manifest up on want_config (#4176)

* Send file system manifest up on want_config

* Platform specific methods

* Helps to actually make the change

* Clear

* tell vscode, if formatting, use whatever our trunk formatter wants (#4186)

without this flag if the user has set some other formatter (clang)
in their user level settings, it will be looking in the wrong directory
for the clang options (we want the options in .trunk/clang)

Note: formatOnSave is true in master, which means a bunch of our older
files are non compliant and if you edit them it will generate lots of
formatting related diffs.  I guess I'll start letting that happen with
my future commits ;-).

* fix the build - would loop forever if there were no files to send (#4188)

* Show owner.short_name on boot (and E-Ink sleep screen) (#4134)

* Show owner.short_name on boot and sleep screen (on e-ink)

* Update Screen.cpp - new line for short_name

Boot screen short_name now below the region setting.
Looks better on small screens.

* Draw short_name on right

---------

Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* nrf52 soft device will watchdog if you use ICE while BT on... (#4189)

so have debugger disable bluetooth.

* correct xiao_ble build preventing sx1262 init (#4191)

* Force a compile time failur if FromRadio or ToRadio get larger than (#4190)

a BLE packet size. We are actually very close to this threshold so
important to make sure we don't accidentally pass it.

* Clear vector after complete config state (#4194)

* Clear after complete config

* Don't collect . entries

* Log file name and size

* [create-pull-request] automated change (#4200)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Make the logs Colorful! (#4199)

* Squash needlessly static functions (#4183)

* Trim extra vprintf and filter for unprintable characters

* Deprecate Router Client role (and make it Client) (#4201)

* [create-pull-request] automated change (#4205)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Move waypoint (#4202)

* Move waypoint screen draw into the waypoint module

* Get the observer set up for the waypoint screen draw

* Static squashing: screen dimensions
Macros moved back to Screen.cpp, as a band-aid until we eventually move all those static functions into the Screen class.

* Move getCompassDiam into Screen class
(supress compiler warnings)
At this stage, the method is still static, because it's used by drawNodeInfo, which has no tidy reference to our screen instance.
This is probably just another band-aid until these static functions all move.

* Use new getCompassDiam function in AccelerometerThread

* Properly gate display code in WaypointModule

---------

Co-authored-by: Todd Herbert <herbert.todd@gmail.com>

* Fix flakey phone api transition from file manifest to complete (#4209)

* Try fix flakey phone api transition from file manifest to complete

* Skip

* enable colors in platformio serial monitor (#4217)

* When talking via serial, encapsulate log messages in protobufs if necessary (#4187)

* clean up RedirectablePrint::log so it doesn't have three very different implementations inline.

* remove NoopPrint - it is no longer needed

* when talking to API clients via serial, don't turn off log msgs instead encapsuate them

* fix the build - would loop forever if there were no files to send

* don't use Segger code if not talking to a Segger debugger

* when encapsulating logs, make sure the strings always has nul terminators

* nrf52 soft device will watchdog if you use ICE while BT on...
so have debugger disable bluetooth.

* Important to not print debug messages while writing to the toPhone scratch buffer

* don't include newlines if encapsulating log records as protobufs

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* [create-pull-request] automated change (#4218)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Fix SHT41 support (#4222)

* Add SHT41 Serial to I2c Detection Code

On the Seeed Wio-WM1110 Dev Kit board, the SHT41 chip was being
incorrectly detected as SHT31.

This patch adds the necessary serial number for the SHT41 chip to
be correctly detected.

fixes meshtastic/firmware#4221

* Add missing sensor read for SHT41

* Typo fix in logs - mhz - MHz (#4225)

As reported by karamo, a few different places in our logs had
incorrect capitalization of MHz.

fixes meshtastic/firmware#4126

* New new BLE logging characteristic with LogRecord protos  (#4220)

* New UUID

* New log radio characteristic with LogRecord protobuf

* LogRecord

* Merge derp

* How did you get there

* Trunk

* Fix length

* Remove assert

* minor cleanup proposal (#4169)

* MESHTASTIC_EXCLUDE_WIFI and HAS_WIFI cleanup...
Our code was checking HAS_WIFI and the new MESHTASTIC_EXCLUDE_WIFI
flags in various places (even though EXCLUDE_WIFI forces HAS_WIFI
to 0).  Instead just check HAS_WIFI, only use EXCLUDE_WIFI inside
configuration.h

* cleanup: use HAS_NETWORKING instead of HAS_WIFI || HAS_ETHERNET
We already had HAS_NETWORKING as flag in MQTT to mean 'we have
tcpip'.  Generallize that and move it into configuration.h so that
we can use it elsewhere.

* Use #pragma once, because supported by gcc and all modern compilers
instead of #ifdef DOTHFILE_H etc...

---------

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>

* Add PowerMon support (#4155)

* Turn off vscode cmake prompt - we don't use cmake on meshtastic

* Add rak4631_dap variant for debugging with NanoDAP debug probe device.

* The rak device can also run freertos (which is underneath nrf52 arduino)

* Add semihosting support for nrf52840 devices
Initial platformio.ini file only supports rak4630
Default to non TCP for the semihosting log output for now...
Fixes https://github.com/meshtastic/firmware/issues/4135

* powermon WIP (for https://github.com/meshtastic/firmware/issues/4136 )

* oops - mean't to mark the _dbg variant as an 'extra' board.

* powermon wip

* Make serial port on wio-sdk-wm1110 board work
By disabling the (inaccessible) adafruit USB

* Instrument (radiolib only for now) lora for powermon
per https://github.com/meshtastic/firmware/issues/4136

* powermon gps support
https://github.com/meshtastic/firmware/issues/4136

* Add CPU deep and light sleep powermon states
https://github.com/meshtastic/firmware/issues/4136

* Change the board/swversion bootstring so it is a new "structured" log msg.

* powermon wip

* add example script for getting esp S3 debugging working
Not yet used but I didn't want these nasty tricks to get lost yet.

* Add PowerMon reporting for screen and bluetooth pwr.

* make power.powermon_enables config setting work.

* update to latest protobufs

* fix bogus shellcheck warning

* make powermon optional (but default enabled because tiny and no runtime impact)

* tell vscode, if formatting, use whatever our trunk formatter wants
without this flag if the user has set some other formatter (clang)
in their user level settings, it will be looking in the wrong directory
for the clang options (we want the options in .trunk/clang)

Note: formatOnSave is true in master, which means a bunch of our older
files are non compliant and if you edit them it will generate lots of
formatting related diffs.  I guess I'll start letting that happen with
my future commits ;-).

* add PowerStress module

* nrf52 arduino is built upon freertos, so let platformio debug it

* don't accidentally try to Segger ICE if we are using another ICE

* clean up RedirectablePrint::log so it doesn't have three very different implementations inline.

* remove NoopPrint - it is no longer needed

* when talking to API clients via serial, don't turn off log msgs instead encapsuate them

* fix the build - would loop forever if there were no files to send

* don't use Segger code if not talking to a Segger debugger

* when encapsulating logs, make sure the strings always has nul terminators

* nrf52 soft device will watchdog if you use ICE while BT on...
so have debugger disable bluetooth.

* Important to not print debug messages while writing to the toPhone scratch buffer

* don't include newlines if encapsulating log records as protobufs

* update to latest protobufs (needed for powermon goo)

* PowerStress WIP

* fix linter warning

* Cleanup buffer

* Merge hex for wm1110 target(s)

* Only sdk

* Sudo

* Fix exclude macros (#4233)

* fix MESHTASTIC_EXCLUDE_BLUETOOTH

* fix HAS_SCREEN=0

* fix MESHTASTIC_EXCLUDE_GPS

* fix typo in build-nrf52.sh (#4231)

chmod is the command, '+x' is the argument.

* Tidy Wireless Paper variant files (#4238)

* Quick tidy of pins_arduino.h
Matches requests made at https://github.com/meshtastic/firmware/pull/4226#discussion_r1664183480)

* Tidy variant.h

* Change deprecated ADC attenuation parameter
From 11dB to 12dB. Resolves compiler warning. Allegly, no impact on function: `This is deprecated, it behaves the same as `ADC_ATTEN_DB_12`

* Updated raspbian CI to update apt repository ahead of libbluetooth. (#4243)

* Fix BLE logging on nrf52 (#4244)

* allow ble logrecords to be fetched either by NOTIFY or INDICATE ble types

This allows 'lossless' log reading.  If client has requested INDICATE
(rather than NOTIFY) each log record emitted via log() will have to fetched
by the client device before the meshtastic node can continue.

* Fix serious problem with nrf52 BLE logging.
When doing notifies of LogRecords it is important to use the
binary write routines - writing using the 'string' write won't work.
Because protobufs can contain \0 nuls inside of them which if being
parsed as a string will cause only a portion of the protobuf to be sent.
I noticed this because some log messages were not getting through.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Fix build when HAS_NETWORKING is false on nrf52 (#4237)

(tested on a rak4631 by setting HAS_ETHERNET false when shrinking
image)

* If `toPhoneQueue` is full, still increment `fromNum` to avoid client never getting packets (#4246)

* Update to SoftDevice 7.3.0 for wio-sdk-wm1110 and wio-tracker-wm1110 (#4248)

* Update variant.h

* Update wio-tracker-wm1110.json

* Update wio-sdk-wm1110.json

* Update platformio.ini

* Update platformio.ini

* Add files via upload

* Add files via upload

* Update variant.h

---------

Co-authored-by: Mike <mikhael.skvortsov@gmail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Mike G <mkgin@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com>
Co-authored-by: Warren Guy <5602790+warrenguy@users.noreply.github.com>
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
Co-authored-by: geeksville <kevinh@geeksville.com>
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
Co-authored-by: Alexander <156134901+Dorn8010@users.noreply.github.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: quimnut <github@dopegoat.com>
Co-authored-by: Manuel <71137295+mverch67@users.noreply.github.com>
Co-authored-by: Agent Blu, 006 <blu006@ucr.edu>
Co-authored-by: Mark Trevor Birss <markbirss@gmail.com>
2024-07-08 06:03:23 -05:00
Tom Fifield
deb7c274c4
Cleanup NRF s140 Softdevice variants (#4252)
Note: This idea is originally from @caveman99 and should be
credited as such. Submitting as a separate PR so the work in
meshtastic/firmware#4148 can be a bit cleaner and Seeed boards
can build while that work is ongoing.

The nrf52 boards that depend on the v7 softdevice all use the same
code and linker files. Rather than duplicate the code, keep it
all together with the platform.
2024-07-08 06:02:05 -05:00
GUVWAF
86ca81b555
If toPhoneQueue is full, still increment fromNum to avoid client never getting packets (#4246) 2024-07-07 09:06:42 -05:00
geeksville
f59d98482f
Fix build when HAS_NETWORKING is false on nrf52 (#4237)
(tested on a rak4631 by setting HAS_ETHERNET false when shrinking
image)
2024-07-07 07:08:49 -05:00
geeksville
27dfe10689
Fix BLE logging on nrf52 (#4244)
* allow ble logrecords to be fetched either by NOTIFY or INDICATE ble types

This allows 'lossless' log reading.  If client has requested INDICATE
(rather than NOTIFY) each log record emitted via log() will have to fetched
by the client device before the meshtastic node can continue.

* Fix serious problem with nrf52 BLE logging.
When doing notifies of LogRecords it is important to use the
binary write routines - writing using the 'string' write won't work.
Because protobufs can contain \0 nuls inside of them which if being
parsed as a string will cause only a portion of the protobuf to be sent.
I noticed this because some log messages were not getting through.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-07-07 06:50:47 -05:00
Tom Fifield
2df8093fef
update SD_FLASH_SIZE to 0x27000 (#4232)
The 7.3.0 softdevice needs the extra 1000 :)
2024-07-05 09:02:55 -05:00
Manuel
ae420dcd21
Fix exclude macros (#4233)
* fix MESHTASTIC_EXCLUDE_BLUETOOTH

* fix HAS_SCREEN=0

* fix MESHTASTIC_EXCLUDE_GPS
2024-07-05 08:58:16 -05:00
Ben Meadors
4b82634d1a Cleanup buffer 2024-07-03 22:19:01 -05:00
geeksville
8bca3e168d
Add PowerMon support (#4155)
* Turn off vscode cmake prompt - we don't use cmake on meshtastic

* Add rak4631_dap variant for debugging with NanoDAP debug probe device.

* The rak device can also run freertos (which is underneath nrf52 arduino)

* Add semihosting support for nrf52840 devices
Initial platformio.ini file only supports rak4630
Default to non TCP for the semihosting log output for now...
Fixes https://github.com/meshtastic/firmware/issues/4135

* powermon WIP (for https://github.com/meshtastic/firmware/issues/4136 )

* oops - mean't to mark the _dbg variant as an 'extra' board.

* powermon wip

* Make serial port on wio-sdk-wm1110 board work
By disabling the (inaccessible) adafruit USB

* Instrument (radiolib only for now) lora for powermon
per https://github.com/meshtastic/firmware/issues/4136

* powermon gps support
https://github.com/meshtastic/firmware/issues/4136

* Add CPU deep and light sleep powermon states
https://github.com/meshtastic/firmware/issues/4136

* Change the board/swversion bootstring so it is a new "structured" log msg.

* powermon wip

* add example script for getting esp S3 debugging working
Not yet used but I didn't want these nasty tricks to get lost yet.

* Add PowerMon reporting for screen and bluetooth pwr.

* make power.powermon_enables config setting work.

* update to latest protobufs

* fix bogus shellcheck warning

* make powermon optional (but default enabled because tiny and no runtime impact)

* tell vscode, if formatting, use whatever our trunk formatter wants
without this flag if the user has set some other formatter (clang)
in their user level settings, it will be looking in the wrong directory
for the clang options (we want the options in .trunk/clang)

Note: formatOnSave is true in master, which means a bunch of our older
files are non compliant and if you edit them it will generate lots of
formatting related diffs.  I guess I'll start letting that happen with
my future commits ;-).

* add PowerStress module

* nrf52 arduino is built upon freertos, so let platformio debug it

* don't accidentally try to Segger ICE if we are using another ICE

* clean up RedirectablePrint::log so it doesn't have three very different implementations inline.

* remove NoopPrint - it is no longer needed

* when talking to API clients via serial, don't turn off log msgs instead encapsuate them

* fix the build - would loop forever if there were no files to send

* don't use Segger code if not talking to a Segger debugger

* when encapsulating logs, make sure the strings always has nul terminators

* nrf52 soft device will watchdog if you use ICE while BT on...
so have debugger disable bluetooth.

* Important to not print debug messages while writing to the toPhone scratch buffer

* don't include newlines if encapsulating log records as protobufs

* update to latest protobufs (needed for powermon goo)

* PowerStress WIP

* fix linter warning
2024-07-03 18:02:20 -05:00