Commit Graph
100 Commits
Author SHA1 Message Date
Jonathan Bennett ff89dca5b3 Add PKI indicator to printPacket 2024-08-13 18:45:40 -05:00
Jonathan Bennett 80fd121d87 Add meshtastic_Routing_Error_NO_CHANNEL 2024-08-13 18:45:40 -05:00
Jonathan Bennett f3fa8daedf Revert "Add Routing_Error_NONE"
This reverts commit e1985fa0f90db0cbc346db18cecbf3604f6973c1.
2024-08-13 18:45:40 -05:00
Jonathan Bennett bcd77c4523 Cleanup public_keys (#4450) 2024-08-13 18:45:40 -05:00
Jonathan Bennett 308c0a6bb8 Add Routing_Error_NONE 2024-08-13 18:45:40 -05:00
Jonathan Bennett 754db3f2bc Finish fixing config migrate 2024-08-13 18:45:40 -05:00
Jonathan Bennett c16f20de21 Make "Alloc an error" a LOG_WARN 2024-08-13 18:45:40 -05:00
Jonathan Bennett b4cbea1b3d Move security migrate to if has_security 2024-08-13 18:45:40 -05:00
Jonathan Bennett b91d66b436 Don't forget public_key.size in converting back 2024-08-13 18:44:27 -05:00
Jonathan Bennett 7537b55586 Ungoober oldestBoring 2024-08-13 18:44:27 -05:00
Jonathan Bennett 2d18130235 Don't goober public_key in Userlite conversion 2024-08-13 18:44:27 -05:00
Jonathan Bennett 67ddae2851 Add logic to nodeDB to prefer evicting boring nodes (#4441) 2024-08-13 18:44:27 -05:00
Jonathan Bennett e7dfabc20f Exclude position packets from PKI (at least for now) 2024-08-13 18:43:19 -05:00
Jonathan Bennett 185eb318ad Manual protobuf update 2024-08-13 18:43:19 -05:00
Jonathan Bennett c86a3200f0 Add missed function rename. (Thanks VSCode) 2024-08-13 18:43:19 -05:00
Jonathan Bennett c3aa56ef30 Refactor platform cryptography, add tests 2024-08-13 18:43:19 -05:00
Jonathan Bennett 192af05a25 Fix compile on STM32 2024-08-13 18:43:19 -05:00
Jonathan Bennett 26d0b2b477 Add DH25519 unit test 2024-08-13 18:43:19 -05:00
Jonathan BennettandBen Meadors b726792efd Re-implement PKI from #1509 (#4379)
* 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>
2024-08-13 18:43:19 -05:00
Jonathan Bennett c6a9edf8c7 Move printBytes to meshUtils (#4424) 2024-08-09 01:43:13 -05:00
Jonathan Bennett a7da3537e2 Adds MESHTASTIC_EXCLUDE_TZ option (#4423) 2024-08-09 00:52:31 -05:00
Jonathan BennettandBen Meadors 789e8f02bf Add more exclude options to save program ram/flash (#4408)
* Add PowerFSM Exclude option

* Add TEXTMESSAGE module exclude option

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-06 18:48:55 -05:00
Jonathan Bennett 7d00e1cef9 Output more useful log message when the NodeDB is full (#4389) 2024-08-04 18:52:10 -05:00
Jonathan Bennett 5453c495e2 Actually set the rand() seed for Portduino (#4380) 2024-08-03 13:12:22 -05:00
Jonathan Bennett d2ea430a3e Make SPI frequency and TOPHONE queue size configurable on Native (#4369)
* 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
2024-08-01 19:29:49 -05:00
Jonathan BennettandBen Meadors 1a1d545c38 Adds a userPrefs.h file, default blank, used for default settings for custom builds (#4325)
* 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>
2024-07-28 14:12:30 -05:00
Jonathan BennettandBen Meadors 300c3d32aa Just a bit of security hygiene. (#4313)
* 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>
2024-07-23 11:52:14 -05:00
Jonathan Bennett e59e50af0e Update build_raspbian_armv7l.yml --fix-missing 2024-07-10 14:42:29 -05:00
Jonathan Bennett 51d54a7d99 Update trunk.yaml 2024-07-10 14:39:41 -05:00
Jonathan Bennett 17c2d60b78 Update trunk.yaml, fix whitespace 2024-07-10 12:47:34 -05:00
Jonathan BennettandTodd Herbert b5d7718319 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>
2024-06-29 21:16:07 -05:00
Jonathan Bennett 6f3d7ca4d2 Trim extra vprintf and filter for unprintable characters 2024-06-28 23:30:39 -05:00
Jonathan Bennett ca969e26a5 Squash needlessly static functions (#4183) 2024-06-28 21:28:18 -05:00
Jonathan Bennett 5263c738f3 Make the logs Colorful! (#4199) 2024-06-28 20:10:41 -05:00
Jonathan BennettandBen Meadors 0425551341 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>
2024-06-25 11:26:02 -05:00
Jonathan Bennett 0852a170a3 Add support for BMX160/RAK12034 compass module (#4021) 2024-06-11 17:47:45 -05:00
Jonathan Bennett 54bccb898e Run tzset() and localtime() in getTZOffset() to ensure proper timezone offset (#3999)
* Run tzset() and localtime() in getTZOffset() to ensure proper timezone offset

* Try #2 to fix timezone/DST
2024-05-31 07:15:16 -05:00
Jonathan Bennett 8d90c496d0 Don't send potentially bogus timestamps with fixed location (#4001) 2024-05-31 07:14:33 -05:00
Jonathan Bennett 34553c9714 Bump portduino to pick up improvements to reboot() (#3975) 2024-05-26 06:42:23 -05:00
Jonathan Bennett 7bcb8f1fee Portduino: Catch the keyboard power button and initiate poweroff (#3953) 2024-05-22 07:54:06 -05:00
Jonathan Bennett d19607ba98 Look in the right place for .debs 2024-05-21 11:23:29 -05:00
Jonathan Bennett b829ee795d re-add .deb download to build 2024-05-21 10:37:26 -05:00
Jonathan Bennett ed8abea11b Add final debug call for Portduino reboot (#3945) 2024-05-21 00:09:33 -05:00
Jonathan Bennett 34aec70998 No need to build Raspbian arm64 twice: Part 2 2024-05-19 23:44:12 -05:00
Jonathan Bennett e8cdac8fa0 No need to build Raspbian arm64 twice 2024-05-19 23:31:33 -05:00
Jonathan Bennett afae3a488e Move Raspbian Arm64 to new build scheme 2024-05-19 23:29:43 -05:00
Jonathan Bennett 85e238ca76 Better names for .deb artifacts 2024-05-19 21:12:47 -05:00
Jonathan Bennett 45b05c9896 Revert "Use the right arch name for armv7l builds"
This reverts commit 7d1a925892.
2024-05-19 20:39:11 -05:00
Jonathan Bennett 7d1a925892 Use the right arch name for armv7l builds 2024-05-19 20:16:33 -05:00
Jonathan Bennett 72fb8a30a1 No sudo on debian docker 2024-05-19 18:18:03 -05:00
Jonathan Bennett 1c67f491d4 Add deps install for armv7l builds 2024-05-19 18:13:12 -05:00
Jonathan Bennett f7a4cd33b4 Add armv7 builds 2024-05-19 18:00:06 -05:00
Jonathan Bennett 84d3117a7a Lock Portduino to MAGIC_USB_BATTERY_LEVEL for now (#3894) 2024-05-18 12:21:35 -05:00
Jonathan Bennett a2284e3d52 DEBIAN is case sensitive 2024-05-17 03:32:11 -05:00
Jonathan Bennett 314d2e2da1 debconf expects absolute paths. 2024-05-17 02:34:18 -05:00
Jonathan Bennett 676319a9ca Implement chunked SPI transfer for ch341 (#3847)
This seems to fix the ch341 quirk where large packets fail to send. As it can be problematic for other radios, we gate it behind "ch341_quirk" in the config.
2024-05-10 04:36:20 -05:00
Jonathan Bennett 0c89aff0f6 Enable telemetry and power telemetry on the native target 2024-05-09 15:45:16 -05:00
Jonathan Bennett c009c0db1e Elimate non-text output for Portduino 2024-05-06 22:27:12 -05:00
Jonathan Bennett b69a1cada9 Portduino bump to pick up minor fix (#3770) 2024-05-02 13:54:50 -05:00
Jonathan Bennett 06e7d2b845 Track actual GPIO values, not just the enum values (#3768)
* Track actual GPIO values, not just the enum values

* trunk
2024-05-02 13:39:28 -05:00
Jonathan Bennett 45c1b46bd0 Move native to spi_host to indicate spidev for LovyanGFX 2024-05-01 13:21:23 -05:00
Jonathan Bennett 5095efc55f Pick up support for more than 64 GPIO lines under Portduino 2024-05-01 13:21:23 -05:00
Jonathan Bennett 30fbcabf84 add conffiles to .deb packaging (#3722) 2024-04-25 14:23:38 -05:00
Jonathan Bennett e3610a2eb1 Move to lovyangfx develop for Native 2024-04-24 13:17:43 -05:00
Jonathan BennettandBen Meadors 57d296e0db Add better support for the Adafruit PiTFT 2.8 for Native (#3704)
* Add better support for the Adafruit PiTFT 2.8 for Native

* native: Make touch i2c address configurable

* Bump portduino to pick up I2C features

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-04-23 14:18:51 -05:00
Jonathan BennettandBen Meadors d47e9bed19 Add multiple SPI devices for Radio, Display, and Touchscreen (#3638)
This changeset gives us the ability to specify a separate SPI device for the LoRa, Display, and Touchscreen. The changes in Portduino also add support for specifying a new SPI speed for each transaction. All together, this means that we can let the Linux OS manage the CS lines, and also get much faster SPI speeds, leading to better framerates.

* Add multiple SPI devices to put Radio, Display, and Touchscreen on each their own

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-04-17 14:25:52 -05:00
Jonathan Bennett 7d3175dc83 More useful default input device for Pi 400 (#3639) 2024-04-16 07:22:31 -05:00
Jonathan Bennett 5b52c31a76 Fix HAS_WIRE logic in main 2024-04-14 16:44:28 -05:00
Jonathan Bennett 00d4c011c7 Fix sx126x error log logic 2024-04-14 16:44:28 -05:00
Jonathan Bennett 1447148811 Make sure settingsStrings get initialized 2024-04-14 16:44:28 -05:00
Jonathan Bennett 0a246bfe9b Add more useful error output in radio interfaces (#3615)
* Add more useful error output in radio interfaces

* trunk
2024-04-14 00:29:42 -05:00
Jonathan Bennett f1a1834ee2 Update portduino to include SPI and setSetial fixes (#3611) 2024-04-13 16:14:15 -05:00
Jonathan Bennett 3f45c2d4f0 Fix another LOG_DEBUG message that should be LOG_ERROR (#3607) 2024-04-12 14:14:56 -05:00
Jonathan Bennett 11adfe05ce Drop unishox2 functions from Router (#3606) 2024-04-12 14:06:05 -05:00
Jonathan Bennett 917b739e62 Update TinyGPS version to un-derped commit 2024-04-12 11:29:08 -05:00
Jonathan Bennett 6de0363eea Pin RadioLib to 6.5.x (#3601) 2024-04-12 07:17:43 -05:00
Jonathan Bennett aa3280c18c add trunk ignore for docker chmod (#3568)
* add trunk ignore for docker chmod

* Fix incorrect comment type
2024-04-07 17:08:17 -05:00
Jonathan Bennett 68e657fd07 Actually fix Docker - hopefully 2024-04-07 15:52:43 -05:00
Jonathan Bennett 47b8f7b6c6 Don't forget to change directory owner 2024-04-07 14:34:19 -05:00
Jonathan Bennett fde20db95f move chmod -t to root section 2024-04-07 14:22:39 -05:00
Jonathan Bennett 40a7fd145a Update Dockerfile to remove sticky bit during build (#3567)
* Update Dockerfile to remove sticky bit during build

* no sudo?
2024-04-07 14:15:03 -05:00
Jonathan Bennett 03f60dcb49 Make instructions clearer in config.yaml comments (#3559) 2024-04-06 08:04:49 -05:00
Jonathan BennettandBen Meadors 8bb562c5fa Add spiTransfer function to Native to support Linux-managed CS (#3524)
* Add spiTransfer function to Native to support Linux-managed CS

* Trunk

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-04-01 18:31:36 -05:00
Jonathan Bennett 64fd866494 Make native honor HAS_SCREEN 0 (#3509)
This allows easier building of the native target without the LovyanGFX libraries.
2024-03-29 00:03:19 -05:00
Jonathan Bennett 1542afb847 Add libulfius2.7 to .deb debendencies (#3494) 2024-03-26 00:58:47 -05:00
Jonathan Bennett 9e8860d188 Crash fix and remove hard-coded path from PiWebServer (#3478)
* Remove hard-coded path from PiWebServer

* Bump portduino to pick up crash fix

* Remove PiWebServer non-ASCII debug output

* Trunk formatting
2024-03-23 12:29:05 -05:00
Jonathan BennettandBen Meadors 35754d661d Make MAX_NUM_NODES configurable in variant.h (#3453)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-03-21 18:26:37 -05:00
Jonathan Bennett 79cfb1e876 Revert "Bump actions to node 20 (#3461)" (#3462)
This reverts commit defeb8e52b.

As per https://github.com/actions/upload-artifact/issues/478 the new version of upload-artifact includes a breaking change.
2024-03-21 16:50:44 -05:00
Jonathan Bennett 907d075917 Revert previous attempt 2024-03-21 16:17:13 -05:00
Jonathan Bennett 9c88906acc Remove double run of build-raspbian 2024-03-21 16:14:45 -05:00
Jonathan Bennett defeb8e52b Bump actions to node 20 (#3461) 2024-03-21 15:24:57 -05:00
Jonathan Bennett fd26914d88 move nodeDB::init code into nodeDB constructor (#3455) 2024-03-21 13:14:02 -05:00
Jonathan BennettandBen Meadors dfcd0d14f6 Add MaxNodes to Native config (#3427)
* Add MaxNodes to Native

* It compiles...

* Convert nodedb to use new

* Closer but still broken.

* Finally working

* Remove unintended lines

* Don't include a pointer

* Capitalization matters.

* avoid rename in protocol regen

* When trimming the nodeDB, start with a cleanup

* Remove extra cleanupMeshDB() call for now

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-03-21 09:06:37 -05:00
Jonathan Bennett dced888492 Add precision_bit sto json 2024-03-09 15:34:01 -06:00
Jonathan Bennett bfce3938d2 Add openssl as dependency to meshtasticd .deb 2024-03-06 18:54:09 -06:00
Jonathan Bennett 46ad623785 Add webroot to .deb 2024-03-06 17:43:04 -06:00
e174328de3 Native Webserver (#3343)
* Added WebServer/WebServices for Native Linux Meshtastic and web gui

* Fix bug in login functionality

* Added customized config of portdunio.ini with LovyannGFX from marelab repro

* Compile Problem resolved with developer version of LovyanGFX.git

* Compile against dev version

* Fixes to fit into main branch

* Update variant.h, main.cpp, .gitignore, WebServer.cpp, esp32s2.ini, WebServer.h, ContentHandler.cpp, rp2040.ini, nrf52.ini, ContentHelper.cpp, Dockerfile, ContentHandler.h, esp32.ini, stm32wl5e.ini

* Added linux pi std /usr/include dir

* Adding /usr/innclude for Linux compile against native libs that are not hadled by platformio

* Review log level changes & translation

* Update Dockerfile

* Fix Typo & VFS ref. Part1

* Fix Typo & VFS ref.

* Dev Version for ulfius web lib

* Update platformio.ini

* Free VFS path string

* Remove unintended changes

* More unintentional changes

* Make the HTTP server optional on native

* Tune-up for Native web defaults

* Don't modify build system yet

* Remove more unneeded changes

---------

Co-authored-by: marc hammermann <marchammermann@googlemail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2024-03-06 16:23:04 -06:00
Jonathan Bennett 9d37a8d17f Stop Fiddling with Newlines! (#3341) 2024-03-06 13:09:46 -06:00
Jonathan Bennett 7ab9a94edb just off the coast of NULL Island isn't OK either. 2024-03-03 11:50:07 -06:00
Jonathan Bennett 146b5b557a UINT32_MAX is not the same as INT32_MAX 2024-02-26 01:03:03 -06:00