* 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
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.
(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.
* 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.
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
* 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
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.
* 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.
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.
* 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
* 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>
* 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>
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
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.
* 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>
* 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>
* feature: default to fuzzy GPS location on the Default Channel
* Default to 13
* 13 default
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* 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
* 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>
* 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>
* 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
* 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>
* 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
* 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>
* 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
* 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.
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 :)
* 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>
* 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
* 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>
* 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>
* 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.
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.
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>
* 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
* 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
* 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
* 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>
* 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>
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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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.
* 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>
* 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>
* 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
* 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!
* 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.
fixesmeshtastic/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.
fixesmeshtastic/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>
* 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>
* 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
* 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>
* 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
* 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>
* 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.
* 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.
fixesmeshtastic/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.
fixesmeshtastic/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>
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.
* 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>
* 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