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>
There is no EXTINT pin available on the Tdeck, which uses
the Ublox M10 GPS. Therefore our previous hack to use that pin
makes the GPS not work. That workaround was implemented to
fix sleep issues which have now since been fixed with the
state machine.
This patch restores the state prior to the hack, which is
known-working.
Additionaly, it was discovered that M10s hate it when you
try and save to non-extistent eeprom/SPI flash.
This patch creates a new SAVE command for the M10 that fixes
this issue.
Many thanks to @MisterC925 whose report and testing was
essential for this fix.
fixes https://github.com/meshtastic/firmware/issues/4625
Co-authored-by: Ken McGuire <kenm@paonia.com>
Based on #4745, PIN_WIRE1_SDA is the 'second' wire interface.
This pach amends the check to determine whether a device has two
wire interfaces should use PIN_WIRE1_SDA, rather than PIN_WIRE_SDA.
* Rename message length headers and set payload max to 255
* Add MESHTASTIC_PKC_OVERHEAD
* compare to MESHTASTIC_HEADER_LENGTH
---------
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
* Refactor and consolidate windowing logic
* Trunk
* Fixes
* More
* Fix braces and remove unused now variables.
There was a brace in src/mesh/RadioLibInterface.cpp that was breaking
compile on some architectures.
Additionally, there were some brace errors in
src/modules/Telemetry/AirQualityTelemetry.cpp
src/modules/Telemetry/EnvironmentTelemetry.cpp
src/mesh/wifi/WiFiAPClient.cpp
Move throttle include in WifiAPClient.cpp to top.
Add Default.h to sleep.cpp
rest of files just remove unused now variables.
* Remove a couple more meows
---------
Co-authored-by: Tom Fifield <tom@tomfifield.net>
* Minor fixes
It turns out setting a map value with the index notation causes
an lookup that can be avoided with emplace. Apply this to one line in
the StoreForward module.
Fix also Cppcheck-determined highly minor performance increase by
passing gpiochipname as a const reference :)
The amount of cycles used on this laptop while learning about these
callouts from cppcheck is unlikely to ever be more than the cycles
saved by the fixes ;)
* Update PortduinoGlue.cpp
* Simplify Ublox code
Ublox comes in a myriad of versions and settings. Presently our
configuration code does a lot of branching based on versions being
or not being present.
This patch adds version detection earlier in the piece and branches
on the set gnssModel instead to create separate setup methods for Ublox 6,
Ublox 7/8/9, and Ublox10.
Additionally, adds a macro to make the code much shorter and more
readable.
* Make trunk happy
* Make trunk happy
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* Honor TFT_MESH color if defined for Heltec T114 or T190
* Temporary: point lib_deps at fork of Heltec's ST7789 library
For demo only, until ST7789 is merged
* Update lib_deps; tidy preprocessor logic
* PMSA0031 sensors require ~3secs before coming up on I2C
As reported by @MALAONE1 and debugged by @shodan8192 , PMSA0031s
on a RAK4631 take 3 seconds before they can become detectable on I2c.
Add a delay(4000) before I2C scan if the air quality sensor pin
is defined.
Fixes https://github.com/meshtastic/firmware/issues/3690
* Remove 4 second wait and rescan during air quality init for the sensor
* works without but this triggers my OCD
---------
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
As discovered and tested by @Mictronics, default Serial FIFO size
on the Pico is 32bytes, which is not enough for GPS messages.
This patch increases the Serial GPS FIFO buffer size to 256
for the RP2040 Architecture
fixes https://github.com/meshtastic/firmware/issues/3989
QMC5883L and HMC5883L are 3-axis compasses which are often confused.
As reported by @Africmod, we had the wrong I2C address for the QMC5883L.
This patch fixes the address and adds its HMC5883L so we keep info
about both.
Fixes https://github.com/meshtastic/firmware/issues/4144
This getACK is used to look for ASCII responses, so print ASCII
when GPS_DEBUG is enabled.
This markedly assisted with recent AG3335 debugging. It works great
with other chips too (tested eg ATGM336H). Even UBLOX prints
understandable "GPTXT,01,01,01,PDTI inv format*35." responses.
Credit to bluebrolly. on discord.
* Added STK8xxxx Accelerometer chip
Added detection of STK8BA53 to I2C scanner.
Change the way and order MCP9808, lLISH3DH and STK8BA53 is detected since they all shares the same I2C address.
* Accelerometer support Radiomaster Bandit.
Enables tap to wake screen if enabled in config,
* Trunk
Trunk
* Add option to preserve private key for factory reset (config)
* Typo fix
* Copy the key in the right direction, and set the size.
* Don't set the key size back to 0 right after setting it to 32.
* Set the key size before using it to do a memcpy.
* Use the right key_size for backing up private_key
* Don't factoryReset() for a missing nodeDB
* Disable Bluetooth in AdminModule when resetting device settings or nodeDB to avoid race
* Add checks for valid objects before deinit bluetooth
* Add disableBluetooth to handleSetConfig, handleSetModuleConfig, and commit settings
---------
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
* All the debug
* Change `memccpy()` to `memcpy()`
* Brint all the bytes of the MAC Address from the NodeDB
* Check for blank MAC Address in ourown NodeDB entry
* One more `memccpy()`
* Clean-up debug log
---------
Co-authored-by: GUVWAF <thijs@havinga.eu>