Commit Graph
100 Commits
Author SHA1 Message Date
geeksville 8bca3e168d 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
2024-07-03 18:02:20 -05:00
geeksvilleandJonathan Bennett 8785adf6e4 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>
2024-07-03 17:39:09 -05:00
geeksvilleandBen Meadors 3219d65387 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>
2024-06-30 18:41:27 -05:00
geeksville ce58a23f9b 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.
2024-06-28 06:51:04 -05:00
geeksville f86a0e5228 nrf52 soft device will watchdog if you use ICE while BT on... (#4189)
so have debugger disable bluetooth.
2024-06-28 06:48:55 -05:00
geeksville 41d633bfd8 fix the build - would loop forever if there were no files to send (#4188) 2024-06-27 20:43:08 -05:00
geeksville 2cb6e7bd37 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 ;-).
2024-06-27 13:14:16 -05:00
geeksvilleandBen Meadors aa12e28568 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>
2024-06-24 10:27:37 -05:00
geeksville e050888b26 Don't complain about wierd platformio python 2024-06-20 12:28:43 -07:00
geeksville 9266a53f4e Make serial port on wio-sdk-wm1110 board work
By disabling the (inaccessible) adafruit USB
2024-06-20 09:49:15 -07:00
geeksville 96853aeeea Merge branch 'master' into pr-nrf52-dap 2024-06-16 22:25:58 -07:00
geeksville af36ee3a05 Merge branch 'pr-nrf52-dap' of https://github.com/geeksville/Meshtastic-esp32 into pr-nrf52-dap 2024-06-16 22:24:57 -07:00
geeksville c593e7ce56 Add rak4631_dap variant for debugging with NanoDAP debug probe device.
use board_level = extra
2024-06-16 22:21:54 -07:00
geeksville 15250a566a Turn off vscode cmake prompt - we don't use cmake on meshtastic (#4122) 2024-06-16 22:21:54 -07:00
geeksville 163a732ddc Turn off vscode cmake prompt - we don't use cmake on meshtastic (#4122) 2024-06-16 19:17:19 -05:00
geeksville ea69b999f9 Add rak4631_dap variant for debugging with NanoDAP debug probe device. 2024-06-16 15:19:29 -07:00
Kevin Hester e2992cd3b9 Merge branch 'master' into ublox-filter-dop-fix 2021-10-28 10:41:03 +08:00
Kevin Hester 4e5ac1ac07 Merge pull request #901 from a-f-G-U-C/rx-src-user
add the user as distinct message source - fixing #900
2021-10-28 10:40:51 +08:00
Kevin Hester 26415cf8e0 Merge branch 'master' into feature/environmental-ds18b20-sensor-support 2021-10-26 02:36:50 +08:00
Kevin Hester 4fb844bddd Merge pull request #869 from geeksville/dev
new release
2021-10-16 01:45:51 +08:00
Kevin Hester dce2fe43a5 1.2.46 2021-10-15 10:21:42 -07:00
Kevin Hester d54dad4225 update protobufs 2021-10-15 10:21:42 -07:00
Kevin Hester 91f4e17037 fix build for my hacked up nrf52 devboard (must use SD140) 2021-10-15 10:21:42 -07:00
Kevin Hester c597cd4a17 regen protos 2021-10-15 10:21:42 -07:00
Kevin Hester 08d8e764d7 bl602 notes 2021-10-15 10:21:42 -07:00
Kevin Hester e626edeffa todo update 2021-10-15 10:21:42 -07:00
Kevin Hester f9c3797397 Merge pull request #883 from osmanovv/fix-variants-radio-declaration
Fix radio module declaration for `NRF52_SERIES` in `variant.h`-files
2021-10-16 01:21:23 +08:00
Kevin Hester 8e45c5ecd7 Merge pull request #882 from ducky64/techofix
Fix for T-echo to not have Critical Error #3 on startup
2021-10-16 01:20:53 +08:00
Kevin Hester 83eb94126b Merge pull request #870 from osmanovv/meshtastic-diy
[Meshtastic DIY v1]
2021-10-12 23:41:29 +08:00
Kevin Hester 0a529dcaac Merge branch 'master' into meshtastic-diy 2021-10-12 23:18:17 +08:00
Kevin Hester 128a481259 Merge pull request #871 from claesg/master
Low battery level counter for NRF52
2021-10-12 23:12:36 +08:00
Kevin Hester 9679861b56 Merge branch 'master' into master 2021-10-12 11:58:52 +08:00
Kevin Hester 3a2120391e Merge pull request #872 from osmanovv/fix-plugin-return-type
Plugins refactoring: `handleReceived` return enumeration `ProcessMessage`
2021-10-12 11:58:33 +08:00
Kevin Hester 3d197d732c Merge branch 'master' into fix-plugin-return-type 2021-10-12 09:15:34 +08:00
Kevin Hester 5d6fc6d63e Merge branch 'master' into master 2021-10-12 09:14:18 +08:00
Kevin Hester 40505a23dc Merge pull request #881 from sachaw/master
Web server changes to support frontend
2021-10-12 09:13:18 +08:00
Kevin Hester 31e833ec59 Merge branch 'master' into master 2021-10-12 08:53:14 +08:00
Kevin Hester 2e65f577d8 Merge pull request #876 from syund/875-Create-geo-coordinates-class
[875] create geo coordinates class
2021-10-12 08:52:44 +08:00
Kevin Hester 89cd3fd73a Merge branch 'master' into 875-Create-geo-coordinates-class 2021-10-12 08:34:03 +08:00
Kevin Hester 9ef55e03be Merge pull request #880 from a-f-G-U-C/issue-879
issue 879 - discriminate between mesh and local messages
2021-10-12 08:32:11 +08:00
Kevin Hester b182819aff Merge pull request #862 from a-f-G-U-C/HAE-MSL-banner
Indicate HAE/MSL mode on startup
2021-09-18 16:27:39 -07:00
Kevin Hester a1b37d3407 Merge branch 'master' into HAE-MSL-banner 2021-09-18 15:59:54 -07:00
Kevin Hester b3777ef6f0 Merge pull request #864 from a-f-G-U-C/sanitize-course-value
input sanitization - TinyGPS course
2021-09-18 15:59:43 -07:00
Kevin Hester d54fecca4e Merge branch 'master' into sanitize-course-value 2021-09-18 15:38:00 -07:00
Kevin Hester 0f14ed0a6c Merge pull request #867 from syund/Show-fixed-GPS-coordinates-on-screen
[866] Show fixed coordinates on screen and indicate fixed GPS
2021-09-18 15:37:41 -07:00
Kevin Hester b3012b7ee5 Merge branch 'master' into Show-fixed-GPS-coordinates-on-screen 2021-09-18 14:44:10 -07:00
Kevin Hester 2f7e200bef Merge pull request #865 from osmanovv/sx1268-support
SX1268 module support and base class for SX126x module family
2021-09-18 14:43:55 -07:00
Kevin Hester b9443d87aa Merge pull request #850 from osmanovv/radiolib-sync-upstream
Radiolib sync upstream
2021-09-08 14:45:36 -07:00
Kevin Hester e351f35cf2 Merge branch 'master' into radiolib-sync-upstream 2021-09-08 14:08:25 -07:00
Kevin Hester be9d637c7c update platformio.ini to pull in latest RadioLib (with portduino fixes) 2021-09-08 14:08:02 -07:00
Kevin Hester 42986c852a Merge pull request #861 from a-f-G-U-C/NMEA-GPS-fixes
fixes from PR #851, #858 ported to NMEA GPS
2021-09-08 13:56:47 -07:00
Kevin Hester 6f763c6418 Merge pull request #858 from a-f-G-U-C/ublox-gps-fixes
UBlox GPS fixes
2021-09-06 17:47:11 -07:00
Kevin Hester c8269d67c3 Merge branch 'master' into radiolib-sync-upstream 2021-09-04 18:07:55 -07:00
Kevin Hester 21f3cc6f7a Merge pull request #851 from a-f-G-U-C/virtual-haslock
allow GPS modules to redefine GPS::hasLock()
2021-09-04 18:07:28 -07:00
Kevin Hester e3ed637942 reference the updated radilib sha256 2021-09-04 18:06:23 -07:00
Kevin Hester ccb4596299 Merge branch 'master' into radiolib-sync-upstream 2021-09-04 17:35:34 -07:00
Kevin Hester 2741de90e5 Merge branch 'master' into virtual-haslock 2021-09-04 17:34:41 -07:00
Kevin Hester adc51519fd Merge pull request #855 from srichs/gps-coordinate-formats
Added OLC and OS grid ref coordinates
2021-09-04 17:31:52 -07:00
Kevin Hester 8a7a3ec668 Merge pull request #847 from a-f-G-U-C/a-f-G-U-C-ublox-power
disable gps powercycle for small gps_update_interval
2021-09-01 10:46:39 -07:00
Kevin Hester f96d8bf645 Merge branch 'master' into a-f-G-U-C-ublox-power 2021-09-01 10:21:50 -07:00
Kevin Hester b1b3d9df6e Merge pull request #848 from srichs/gps-coordinate-formats
GPS Coordinate Formats
2021-09-01 10:21:27 -07:00
Kevin Hester 5fe3ec09de Merge pull request #840 from geeksville/dev
bugs
2021-08-18 12:35:49 -07:00
Kevin Hester 079843d777 add native build to bin zip 2021-08-18 11:10:20 -07:00
Kevin Hester bd7171a7a2 1.2.45 2021-08-18 10:57:26 -07:00
Kevin Hester eaa15076cd WIP debug logging over TCP 2021-08-18 10:31:30 -07:00
Kevin Hester 2fd74d8f47 cleanup ssl cert generation 2021-08-17 20:40:46 -07:00
Kevin Hester 0e91d39b27 don't shutdown bluetooth if we didn't start it 2021-08-17 20:40:13 -07:00
Kevin Hester 52d7a6b8e4 immediately reconnect to mqtt server on wifi reconnect 2021-08-17 19:59:56 -07:00
Kevin Hester 472e880280 fix race condition when starting web service 2021-08-17 17:04:09 -07:00
Kevin Hester 189889489b disable bluetooth while using wifi (esp32 drops networks otherwise) 2021-08-17 16:58:21 -07:00
Kevin Hester 0d758347af Fix rare assertion failure which could occur due to pending interrupts
* fix assertion failure
```
22:57:36 64409 [PositionPlugin] FIXME-update-db Sniffing packet
22:57:36 64409 [PositionPlugin] Delivering rx packet (id=0x5851f437 Fr0xa1 To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxtime=1628895456 priority=10)
22:57:36 64409 [PositionPlugin] Forwarding to phone (id=0x5851f437 Fr0xa1 To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxtime=1628895456 priority=10)
22:57:36 64409 [PositionPlugin] Update DB node 0x85f4da1, rx_time=1628895456
22:57:36 64409 [PositionPlugin] Plugin routing considered
22:57:36 64409 [PositionPlugin] Add packet record (id=0x5851f437 Fr0xa1 To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxtime=1628895456 priority=10)
22:57:36 64409 [PositionPlugin] Expanding short PSK #1
22:57:36 64409 [PositionPlugin] Installing AES128 key!
22:57:36 64409 [PositionPlugin] enqueuing for send (id=0x5851f437 Fr0xa1 To0xff, WantAck0, HopLim3 Ch0xb1 encrypted rxtime=1628895456 priority=10)
22:57:36 64409 [PositionPlugin] (bw=125, sf=12, cr=4/8) packet symLen=32 ms, payloadSize=22, time 2596 ms
22:57:36 64409 [PositionPlugin] txGood=6,rxGood=10,rxBad=0
22:57:36 64409 [PositionPlugin] AirTime - Packet transmitted : 2596ms
22:57:36 64409 [RadioIf] assert failed src/mesh/RadioLibInterface.cpp: 240, void RadioLibInterface::handleReceiveInterrupt(), test=isReceiving
```
2021-08-17 16:31:01 -07:00
Kevin Hester 3266d57cfb todo updates 2021-08-17 16:14:08 -07:00
Kevin Hester f2c9c5553c Merge pull request #839 from geeksville/dev
bugs
2021-08-15 10:52:51 -07:00
Kevin Hester bcdc42816b 1.2.44 2021-08-15 10:35:07 -07:00
Kevin Hester b04e313665 minor debug output 2021-08-15 10:34:57 -07:00
Kevin Hester 700e799125 check our host PC using the new nrf52 api 2021-08-12 22:07:30 -07:00
Kevin Hester a9f8080ee7 cope with race on available() vs read() found while looking at #838 2021-08-12 22:06:51 -07:00
Kevin Hester 9f450cb1c5 Merge pull request #837 from claesg/master
No SuperDeepSleep for RAK4631 and T-Echo
2021-08-12 17:01:28 -07:00
Kevin Hester 388f19da79 Merge branch 'master' into master 2021-08-12 16:32:52 -07:00
Kevin Hester 4f11598112 Merge pull request #831 from geeksville/dev
bugs
2021-08-12 16:32:37 -07:00
Kevin Hester bcb54b643f Merge branch 'master' into dev 2021-08-12 16:09:30 -07:00
Kevin Hester 04d3f44179 Updates to work with latest adafruit nrf52 arduino 2021-08-12 15:50:54 -07:00
Kevin Hester 6d2cd73599 show a max of four node screens in the scrolling list 2021-08-04 09:10:34 -07:00
Kevin Hester 057b04a88a treat RECEIVED_PACKET like PACKET_FOR_PHONE 2021-08-02 22:07:39 -07:00
Kevin Hester 28af18389b If MQTT connected don't let the board enter LS state 2021-08-02 21:34:14 -07:00
Kevin Hester 2af4c619e1 fix #801 (I think) we were sometimes dropping packets in light sleep
Because of failure to enter the NB state packets were not getting queued
for sending.
2021-08-02 21:07:32 -07:00
Kevin Hester 99d529be51 While connected to MQTT server, veto light-sleep (to keep wifi working) 2021-08-02 17:42:44 -07:00
Kevin Hester 39df7108a8 fix wifi hang when bad password used, cleanup wifi in general 2021-08-02 11:28:57 -07:00
Kevin Hester 72807f0fa0 CSE to cleanup mqtt addr setting 2021-08-02 10:50:55 -07:00
Kevin Hester 2fe11d4fe8 don't break strict-aliasing rules 2021-08-02 10:50:28 -07:00
Kevin Hester 596befff74 Fix invalid heap reference fixed by @flux242 2021-08-02 10:41:31 -07:00
Kevin Hester b2524ceaff Merge pull request #830 from dmitryelj/master
USE_SH1106 compilation error fix
2021-08-01 14:06:42 -07:00
Kevin Hester 5f323e8bd1 fix leakage of wifi password reported by @vodkin 2021-08-01 12:58:23 -07:00
Kevin Hester d40b66beac Allow plugins to write to the parsed protobuf (minimizes copies in some cases) 2021-08-01 12:58:23 -07:00
Kevin Hester 676a6f3bea Merge pull request #829 from audunf/mesh-packet-queue-priority
Drop lower priority packets when tx queue is full.
2021-08-01 10:40:13 -07:00
Kevin Hester 564262e75b Merge pull request #824 from geeksville/dev
1.2.43
2021-07-27 03:05:28 +08:00
Kevin Hester a405d81c46 1.2.43 2021-07-26 10:26:53 -07:00
Kevin Hester aac3143745 Merge remote-tracking branch 'mine/dev' into dev
# Conflicts:
#	version.properties
2021-07-26 10:14:46 -07:00
Kevin Hester bb396508a4 Merge pull request #822 from audunf/issue-108
Track recent packets in unordered_set
2021-07-26 04:53:13 +08:00
Kevin Hester 810740b156 Merge branch 'master' into issue-108 2021-07-26 04:31:05 +08:00