We currently have 4 different places where we have the logic for
modifying LED state of the various types of Ambient LEDs,
ExternalNotificationModule::SetExternalOff
ExternalNotificationModule::SetExternalOn
AmbientLightingThread::setLighting
AmbientLightingThread::setLightingOff
This patch de-duplicates the methods in ExternalNotification to
a single method, using a boolean to toggle whether we're turning
things on or off.
* Add support for loading yaml from a config directory
* Add waveshare hats to the new config.d approach
* Move to available.d for module inactive module configs
* Update GPSUpdateScheduling.cpp
Default value is too short, resulting in unstable GPS locks on T1000-E (possibly others). Fix has been tested an confirmed working with no adverse effects, by multiple users. Also discussed at length on Discord
* Coerce minimum instead of hardcode
* config
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* T1000-E Peripherals
- enable intelligent charge controller signals
- enable Accelerometer
- enable internal I2C bus
- provide Power to Accelerometer
* POC Accelerometer Code (wakeScreen is moot for that device, just test if the driver works)
* fix building without the sensor
Implements an input driver utilising the MPR121 Touch IC and is compatible with common MPR121 keypad PCB's.
- Implements a "candybar" phone style 12-key keypad
- multiple taps to rotate through the character set
- longpress for navigation keys
- keymap to allow arbitrary routing of MPR121 pin to button configuration
- extendable to other key functions
- Integrates with the existing kbI2cBase implementation
- Works with CannedMessageModule Freetext mode
- Can be used with common MPR121 boards, such as https://www.amazon.com/MPR121-Capacitive-Keyboard-Buttons-Sensitive/dp/B083R89CHB/ref=sr_1_6
- Of use for PCB based radios, where some form of low surface area low component freetext input is required, but also without consuming too many IO pins.
- Tested on a T3S3 connected to Wire1 (Second) interface.
- Demonstration of functionality: https://youtu.be/UI6QP6nGvhY
After the recent change to move logging line breaks to a central
location, GPS_DEBUG is now emitting one character per line,
making the logs unusable.
Patch uses local strings and appends to collate and then print
in the right places.
Fixes https://github.com/meshtastic/firmware/issues/5099
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Triple Press on buttons toggles GPS enable/disable.
This enhancement plays a triple-beep so that users of devices with buzzers can get audible feedback about whether they have turned the GPS off or on. This is especially valuable for screenless devices such as the T1000E where it may not be immediately obvious the GPS has been disabled.
Determines if the given IP address is a private address, i.e. not routable on the public internet.
These are the ranges: 127.0.0.1, 10.0.0.0-10.255.255.255, 172.16.0.0-172.31.255.255, 192.168.0.0-192.168.255.255.
If so, allow MQTT publication the same as existing localhost support.
* ws85 updates
add temperature
add wantack
add high_priority
set lull to 0 if never set.
add the has_FIELD_NAME lines to ws85
* pbufs sync
* high insteaed of max reliability
* only set want_ack and high reliable if sensor_role set
* protobufs
---------
Co-authored-by: Tom Fifield <tom@tomfifield.net>
remove newline from logging statements in code. The LOG_* functions will now magically add it at the end.
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* Uplink DMs not to us if MQTT encryption enabled
* Only really need to try uplinking encrypted packet if MQTT encryption is enabled
* Add log about publishing nothing when packet is not decrypted and encryption_enabled is false
* Improve comment
Recently there have been reports of intermittent difficulties
detecting U-Blox chips. This patch proposes a new approach that should
be more reliable.
Previously we were fighting with NMEA messages to try and send binary
commands. We unusually also tried changing the Baud rate of U-Blox
chips, something we don't do with any other GPS.
It turns out U-Blox has another method to disable NMEA
messages. PUBX,40 is a text-based command, supported on all the
U-Blox versions we care about that can set the rate of NMEA messages
to zero.
This is what we attempt to do with all other GPS and it works quite
well.
So this patch alters the probe code to:
1. Remove UBX binary code to stop NMEA messages
2. Remove code that tries to reset UBX chips to 9600 baud
3. Add UBX proprietary text commands messages to stop the NMEA flood
4. Improve log strings sent to the user.
Tested on Ublox 6, Ublox 9, and Ublox 10 on multiple devices.
Also tested on several devices with
non-Ublox GPS to ensure it does not interfere with their detection
(heltec-wireless-tracker, wio-tracker-wm11110)
@allanmac noted we were not enabling QZSS on the UC6580.
QZSS is an augmentation service that runs on the same frequency
as GPS, so turning it on should not have any impact on usage other
than improving performance for users in the Asia Pacific.
Fixes https://github.com/meshtastic/firmware/issues/5009
* preliminary Othernet Dreamcatcher 2206 Support
Need to adapt to 2301 final version
* second target for latest revision
* preliminary Othernet Dreamcatcher 2206 Support
Need to adapt to 2301 final version
* second target for latest revision
* preliminary Othernet Dreamcatcher 2206 Support
Need to adapt to 2301 final version
* second target for latest revision
* address comments
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Tom Fifield <tom@tomfifield.net>
* 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>
* 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>
* 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
* 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>
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>
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.
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.
* 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
* * Adding the -Wcast-align compilation flag for
the rp2040.
* * Some rework to use a struct to access radio data
* Buffer will not be accessed by arithmetic pointer anymore
* * Remplace arithmetic pointer to avoid Warning
* * Avoid 2 little artitmetic pointer
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* When importing config, keep Bluetooth on and defer rebooting until config is committed
* One more place that was prematurely disabling Bluetooth
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* Potential fix for bad Rx performance on T1000-E
* validate and refactor RF switching, eliminate godmode
---------
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
* Ignore PhoneAPI packet if it's been seen
* ignoramus
* Also keep track of the last 20 packet IDs
* Fill
* Make this match the nimble one
* Add the log too
* Ignore zero ID packets
* Remove message entirely
* TRunkt
* Replace multiple potentially non aligned pointer dereference (#4855)
First step to fix some Crypto crashes or strange behaviors
* Makes the two Crypto byte buffers aligned (#4855)
Fix#4855, and probably multiple Crypto problems depending on hardware
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com>