* Optimise GPS Baud Rate cycle
Previously, our baud rate cycled through one list twice.
There were some rarer baudrates in there, so this code
separates out those into a dedicated list that is only
run through if detection fails for common bauds. We also
only run through each baud rate once.
* Fix first time around bug
Would have always reset GPS baudrate every time.
* Add support for fixing GPS_BAUDRATE
If GPS_BAUDRATE is set in variant.h, the deployer knows something we
don't about the GPS. Used especially when the GPS is soldered to a board
in a commercial product :) If we see that, we don't try other baud rates
at all.
* Don't print blank lines in GPS_DEBUG.
* Try GPS_BAUDRATE first, not only.
* Fix spelling mistakes in comments
* Only use GPS_BAUDRATE if specified in variant.h
* Modify RareSerial Speeds based on FIXED or not.
* 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
* 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>
* 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>
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.
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
* 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
* 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>
* 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>
* 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>
* 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.
* 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
* 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>
REGULATORY_GAIN is the total system gain in dBm to subtract from the configured Tx power, to remain within regulatory ERP limit for non-licensed operators.
This value should be set in variant.h and is PA gain + antenna gain (if system ships with an antenna).
This is similar to antenna_gain/NL80211_ATTR_WIPHY_ANTENNA_GAIN/NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN setting in Linux Regulatory/OpenWrt/mac80211/nl80211/iw.
Signed-off-by: Andrew Yong <me@ndoo.sg>
Add REGULATORY_ prefix to LORA_REGIONCODE to prepare for more regulatory configuration options, and update comment block accordingly too.
Signed-off-by: Andrew Yong <me@ndoo.sg>
The main use case for this will be to create a custom Heltec WiFi LoRa 32 V3 SG_923 variant, which will be pre-flashed and sent for regulatory approval for retail sale.
Signed-off-by: Andrew Yong <me@ndoo.sg>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* basic identification of TCA9555
* recognise LSM6DS3 on alt address
* keep variant.h changes out of this PR
* 2nd attempt to keep variant.h changes out of this PR
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* started work on pulling in the unphone library and dependencies, to do e.g. power switch management and etc.; currently failing at Adafruit_ImageReader
* now compiles with unphoneLibrary included
* successfully pulled in unphone library to manage power switch and init vibe motor and etc.
doesnt print to serial tho...
* simplified the build a bit; when doing meshtastic do not depend on the MCCI lora libs etc., then also no need to config them via build flags
* version that doesnt trigger brownout
* cleaned up initVariant a little
* note re. GPS
* back to mesh upstream version
* this time we're back to mesh upstream version
* getting LSM6DS3TRC driver installed
* shake to wake works, set threshold quite low may need increasing
* whats the crack with these end of file changes?
* paramatize the wake threshold
* try to get the PR to just include real changes
* got the right config item and also not giving compiler messages
* moved the lib_deps for the LSM6DS3TRC driver from our variant platformio.ini to the main one in root so all boards have it
* stuupid error #define-ing
---------
Co-authored-by: Hamish Cunningham <hamish@gate.ac.uk>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* (3/3) Add variant for pico with waveshare and GPS hat, utilizing slow clock.
* Not everybody has Serial2
* Trunk
* Push it real gud
* No init
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>