Commit Graph

8620 Commits

Author SHA1 Message Date
Ben Meadors
876993f095 No idea why trunk wants to disturb these PNGs but... 2024-10-08 05:34:41 -05:00
Ben Meadors
a05b009379 Posthumous tronkination 2024-10-08 05:33:38 -05:00
TheMalkavien
a0dd7b43d5
First version of a DeepSleep state for the RP2040 (#4976)
* Adding pico-extra utils

* RP2040 can now go to deepsleep

* First RP2040 DeepSleep code - TODO : do better and restore

* FIX RAK11310 compilation (revert SDK + missing defines)

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-10-08 05:24:37 -05:00
Ben Meadors
2e5399dbe4 De-conflict MLX90614_ADDR macro 2024-10-08 05:03:43 -05:00
jhps
37f294d0a6
In shutdown, on button press, wake back to application rather than into the loader. (#4997)
Suggested by lyusupov and implemented by todd-herbert.
https://github.com/meshtastic/firmware/issues/4651
2024-10-07 20:39:59 -05:00
Ben Meadors
411aedaf5d
Add health telemetry module (#4927)
* Add stub health telemetry module

* Add detection for MAX30102 Health Sensor

It lives on I2C bus at 0x57, which conflicts with an existing
sensor. Add code to check the PARTID register for its response 0x15
per spec.

* Add detection for MLX90614

An IR Temperature sensor suitable for livestock monitoring.

* Add libraries for MLX90614 and MAX30102 sensors

* Fix Trunk

* Add support for MLX90614 IR Temperature Sensor

* Add support for MAX30102 (Temperature)

* Make it build - our first HealthTelemetry on the mesh.

If a MAX30102 is connected, its temperature will be sent to the
mesh as HealthTelemetry.

* Add spo2 and heart rate calculations to MAX30102

* Switch MLX90614 to Adafruit library

Sparkfun was having fun with SDA/SCL variables which we can avoid
by switching to this highly similar library.

* Enable HealthTelemetry if MLX90614 detected

* Change MLX90614 emissivity for human skin.

* Add health screen!

* Remove autogenerated file from branch

* Preparing for review

* Fix MeshService master sync from before.

* Prepare for review

* For the americans

* Fix native build

* Fix for devices with no screen

* Remove extra log causing issues

---------

Co-authored-by: Tom Fifield <tom@tomfifield.net>
2024-10-07 19:50:44 -05:00
HarukiToreda
1c54388bb8
Toggle Bluetooth with Fn+b shortcut (#4977)
* Toggle Blutooth with Fn+b shortcut

Problem:
As many are aware, ESP32 devices are known for their high power consumption. For instance, the Heltec ESP32 V3 draws around 110mA when powered on with the screen active and connected to a phone via Bluetooth. The Bluetooth radio alone is responsible for approximately 50mA of that consumption. For keyboard-based standalone devices, which rarely need Bluetooth other than for changing settings, users were forced to keep Bluetooth on regardless of necessity. There was no way to toggle Bluetooth on or off without physically connecting the device to a computer via serial or using the admin channel, which required another node for access.

Solution:
I implemented a new feature that allows users to turn off Bluetooth on keyboard devices by pressing Fn+b and turn it back on when needed. This enhancement significantly improves power efficiency for these devices.

Result:
With Bluetooth off, the device now consumes only 55mA. When combined with Power Save mode, the consumption can drop as low as 11mA, a substantial reduction from the previous 110mA. Users can still easily reconnect to a phone using the shortcut when necessary, offering greater flexibility and extended battery life.

* Remove 1 reboot at least.

I was able to prevent a reboot using the disableBluetooth(); command, current tested at 47-55mA, it doesn't require a reboot to turn off, but it does need reboot to turn back on.

* Update CannedMessageModule.cpp
2024-10-07 15:16:10 -05:00
Mictronics
94ecbad904
Fix storage of admin key when installing default config. (#4995)
* 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.

* Admin key count needs to be set otherwise the key will be zero loaded after reset.

* Don't reset the admin key size when loading defaults. Preserve an existing key in config if possible.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-10-07 12:44:21 -05:00
Ben Meadors
53f189fff4
Remove has_rx * on installDefaultDeviceState (#4982) 2024-10-07 19:43:55 +08:00
Jonathan Bennett
93d874b013
set tz config from string if unset (#4979) 2024-10-07 05:09:19 -05:00
Tom Fifield
234a56446b
Add frequencies for Philippines (#4951)
There are three different frequencies available for Meshtastic
in the Philippines, each with pros and cons:
433 - 434.7 MHz <10 mW erp
868 - 869.4 MHz <25 mW erp
915 - 918 MHz <250 mW EIRP, no external antennna allowed

Philippines may also use LORA_24 unrestricted at up to 10mW, or up to
250mW if there is no external antennna.

Frequency rules in the Philippines are determined by aggregating the
information in laws, following the circulars referenced in the
[National Radio Frequency Allocation Table (NRFAT)](https://ntc.gov.ph/wp-content/uploads/2022/frequencyallocations/NRFAT_Rev_2020.pdf)
and then circulars that amend the circulars referenced in the NRFAT.
A full description of the regulatory basis can be found in the github issue:
https://github.com/meshtastic/firmware/issues/4948#issuecomment-2394926135

For 433MHz and 868MHz we refer to the Low Power Equipment rules for
"Non-specific Short Range Devices, Telemetry, Telecommand, Alarms,
Data In General and Other Similar Applications.".

For 915MHz and Wireless Data Network Services indoor device rules.

A device approved by the NTC is required for any use of Meshtastic
in the Philippines.

fixes https://github.com/meshtastic/firmware/issues/4948

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-10-06 09:31:13 -05:00
github-actions[bot]
830281803f
[create-pull-request] automated change (#4974)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-10-06 08:14:03 -05:00
Tom Fifield
bb9f003c24
Switch EnvironmentTelemetry to use UnitConversions (#4972)
We already have a central class for unit conversions, switch
EnvironmentTelemetry to that in preparation for HealthTelemetry.
2024-10-06 07:55:21 -05:00
Ben Meadors
001a845ac3
Upgrade nanopb (#4973) 2024-10-06 07:55:02 -05:00
Tom Fifield
7febb41727
Trunk format Screen.cpp (#4970) 2024-10-06 07:37:20 -05:00
github-actions[bot]
ad031dd69f
[create-pull-request] automated change (#4971)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-10-06 07:28:05 -05:00
Tom Fifield
ebc3a66d10
Which Module wants a UI Frame? (#4967)
Previously our debug message for screens blandly stated
"Module wants a UI Frame"

This patch replaces the word Module with the name of the Module
in need of a frame a frame, enhancing debugging ability.
2024-10-06 06:40:23 -05:00
Tom Fifield
553e572eb5
Coalesce duplicated method GetTimeSinceMeshPacket (#4968)
GetTimeSinceMeshPacket was duplicated in PowerTelemetry and
EnvironmentalTelemetry, albeit one had a cooler name than the other.

As we add HealthTelemetry, to avoid creating a third instance of
this method, let's move it somewhere that makese sense.

Adds a new method GetTimeSinceMeshPacket to MeshService and updates
EnvironmentTelemetry and PowerTelemetry to use it.
2024-10-06 06:40:06 -05:00
Ben Meadors
01df3ff477
Update generate-userprefs.yml 2024-10-06 05:26:04 -05:00
Ben Meadors
a3a97d3025
Start of generating json manifest of macros in userPrefs.h (#4946)
* Start of generating json manifest for userPrefs.h

* Just trunk this for now

* Add automatic generation of json manifest in GH action

* Trunk
2024-10-06 05:24:57 -05:00
medentem
0952d1b252
UserPrefs - Preconfigure up to 3 channels, GPS Mode (#4930)
* added up to 3 channels via userprefs

* added up to 3 channels via userprefs

* added up to 3 channels via userprefs

* trunk fmt

* Added USERPREFS for GPS MODE
2024-10-06 15:32:07 +08:00
Tom Fifield
8a370c5381
Revert "Revert "Remove unused Jlink monitoring files (#4953)" (#4959)" (#4966)
This reverts commit 783466f116.
2024-10-05 19:34:51 -05:00
Tom Fifield
a6f96cb9b4
Revert "Remove rak4631_epaper_onrxtx variant (#4958)" (#4963)
This reverts commit dac433ed2f.
2024-10-05 09:27:10 -05:00
github-actions[bot]
d650001caa
[create-pull-request] automated change (#4960)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-10-05 08:05:44 -05:00
Tom Fifield
0c90a2274f
Remove unused headers (#4954)
These files had existing since 2020 without being used/modified.
2024-10-05 05:39:13 -05:00
Tom Fifield
dac433ed2f
Remove rak4631_epaper_onrxtx variant (#4958)
Appears to be a testing variant of rak4631_epaper. Due to little
information available, let's remove it for now.
2024-10-05 05:27:15 -05:00
Tom Fifield
8acc9ccf5f
Remove support for pca10056-rc-clock (#4955)
In 2020, geeksville had a NRF52840-dk development board with a
busted oscilliator. Let's retire it from service :)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-10-05 05:26:54 -05:00
Tom Fifield
243421b2a5
Retire lora-relay boards (#4957)
The lora-relay boards were important pathfinders for nrf52
support some years back. They are no longer commonly produced and
there are now many nrf52 options on the market. Retire these
boards and associated variant.
2024-10-05 05:25:28 -05:00
Tom Fifield
6d6ed55ed7
Retire PPR Boards (#4956)
The Othernet project appears to have failed. Retire these
boards/variants.
2024-10-05 05:25:14 -05:00
Ben Meadors
783466f116
Revert "Remove unused Jlink monitoring files (#4953)" (#4959)
This reverts commit 55049ed547.
2024-10-05 05:24:59 -05:00
Tom Fifield
55049ed547
Remove unused Jlink monitoring files (#4953)
The NRF52 JLINK_MONITOR are unmodified copies of code from Nordic
(https://github.com/NordicPlayground/j-link-monitoring-mode-debugging ),
which are not used by our firmware and have not been touched in ~4 years.
2024-10-05 05:24:12 -05:00
Tom Fifield
e182ae75c2
Remove ancient .gitignore lines (#4952)
The files referenced here have not existed for some time.
2024-10-05 05:15:20 -05:00
Jonathan Bennett
7e946d15ca
Move ifndef to fix test (#4950) 2024-10-04 22:59:00 -05:00
Ben Meadors
c3b9d493b6
Leave the build epoch commented and uncomment when CI runs (#4943) 2024-10-04 15:07:10 -05:00
Jonathan Bennett
4db0c75c8e
Don't use a static decleration in a header file (#4944)
* Don't use a static decleration in a header file

* Actually add the rest of the commit
2024-10-04 12:06:02 -05:00
Ludovic BOUÉ
e7cfadacd8
Add Panel_ILI9342 to TFTDisplay.cpp (#4822)
* Add Panel_ILI9342 to TFTDisplay.cpp

[Panel_ILI9342](https://github.com/lovyan03/LovyanGFX/blob/master/src/lgfx/v1/panel/Panel_ILI9342.hpp)

* Add ILI9342_DRIVER to TFTDisplay.cpp

* Add ILI9342_DRIVER to Screen.cpp

* Add ILI9342_DRIVER to ScreenFonts.h

* Add ILI9342_DRIVER to main.cpp

* Add ILI9342_DRIVER to images.h

* Add ILI9342_DRIVER to NodeDB.cpp

* Add ILI9342 to PortduinoGlue.cpp

* Add ili9342 to PortduinoGlue.h

* Fix formatting

* Update Screen.cpp to add ILI9342_DRIVER

* Update TFTDisplay.cpp

* Update TFTDisplay.cpp

* Update Screen.cpp

* Update Screen.cpp

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Tom Fifield <tom@tomfifield.net>
2024-10-04 07:47:14 -05:00
GUVWAF
673fe294f3
Add rxDupe, txRelay and txRelayCanceled to LocalStats (#4936)
* Introduce `isFromUs()` and `isToUs()`

* Add rxDupe, txRelay and txRelayCanceled to LocalStats
2024-10-04 06:28:51 -05:00
gitbisector
236374491b
cleanupNeighbors() time difference fix (#4941) 2024-10-04 06:17:23 -05:00
HarukiToreda
d6f26c682d
Enabling Ve pin on T114 (#4940)
* Enabling Ve pin on T114

Problem:
The Ve pin was not enabled in the firmware, and it was supposed to control the power to the GPS via the GPS_EN pin. As a result, users were forced to rely on the 3.3V pin to power their additional peripherals, which caused a constant power draw from the battery, even when the node was in deep sleep mode.

Solution:
To resolve this, Todd_Hervert and I decided to remove the GPS power toggle after testing revealed that the GPS only consumes 1mA in soft sleep mode. This minimal power consumption allowed us to enable the Ve pin without causing significant battery drain. Additionally, we added a delay to the I2C initialization process, as the Ve pin requires a few milliseconds to stabilize, which could prevent some peripherals from booting up in time.

Result:

The GPS operates as usual, drawing only 1mA of power.
The keyboard and other peripherals attached to the Ve pin now power off correctly when the node is shut down.
The I2C check initiates without issues after the delay, allowing all peripherals to function smoothly.

* trunk format

---------

Co-authored-by: Tom Fifield <tom@tomfifield.net>
2024-10-04 06:15:59 -05:00
Jonathan Bennett
befc2ece6f
Add a Userprefs Timezone String, to be replaced in the web flasher (#4938)
* Add a Userprefs Timezone String, to be replaced in the web flasher

* Use a volatile char buffer for slipstreamed strings.

* More refinement
2024-10-03 20:51:22 -05:00
github-actions[bot]
b2b60eccdb
[create-pull-request] automated change (#4937)
Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com>
2024-10-03 14:54:18 -05:00
dependabot[bot]
07d4e6f5be
Bump protobufs from 62c4b00 to b419706 (#4934)
Bumps [protobufs](https://github.com/meshtastic/protobufs) from `62c4b00` to `b419706`.
- [Release notes](https://github.com/meshtastic/protobufs/releases)
- [Commits](62c4b0081c...b419706693)

---
updated-dependencies:
- dependency-name: protobufs
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-03 07:57:34 -05:00
github-actions[bot]
0a93261c06
[create-pull-request] automated change (#4926)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-10-02 06:14:55 -05:00
Ben Meadors
00f15459ec
Userprefs prefix macros for clarity and consistency (#4923)
* Convert userprefs macros to prefixed ones for clarity

* Fix key
2024-10-02 06:14:24 -05:00
todd-herbert
b8044c4983
Tweak dimensions for Canned Message Notifications (#4924) 2024-10-02 05:37:08 -05:00
Ben Meadors
18f12584ab
Consolidate and shrink down the re-used strings in logs (#4907)
* Consolidate and shrink down the re-used strings in GPS

* Condense all the things

---------

Co-authored-by: GUVWAF <thijs@havinga.eu>
2024-10-01 15:38:36 -05:00
github-actions[bot]
e1e7bbc420
[create-pull-request] automated change (#4918)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2024-10-01 14:04:44 -05:00
Thomas Göttgens
5f974d2961
save a couple of bytes (#4922) 2024-10-01 14:04:23 -05:00
Thomas Göttgens
cae2e43dc6 revert .... revert .... 2024-10-01 16:36:44 +02:00
Thomas Göttgens
0d175a918c misc library updates and compiler warnings, trunk upgrade 2024-10-01 16:02:10 +02:00