Skip to content

Commit

Permalink
Sync Wio lr1110 refresh with master (#4251)
Browse files Browse the repository at this point in the history
* Fix protobuf structs handling (#4140)

* Fix protobuf structs handling

* Log instead of assert

---------

Co-authored-by: Ben Meadors <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 #4135

* fix my botched merge - keep board_level = extra flag for rak3631_dbg

---------

Co-authored-by: Ben Meadors <[email protected]>

* [create-pull-request] automated change (#4174)

Co-authored-by: thebentern <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: todd-herbert <[email protected]>
Co-authored-by: Ben Meadors <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* [create-pull-request] automated change (#4218)

Co-authored-by: thebentern <[email protected]>

* 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.

fixes #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.

fixes #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 <[email protected]>

* 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 #4135

* powermon WIP (for #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 #4136

* powermon gps support
#4136

* Add CPU deep and light sleep powermon states
#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 #4226 (comment))

* 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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: Ben Meadors <[email protected]>
Co-authored-by: Mike G <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: thebentern <[email protected]>
Co-authored-by: GUVWAF <[email protected]>
Co-authored-by: Warren Guy <[email protected]>
Co-authored-by: todd-herbert <[email protected]>
Co-authored-by: geeksville <[email protected]>
Co-authored-by: Jonathan Bennett <[email protected]>
Co-authored-by: Alexander <[email protected]>
Co-authored-by: Thomas Göttgens <[email protected]>
Co-authored-by: quimnut <[email protected]>
Co-authored-by: Manuel <[email protected]>
Co-authored-by: Agent Blu, 006 <[email protected]>
Co-authored-by: Mark Trevor Birss <[email protected]>
  • Loading branch information
17 people authored Jul 8, 2024
1 parent 2df8093 commit d97e6b8
Show file tree
Hide file tree
Showing 145 changed files with 29,832 additions and 838 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_raspbian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- name: Install libbluetooth
shell: bash
run: |
apt-get update -y
apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev
- name: Checkout code
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"trunk.enableWindows": true,
"files.insertFinalNewline": false,
"files.trimFinalNewlines": false,
"cmake.configureOnOpen": false
"cmake.configureOnOpen": false,
"[cpp]": {
"editor.defaultFormatter": "trunk.io"
}
}
2 changes: 1 addition & 1 deletion arch/esp32/esp32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ lib_deps =
${networking_base.lib_deps}
${environmental_base.lib_deps}
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
h2zero/NimBLE-Arduino@^1.4.1
h2zero/NimBLE-Arduino@^1.4.2
https://github.com/dbSuS/libpax.git#7bcd3fcab75037505be9b122ab2b24cc5176b587
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
Expand Down
15 changes: 12 additions & 3 deletions bin/build-nrf52.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

set -e

VERSION=`bin/buildinfo.py long`
SHORT_VERSION=`bin/buildinfo.py short`
VERSION=$(bin/buildinfo.py long)
SHORT_VERSION=$(bin/buildinfo.py short)

OUTDIR=release/

rm -f $OUTDIR/firmware*
rm -r $OUTDIR/* || true

# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio pkg update
platformio pkg update

echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
rm -f .pio/build/$1/firmware.*
Expand All @@ -29,6 +29,15 @@ cp $DFUPKG $OUTDIR/$basename-ota.zip

echo "Generating NRF52 uf2 file"
SRCHEX=.pio/build/$1/firmware.hex

# if WM1110 target, merge hex with softdevice 7.3.0
if (echo $1 | grep -q "wio-sdk-wm1110"); then
echo "Merging with softdevice"
sudo chmod +x ./bin/mergehex
bin/mergehex -m bin/s140_nrf52_7.3.0_softdevice.hex $SRCHEX -o .pio/build/$1/merged_fimware.hex
SRCHEX=.pio/build/$1/merged_fimware.hex
fi

bin/uf2conv.py $SRCHEX -c -o $OUTDIR/$basename.uf2 -f 0xADA52840

cp bin/device-install.* $OUTDIR
Expand Down
Binary file added bin/mergehex
Binary file not shown.
Loading

0 comments on commit d97e6b8

Please sign in to comment.