Compare commits

..

2227 Commits

Author SHA1 Message Date
Scott Powell
9f1a3eafcc Merge branch 'dev'
# Conflicts:
#	docs/cli_commands.md
2026-03-06 12:21:52 +11:00
Scott Powell
3fe2dd7f48 * ver 1.14.0 2026-03-06 12:20:04 +11:00
Scott Powell
5684b4f1b8 * LOOP_DETECT_MODERATE bug fix 2026-03-05 17:38:51 +11:00
Scott Powell
e233346bf0 * repeater: new "get/set loop.detect {off | minimal | moderate | strict }" 2026-03-05 16:26:09 +11:00
Liam Cottle
3031deb980 Merge pull request #1811 from robekl/docs_update_cli_commands
docs: correct CLI command forms and targeted typos
2026-03-05 15:31:32 +13:00
Liam Cottle
dc9e7abacc Merge pull request #1490 from mesher-de/feature-0hop-cli
Add CLI-command for zerohop advert
2026-03-05 15:24:48 +13:00
Liam Cottle
044c66e261 Merge pull request #1001 from kallanreed/fix_gps_debug_logging
Use correct macro for GPS logging test
2026-03-05 13:14:37 +13:00
Liam Cottle
3e5522fcde Merge pull request #1901 from weebl2000/fix-ikoka-handheld-build
Fix ikoka handheld build
2026-03-04 15:54:17 +13:00
Wessel Nieboer
c0c9c17cf5 and buildscript 2026-03-03 15:37:33 +01:00
Wessel Nieboer
780720c117 and board! 2026-03-03 15:37:33 +01:00
Wessel Nieboer
90fcd1043f Fix ikoka handheld build
The extends was wrong.
2026-03-03 15:37:32 +01:00
Liam Cottle
cdd3d5f34e Merge pull request #1841 from weebl2000/nit-prefs
prefs is 5 char length :nerd:
2026-03-04 01:39:55 +13:00
ripplebiz
7c594ebc50 Merge pull request #1743 from weebl2000/fixagcreset
fix agc reset on SX126x, SX1276 & LR11x0 chips
2026-03-03 22:19:34 +11:00
Liam Cottle
ba3d9e264e Merge pull request #1836 from weebl2000/fix-rak3401-sky66122-11-fem
Fix RAK3401 SKY66122-11 FEM control: enable CSD/CPS for proper PA/LNA operation
2026-03-03 23:51:42 +13:00
Liam Cottle
d7ad89046b Merge pull request #1633 from weebl2000/fix/gps-uart-power-leak
Fix GPS UART consuming +8mA when disabled (nRF52)
2026-03-03 23:26:58 +13:00
Liam Cottle
67779aded8 Merge pull request #1600 from weebl2000/heltec_deep_sleep_lna
Hold GC1109 PA_POWER during deep sleep for LNA RX wake
2026-03-03 23:20:22 +13:00
Liam Cottle
bbd621ba85 Merge pull request #1351 from weebl2000/heltec_wireless_tracker_gps
Support GPS properly on Heltec Wireless Tracker v1.x
2026-03-03 23:11:46 +13:00
ripplebiz
6431cd2d47 Merge pull request #1900 from wbijen/feature/contact-filter-by-hops
Add configurable max hops filter for auto-add contacts
2026-03-03 21:05:44 +11:00
Wouter Bijen
1d190ad944 Clamp max_hops to 64 to cover full protocol hop range (0-63) 2026-03-03 09:05:53 +01:00
Wouter Bijen
2cb08775c0 Clarify comment wording: 1 = direct (0 hops)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 08:40:17 +01:00
Wouter Bijen
c016db86d5 Address PR review: subtract-1 encoding and clamp max_hops
- Change > to >= so stored value 1 means direct/0-hop only (liamcottle)
- Clamp max_hops to 63 on write since getPathHashCount() caps at 63 (robekl)
- Update comments to reflect encoding: 0=no limit, 1=direct only, N=up to N-1 hops

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 08:37:22 +01:00
Wouter Bijen
00566741f6 Add configurable max hops filter for auto-add contacts
Filter auto-add of new contacts by hop count (issues #1533, #1546).
Setting is configurable from the companion app via extended
CMD_SET/GET_AUTOADD_CONFIG protocol (0 = no limit, 1-63 = max hops).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:41:41 +01:00
Wessel Nieboer
8a9a0dca5f Fix GPS +8mA power leak when disabled (nRF52)
On the T114, GPS_RESET (pin 38) is the same pin as PIN_3V3_EN.
MicroNMEALocationProvider::begin() sets pin 38 HIGH (powering the 3V3
rail) but stop() never set it back LOW, leaving the GPS module powered
even when disabled.

Assert reset pin in stop() to mirror begin(), and guard
_location->loop() behind gps_active check.

Fixes meshcore-dev/MeshCore#1628
2026-02-28 19:13:42 +01:00
Wessel Nieboer
59d9770ab9 Add GPS support Heltec Wireless Tracker v1.x
Pin mapping verified against HTIT-Tracker V0.5 schematic:
- GPIO35 (GPS_EN): N-ch MOSFET drives P-ch high-side switch, active HIGH
- GPIO36 (GPS_RST): hardware reset, active LOW
- GPIO33/34: UART TX/RX

Delegates power management to MicroNMEALocationProvider begin()/stop()
which independently controls GPS power via GPS_EN and shares VEXT with
the display through RefCountedDigitalPin.
2026-02-28 19:09:28 +01:00
Wessel Nieboer
9bae9d0ed2 fix comment, we know the band now after checking LR1110 user manual 2026-02-28 19:09:25 +01:00
Wessel Nieboer
85f764a114 Calibrate configured frequency for AGC reset 2026-02-28 19:09:25 +01:00
Wessel Nieboer
f54948e06d Also implement LR11x10 AGC reset
Similar to SX126x but simpler.
2026-02-28 19:09:25 +01:00
Wessel Nieboer
b2032e11b6 make it more dry 2026-02-28 19:09:25 +01:00
Wessel Nieboer
9106ab46e1 reset noise_floor sampling after agc reset 2026-02-28 19:09:25 +01:00
Wessel Nieboer
a2dc2eb50c when doing AGC reset, call Calibrate(0x7F)
1. warm sleep
2. wake to stdby
3. Calibrate(0x7F) to reset all internal blocks
4. re-apply DIO2 RF / boosted gain & register patch to make sure
everything is as it was
2026-02-28 19:09:25 +01:00
Wessel Nieboer
f81ec4b14c fix agc reset 2026-02-28 19:09:25 +01:00
Wessel Nieboer
49d8313501 Fix pin mapping & TX switch (it's DIO2) 2026-02-28 19:09:06 +01:00
Wessel Nieboer
5a5568ed56 Drive CTX low first 2026-02-28 19:09:06 +01:00
Wessel Nieboer
ac2aa03b09 Add SX126X_REGISTER_PATCH for RAK3401 2026-02-28 19:09:06 +01:00
Wessel Nieboer
70f1ad4aeb Fix RAK3401 SKY66122-11 FEM control: enable CSD/CPS for proper PA and LNA operation
The RAK13302 1W module uses a Skyworks SKY66122-11 front-end module with
three digital control pins (CSD, CTX, CPS) that must be actively driven
by the host MCU. The previous code only managed CTX (GPIO 31) — toggling
it for TX/RX — but never initialized CSD (GPIO 24) or CPS (GPIO 21),
leaving them floating with no pull-up/pull-down resistors on the PCB.

With floating CSD and CPS, the SKY66122 was in an undefined operating
mode:
- The 30 dB TX PA may not have been reliably engaging
- The 16 dB RX LNA was never reliably active, degrading receive
sensitivity
2026-02-28 19:09:06 +01:00
Wessel Nieboer
d9e67222f5 prefs is 5 char length :nerd: 2026-02-28 19:07:38 +01:00
Wessel Nieboer
2bb6f636a4 Add 1ms delay after powering PA (cold-boot) 2026-02-28 19:05:31 +01:00
Wessel Nieboer
329e408197 Hold GC1109 PA_POWER during deep sleep for LNA RX wake
The GC1109 FEM needs its VFEM_Ctrl pin held HIGH during deep sleep
to keep the LNA active, enabling proper RX sensitivity for
wake-on-packet. Without this, the LNA is unpowered during sleep
and RX wake sensitivity is degraded by ~17dB.

Release RTC holds in begin() after configuring GPIO registers
(not before) to ensure glitch-free pin transitions on wake.

Trade-off: ~6.5mA additional sleep current for significantly
improved wake-on-packet range.
2026-02-28 19:05:31 +01:00
fdlamotte
06ab9f7f6b Merge pull request #1871 from enricolorenzoni59/gps-sync-reply
`gps sync` reply: fill buffer with text
2026-02-28 07:45:19 -04:00
enricolorenzoni59
8ad17d1022 gps sync reply: fill buffer with text 2026-02-28 09:07:30 +00:00
Liam Cottle
eee42c5099 Merge pull request #1569 from IoTThinks/MCdev-Fixed-Incorrect-Release-of-RefCountedDigitalPin
Fixed RefCountedDigitalPin.h and SSD1306Display for Heltec v4
2026-02-28 17:35:17 +13:00
Scott Powell
b67decfba0 * bug fix: Packet::writeTo(), Packet::readFrom() 2026-02-26 15:36:21 +11:00
Scott Powell
ca81f645ed Merge branch 'multibyte-paths' into dev 2026-02-26 12:30:23 +11:00
ripplebiz
5280433098 Merge pull request #1820 from recrof/patch-1
Update default preset to EU/UK (Narrow)
2026-02-26 12:08:17 +11:00
Scott Powell
def01889aa Merge branch 'dev' into multibyte-paths 2026-02-25 17:11:51 +11:00
Scott Powell
8737c64fdb * Packet::copyPath() fix 2026-02-25 17:10:31 +11:00
Liam Cottle
eeae32b25d Merge pull request #1826 from dreirund/docs_-_fix-faq.md-bogous-last-tableofcontentsentry
docs/faq.md: Table of Contents: Remove bogous `[| | High Output | 22 dBm | 28 dBm | |](#--high-output--22-dbm--28-dbm--)`
2026-02-25 15:25:26 +13:00
Liam Cottle
1bde7de521 Merge pull request #1822 from dreirund/docs_-_add-more-other-projects
docs/faq.md: Section 5.14: Add more external projects, and categorise the section.
2026-02-25 15:18:15 +13:00
Liam Cottle
e6e87fb8ca Merge pull request #1838 from weebl2000/github_workflows_sanitycheck
Add basic sanity test github PR workflow
2026-02-25 14:52:10 +13:00
Wessel Nieboer
15cce12efd Add basic sanity test github PR workflow
Build a few generic variants to verify at least those compile. Can't
hurt.
2026-02-25 02:43:48 +01:00
dreirund
751a3e49be Merge pull request #1 from dreirund/docs_-_categorise-faq: "docs/faq.md: Categorising section 5.14. "Q: Are there are projects built around MeshCore?""
docs/faq.md: Categorising section 5.14. "Q: Are there are projects built around MeshCore?"
2026-02-24 18:21:36 +01:00
dreirund
ff72564bca docs/faq.md: Categorising section 5.14. "Q: Are there are projects built around MeshCore?".
In `[docs/faq.md](https://github.com/meshcore-dev/MeshCore/blob/main/docs/faq.md)`, the entries are now grouped by category.

This patch applies on top of https://github.com/meshcore-dev/MeshCore/pull/1822.
2026-02-24 18:19:50 +01:00
dreirund
b16adee4bb docs/faq.md: Table of Contents: Remove bogous [| | High Output | 22 dBm | 28 dBm | |](#--high-output--22-dbm--28-dbm--).
The table of contents of `docs/faq.md` had at the end a bogous entry  
```markdown
- [| | High Output | 22 dBm | 28 dBm | |](#--high-output--22-dbm--28-dbm--)
```

This patch removes that bogous entry.
2026-02-24 17:48:30 +01:00
dreirund
5e24d03a91 faq.md: Section 5.14: Added more external projects.
Added to section 5.14 "Are there are projects built around MeshCore?":

* awesome-meshcore
* meshcore-open
* MeshCore-Cardputer-ADV
* LunarCore
* MC-Term
* Meck
* Meshcore for Wio Tracker L1 Pro
* MeshCore map auto uploader
2026-02-24 13:26:30 +01:00
Scott Powell
f4748a7f9d * misc 2026-02-24 21:30:04 +11:00
Rastislav Vysoky
b777a7c635 Update default preset to EU/UK (Narrow) 2026-02-24 11:28:23 +01:00
Scott Powell
b14879ce2d * CMD_GET_ADVERT_PATH bug fix 2026-02-24 14:23:59 +11:00
Robert Ekl
b43319d1a4 docs: correct CLI command forms and targeted typos 2026-02-23 18:53:20 -06:00
Liam Cottle
f7c8cf1146 Merge pull request #1808 from callum5892/dev
Added build flags for M5Stack Unit C6L
2026-02-24 12:24:56 +13:00
callum5892
9f4eeeeceb Added build flags for M5Stack Unit C6L
Enabled USB-CDC on boot for M5Stack_Unit_C6L_companion_radio_usb to fix serial connection issues
2026-02-23 17:31:18 +00:00
Scott Powell
9d5c4865c3 * room server fix 2026-02-24 01:08:11 +11:00
Scott Powell
213d085012 * revert CMD_SEND_SELF_ADVERT, use _prefs.path_hash_mode 2026-02-24 00:08:13 +11:00
Scott Powell
45564bad9b * Dispatcher bug fixes 2026-02-23 23:51:30 +11:00
Scott Powell
5b0884ad2d * added CMD_SET_PATH_HASH_MODE 2026-02-23 21:08:22 +11:00
Scott Powell
e52d57c065 * companion: new pref: path_hash_mode (0..2)
* companion: new field in CMD_SET_OTHER_PARAMS, path_hash_mode
* companion: CMD_SEND_SELF_ADVERT, cmd_frame[1] now holds the path hash size (0 = zero hop, 1..3 = flood path hash size)
2026-02-23 18:26:56 +11:00
Scott Powell
a66773bac0 * CommonCLI: added "get/set path.hash.mode " 2026-02-23 14:25:19 +11:00
Scott Powell
05e7b682b9 Merge branch 'dev' into multibyte-paths 2026-02-23 13:11:36 +11:00
ripplebiz
9c318561da Merge pull request #1792 from ElectroMW/feature/t-beam-supreme-improvements
T-Beam Supreme - Make full use of board's 8MB Flash and add Companion WiFi target
2026-02-23 12:38:56 +11:00
ripplebiz
2e0fa3ec46 Merge pull request #1794 from accumulator/heltec_wireless_tracker_companion_usb
add companion usb build target for Heltec Wireless Tracker
2026-02-23 12:37:02 +11:00
ripplebiz
8ee4867397 Merge pull request #1795 from DanielNovak/fix-packetqueue-millis-wraparound
Fix millis() wraparound in PacketQueue time comparisons
2026-02-23 12:33:21 +11:00
Sam Koucha
5a885bffe4 Make full use of board's 8MB Flash and add companion WiFI target 2026-02-22 18:14:39 +00:00
Daniel Novak
011edd3c99 Fix millis() wraparound in PacketQueue time comparisons
PacketQueue::countBefore() and PacketQueue::get() use unsigned
comparison (_schedule_table[j] > now) to check if a packet is
scheduled for the future. This breaks when millis() wraps around
after ~49.7 days: packets scheduled just before the wrap appear
to be in the far future and get stuck in the queue.

Use signed subtraction instead, matching the approach already used
by Dispatcher::millisHasNowPassed(). This correctly handles the
wraparound for time differences up to ~24.8 days in either
direction, well beyond the maximum queue delay of 32 seconds.
2026-02-22 18:01:55 +01:00
Sander van Grieken
3dc14976a0 add companion usb build target for Heltec Wireless Tracker 2026-02-22 17:57:36 +01:00
Scott Powell
3e76161e9c * refactor of Contact/Client out_path_len (stored in files), from signed to unsigned byte (+2 squashed commits)
Squashed commits:
[f326e25] * misc
[fa5152e] * new 'path mode' parsing in Dispatcher
2026-02-21 19:35:51 +11:00
ripplebiz
d05d6abab8 Merge pull request #1726 from weebl2000/fix-packet-pool-leak-queue-full
Fix packet pool leak when rx queue is full
2026-02-21 17:18:02 +11:00
ripplebiz
c2abe894c9 Merge pull request #1728 from oltaco/nrf52-bootloader-version
NRF52: Add get bootloader.ver command for NRF52
2026-02-21 12:56:52 +11:00
Liam Cottle
f903c50e9d Merge pull request #1758 from jeroenvermeulen/patch-1
Update admin password command description
2026-02-21 12:45:02 +13:00
Jeroen Vermeulen
246f5352d6 Update admin password command description
Tested in v1.13.
These commands don't work anymore:
```
get password
  -> ??: password
set password secret
  -> unknown config: password secret
```
This does work:
```
password secret
  -> password now: secret
```
2026-02-20 20:48:48 +01:00
Kevin Le
13d0dff918 Reverted to use GPIO 17, 18 as I2C for Heltec v4 repeater 2026-02-18 22:38:24 +07:00
Kevin Le
44b80d00c2 Disabled periph_power for Heltec v4's display 2026-02-18 22:32:01 +07:00
Kevin Le
f6603fe7a5 Set back PIN_VEXT_EN_ACTIVE=HIGH 2026-02-18 22:32:01 +07:00
Kevin Le
39fb2902ec Avoid negative _claims 2026-02-18 22:32:01 +07:00
Kevin Le
063f5056f2 Fixed RefCountedDigitalPin.h to release claim correctly. Ensure no negative claims number. 2026-02-18 22:32:01 +07:00
taco
1500a5a9cb add get bootloader.ver command for nrf52 2026-02-18 15:35:20 +11:00
Wessel Nieboer
ffc9815e9a Fix packet pool leak when rx queue is full
PacketQueue::add() silently dropped packets when the queue was at
capacity. The packet pointer was lost — never enqueued, never returned
to the unused pool. Each occurrence permanently shrank the 32-packet
pool until allocNew() returned NULL and the node went deaf. Return bool
from add() and free the packet back to the pool on failure.
2026-02-17 23:54:33 +01:00
mesher-de
8e404e9aea add advert.zerohop command to CLI 2026-02-17 13:56:18 +01:00
Liam Cottle
bbc5f0c11a Merge pull request #1718 from realtag-github/repeater-v1.13-implement-discover
discover sends a single repeater discovery request and populates the neighbor list; self is excluded
2026-02-17 23:53:28 +13:00
Scott Powell
2e00298128 * companion: retransmit delays now hard-coded (only for client repeat mode) 2026-02-17 20:25:56 +11:00
Scott Powell
5de3e1bf32 * repeater: slight increase to default direct.txdelay 2026-02-17 20:10:13 +11:00
ripplebiz
a073ba4707 Merge pull request #1719 from 3dpgg/pr_lilygo_tlora_terminal_chat
Fix LilyGo_TLora_V2_1_1_6_terminal_chat build
2026-02-17 15:34:56 +11:00
3DPGG
3e53df5082 Fix LilyGo_TLora_V2_1_1_6_terminal_chat build
This change addresses two issues. The first is that the
LilyGo_TLora_V2_1_1_6_terminal_chat build would try to compile
simple_repeater/MyMesh.cpp. All other examples of terminal chat
targets are instead building simple_secure_chat/main.cpp . This
change would align this build to the rest of the builds.

The second issue, found during the course of investigating the
first, stems from simple_repeater/MyMesh.cpp using the
MAX_NEIGHBOURS #define to control whether the neighbor list is kept.
Repeaters that keep this list must define this value, and if the
value is not defined, then all neighbor-related functionality is
compiled out. However, the code that replies to
REQ_TYPE_GET_NEIGHBOURS did not properly check for this #define,
and thus any target that compiles simple_repeater/MyMesh.cpp
without defining MAX_NEIGHBOURS would get an undefined variable
compilation error.

As a practical matter though, there are no targets that compile
simple_repeater/MyMesh.cpp AND do not define MAX_NEIGHBOURS,
except this build due to the first issue. As a result, the
second issue is addressed only as a matter of completeness. The
expected behavior with this change is that such a repeater would
send a valid reply indicating zero known neighbors.
2026-02-16 18:10:29 -08:00
realtag
0770618ee2 Allow repeater discovery even if repeater mode is disabled on the requesting repeater. 2026-02-17 01:39:04 +00:00
realtag
bf9c6cb50f Increased the timeout timer to 60 seconds, up from 30 seconds. 2026-02-17 01:22:17 +00:00
realtag
87c78a98bd discover.neighbors sends a tagged repeater discovery request and only accepts matching repeater responses 2026-02-17 01:04:14 +00:00
realtag
e8785dd9b0 discover sends a single repeater discovery request and populates the neighbor list; self is excluded 2026-02-17 00:41:24 +00:00
ripplebiz
2005977403 Merge pull request #1699 from recrof/m5stack-m6l-build-fix
fix M5Stack Unit M6L build errors
2026-02-15 21:38:00 +11:00
recrof
cafc212bb2 fix M5Stack Unit M6L build errors 2026-02-15 11:25:27 +01:00
Scott Powell
295f67d4fa Merge branch 'dev'
Some checks failed
Build and deploy Docs site to GitHub Pages / github-pages (push) Failing after 49s
2026-02-15 17:25:07 +11:00
Scott Powell
e2571accbe * ver 1.13.0 2026-02-15 17:24:37 +11:00
Liam Cottle
603bd0e446 Merge pull request #1346 from mboelen/patch-1
Update faq.md
2026-02-15 18:20:00 +13:00
ripplebiz
88452c412e Merge pull request #1603 from oltaco/fix-build.sh-for-RP2040-and-STM32
Add RP2040 and STM32 support to build.sh
2026-02-15 16:09:46 +11:00
ripplebiz
2220eca4f3 Merge pull request #1669 from Azuresword/fix/wio-tracker-l1-grove-sensor-v2
Fix WioTrackerL1 BLE companion: route sensors to Grove I2C bus (Wire1)
2026-02-15 15:55:25 +11:00
ripplebiz
a6e741e30e Merge pull request #1672 from ChaoticLeah/feature/mute-buzzer-icon
Add muted icon to show when buzzer is muted
2026-02-15 15:54:33 +11:00
Scott Powell
0abac35744 * client_repeat state now in _DEVICE_INFO response 2026-02-14 16:45:41 +11:00
Scott Powell
564a19d125 * companion client repeat mode support 2026-02-14 15:50:06 +11:00
taco
5df139f3d6 update build.sh to support RP2040 and STM32 2026-02-13 12:43:04 +11:00
taco
77675ab496 add -D ESP32_PLATFORM to esp32_base 2026-02-13 12:01:04 +11:00
Liam Cottle
246d681b2b Merge pull request #1678 from liamcottle/main
Some checks failed
Build and deploy Docs site to GitHub Pages / github-pages (push) Failing after 13s
Docs: Update Packet Formats
2026-02-12 17:13:51 +13:00
liamcottle
4224ddff0b refactor packet format docs 2026-02-12 17:12:23 +13:00
Liam Cottle
5ccae4bddc Merge pull request #1671 from recrof/rak3112-fix
fix: usb and ui for rak 3112
2026-02-12 11:39:27 +13:00
Leah
fb025fb67e Add muted icon to show when buzzer is muted 2026-02-11 10:00:20 +01:00
Rastislav Vysoky
beff18c53b fix usb and build for rak 3112 2026-02-11 09:34:41 +01:00
dylan
f720338c03 Fix WioTrackerL1 BLE companion: route sensors to Grove I2C bus (Wire1)
Sensors connected via the Grove I2C connector (D18/D17) were not detected
because the firmware scanned the OLED I2C bus (Wire, D14/D15) by default.
Adding ENV_PIN_SDA/SCL flags directs EnvironmentSensorManager to use Wire1,
matching the physical Grove connector pinout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 14:12:48 +08:00
ripplebiz
e33d93dc7f Merge pull request #1611 from weebl2000/semtech-patch-tracker-v2
Enable register patch heltec tracker v2
2026-02-11 14:04:58 +11:00
ripplebiz
8db42146d1 Merge pull request #1645 from Snayler/Snayler-patch-1
Enable TX LED for LilyGo LoRa32 V2.1_1.6
2026-02-11 13:52:47 +11:00
Liam Cottle
e418b0c0ab Merge pull request #1557 from mattzzw/dev
cli_commands.md: `region` available via remote cli in 1.12.0
2026-02-11 11:58:11 +13:00
mattzzw
d11d8ea626 Merge branch 'meshcore-dev:dev' into dev 2026-02-10 22:33:43 +01:00
Liam Cottle
4944a46af1 Merge pull request #1638 from thanegill/build_sh-list
build.sh: add list and -l to list firmwares available to build
2026-02-10 22:27:35 +13:00
Liam Cottle
7d7e88e950 Merge pull request #1651 from liamcottle/fix/path-trace-timeout
Fix: Path Trace Timeout
2026-02-10 17:17:50 +13:00
liamcottle
bafa2ccd22 fix estimated timeout for multi byte path traces 2026-02-10 17:01:30 +13:00
Snayler
810fd561d2 Enable TX LED for LilyGo LoRa32 V2.1_1.6
Working on my device, green TX LED starts blinking every time I transmit
2026-02-09 23:20:29 +00:00
ripplebiz
3f33455b4d Merge pull request #1570 from Quency-D/fix-heltec-power-consumption
Fix heltec-v4 power consumption
2026-02-09 16:49:49 +11:00
ripplebiz
248c3107b4 Merge pull request #1605 from ViezeVingertjes/kiss-modem-spec-compliance
Kiss modem spec compliance
2026-02-09 16:45:20 +11:00
Quency-D
9efb7cb0b6 Merge pull request #2 from weebl2000/pr-1570-fix-heltec-v4-power
Fix double claim, eliminate dead code at compile time
2026-02-09 10:06:59 +08:00
Thane Gill
3ff1394dd2 build.sh: add list and -l to list firmwares available to build. 2026-02-08 14:49:57 -08:00
Michael
e4ef6dba3d Merge pull request #2 from agessaman/fix-simplify-kiss-noise-floor
Simplify kiss noise floor
2026-02-08 16:26:25 +01:00
Liam Cottle
b1094c2842 Merge pull request #1616 from jbrazio/2026/raknorm
Refactor environment names and build flags for RAK variants
2026-02-09 01:33:26 +13:00
ripplebiz
f6fc05601c Merge pull request #1609 from weebl2000/bridge-always-has-work
Bridge always has work (prevents sleep)
2026-02-08 22:42:05 +11:00
Liam Cottle
736ddbfd99 Merge pull request #1620 from thanegill/patch-2
Correct manufacturer name 'Elecrow ThinkNode M5'
2026-02-08 14:07:00 +13:00
Thane Gill
31a2e74ada Correct manufacturer name 'Elecrow ThinkNode M5' 2026-02-07 17:05:51 -08:00
Liam Cottle
e812632235 Merge pull request #1619 from liamcottle/main
[docs] update github build script
2026-02-08 13:04:18 +13:00
liamcottle
85aa052e1f only deploy docs from main branch 2026-02-08 13:01:13 +13:00
liamcottle
6564bbd58e migrate docs build script so cname survives 2026-02-08 13:00:59 +13:00
Liam Cottle
10eacc4e95 Merge pull request #1316 from weebl2000/allow-negative-tx
Allow negative tx
2026-02-08 12:43:10 +13:00
João Brázio
fcfbb458f8 Refactor environment names and build flags for RAK variants 2026-02-07 21:26:28 +00:00
Wessel Nieboer
e8646f5ede Parse as signed int 2026-02-07 16:58:06 +01:00
agessaman
776131e263 simplify kiss noise floor sampling 2026-02-07 07:42:52 -08:00
Wessel Nieboer
23b4baa066 Enable register patch heltec tracker v2 2026-02-07 16:04:01 +01:00
Wessel Nieboer
c4c287d01b Bridge always has work (prevents sleep) 2026-02-07 15:39:24 +01:00
ViezeVingertjes
f6ebbd978e Remove redundant locals in handleSetRadio 2026-02-07 14:32:11 +01:00
ViezeVingertjes
5157daf1c1 Remove individual HW_RESP_* defines, use HW_RESP() macro directly 2026-02-07 14:24:34 +01:00
ViezeVingertjes
00b44c4114 Remove redundant send/complete/finished callbacks, use Radio interface directly 2026-02-07 14:22:21 +01:00
ViezeVingertjes
362b5eb0a1 Update protocol docs for new response codes and signal reporting 2026-02-07 10:26:08 +01:00
ViezeVingertjes
5ccd99e25f Add toggleable per-packet signal reporting 2026-02-07 10:21:36 +01:00
ViezeVingertjes
7982d1ce1f Use high-bit convention for hardware response codes 2026-02-07 10:21:32 +01:00
ViezeVingertjes
49e7516145 Add KISS UART support 2026-02-07 08:51:52 +01:00
agessaman
f445b5acdc fix(kiss_modem): improve RX delivery and noise floor sampling 2026-02-07 08:51:52 +01:00
ViezeVingertjes
1af013c741 Clarify data frame limitations in KISS modem documentation. 2026-02-07 08:51:52 +01:00
ViezeVingertjes
02ddc05c30 Reorganise KISS protocol to close gaps. 2026-02-07 08:51:52 +01:00
ViezeVingertjes
203d86f87d Update documentation. 2026-02-07 08:51:52 +01:00
ViezeVingertjes
f78617dbdb Add periodic noise floor calibration and AGC reset 2026-02-07 08:51:52 +01:00
ViezeVingertjes
5dcc377b77 Rewrite KISS modem to be fully spec-compliant 2026-02-07 08:51:52 +01:00
ripplebiz
bcb7a8067e Merge pull request #1578 from recrof/m5stack-unit-c6l
initial port of M5Stack Unit C6L
2026-02-07 14:21:47 +11:00
ripplebiz
c1c9848569 Merge pull request #1596 from jbrazio/2026/t114-sensors
Refactor Heltec T114 sensor management
2026-02-07 14:17:15 +11:00
ripplebiz
6502067368 Merge pull request #1591 from agessaman/fix-kiss-noise-floor
fix(kiss): periodic noise floor calibration and AGC reset
2026-02-07 14:08:26 +11:00
Wessel Nieboer
0b1fd580f1 Fix double claim, eliminate dead code at compile time 2026-02-06 11:35:05 +01:00
Wessel Nieboer
d0720c63c2 Allow negative tx power
Like SX1262 allows -9 dBm lowest, some allow lower but that probably
isn't useful
2026-02-06 02:24:51 +01:00
Adam Gessaman
c0b81b9ad8 Clean up comments on kiss noise floor changes. 2026-02-05 09:46:30 -08:00
João Brázio
18473333df Merge remote-tracking branch 'upstream/dev' into 2026/t114-sensors 2026-02-05 13:36:22 +00:00
João Brázio
5cb26b91f6 Refactor Heltec T114 sensor management 2026-02-05 13:35:04 +00:00
João Brázio
f0aa12faac Merge remote-tracking branch 'pikolin/T114_sensors' into 2026/t114-sensors 2026-02-05 12:57:27 +00:00
ripplebiz
f7e92a7cd1 Merge pull request #1398 from Socalix/heltecv4-register1
Improve Heltec v4 RX reception with undocumented register patch
2026-02-05 19:14:18 +11:00
ripplebiz
76a46a74e9 Merge pull request #1562 from oltaco/nrf52-sleep-repeater
Add Low-Power Sleep for nRF52 Boards
2026-02-05 13:16:47 +11:00
ripplebiz
4b9d5462bb Merge pull request #1532 from oltaco/esp32board.h-removewifi
Refactor ESP32Board.h to save ~500 bytes of DRAM
2026-02-05 13:09:04 +11:00
agessaman
0fb570338f fix(kiss): periodic noise floor calibration and AGC reset
- Trigger noise floor calibration every 2s and AGC reset every 30s in main loop.
- Reorder loop to match Dispatcher: calibrate + radio.loop() before AGC reset
  and recvRaw() so RSSI is never sampled right after startReceive().
- Update protocol doc with calibration intervals and typical noise floor range.
- Variant platformio.ini updates (heltec_v3, rak4631).
2026-02-03 20:58:39 -08:00
Liam Cottle
236025913d Merge pull request #1487 from oltaco/refactor-ui-with-ringbuffer
Show most recent message on display when no client is connected
2026-02-04 15:48:39 +13:00
Liam Cottle
10067ada18 Merge pull request #1590 from djp3/main
Fix URLs
2026-02-04 15:31:28 +13:00
Don Patterson
dccdc4d958 Fix URLs 2026-02-03 18:06:23 -08:00
taco
598489be47 refactor ui with ring buffer and display most recent 2026-02-04 09:38:05 +11:00
Liam Cottle
cd8d2fdb6d Merge pull request #1583 from liamcottle/docs/migrate
Refactor Documentation
2026-02-04 01:03:35 +13:00
liamcottle
4af31e552e refactor documentation 2026-02-04 00:59:13 +13:00
ripplebiz
e03f311e51 Merge pull request #1545 from ViezeVingertjes/kiss-modem-firmware
Add KISS-like Modem example and protocol documentation
2026-02-03 12:33:19 +11:00
Liam Cottle
384e482052 Create CNAME 2026-02-03 13:47:43 +13:00
Liam Cottle
2eb1d801f8 Merge pull request #1579 from liamcottle/docs
Add mkdocs for automated documentation site
2026-02-03 13:42:19 +13:00
Rastislav Vysoky
84e68cf4cb initial port of M5Stack Unit C6L, update pioarduino to newer bugfix release 2026-02-02 22:58:55 +01:00
ViezeVingertjes
f0ba14ff75 Remove sync word handling from KissModem. 2026-02-02 18:05:26 +01:00
Quency-D
e15503d50d Fix low power consumption issues 2026-02-02 14:19:42 +08:00
ripplebiz
ab994664ac Merge pull request #1549 from Meshcore-Portugal/jbrazio/t114-fix
Revert "Merge pull request #1428 from etienn01/update-t114-i2c"
2026-02-02 13:36:25 +11:00
Jan Pinkas
223930765c Enable I2C sensors and EnvironmentSensorManager for Heltec T114 2026-02-01 09:05:03 +01:00
taco
a342ab8437 nrf52: allow repeater to sleep when idle 2026-02-01 14:51:27 +11:00
ripplebiz
699d1cd0b6 Merge pull request #1495 from oltaco/esp32-advblob-removal
Fix unlimited advert blob growth on ESP32
2026-02-01 13:37:28 +11:00
ripplebiz
13cfc9ad4c Merge pull request #1498 from piotrmalek/fix-env-sensor-manager
Fix incorrect INA260 address in debug message
2026-02-01 13:34:58 +11:00
ripplebiz
f231347131 Merge pull request #1512 from litruv/dev
Refactor display scaling definitions for HELTEC_VISION_MASTER_T190
2026-02-01 13:33:53 +11:00
ripplebiz
852c0b0b78 Merge pull request #1547 from oltaco/t114-remove-extra-dcdcen
Heltec T114: Remove extra DCDC enable call
2026-02-01 13:18:21 +11:00
Matthias Wientapper
2b754d4295 cli_commands.md: region available via remote cli in 1.12.0
changed with #1476
2026-01-31 23:20:56 +01:00
ViezeVingertjes
240b5ea1e3 Refactor KissModem to integrate radio and sensor management directly, removing callback dependencies. 2026-01-31 15:15:19 +01:00
ViezeVingertjes
1bcb52bab3 Add new commands and responses for RSSI, channel status, airtime, noise floor, statistics, battery, and sensors. 2026-01-31 15:05:25 +01:00
João Brázio
b5248faec4 Revert "Merge pull request #1428 from etienn01/update-t114-i2c"
This reverts commit 616eb57b16, reversing
changes made to 537acd7ea1.

This patch needs to be reverted because it boot freezes t114 433Mhz variant.
2026-01-31 13:45:58 +00:00
taco
8d5eaf500d add makeBlobPath inline helper for esp32 2026-02-01 00:02:30 +11:00
taco
31ba971c60 only store advblob when adding/updating contacts 2026-02-01 00:02:30 +11:00
taco
e6e1b810f8 add DataStore::deleteBlobByKey() 2026-02-01 00:02:29 +11:00
taco
c5b1d30280 t114: remove extra DCDC enable 2026-01-31 23:48:28 +11:00
ViezeVingertjes
c786cfe613 Add KISS Modem firmware 2026-01-31 10:22:32 +01:00
Liam Cottle
06a83c0453 Merge pull request #1531 from agessaman/add-recv-errors-stats
Add recv_errors to CMD_GET_STATS STATS_TYPE_PACKETS response
2026-01-30 20:57:07 +13:00
agessaman
019bbf74d3 Add recv_errors to CMD_GET_STATS STATS_TYPE_PACKETS response
Append uint32_t recv_errors (RadioLib receive/CRC errors) to packet stats
binary frame. Frame size 26 -> 30 bytes. Update stats_binary_frames.md and
Python/TypeScript parsing examples for backward compatibility (accept >=26).
2026-01-29 20:44:11 -08:00
taco
c7eea3915d fix: remove esp_wifi.h from esp32board.h
saves ~500 bytes of dram and allows Tbeam to compile again
2026-01-30 15:07:40 +11:00
ripplebiz
cf7d95c6de Merge pull request #1509 from stevenlafl/tbeam-1w
Add LilyGO T-Beam 1W Support
2026-01-30 14:55:17 +11:00
ripplebiz
e60fb14e88 Merge pull request #1500 from Meshcore-Portugal/jbrazio/2026_03a6aa94
Allow usage of "/" in radio names
2026-01-30 12:09:08 +11:00
Liam Cottle
e50fe31fd6 Merge pull request #1528 from recrof/revert-1437-dev
Revert "Remove _serial->isConnected() logic from buzzer notifications"
2026-01-30 12:16:12 +13:00
Rastislav Vysoky
c345f1da8e Revert "Remove _serial->isConnected() logic from buzzer notifications" 2026-01-30 00:12:04 +01:00
SoCalix
31fbb679d5 Merge branch 'dev' into heltecv4-register1 2026-01-29 09:12:35 -06:00
fdlamotte
acca73f57e Merge pull request #1524 from recrof/thinknode-m3-m6-fixes
Elecrow ThinkNode M3, M6 build errors fix after NRF52Board base class migration
2026-01-29 11:07:32 -04:00
Rastislav Vysoky
2a321b53eb renamed board files 2026-01-29 16:00:19 +01:00
Rastislav Vysoky
3a7ccc085d fixed build errors and typos/inconsistencies 2026-01-29 15:32:51 +01:00
Scott Powell
e738a74777 Merge branch 'dev' 2026-01-29 21:16:53 +11:00
Scott Powell
465776d667 * ver 1.12.0 2026-01-29 21:12:31 +11:00
Steven Linn
a9a8299e14 Set LilyGO T-Beam 1W to use TX0 3.0V (within reference +2.85V~+3.15V) 2026-01-28 22:24:57 -07:00
Steven Linn
44e7c092c8 Add battery min/max voltage parameter support 2026-01-28 22:24:49 -07:00
Steven Linn
f7e54ea797 Add LilyGO T-Beam 1W Support 2026-01-28 22:24:43 -07:00
Liam Cottle
629adc23c5 Merge pull request #1508 from recrof/rak4631-cleanup
cleanup: moved RAK4631 pindefs from board file to variant.h
2026-01-29 12:35:47 +13:00
Liam Cottle
8f605f83fc Merge pull request #1507 from recrof/rak3401-board-fix
fix: build errors because of changes in RAK3401Board base class
2026-01-29 12:05:58 +13:00
Max Litruv Boonzaayer
dd2a9044f3 Refactor display scaling definitions for HELTEC_VISION_MASTER_T190 2026-01-29 08:05:26 +11:00
Rastislav Vysoky
f41872420e moved pindefs from board file to variant.h 2026-01-28 17:28:48 +01:00
Rastislav Vysoky
d5a73b2394 fix: build errors because of changes in NRF52 base class 2026-01-28 17:18:39 +01:00
liamcottle
706b5a39c6 allow manual deploy 2026-01-28 21:48:39 +13:00
liamcottle
c35c1961de add docs branch for testing 2026-01-28 21:48:39 +13:00
liamcottle
132c8961e8 add workflow to build and deploy docs to github pages 2026-01-28 21:48:39 +13:00
liamcottle
a87c0fe2d6 separate table of contents 2026-01-28 21:48:39 +13:00
liamcottle
0c2da8ce1e add support for mkdocs 2026-01-28 21:48:39 +13:00
ripplebiz
93367b9f8f Merge pull request #1493 from Cisien/dev
Add a cli command reference document
2026-01-28 15:44:26 +11:00
Liam Cottle
3fc736e3b0 Merge pull request #1499 from Meshcore-Portugal/jbrazio/2026_2768c833
Update runArgs in devcontainer.json
2026-01-28 16:44:02 +13:00
Chris
4e1e8bbffb Add a cli command reference document 2026-01-27 19:08:04 -08:00
João Brázio
edeafde51c Fix: Correct validation logic in isValidName function 2026-01-27 19:36:12 +00:00
ripplebiz
58a3782325 Merge pull request #1497 from oltaco/meshtiny-build-fix
Build fix for Meshtiny
2026-01-28 05:55:01 +11:00
João Brázio
9665feeebf Update runArgs in devcontainer.json 2026-01-27 16:57:54 +00:00
Piotr Małek
3845a1c021 Fix incorrect INA260 address in debug message 2026-01-27 16:29:31 +01:00
taco
4a83a6658a build fix for meshtiny (nrf52board ota refactor) 2026-01-28 00:59:42 +11:00
fdlamotte
ac79b38fa6 Merge pull request #1246 from fschrempf/nrf-dcdc
NRF52 boards: Enable internal DC/DC regulator to reduce power consumption and enable OTA support for all boards
2026-01-27 09:02:47 -04:00
fdlamotte
3f3978c7d3 Merge branch 'dev' into nrf-dcdc 2026-01-27 08:42:58 -04:00
ripplebiz
c0194d889a Merge pull request #1492 from oltaco/meshtiny
Support for Meshtiny
2026-01-27 19:54:16 +11:00
ripplebiz
fedf703262 Merge pull request #1486 from Quency-D/fix-heltec-v4-tft
Add heltec v4-tft code.
2026-01-27 19:47:20 +11:00
Scott Powell
5ff6e813bd * Fix: RegionMap build fail on _max 2026-01-27 18:16:21 +11:00
Scott Powell
5627500988 * new "clkreboot" CLI command 2026-01-27 15:22:18 +11:00
taco
5a20e8674f support for meshtiny 2026-01-27 14:15:02 +11:00
ripplebiz
d81616ec68 Merge pull request #1476 from mattzzw/region_via_LoRa
Add cli command `region list {allowed|denied}`, enable output of region cmd via remote cli
2026-01-27 11:07:22 +11:00
Matthias Wientapper
0805a47f35 Add output of region cmd via lora cli
Add cli commands "region list {allowed|denied}"
2026-01-26 17:44:43 +01:00
ripplebiz
f1be7d0914 Merge pull request #1488 from liamcottle/firmware/boot-adverts
Change advert on boot from flood to zero hop
2026-01-26 21:55:48 +11:00
liamcottle
7e24bd00b9 increase maximum flood advert interval to 168 hours (7 days) 2026-01-26 23:05:10 +13:00
liamcottle
d13bc446de added build flag to enable/disable boot advert 2026-01-26 22:39:39 +13:00
liamcottle
ed589f9620 boot adverts are now zero hop instead of flood 2026-01-26 22:20:36 +13:00
ripplebiz
4b7684c7df Merge pull request #1477 from Cisien/dev
Expose a counter to track RadioLib receive errors
2026-01-26 19:04:48 +11:00
Quency-D
c7ac16f0e3 Add v4-tft code. 2026-01-26 13:48:15 +08:00
Scott Powell
7ae164217c * region names now don't need '#' prefix. (SHA still adds a '#' for back compat) 2026-01-25 18:35:55 +11:00
Chris
c16bcd2fe3 Expose a counter to track RadioLib receive errors
This change counts when readData returns an err code other than RADIOLIB_ERR_NONE. In most cases this is going to be a CRC error. This counter is exposed in the `stats-packets` command, and in the repeater stats payload (4 additional bytes to the payload, which is now 56 bytes with this change. My incompetent robot claims the total payload size is 96 bytes (unverified but probably close).
2026-01-24 20:06:29 -08:00
ripplebiz
a5f3766016 Merge pull request #1429 from Snayler/dev
Fix Serial and TX LED not working on Heltec Wireless Paper V1.2
2026-01-25 14:58:07 +11:00
ripplebiz
f0269c9bff Merge pull request #1465 from recrof/rak3112-port
initial RAK 3112 support
2026-01-25 14:56:17 +11:00
ripplebiz
153bcdc6a3 Merge pull request #1457 from oltaco/remote-set-prvkey
Allow set prv.key over LoRa, clear ACL and validate key
2026-01-25 14:46:41 +11:00
taco
96ef5e5efe allow set prv.key from remote, validate new prv.key 2026-01-25 01:32:48 +11:00
taco
988287bfd7 recalc ClientACL shared_secrets at startup 2026-01-25 01:32:44 +11:00
taco
6336bd5b72 refactor ClientACL and CommonCLI, add ClientACL::clear() 2026-01-25 01:31:53 +11:00
Scott Powell
f46f0d0ed1 * WIO tracker l1: BLE companion. default node name now MAC address 2026-01-24 22:08:05 +11:00
ripplebiz
c7b3d34963 Merge pull request #1456 from Quency-D/fix-env-i2c
Fix env i2c errors
2026-01-24 21:58:14 +11:00
ripplebiz
e744adfa39 Merge pull request #1413 from entr0p1/powermgt-nrf52840-v2
nRF52840 Power Management v2 Phase 1 - LPCOMP Wake and startup lockout
2026-01-24 21:51:06 +11:00
Liam Cottle
b853c7ced5 Merge pull request #1459 from oltaco/fix-roomserver-debug
Build fix for room server with MESH_DEBUG
2026-01-24 19:31:31 +13:00
Rastislav Vysoky
266f6ee856 fixed battery measurement 2026-01-23 23:35:00 +01:00
Rastislav Vysoky
e7c72c5c6a initial port of rak3112 2026-01-23 22:26:24 +01:00
taco
9dd52bd0cc build fix for room server with MESH_DEBUG=1 2026-01-23 23:43:05 +11:00
entr0p1
1f59e52880 nRF52840 Power Management - Phase 1 - Boot Low VBAT Voltage Lockout
Added NRF52840 power management core functionality:
- Boot‑voltage lockout
- Initial support for shutdown/reset reason storage and capture (via RESETREAS/GPREGRET2)
- LPCOMP wake (for voltage-driven shutdowns)
- VBUS wake (for voltage-driven shutdowns)
- Per-board shutdown handler for board-specific tasks
- Exposed CLI queries for power‑management status in CommonCLI.cpp
- Added documentation in docs/nrf52_power_management.md.
- Enabled power management support in Xiao nRF52840, RAK4631, Heltec T114 boards
2026-01-23 17:18:41 +11:00
Scott Powell
3c27132914 * T1000e BLE - default node name is now the MAC address 2026-01-23 15:53:58 +11:00
Quency-D
fc61018d4d Fix the issue of inconsistent I2C usage in the environmental sensor. 2026-01-23 10:45:13 +08:00
ripplebiz
616eb57b16 Merge pull request #1428 from etienn01/update-t114-i2c
Update T114 I2C pins for external RTC
2026-01-23 12:25:07 +11:00
ripplebiz
537acd7ea1 Merge pull request #1437 from nakoeppen/dev
Remove _serial->isConnected() logic from buzzer notifications
2026-01-23 12:20:57 +11:00
ripplebiz
32230f6167 Merge pull request #1415 from WattleFoxxo/StationG2-tx-power-changes
Change the Station G2's default TX power
2026-01-23 11:58:53 +11:00
Liam Cottle
bccefd6e37 Merge pull request #1445 from oltaco/thinknode_m1-gps-fix
ThinkNode M1 GPS fixes
2026-01-22 20:02:41 +13:00
taco
36f230d074 thinknode m1: allow GPS to sync clock 2026-01-22 14:42:43 +11:00
taco
ea85486dca thinknode m1: add missing GPS page to new UI 2026-01-22 14:42:08 +11:00
taco
b09ddfc5e1 thinknode m1: add missing getLocationProvider() override 2026-01-22 14:41:07 +11:00
Socalix
46e4cc06e3 Revert boosted gain flag to original 2026-01-21 21:12:54 -06:00
nakoeppen
d68bc74514 Remove _serial->isConnected() logic from buzzer notifications 2026-01-20 20:19:10 -06:00
Miguel de Matos
a7cadc8e44 Fix Serial and TX LED not working on Heltec Wireless Paper V1.2
As described on #1276, tested and working on my heltec wireless paper v1.2
2026-01-20 01:52:45 +00:00
Étienne Fesser
e51a2d1ba0 Update T114 I2C pins 2026-01-19 21:39:01 +01:00
ripplebiz
56ab59ded2 Merge pull request #1387 from chrisdavis2110/rak3401
Add Variant rak3401 (for new 1W booster kit)
2026-01-19 16:11:07 +11:00
ripplebiz
bf0777845a Merge pull request #1408 from oltaco/improved-contact-mgmt
Contact management tweaks
2026-01-19 12:29:52 +11:00
chrisdavis2110
ed5d2909fc updated variant rak3401 2026-01-17 22:54:20 -08:00
Chris Davis
5e4b33a1a0 Merge pull request #4 from chrisdavis2110/var-rak3401
Var rak3401
2026-01-17 22:47:25 -08:00
WattleFoxxo
5c7b28f110 Change the Station G2 default tx power
set the default TX power to 7dBm to avoid illegal power output by default.
2026-01-18 14:29:50 +11:00
taco
b919119faf only write contacts when changed 2026-01-16 13:15:35 +11:00
taco
c61fde9328 always send PUSH_CODE_NEW_ADVERT when advert was not added to contacts[] 2026-01-16 13:15:35 +11:00
Liam Cottle
7d1f52252b Merge pull request #1402 from recrof/v3-usb-contact-fix
fix: bump max contacts for heltec v3 companion usb
2026-01-16 09:50:06 +13:00
Rastislav Vysoky
11565673c3 fix: bump max contacts for v3 companion usb 2026-01-15 15:39:44 +01:00
Liam Cottle
23f1f2a3fa Merge pull request #1399 from mannkind/patch-1
Fix Ikoka Stick builds
2026-01-15 23:32:34 +13:00
ripplebiz
d41a968d1d Merge pull request #1379 from oltaco/improved-contact-mgmt
Companion: Improved Contact Management
2026-01-15 20:36:28 +11:00
taco
df6687034a bootstrap RTC from contact.lastmod and improve slot overwrite logic
slot overwrite logic can now safely use contact.lastmod to find oldest contact for overwrite
2026-01-15 18:01:20 +11:00
taco
741564dd48 refactor: add populateContactFromAdvert() 2026-01-15 18:01:20 +11:00
taco
403ce1db08 contacts: granular autoadd and overwrite-oldest 2026-01-15 18:01:20 +11:00
Dustin Brewer
31f98bdd43 Fix Ikoka Stick builds 2026-01-14 17:53:42 -08:00
Socalix
4575800e40 Turn on register 0x8B5 LSB for improved RX, turn off boosted gain 2026-01-14 17:52:15 -06:00
Liam Cottle
56eb5b0499 Merge pull request #1373 from liquidraver/buildwithoutdebug
DISABLE_DEBUG=1 env variable to build.sh
2026-01-15 06:36:00 +13:00
chrisdavis2110
06c4ca19ab added variant rak3401 2026-01-13 10:06:50 -08:00
liquidraver
a48b185189 DISABLE_DEBUG=1 env variable to build.sh 2026-01-13 12:48:53 +01:00
Liam Cottle
4643f4d3a3 Merge pull request #1378 from recrof/ikoka-cleanup
cleanup ikoka variants and add all supported sensors
2026-01-13 17:21:24 +13:00
Liam Cottle
77257a376b Merge pull request #1377 from recrof/t3s3-sx1276-fix
FIX: remove serial debug logging from t3s3 sx1276 companion usb
2026-01-13 10:34:45 +13:00
Rastislav Vysoky
324eab9394 cleanup ikoka variants and add all supported sensors 2026-01-12 19:29:32 +01:00
Rastislav Vysoky
266e4893fd remove serial debug logging from t3s3 sx1276 companion usb 2026-01-12 19:19:23 +01:00
Scott Powell
bafbfaf2b5 Merge branch 'regions-request' into dev 2026-01-12 17:48:19 +11:00
Scott Powell
69a71d0e25 * repeater login response, FIRMWARE_VER_LEVEL now bumped to 2 2026-01-12 17:47:51 +11:00
Scott Powell
b6110eee38 * new req/resp (after login): REQ_TYPE_GET_OWNER_INFO (includes firmware-ver)
* ANON_REQ_TYPE_OWNER, firmware-ver removed (security exploit)
* ANON_REQ_TYPE_BASIC, formware-ver removed, just remote clock + some 'feature' bits
* CTL_TYPE_NODE_DISCOVER_REQ now ingored if 'repeat off' has been set
2026-01-12 16:58:35 +11:00
Scott Powell
4e4f6d92a0 * ANON_REQ_TYPE_VER_OWNER now delimited by newline chars 2026-01-09 16:32:08 +11:00
Scott Powell
65796c8f20 * CommonCLI: added "set name ..." validation
* ANON_REQ_TYPE_VER_OWNER, now removes commas from node_name
2026-01-09 16:28:08 +11:00
Scott Powell
fd69acb421 * new ANON_REQ_TYPE_VER (for just simple clock + ver info) 2026-01-09 13:54:18 +11:00
Scott Powell
2a035ad816 * ANON_REQ_TYPE_VER_OWNER, now includes node_name 2026-01-09 13:20:20 +11:00
Scott Powell
5475043083 * new ANON_REQ_TYPE_VER_OWNER
* CommonCLI: new "get/set owner.info ..."
2026-01-09 11:07:31 +11:00
Frieder Schrempf
4f46ec75dd Remove NRF52BoardOTA class and integrate it into NRF52Board
As all NRF52 boards now have OTA support, let's remove the subclass
and integrate it into the base class.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:46:20 +01:00
Frieder Schrempf
686d887f72 variants: T1000E: Add OTA support
To reduce the number of different code paths, add OTA support for the
remaining NRF52 boards.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:46:09 +01:00
Frieder Schrempf
1651db81f9 variants: Sensecap Solar: Use DC/DC regulator
The schematic shows the LC circuit for the internal DC/DC regulator
to be available. Enable it to save power.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:44:23 +01:00
Frieder Schrempf
80ca720002 variants: ProMicro: Use DC/DC regulator
The schematic shows the LC circuit for the internal DC/DC regulator
to be available. Enable it to save power.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:44:22 +01:00
Frieder Schrempf
137eed3ede variants: Minewsemi ME25LS01: Use DC/DC regulator
The schematic shows the LC circuit for the internal DC/DC regulator
to be available. Enable it to save power.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:44:21 +01:00
Frieder Schrempf
465b481a2e variants: Mesh Pocket: Use DC/DC regulator
The schematic shows the LC circuit for the internal DC/DC regulator
to be available. Enable it to save power.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:44:20 +01:00
Frieder Schrempf
bf93d6cf7a variants: Lilygo T-Echo (Lite): Use DC/DC regulator
The schematic shows the LC circuit for the internal DC/DC regulator
to be available. Enable it to save power.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:44:19 +01:00
Frieder Schrempf
041f67ab71 variants: Ikoka NRF: Use DC/DC regulator
The Ikoka boards are based on the Xioa NRF52840 module which is known
to have the LC circuit for the internal DC/DC regulator to be
available. Enable it to save power.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:44:18 +01:00
Frieder Schrempf
3b0870e2c1 variants: Heltec T114: Use DC/DC regulator
The schematic shows the LC circuit for the internal DC/DC regulator
to be available. Enable it to save power.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:44:16 +01:00
Frieder Schrempf
24a4b99e31 variants: Heltec Mesh Solar: Use DC/DC regulator
The schematic shows the LC circuit for the internal DC/DC regulator
to be available. Enable it to save power.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:44:15 +01:00
Frieder Schrempf
578d55b28a variants: Thinknode M3/M6: Use common Nrf52Board class
Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:44:14 +01:00
Frieder Schrempf
57fa1ba854 variants: Wio WM1110: Use common implementation of startOTAUpdate()
Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:44:13 +01:00
Frieder Schrempf
fa48d4fe81 variants: Nano G2 Ultra: Use common implementation of startOTAUpdate()
Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:43:38 +01:00
Michael Boelen
599e15fd0c Update faq.md
Fix of a typo, change second sentence to start with a capital (like Q 3.6), adding missing dot in 3.8, and turn 3.8 into a question.

The file on dev branch is outdated, so submitting this on main.
2026-01-08 15:20:05 +00:00
Liam Cottle
5b7f66712c Merge pull request #1337 from fmckeogh/dev
Fix capitalization in T1000-E manufacturer string
2026-01-08 23:31:10 +13:00
Scott Powell
5cc44dd802 * ANON_REQ_TYPE_REGIONS now direct only, with reply_path encoded in request 2026-01-08 13:20:52 +11:00
Ferdia McKeogh
55fc03b109 Fix capitalization in T1000-E manufacturer string 2026-01-07 14:24:25 +01:00
Scott Powell
8d51126956 Merge branch 'dev' into regions-request 2026-01-08 00:21:08 +11:00
Liam Cottle
ff973e43b9 Merge pull request #1334 from olanwe/wifi-queuesize
Apply #1331 to other WiFi companions
2026-01-07 22:47:13 +13:00
ripplebiz
3eaaf96ed3 Merge pull request #1300 from fschrempf/fix-rak4631-gps
Fix RAK4631 GPS Detection
2026-01-07 14:56:58 +11:00
ripplebiz
ebfe6e4ba5 Merge pull request #1320 from alex-vg/dev
Add Xiao_S3_WIO WiFi companion env (Xiao_S3_WIO_companion_radio_wifi)
2026-01-07 14:37:32 +11:00
Oliver Weyhmüller
a7a6bb51ce Apply #1331 to other WiFi companions 2026-01-07 03:40:00 +01:00
Liam Cottle
c14362d80f Merge pull request #1331 from an0key/wifi-offlinequeuesizemissing
OFFLINE_QUEUE_SIZE for Heltec Wifi companions
2026-01-07 10:46:56 +13:00
Luke
d4a2e5789f OFFLINE_QUEUE_SIZE for Heltec Wifi companions
OFFLINE_QUEUE_SIZE missing from h3/h4 wifi companions, causing them only store 16 messages.
2026-01-06 14:49:15 +00:00
alex-vg
818f5e9da5 variants: Xiao_S3_WIO: Add WiFi companion env 2026-01-05 02:25:30 +01:00
ripplebiz
09005fa455 Merge pull request #1308 from liamcottle/fix/wifi-interface-frames
Fix: WiFi Interface Frame Parsing
2026-01-04 16:19:57 +11:00
liamcottle
8708fa012a simplify reading frame header 2026-01-04 17:43:25 +13:00
ripplebiz
c5c67ee1a5 Merge pull request #1313 from recrof/thinknode_m6_companion_fix
fix compilation errors for m6 companion roles
2026-01-04 13:30:52 +11:00
Liam Cottle
badcefb9f8 Merge pull request #1317 from cj-vana/fix/typos
Fix typos in README and source comments
2026-01-04 14:57:43 +13:00
cj-vana
63767cdb7d Fix typos in README and source comments 2026-01-03 18:54:48 -07:00
Rastislav Vysoky
63ae92aa09 fix compilation errors for m6 companion roles 2026-01-03 16:32:36 +01:00
Liam Cottle
6b52fb3230 Merge pull request #1310 from LitBomb/patch-22
fix Station G2 output dBm typo
2026-01-03 19:39:31 +13:00
uncle lit
a93527a474 fix Station G2 output dBm typo
fix Station G2 output dBm typo reported on https://github.com/meshcore-dev/MeshCore/issues/1304

changed 26.5 dBm to 36.5 dBm
2026-01-02 22:34:10 -08:00
liamcottle
71bb49e556 remove use of dynamic allocation 2026-01-03 16:36:19 +13:00
liamcottle
ed263b0727 implement frame header parising for wifi interface 2026-01-03 15:39:57 +13:00
Scott Powell
3af25495bb * Repeater: new anon request sub-type: ANON_REQ_TYPE_REGIONS (rate limited to max 4 every 3 mins)
* Companion: new CMD_SEND_ANON_REQ command (reply with existing RESP_CODE_SENT frame)
2026-01-03 12:02:15 +11:00
ripplebiz
e31c46ff56 Merge pull request #1294 from liquidraver/factorynvsreset
Add NVS partition reset to ESP factory reset
2026-01-03 11:57:14 +11:00
liquidraver
faf177de46 ESP factory reset clear NVS too 2026-01-02 08:37:22 +01:00
Scott Powell
813e502970 * added protocol_guide doc 2026-01-02 12:54:57 +11:00
ripplebiz
2f5a8c59ea Merge pull request #1299 from entr0p1/companion-timestamp-fix
BUGFIX: Companion packet timestamp mismatch trips replay protection
2026-01-02 12:44:45 +11:00
Frieder Schrempf
ab7935142c EnvironmentSensorManager.cpp: Cleanup after failed RAK4631 GPS detection
If no GPS was detected, revert the hardware to the initial state,
otherwise we may see conflicts or increased power consumption on some
boards.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-31 14:42:42 +01:00
Frieder Schrempf
e79ee11872 EnvironmentSensorManager.cpp: Fix RAK4631 serial GPS detection
Serial1 is always true. If we want to check for the presence of a GPS
receiver, we need to check if any data was received.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-31 14:42:41 +01:00
Liam Cottle
84b84717cc Merge pull request #1293 from weebl2000/gitignorevenv
Add common venv dirs to .gitignore
2026-01-01 01:29:55 +13:00
Wessel Nieboer
7ea751d3a0 Add venv dirs to .gitignore 2025-12-31 13:01:56 +01:00
ripplebiz
f9720f0b0c Merge pull request #1266 from IoTThinks/MCdev-Powersaving-for-esp32-202512
Added powersaving to all ESP32 boards with RTC-supported DIO1
2025-12-31 11:35:46 +11:00
entr0p1
4a869163b2 BUGFIX: replay protection on repeaters tripped by timestamp sent from companion node mobile app. Send the node's RTC timestamp for TXT_TYPE_CLI_DATA messages instead of the timestamp from the app (matches the sendRequest() code logic). 2025-12-30 21:58:59 +11:00
Kevin Le
d911a34eeb Used esp_wifi_get_mode instead of WiFi.getMode() to reduce the code size 2025-12-29 22:38:05 +07:00
Kevin Le
33b1e7edb9 Added pad after powersaving_enabled 2025-12-29 21:49:13 +07:00
ripplebiz
8edbb085fb Merge pull request #1254 from entr0p1/tx-led-fix-v2
Fix TX LED stuck on when StartTransmit() fails
2025-12-29 16:09:08 +11:00
ripplebiz
1c594d4cbd Merge pull request #1274 from IoTThinks/MCdev-FixedMCUTemperature
To fix MCU Temperature for repeaters
2025-12-29 15:05:31 +11:00
ripplebiz
9b08a9bd93 Merge pull request #1260 from LitBomb/patch-21
Update FAQ with new community projects and tx power settings for amped radios
2025-12-29 13:44:38 +11:00
ripplebiz
1d9d37c654 Merge pull request #1247 from entr0p1/dev
Fixed T1000-E temperature, lux and BME280 sensor reading accuracies
2025-12-29 12:42:05 +11:00
Liam Cottle
3d6e523ec8 Merge pull request #1281 from Meshcore-Portugal/jbrazio/promicro_rs232
Add RS232 bridge environment configuration for ProMicro
2025-12-29 12:57:00 +13:00
João Brázio
992d971f07 Add RS232 bridge environment configuration for ProMicro 2025-12-28 20:04:57 +00:00
Scott Powell
90d1e87ba1 * check for 'early receive' ACK 2025-12-27 20:46:28 +11:00
Kevin Le
0b30d2433f To get and average the temperature so it is more accurate, especially in low temperature 2025-12-27 15:25:21 +07:00
Kevin Le
26321162ee To fix the default temperature to be overridden by external sensors (if any) 2025-12-27 15:23:23 +07:00
Kevin Le
def1902688 Fixed T-Beam board to work with sleep 2025-12-24 12:04:39 +07:00
Kevin Le
0d11a02e71 Added extra check for P_LORA_DIO_1 before going to sleep 2025-12-24 11:47:19 +07:00
Kevin Le
89a289eb22 Added powersaving_enabled sanitization
Moved powersaving_enabled to match serialization order
2025-12-24 11:23:19 +07:00
Kevin Le
1706f759b7 Modified hasPendingWork to return bool 2025-12-24 11:00:34 +07:00
Kevin Le
5c6c15942b Added powersaving to all ESP32 boards with RTC-supported DIO1
Added CLI to enable/disable powersaving
2025-12-23 12:48:08 +07:00
uncle lit
27c92d2fe9 Update FAQ with new MeshCore applications and tx power settings for amped radios
Added entries for meshcore-pi and pyMC_Repeater to the FAQ
Added tx power settings for amped radios
2025-12-21 21:48:56 -08:00
entr0p1
245a818085 Fix TX LED stuck on when StartTransmit() fails 2025-12-20 23:15:41 +11:00
entr0p1
cc28b1a34d EnvironmentSensorManager.cpp: Mitigate BME280 self-heating causing inaccurate readings. 2025-12-20 21:51:51 +11:00
entr0p1
6c993827de Fixed T1000-E temperature and lux sensors 2025-12-19 23:51:36 +11:00
Liam Cottle
0c3fb918b2 Merge pull request #1203 from liquidraver/fix-gps-popup
Fix GPS/Buzzer toggle UI popup
2025-12-18 21:39:25 +13:00
liquidraver
e855706abb move showalert after saveprefs 2025-12-17 21:27:22 +01:00
fdlamotte
2ddd5ca0c3 Merge pull request #1235 from liquidraver/btfixv7
queue throttling + slave latency and minor refactor
2025-12-17 15:08:20 +01:00
liquidraver
cba29ea50c queue throttling + slave latency and minor refactor 2025-12-17 13:46:58 +01:00
fdlamotte
9b13106b6f Merge pull request #1201 from fschrempf/nrf52-board-deduplication
NRF52 Board Code Deduplication
2025-12-17 11:29:33 +01:00
Frieder Schrempf
8eb229bcf8 variants: RAK4631: Enable DC/DC regulator to reduce power consumption
The RAK4631/RAK4630 module are able to use the DC/DC converter. Enable
it to reduce power consumption.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-17 10:39:55 +01:00
Frieder Schrempf
22b1585959 NRF52Board.h: Mark getMCUTemperature() as virtual
The function in the derived class is virtual per definition. Mark it
to make this clearer to the reader.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-17 10:39:54 +01:00
Frieder Schrempf
b024b9e1a1 Deduplicate NRF52 startOTAUpdate()
The startOTAUpdate() is the same for all NRF52 boards. Use a common
implementation for all boards that currently have a specific
implementation.

The following boards currently have an empty startOTAUpdate() for
whatever reasons and therefore are not inheriting NRF52BoardOTA to
keep the same state: Nano G2 Ultra, Seeed SenseCAP T1000-E,
Wio WM1110.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-17 10:30:50 +01:00
Frieder Schrempf
e3bb225efb Deduplicate DC/DC regulator enable for NRF52 boards
Some NRF52 boards are able to use the internal power-efficient DC/DC
regulator. Add a new class that can be inherited by board classes to
enable this feature and reduce the power consumption.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-17 10:29:14 +01:00
Frieder Schrempf
93d1560d14 Use common NRF52 begin() and deduplicate() startup reason init
Use a common begin() method that can be called from derived classes
to contain the shared initialization code.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-17 10:26:57 +01:00
Frieder Schrempf
87b0e432bb Deduplicate reboot() for NRF52 boards
The reboot() method is the same for all NRF52 boards. Use a shared
implementation.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-17 10:25:16 +01:00
Frieder Schrempf
6486192477 variants: IkokaNrf52Board: Use NRF52Board base class
Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-17 10:22:15 +01:00
ripplebiz
d67f311c3d Merge pull request #1206 from IoTThinks/MCdev-MCUTemperature-for-repeaters-202512
Added default temperature from ESP32 MCU and NRF52 MCU
2025-12-15 19:37:34 +11:00
Liam Cottle
2228214ded Merge pull request #1216 from mattzzw/main
Update faq.md
2025-12-15 18:18:00 +13:00
mattzzw
2bcc9c10d2 Update faq.md
Fix typo
2025-12-14 18:29:49 +01:00
fdlamotte
f38b951e87 Merge pull request #1142 from Meshcore-Portugal/jbrazio/2025_7bc6ab2c
Add devcontainer configuration for vscode
2025-12-13 09:07:05 +01:00
Kevin Le
2deb9cf144 Fixed to call getMCUTemperature once. 2025-12-13 07:32:26 +07:00
João Brázio
0df8c86b98 Refactor devcontainer runArgs 2025-12-12 17:24:28 +00:00
Florent
aba868f324 Merge branch 'thinknode_m3_port' into dev 2025-12-12 17:20:06 +01:00
Florent
bde4fc3a23 thinknode_m3: initial commit 2025-12-12 17:16:28 +01:00
Florent
e7ed69bdb6 Merge branch 'thinknode_m6_port' into dev 2025-12-12 16:39:37 +01:00
Florent
14efaf6fd3 thinknode_m6: initial port 2025-12-12 16:37:57 +01:00
Kevin Le
4504ad4daf Added default temperature from ESP32 MCU and NRF52 MCU
Added NRF52Board.h and NRF52Board.cpp
Modified NRF52 variants to extend from NRF52Board to share common feature
2025-12-12 19:01:15 +07:00
ripplebiz
9bba417ebc Merge pull request #1160 from flol/rak11310
Support for RAK11310 WisBlock
2025-12-11 10:47:12 +11:00
ripplebiz
f378e103c2 Merge pull request #1171 from luigi311/techo_hibernate_led
variants: lilygo_techo: variant: Turn off leds on poweroff
2025-12-11 10:24:05 +11:00
ripplebiz
922e378be5 Merge pull request #1192 from LitBomb/patch-20
Update faq.md
2025-12-11 10:21:19 +11:00
ripplebiz
fc4f9e8f33 Merge pull request #1197 from agessaman/LPS22HB-fix
fix output from LPS22HB sensor: convert barometric pressure from kPa to hPa
2025-12-11 10:14:10 +11:00
agessaman
b91b854a1d fix output from LPS22HB: convert barometric pressure from kPa to hPa in EnvironmentSensorManager 2025-12-08 19:53:33 -08:00
uncle lit
1f5659dd26 Update faq.md
fix typo bugs found by @4np
2025-12-08 09:33:10 -08:00
uncle lit
cae37d8892 Update faq.md
add get and set prv.key
add web site to generate new private key and specific its public key's first byte value
add link to repeater observer instruction
add links to The Comms Channel's meshcore video, MCarper's Meshcore Advantages, and Austin Mesh's MeshCore vs Meshtastic comparison
add deafness instruction for agc reset interval
add reference to Liam's Windows and Intel Mac client apps
add reference to Tree's Meshcore packet decoder
add OTA BLE update addendum for Seeed Wio Tracker L1 Pro
add instruction to use T-deck's software keyboard to enter `=` at the end of the base64 public key
2025-12-07 22:31:54 -08:00
Liam Cottle
09c121efae Merge pull request #1178 from fschrempf/xiao-nrf-button-pullup-fix
Xiao NRF52: Enable pullup on button input
2025-12-07 19:18:48 +13:00
Scott Powell
676c317f78 * refactor: on-demand getSharedSecret() 2025-12-06 19:17:45 +11:00
ripplebiz
46f6146df7 Merge pull request #1180 from oltaco/shared-secret-on-demand
Companion: Faster startup by calculating shared_secret on demand
2025-12-06 18:59:19 +11:00
Scott Powell
d7adcc136b * LPPDataHelpers, readCurrent() signed value 2025-12-06 16:49:25 +11:00
taco
638f41d143 calculate shared_secret on demand 2025-12-06 16:21:17 +11:00
ripplebiz
9ee3008f88 Merge pull request #1177 from liquidraver/btfixv6
Fix BLE semaphore leak and improve SerialBLEInterface
2025-12-06 14:23:27 +11:00
ripplebiz
4040f201a8 Merge pull request #1179 from carroarmato0/tdeck-gps
Enable GPS for LilyGo TDeck + Optimizations
2025-12-06 14:11:58 +11:00
Christophe Vanlancker
01eb8716af fix(core): optimize GPS loop and add display GPIO safeguards 2025-12-05 20:45:10 +01:00
Christophe Vanlancker
d834d66803 feat(tdeck): enable GPS support and configure pins 2025-12-05 20:44:56 +01:00
Frieder Schrempf
10b43a8f9f variants: XIAO NRF52: Enable button pullup
Some versions of the Wio-SX1262 board don't have the button and the
pullup resistor populated. Enable the internal pullup to prevent
a floating pin and spurious button presses on those boards.

This fixes #1173.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-05 12:40:12 +01:00
liquidraver
73ab0d8813 Improve SerialBLEInterface 2025-12-05 07:39:48 +01:00
Florent de Lamotte
6db57677f9 tracker_l1: enable dc/dc converter 2025-12-04 12:01:00 +01:00
liquidraver
1a3f7a7ea9 Fix BLE semaphore leak in Bluefruit library
Patches Bluefruit library to fix semaphore leak bug that causes device lockup
when BLE central disconnects unexpectedly (e.g., going out of range, supervision timeout).

Co-authored-by: Liam Cottle <liamcottle@users.noreply.github.com>
Co-authored-by: oltaco <oltaco@users.noreply.github.com>
2025-12-04 11:47:41 +01:00
fdlamotte
01f7a3c95e Merge pull request #1057 from liquidraver/wiodev
Disable screen switching on when connected
2025-12-04 11:10:51 +01:00
Luis Garcia
ec375fa248 variants: lilygo_techo: variant: Turn off leds on poweroff
Signed-off-by: Luis Garcia <git@luigi311.com>
2025-12-03 19:30:47 -07:00
ripplebiz
441d768ddb Merge pull request #1172 from oltaco/nrf52-power-changes
NRF52 Power related changes
2025-12-03 17:50:15 +11:00
taco
e1d3da942b fix DC/DC enable for boards which currently have it.
this fixes how the reg1 dc/dc converter is enabled on WisMesh Tag / T1000e / WM1110 and Xiao NRF52
2025-12-03 15:59:59 +11:00
taco
dde9b7cc76 remove calls to sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
this is the default mode, there is no need to call it unless previously changing it.
2025-12-03 15:59:59 +11:00
ripplebiz
0082149c60 Merge pull request #996 from mattzzw/dev
Add display of IP address to companion screen
2025-12-03 13:52:48 +11:00
ripplebiz
a616a843a9 Merge pull request #1039 from ViezeVingertjes/feat/support-nibble-screen-connect
Add ESP32-S3-Zero board configuration and Nibble Screen Connect variant
2025-12-03 13:49:51 +11:00
ripplebiz
c77391c5dd Merge pull request #1169 from Meshcore-Portugal/jbrazio/2025_db83f76e
Bridge: Fix RAK4631 GPS conflict and add T114 RS232 targets
2025-12-03 13:43:19 +11:00
ripplebiz
acc32aa166 Merge pull request #1156 from csrutil/persist-gps
Persist GPS enabled state to preferences
2025-12-02 21:50:21 +11:00
João Brázio
69a9a0bce9 Bridge: Add t114 rs232 targets 2025-12-02 10:31:24 +00:00
João Brázio
f56172738d Bridge: Fix RAK4631 serial2 GPS conflict 2025-12-02 10:30:45 +00:00
Florian Lippert
07d6484b61 Support for RAK11310 WisBlock 2025-12-01 21:29:03 +01:00
Florent
405f703bfe thinknode_m5: fix repeater build 2025-12-01 09:40:02 +01:00
ripplebiz
eee25605ca Merge pull request #1162 from recrof/led_state_fix
add default LED_STATE_ON for boards that don't have it defined
2025-11-30 21:09:01 +11:00
Rastislav Vysoky
052f17738c add default LED_STATE_ON for boards that don't have it defined 2025-11-30 10:52:33 +01:00
Scott Powell
6d3219329f Merge branch 'dev' 2025-11-30 18:32:49 +11:00
Scott Powell
e054597a18 * ver 1.11.0 2025-11-30 18:32:10 +11:00
csrutil
cfb7ed876c CMD_SET_CUSTOM_VAR will update gps and gps_interval 2025-11-30 09:45:56 +08:00
csrutil
df3cb3d192 _location->loop() should be in the next tick 2025-11-29 20:29:52 +08:00
csrutil
62e180dc0f changed ms to sec 2025-11-29 19:02:00 +08:00
csrutil
39503ad0b4 move GPS preference initialization to UITask 2025-11-29 18:35:34 +08:00
csrutil
4aebc57add fixed gps init value 2025-11-29 18:02:08 +08:00
csrutil
678915ef3b add GPS interval validation and bounds checking 2025-11-29 17:30:13 +08:00
csrutil
88fb173297 add configurable GPS update interval
Make GPS update interval configurable via settings instead of using hardcoded 1 second value. The interval is persisted from preferences and can be adjusted at runtime through the sensor manager settings interface
2025-11-29 17:20:21 +08:00
csrutil
c641beabd3 https://github.com/meshcore-dev/MeshCore/issues/989 - persist GPS enabled state to preferences
Add GPS configuration to NodePrefs structure and persist the GPS
enabled state when toggled via UI. This ensures GPS settings are
retained across device restarts.
2025-11-29 16:37:23 +08:00
ripplebiz
fe874032d5 Merge pull request #1153 from fdlamotte/thinknode_m5
Thinknode m5 support
2025-11-29 12:13:30 +11:00
Florent
1c0017b634 thinknode_m5: gps support 2025-11-28 13:15:11 +01:00
Florent
ee4e87c3ee thinknode_m5: manage baclight 2025-11-28 10:33:19 +01:00
Florent
dfec6d3483 thinknode_m5: tx_led 2025-11-28 09:57:58 +01:00
Florent
24edd3cf20 thinknode_m5: add pca9557 expander 2025-11-27 22:55:21 +01:00
Florent
d0f6def4f9 thinknode_m5: initial port 2025-11-27 21:49:04 +01:00
Scott Powell
0307b64721 Merge branch 'dev' into ext-trace 2025-11-27 23:22:06 +11:00
Scott Powell
3ddfdd477b Revert "add heltec_v4 tft expansion box"
This reverts commit 310618e689.
2025-11-27 21:34:52 +11:00
Scott Powell
5b975d9e94 Merge branch 'dev' into ext-trace 2025-11-27 19:31:03 +11:00
ripplebiz
ffbc24b3e7 Merge pull request #1148 from Meshcore-Portugal/jbrazio/2025_6d9681e2
Add RAK4631 support for rs232 bridge
2025-11-27 17:01:30 +11:00
ripplebiz
eae2fba73c Merge pull request #1082 from KR4DIO/dev
Ikoka Handheld variant
2025-11-27 16:12:22 +11:00
ripplebiz
13bf82f1c4 Merge pull request #1130 from zaquaz/buzzer-feature-pr
Added buzzer config persistance across restart
2025-11-27 16:04:44 +11:00
zaquaz
6c7b5390e2 Remove default setting, since it is handled in MyMesh 2025-11-26 18:37:56 -08:00
ripplebiz
59fc28b344 Merge pull request #1150 from recrof/heltec_build_fixes
fix building issues with heltec wireless paper and heltec tracker
2025-11-26 22:18:23 +11:00
ripplebiz
2ca15ef3dc Merge pull request #1151 from recrof/m2_fixes
ThinkNode M2: build fix
2025-11-26 22:17:17 +11:00
ripplebiz
c17bd5d6fc Merge pull request #1122 from fschrempf/xiao-nrf-ui-and-power-optimizations
Companion Power Optimizations and UI Support for XIAO NRF52
2025-11-26 22:11:02 +11:00
Rastislav Vysoky
e98c79ae48 added missing NonBlockingRTTTL dependency, added USB and WIFI companions 2025-11-25 19:45:51 +01:00
Rastislav Vysoky
5b7d73866c fix building issues with heltec wireless paper and heltec tracker 2025-11-25 19:41:01 +01:00
João Brázio
baedddb25d Rename RS232 bridge environments and update build flags for Serial1 and Serial2 2025-11-25 16:19:28 +00:00
João Brázio
eafbd85d17 Add RAK4631 support for rs232 bridge 2025-11-25 11:53:21 +00:00
ripplebiz
8340d0e060 Merge pull request #1104 from zjs81/Fix-BW-setting-and-returning
Refactor float conversion in CommonCLI
2025-11-25 22:32:35 +11:00
ripplebiz
a9397c17d1 Merge pull request #1118 from Quency-D/dev-heltec-v4-tft
add heltec_v4 tft  expansion box
2025-11-25 22:18:05 +11:00
ripplebiz
79a036f995 Merge pull request #1131 from wel97459/dev-uint
Changed uint used in flags to uint8_t
2025-11-25 21:51:36 +11:00
Scott Powell
cdbeacdc4d Merge branch 'dev' into ext-trace 2025-11-25 15:17:48 +11:00
Scott Powell
30ccc1fa01 * BUG FIX: remote login fix same as repeater 2025-11-25 15:12:48 +11:00
Scott Powell
0e903de72c * BUG FIX: same remote login fix as repeater 2025-11-25 15:09:51 +11:00
Scott Powell
dc58f0ea83 * BUG FIX: repeater remote admin, flood login should invalidate the client->out_path 2025-11-24 22:56:55 +11:00
ripplebiz
f2740150df Merge pull request #1075 from agessaman/companion-stats
Add statistics commands to return device metrics on companions
2025-11-24 12:34:35 +11:00
João Brázio
d84e615466 Add devcontainer configuration for vscode 2025-11-23 14:25:38 +00:00
Brad Ferguson
2a33246c6f Merge branch 'meshcore-dev:dev' into dev 2025-11-22 23:48:01 -06:00
Frieder Schrempf
7723a4cb34 variants: Heltec T114: Enable DC/DC regulator
According to the documentation and experiments on other boards using
NRF52 + SX1262 this reduces the power consumption significantly.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-11-22 15:05:12 +01:00
Jaroslav Škarvada
32d622d969 variants: Heltec T114: Disable LED and GPS when powering off
This should reduce power consumption in hibernation.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2025-11-22 15:05:11 +01:00
Frieder Schrempf
5235516dc7 variants: XIAO NRF52: Enable status LED
Fix the active state of the LEDs (active low) and enable the status
LED.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-11-22 15:05:09 +01:00
Frieder Schrempf
048bd268a1 companion: ui: Respect LED_STATE_ON for status LED
The current logic only works for active high LEDs. Some boards need
an active low level control and therefore they set LED_STATE_ON to 0.
Take this into account and use the correct LED pattern for both cases.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-11-22 15:05:08 +01:00
Frieder Schrempf
4a8dcb4906 variants: XIAO NRF52: Support power-off via user button
Add the necessary code to properly power-off the Xiao + Wio
companions. This way we can achieve around 15 microamps of power
consumption in the off state.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-11-22 15:05:07 +01:00
Frieder Schrempf
c76d337a00 variants: XIAO NRF52: Enable user button
The Xiao nRF52840 combined with the Wio-SX1262 is often used for
cheap and compact DIY companion nodes. The Wio actually has an onboard
pushbutton that can be used as user button. Enable support for the
button.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-11-22 15:05:06 +01:00
Frieder Schrempf
11f119a7fb variants: XIAO NRF52: Enable DC/DC regulator
This reduces the power consumption by approximately 25%.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-11-22 15:05:05 +01:00
Frieder Schrempf
b9b82fcf1b variants: WisMesh Tag: Enable status LED
Use the blue LED as status LED. This prevents the blue LED from
being always-on and draining the battery. Instead use it as status
LED with blink patterns as other companion devices do.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-11-22 15:05:04 +01:00
Frieder Schrempf
0f565323a0 variants: WisMesh Tag: Enable DC/DC regulator
According to the documentation and experiments on other boards using
NRF52 + SX1262 this reduces the power consumption significantly. This
assumes that the hardware actually has the inductor for the internal
DC/DC regulator populated which is very likely. Even if not, it won't
hurt.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-11-22 15:05:02 +01:00
Jaroslav Škarvada
07e7e2d44b companion: Suspend radio when hibernating
This should significantly reduce power consumption in hibernation.

Fixes: #1014

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Signed-off-by: Frieder Schrempf <frieder@fris.de> # generalize for all radios and UIs
2025-11-22 15:05:01 +01:00
ripplebiz
5f06dc4a2f Merge pull request #1133 from oltaco/repeater-adc-multiplier-setting
Feature: configurable adc.multiplier for repeaters
2025-11-22 14:50:23 +11:00
taco
fc93d84fb8 tweaks get/set adcMultiplier logic 2025-11-21 23:44:17 +11:00
taco
e13c064487 add board.setAdcMultiplier to room server and sensor 2025-11-21 21:46:55 +11:00
ripplebiz
fc68203275 Merge pull request #1127 from oltaco/rename-faketec-to-promicro
Rename Faketec to ProMicro
2025-11-21 19:40:31 +11:00
taco
5a3ea64a97 Repeater: add adc.multiplier setting 2025-11-21 18:15:30 +11:00
taco
454f6b2583 rename adverts 2025-11-21 17:57:49 +11:00
Winston Lowe
031fa1e704 Changed uint to a uint8_t 2025-11-20 21:58:42 -08:00
Scott Powell
b33d226c58 * proposal for 'Extended Trace' packets. Using 'flags' byte, lower 2 bits, for path hash size. 2025-11-21 15:44:31 +11:00
zaquaz
2bd47de3b9 Added buzzer config persistance accross restart 2025-11-20 19:02:32 -08:00
taco
ed9655e14e rename faketec to promicro 2025-11-21 12:48:33 +11:00
ripplebiz
f5a56c537f Merge pull request #1113 from recrof/bme280_fix
fix: make bme280 sensor usable again
2025-11-19 15:39:48 +11:00
Quency-D
310618e689 add heltec_v4 tft expansion box 2025-11-19 11:43:52 +08:00
recrof
88a6141943 fix: move bme680 detection before bme280 2025-11-18 15:36:25 +01:00
agessaman
a3c9a07377 Modify CMD_GET_STATS with sub-types for core, radio, and packet statistics. Consolidated to a single RESP_CODE_STATS with a second byte to identify response structure. Updated documentation and examples to reflect the new command structure and response parsing. 2025-11-17 09:57:36 -08:00
ripplebiz
459169e8cb Merge pull request #1092 from liquidraver/rakgps
Fix RAK4631 GPS UART pin macros for L76K to work
2025-11-17 14:04:09 +11:00
ripplebiz
caf421b591 Merge pull request #1106 from oltaco/keepteen-lt1
Add support for Keepteen LT1
2025-11-17 13:50:16 +11:00
Florent
838e83b3b5 xiao_s3: relocate serial pins on repeater_bridge_rs232
* conflicts with i2c pins that are documented on the same pins
* this is a commented target
2025-11-16 17:07:33 +01:00
Florent
3dd6dc02ea xiao_s3: use environment sensor manager and add sensor role 2025-11-16 16:55:16 +01:00
taco
bc2256f232 Keepteen LT1: remove terminal_chat and sensor targets 2025-11-16 16:17:11 +11:00
taco
2058af8453 initial support: Keepteen LT1 2025-11-16 15:55:49 +11:00
zach
850d57a8f2 Refactor float conversion in CommonCLI to use strtof for improved precision and add ftoa3 function for formatting floats with three decimal places in TxtDataHelpers to fix display issue in app and repeater config ui in web
REPO:
1. Flash a repeater
2. Connect over lora
3. Set bw to 42.7 KHZ

It will revert back due to converting a double to a float.

REPO2:
1.Flash Repeater
2. Apply float fix
3. Set to say 20.8
4. try to get value via app or web cli repeater config
It wil show blank because it doesnt return a good value. It would be something like 20.7999992 which the app and web apps dont like so the ftoa3 rounds it and returns a 3 decimal point float
2025-11-14 21:51:28 -07:00
ripplebiz
8dbb0f5f23 Merge pull request #1071 from tpp-at-idx/thinknode_m2
Thinknode_M2: better battery reading accuracy and no display on powerup fix
2025-11-14 15:11:06 +11:00
ripplebiz
ff67c786ef Merge pull request #985 from liquidraver/dev3
Fix reversed GPS PINs on G2 and enable timesync
2025-11-14 14:34:23 +11:00
ripplebiz
11a0bd6ef1 Merge pull request #1035 from liquidraver/devt114
Add Heltec T114 GPS + timesync
2025-11-14 14:33:05 +11:00
Liam Cottle
9bfbb777a1 Merge pull request #1100 from stphnrdmr/dev
Allow SF smaller than 7 to be saved
2025-11-14 12:15:10 +13:00
Stephan Rodemeier
16c294ce60 Allow SF smaller than 7 to be saved 2025-11-13 22:25:55 +01:00
Brad Ferguson
15d52a6e27 Merge branch 'meshcore-dev:dev' into dev 2025-11-13 14:52:02 -06:00
Scott Powell
9405e8bee3 Merge branch 'dev'
# Conflicts:
#	docs/payloads.md
2025-11-13 20:47:52 +11:00
Scott Powell
91e9fcea4b * ver 1.10.0 2025-11-13 20:45:38 +11:00
fdlamotte
750e955f19 Update library.json to latest libs and version 2025-11-13 10:39:20 +01:00
fdlamotte
8b68b5a689 Update README.md (RAK boards don't need pio patch) 2025-11-12 16:14:57 +01:00
ripplebiz
a5cdc88fe2 Merge pull request #1064 from recrof/esp_contacts_350_channels_40
set max contacts to 350 and channels to 40 for esp32c3, s3 and c6
2025-11-12 00:49:05 +11:00
ripplebiz
ba6b8535c9 Merge pull request #971 from fdlamotte/remove_set_setting_by_key
SensorManager: remove setSettingByKey
2025-11-11 23:40:13 +11:00
liquidraver
b0ce00652f Fix RAK4631 GPS UART pin macros 2025-11-11 13:00:27 +01:00
Florent
90e26129ee Merge branch 'dev' into remove_set_setting_by_key 2025-11-11 12:23:12 +01:00
Scott Powell
b59d1999e6 * Sensor: DISCOVER_REQ, prefix_only support 2025-11-11 20:08:05 +11:00
ripplebiz
74f136ba7a Merge pull request #1068 from fdlamotte/sensor_control_data
sensor: copy control data code from repeater
2025-11-11 20:03:33 +11:00
agessaman
39f83efbfe Remove unused statistics formatting methods and associated header includes from MyMesh class. Whoops. 2025-11-09 11:39:47 -08:00
agessaman
80d6dd4367 Update statistics handling to use binary frames instead of JSON formatting for consistency with other companion commands. Added documentation of frame structure with code examples. 2025-11-09 11:28:49 -08:00
agessaman
c9aa536ca6 Reverted MyMesh constructor for simplicity.
Updated formatStatsReply method to use new member variables for statistics handling.
Removed excess variable creation
2025-11-09 11:28:49 -08:00
agessaman
df4dab8509 Add statistics commands and response handling in MyMesh
- Introduced new commands for retrieving statistics: CMD_GET_STATS_CORE, CMD_GET_STATS_RADIO, and CMD_GET_STATS_PACKETS.
- Implemented corresponding response handling methods to format and send statistics data.
- Updated MyMesh constructor to initialize new member variables for managing statistics.
- Included StatsFormatHelper for formatting statistics replies.
2025-11-09 11:28:49 -08:00
Scott Powell
ab0721d6df * fix: repeater and room server telemetry requests now return all telemetry for _READ & _WRITE ACL permissions. 2025-11-09 16:36:23 +11:00
Scott Powell
b31d3e7b5f * added StrHelper::fromHex() 2025-11-09 16:17:49 +11:00
brad
00e0635ab5 add variant files for ikoka handheld (nrf52 with e22 radio) 2025-11-08 20:05:46 -06:00
Tomas P
a0bf66f9d8 Fix for display not coming on after poweron 2025-11-07 09:50:21 +01:00
Tomas P
429f82106b tweak getBattMilliVolts to report battery more accurately 2025-11-07 09:48:57 +01:00
Tomas P
c0a51aff66 change ADC_MULTIPLIER to better reflect battery voltage 2025-11-07 09:47:18 +01:00
Scott Powell
1520f4d28e * repeater, DISCOVER_REQ, flags lowest bit now for 'prefix_only' responses 2025-11-07 19:31:09 +11:00
Scott Powell
62d7ce110b * packet format docs updated 2025-11-07 15:49:01 +11:00
Scott Powell
28b90c18cf Merge branch 'transportcodes' into dev 2025-11-07 14:52:11 +11:00
Scott Powell
963290ea15 * repeater: various "region" CLI changes
* transport codes 0000 and FFFF reserved
2025-11-07 14:42:06 +11:00
Florent
06825030e5 sensor: copy control data code from repeater 2025-11-06 22:36:37 +01:00
Scott Powell
2e63499ae5 * companion: protocol ver bumped to 8. 2025-11-06 22:51:17 +11:00
Scott Powell
4a5404d997 * companion: added CMD_SEND_CONTROL_DATA, and PUSH_CODE_CONTROL_DATA 2025-11-06 22:10:20 +11:00
Scott Powell
ddac13ae80 * repeater: CLI, added "region put" and "region remove" commands 2025-11-06 21:40:52 +11:00
Scott Powell
256848208d * repeater: onAnonDataRecv(), future code check bug fix (offset 4)
* sensor: onAnonDataRecv(), future request code provision
2025-11-06 20:22:40 +11:00
Scott Powell
09eab330a2 * repeater: onAnonDataRecv(), now rejecting non-ASCII password (preparing for future request codes)
* repeater: DISCOVER requests now with a simple RateLimiter (max 4, every 2 minutes)
2025-11-06 20:15:01 +11:00
Scott Powell
cf547da857 * RegionMap: get/set Home Region
* repeater: admin CLI, changed "allowf *", "denyf *", added "home"
2025-11-06 17:28:45 +11:00
ripplebiz
a9d245fe68 Merge pull request #1038 from adam2872/Analogue-button-fix-for-new-UI
Analogue user button fix for new UI
2025-11-06 15:41:45 +11:00
ripplebiz
23783b27c8 Merge pull request #1058 from dotdavid/dev
Fix Xiao S3 WIO board name
2025-11-06 13:45:12 +11:00
Scott Powell
7419ed71f7 * region filtering now applied in allowPacketForward() 2025-11-06 12:27:25 +11:00
Scott Powell
82b4c1e6b0 * new PAYLOAD_TYPE_CONTROL (11)
* repeater: onControlDataRecv(), now responds to new CTL_TYPE_NODE_DISCOVER_REQ (zero hop only)
* node prefs: new discovery_mod_timestamp  (will be set to affect when node should respond to DISCOVERY_REQ's )
2025-11-06 00:56:54 +11:00
Scott Powell
3ef53e64a1 * is_name_char() bug fix 2025-11-05 15:34:23 +11:00
Scott Powell
937865c8fd * companion: new CMD_SET_FLOOD_SCOPE (54) 2025-11-05 14:56:18 +11:00
Scott Powell
9ebeb477aa * RegionMap: inverted 'flags' to _deny_ bits
* Mesh: new filterRecvFloodPacket() for overriding
* repeater CLI: 'allow' -> 'allowf' or 'denyf'
2025-11-05 14:34:44 +11:00
recrof
04c0c40b39 set max contacts to 350 and channels to 40 for esp32c3, s3 and c6 2025-11-04 23:58:32 +01:00
David Hall
c3dbec41ba Fix manufacturer name on Seeed Xiao S3 WIO 2025-11-03 21:02:08 +00:00
David Hall
5c80334dbd Fix manufacturer name on Seeed Xiao S3 WIO 2025-11-03 21:00:43 +00:00
liquidraver
99a3473169 even less comments \o/ 2025-11-03 21:41:11 +01:00
liquidraver
eae16cfc5f less unnecessary comments, less lines of code :) 2025-11-03 21:39:35 +01:00
liquidraver
397d280c3b stop OLED powering on every message if connected to phone 2025-11-03 21:25:31 +01:00
Scott Powell
d9ff3a4d02 * Mesh: new sendFlood() overload with transport codes.
* BaseChatMesh:  sendFloodScoped(), for overriding with some outbound 'scope' / TransportKey
* companion: new 'send_scope' variable.
2025-11-04 01:21:56 +11:00
Scott Powell
ecd30f4d36 * new CLI commands: region, region load, region save, region get, region allow 2025-11-03 22:53:14 +11:00
Scott Powell
f797744f7c * misc RegionMap and key store methods 2025-11-03 18:14:44 +11:00
Scott Powell
03fc949014 * setting up framework for Regions, TransportKeys, etc 2025-11-03 14:23:32 +11:00
ripplebiz
5b4544b9fe Merge pull request #889 from fdlamotte/sensecap_indicator
Sensecap indicator
2025-11-03 11:09:17 +11:00
ripplebiz
920ac51c8c Merge pull request #998 from tahnok/bmp085-sensor
Add support for bmp085/bmp180 temperature/pressure sensor
2025-11-03 10:58:22 +11:00
Liam Cottle
0b9f055860 Merge pull request #1047 from aqua/build-name-fix
Fix the sample RAK repeater build target name
2025-11-01 19:19:49 +13:00
Devin Carraway
d0caa3be04 Fix the sample RAK repeater build target name
The actual target doesn't capitalize the 'r' in repeater.
2025-10-31 22:11:24 -07:00
ViezeVingertjes
ff4fa7be31 Add ESP32-S3-Zero board configuration and Nibble Screen Connect variant 2025-10-31 14:42:16 +01:00
Adam Mealings
c13b4ae481 Analogue button delay based on millis 2025-10-31 13:04:59 +00:00
Scott Powell
7755400a35 * Companion: Now using transport codes { 0, 0 } when Share contact zero hop.
* Repeater: onAdvertRecv(), adverts via Share now NOT added to neighbours table
2025-10-31 20:40:22 +11:00
ripplebiz
ef752926c9 Merge pull request #1036 from oltaco/datastore-refactor
Refactor DataStore to use openRead() and openWrite()
2025-10-31 17:10:03 +11:00
ripplebiz
228b073006 Merge pull request #982 from ViezeVingertjes/feat/wio-wm1110-variant
Add Seeed Wio WM1110 Dev Board variant
2025-10-31 17:02:47 +11:00
ripplebiz
7ad45d113c Merge pull request #993 from recrof/allow_lower_bw_sf
allow saving spreading factor from 5 and bandwidth from 7.8kHz
2025-10-31 16:58:35 +11:00
Scott Powell
7abe6c9693 * Upping max channel hash conflicts to 4 (was 2) 2025-10-31 16:54:58 +11:00
taco
52a3df4977 revert pubBlobByKey() change 2025-10-31 15:06:29 +11:00
taco
0b8159c6e5 refactor DataStore to use openRead() and openWrite()
refactored loadPrefsInt(), loadContacts(), loadChannels(), getBlobByKey() and putBlobByKey() to use openRead() and openWrite()
2025-10-31 13:17:22 +11:00
ViezeVingertjes
5088444f85 Update Wio WM1110 configuration to disable GPS and clean up location provider code 2025-10-30 16:33:02 +01:00
liquidraver
07e58d8ab5 Merge branch 'dev' into devt114 2025-10-30 10:10:06 +01:00
Scott Powell
96e786fa9e * FIX: for divide by zero crash 2025-10-30 19:11:04 +11:00
liquidraver
f3b20d5e70 t114 gps 2025-10-30 08:35:01 +01:00
Scott Powell
3d9378d91e * Fix for VolatileRTCClock wrapping around to initial synced time every 49 days 2025-10-30 16:45:50 +11:00
ripplebiz
c4e99a841a Merge pull request #1023 from WattleFoxxo/dev
Update xiao rp2040 to use new radio standard init
2025-10-30 12:43:20 +11:00
Scott Powell
80f0405600 * direct.txdelay default now 0.2 (was zero) 2025-10-30 00:03:10 +11:00
Scott Powell
886878c70a Merge commit 'cc002404fa89a2b0139a1394f78b4a72988846f8' into dev 2025-10-29 23:36:07 +11:00
Scott Powell
8cbcd2271d * experimental: retransmit delay, removing the 6 'slots' 2025-10-29 23:35:46 +11:00
ripplebiz
cc002404fa Merge pull request #1026 from recrof/disable_esp32c6
esp32c6: disable releases because of issues with pioarduino(arduino 3.0)
2025-10-29 23:29:06 +11:00
ripplebiz
ac37a37b18 Merge pull request #1025 from recrof/disable_vision_master
heltec vision master: remove boards from build process
2025-10-29 23:28:26 +11:00
recrof
4aef696620 missed one definition 2025-10-29 13:27:26 +01:00
recrof
377f9ff67d renamed esp32c6 variants, so they are not included in release. added disclaimer about pioarduino builds 2025-10-29 13:22:11 +01:00
recrof
1c052d8ad2 use different strategy in renaming the envs in order to avoid building 2025-10-29 13:14:27 +01:00
recrof
1bbc2151f1 remove vision master boards because of issues with display drivers 2025-10-29 10:32:39 +01:00
fdlamotte
1d2a115b26 Merge pull request #900 from michaelhart/dev
Add stats to serial CLI
2025-10-29 08:50:17 +01:00
Michael Hart
81ab944682 Adds serial commands to get stats
- Added formatStatsReply, formatRadioStatsReply, and formatPacketStatsReply methods in MyMesh for both simple_repeater, simple_room_server, and simple_sensor.
- Updated CommonCLI to handle new stats commands.
2025-10-28 23:55:49 -07:00
WattleFoxxo
d4eb04d6e9 Switch xiao rp2040 to std init 2025-10-29 15:20:31 +11:00
Matthias Wientapper
f339c74bb4 * Add #ifdef, reuse variable 2025-10-27 17:58:29 +01:00
ripplebiz
cb4468bd5d Merge pull request #977 from tpp-at-idx/thinknode_m2
Support for Elecrow Thinknode M2
2025-10-27 13:31:09 +11:00
ripplebiz
9aa11a87ab Merge pull request #1000 from kallanreed/enable_wismesh_tag_gps
Add PIN_GPS_EN build flag for wismesh tag companion
2025-10-26 15:36:48 +11:00
ripplebiz
a2f5432818 Merge pull request #1018 from Woodie-07/dev
LR1110 IRQ fixes
2025-10-26 14:54:27 +11:00
Woodie-07
0e259a63ed lr1110 irq fixes
fix incorrect irqs used in isReceiving. also remove getTimeOnAir override as fixed upstream
2025-10-25 22:12:30 +01:00
fdlamotte
6d6db10ac5 Merge pull request #1012 from Woodie-07/dev
New workaround for LR1110 shift issue
2025-10-25 09:14:11 +02:00
Woodie-07
2981fc70e1 new workaround 2025-10-24 20:12:02 +01:00
ripplebiz
61cd01db27 Merge pull request #1003 from liamcottle/feature/increased-max-uptime
Increase max uptime stats from 49 days to 136 years
2025-10-23 23:30:10 +11:00
Scott Powell
63c3342f7d Merge commit '6288a5d11a8786c9883d6ce0c8a404430150a664' into dev 2025-10-23 21:49:11 +11:00
Scott Powell
dfb4497c7a * T114: enabled GPS page in UITask 2025-10-23 21:44:52 +11:00
liamcottle
273a54f104 increase room server max uptime from 49 days to 136 years 2025-10-23 23:29:08 +13:00
liamcottle
f1824e68b9 increase repeater max uptime from 49 days to 136 years 2025-10-23 23:24:40 +13:00
Liam Cottle
6288a5d11a Merge pull request #1002 from wel97459/dev-CayenneLPP
Updated CayenneLPP to 1.6.1
2025-10-23 20:24:49 +13:00
Winston Lowe
2e249e24dc Updated CayenneLPP to 1.6.1 2025-10-22 23:55:51 -07:00
kallanreed
9e61b56e70 Use correct macro for logging test 2025-10-22 16:44:20 -07:00
kallanreed
8ca3ed28cf set PIN_GPS_EN in wismesh tag companion 2025-10-22 16:16:43 -07:00
Wesley Ellis
4cfbd3bad5 Switch BMP085 mode to 0 for ULTRALOWPOWER 2025-10-22 16:53:11 -04:00
Wesley Ellis
ac15131296 Add support for bmp085/bmp180 temperature/pressure sensor 2025-10-22 16:17:06 -04:00
Matthias Wientapper
a38418e09a * Add display of IP address to companion screen 2025-10-22 20:01:15 +02:00
recrof
87677fda76 allow spreading factor from 5 and bandwidth from 7.8kHz 2025-10-22 15:15:29 +02:00
liquidraver
0920dc6663 Fix reversed GPS PINs on G2 and enable timesync 2025-10-21 12:23:45 +02:00
ripplebiz
f27e8ba6b2 Merge pull request #981 from oltaco/revert-heltecT114-powersaving
Revert Heltec T114 power savings
2025-10-21 17:20:02 +11:00
ViezeVingertjes
ec05d40b3c Add Seeed Wio WM1110 Dev Board variant 2025-10-20 21:40:59 +02:00
taco
5d495d505a Revert Heltec T114 power savings
As discussed on discord with @recrof people are having issues, possibly due to these changes. See https://github.com/meshcore-dev/MeshCore/issues/746

This reverts commit a16e011bd2.
2025-10-21 00:34:57 +11:00
ripplebiz
4687ab74e3 Merge pull request #973 from recrof/rak_platform_update
equalize RAK with all other nrf52 variants and use newer platform with all important fixes
2025-10-20 20:07:49 +11:00
ripplebiz
292305c5e1 Merge pull request #972 from recrof/Adafruit_nRF52_Arduino-1.7.0
all nrf52 devices: force framework-arduinoadafruitnrf52 version to 1.10700.0
2025-10-20 20:04:36 +11:00
Tomas P
31b8f7252a Support for Elecrow Thinknode M2 2025-10-19 20:44:27 +02:00
ripplebiz
99e44f499e Merge pull request #968 from fdlamotte/uitask_back3_disables_buzzer
uitask: bring back buzzer toggle on tracker l1
2025-10-19 14:34:42 +11:00
ripplebiz
dab44a1bb0 Merge pull request #967 from fdlamotte/remove_target_h_dep
CommonCli: Remove dependency on target.h
2025-10-19 14:25:20 +11:00
ripplebiz
53a2ae97ea Merge pull request #923 from recrof/tlora_1.6_cleanup
TLora V2.1 1.6 cleanup
2025-10-19 14:15:55 +11:00
ripplebiz
798725d450 Merge pull request #922 from recrof/station_g2_cleanup
station g2 cleanup
2025-10-19 14:11:20 +11:00
ripplebiz
a222578041 Merge pull request #921 from recrof/heltec_v2_cleanup
heltec v2 cleanup
2025-10-19 14:07:16 +11:00
ripplebiz
ebf4599c92 Merge pull request #920 from recrof/heltec_v3_cleanup
heltec v3 cleanup
2025-10-19 14:01:50 +11:00
Liam Cottle
79d0989702 Merge pull request #962 from haxwithaxe/dev
Added more polished build.sh usage
2025-10-19 12:10:58 +13:00
Liam Cottle
b2dcb06197 Merge pull request #809 from tekstrand/fixup
Change source of truth to this repo, remove whitespace
2025-10-19 12:07:53 +13:00
recrof
a5070077ba equalize RAK with all other nrf52 variants and use newer platform with all important fixes 2025-10-19 00:02:38 +02:00
recrof
a421215e84 all nrf52 devices: force framework-arduinoadafruitnrf52 version to 1.10700.0 2025-10-18 23:42:28 +02:00
Florent
37dc715a8e SensorManager: remove setSettingByKey 2025-10-18 23:37:58 +02:00
Florent
ce70792309 lgfx_display: better handle display class construction 2025-10-18 14:03:27 +02:00
Florent
7d62a27836 uitask: bring back buzzer toggle on tracker l1 2025-10-18 13:40:01 +02:00
Florent
f085a9d6c5 tracker_l1_eink: set UI_HAS_JOYSTICK 2025-10-18 13:11:18 +02:00
Florent
3210475f35 CommonCli: Remove dependency on target.h 2025-10-18 12:33:43 +02:00
ripplebiz
666447eafc Merge pull request #955 from liquidraver/dev
Add simple BME680 support to RAK (RAK1906)
2025-10-18 15:06:05 +11:00
haxwithaxe
006af52776 Added more polished build.sh usage 2025-10-17 14:20:55 -04:00
fdlamotte
ece40716da Merge pull request #956 from recrof/uf2_pio_task
added custom pio task "Create UF2 file"
2025-10-17 17:24:32 +02:00
recrof
24ed5b377f added custom pio task "Create UF2 file" 2025-10-17 16:25:58 +02:00
fdlamotte
15ecf186fa Merge pull request #953 from Woodie-07/dev
LR1110 packet shift issue workaround
2025-10-17 15:26:09 +02:00
Woodie-07
02351abc2d change println to debug macro in lr1110 patch 2025-10-16 16:25:18 +01:00
liquidraver
3c48f01601 BME680 library doesn't have altitude calculation, we can add it here to match other sensors' 2025-10-16 11:29:22 +02:00
liquidraver
0e7486552d Add simple BME680 support to RAK with adafruit library 2025-10-16 10:17:23 +02:00
Scott Powell
cd920693ec * UITask: new UI_HAS_JOYSTICK
* MomentaryButton: new constructor 'multiclick' param
* WIoTrackerL1: now just use joystick, joystick press for KEY_ENTER, no multi-click for snappier UI
2025-10-16 17:33:22 +11:00
Scott Powell
d3be6afccb * fix for non-RAK targets 2025-10-15 22:51:05 +11:00
Scott Powell
fa8c31be88 * fix for RAK12500 GPS (I2C) 2025-10-15 22:47:55 +11:00
ripplebiz
34b9a1c9dc Merge pull request #916 from Quency-D/dev-heltec_tracker_v2
add heltec tracker v2
2025-10-14 12:45:15 +11:00
ripplebiz
ca5dcf22dd Merge pull request #911 from bplein/ikoka-nano-support
Ikoka Nano Variant
2025-10-14 12:39:35 +11:00
ripplebiz
86ecf97d33 Merge pull request #912 from recrof/patch-1
heltec wireless tracker: use `-D ARDUINO_USB_CDC_ON_BOOT=1` with all envs
2025-10-14 12:35:11 +11:00
Scott Powell
c6b4a58449 * repeater and room server: enable downgrading permissions on guest login 2025-10-14 12:31:43 +11:00
fdlamotte
633538d9c7 Merge pull request #918 from recrof/xiao_c3_refresh
xiao c3 cleanup
2025-10-12 19:10:47 +02:00
recrof
c6e5d5021e fix: remove VL53L0X because it causes bootloops on esp32c3 2025-10-12 17:16:45 +02:00
Woodie-07
8426fddcb7 workaround for LR1110 shift issue
it seems that if the LR1110 radio hears a packet corrupted in a specific way, it'll report a packet of 0 length and with the header error IRQ set. every packet received afterwards will then be shifted to the right by 4 bytes on top of the radio's reported offset. this can occur multiple times with the shift increasing by 4 bytes each time. thus, this patch will read from an additional offset after hearing the trigger packet.
transmitting seems to reset the shift - unsure exactly what operation resets it but standby() is called after tx so patch assumes shift is 0 after standby(). more investigation may be needed here.
2025-10-12 16:09:57 +01:00
Scott Powell
93c0180740 * Refactor: advert_loc_policy now applied in new method CommonCLI::buildAdvertData() 2025-10-12 12:49:26 +11:00
Scott Powell
837e7dcbdb * Advert type fix
* GPS pref defaults tidy
2025-10-12 12:33:20 +11:00
ripplebiz
487b7c6576 Merge pull request #890 from fdlamotte/CommonCLI--gps-management
CommonCLI: gps management commands
2025-10-12 12:21:47 +11:00
recrof
69cddbca4e move LilyGoTLoraBoard.h to variants, use template in platformio.ini, cleanup 2025-10-12 00:32:26 +02:00
recrof
7cb2e0863a move StationG2Board.h to variants, enable ESM, add companion wifi, cleanup 2025-10-12 00:13:34 +02:00
recrof
1979517381 heltec v2 cleanup 2025-10-11 23:35:10 +02:00
recrof
c4a2b13930 moved HeltecV3Board.h to variant folder 2025-10-11 21:52:48 +02:00
Florent
bf1da43d7d gps_cli: gps advert to control advert location policy 2025-10-11 19:00:02 +02:00
recrof
4dc3dda2d8 xiao c3: migrated to esm, added missing roles, cleanup 2025-10-11 18:32:02 +02:00
Florent
f6064b41e9 gps_cli: set node location based on gps 2025-10-11 18:00:57 +02:00
Florent
76dcfbb23a gpsCli: use parseTextParts 2025-10-11 15:29:17 +02:00
Quency-D
ad2894a039 delete PSRAM. 2025-10-11 18:03:15 +08:00
Quency-D
70ac820594 add heltec tracker v2 board. 2025-10-11 18:01:26 +08:00
Rastislav Vysoky
8a2e4721d1 heltec wireless tracker: use -D ARDUINO_USB_CDC_ON_BOOT=1 with all envs
repeater and room server envs did not have arduino cdc flag enabled which resulted in broken serial.
2025-10-10 16:01:48 +02:00
ripplebiz
da52d08168 Merge pull request #898 from syssi/wsl3-wifi-build
Introduce Heltec_WSL3_companion_radio_wifi target
2025-10-10 13:30:55 +11:00
ripplebiz
b47ace5d10 Merge pull request #908 from ViezeVingertjes/feat/meshpocket-poweroff
Add hibernation support for MeshPocket
2025-10-10 11:38:07 +11:00
Bill Plein
b588e3f1e3 Ikoka Nano Variant
Created as a fork of the ikoka stick variant.

- Updated for Ikoka Nano legacy pinout
- Removed display support
- Removed user button support
- Retains I2C sensor support

Tested with the ebytes E22 30W module, companion-ble and repeater firmware versions, with an I2C INA3221 power sensor.
2025-10-09 17:31:32 -05:00
ViezeVingertjes
da7b8ad669 Add powerOff support for MeshPocket 2025-10-09 20:30:25 +02:00
ripplebiz
27e5f6e7df Merge pull request #885 from ViezeVingertjes/fix/heltec-v4-max-tx-power
Add MAX_LORA_TX_POWER build flag for Heltec V4 configuration
2025-10-09 12:39:21 +11:00
Sebastian Muszynski
601479e572 Introduce Heltec_WSL3_companion_radio_wifi target 2025-10-07 11:17:19 +02:00
ripplebiz
da5dbcd274 Merge pull request #871 from spacepc-de/fix-debug-log-field
Fix debug log: use c->extra.room.push_failures instead of c->push_failures
2025-10-07 09:45:11 +11:00
Florent de Lamotte
9e3c2fc9d9 gps_cli: gps also restored on sensors and rooms 2025-10-06 15:30:18 +02:00
Florent de Lamotte
6ed8e9d514 gps_cli: gps state is now saved and restored upon reboot 2025-10-06 15:12:03 +02:00
Florent de Lamotte
c9fd1827ef Merge branch 'dev' into CommonCLI--gps-management 2025-10-06 14:26:05 +02:00
fdlamotte
5f31979e1e Merge pull request #831 from Meshcore-Portugal/jbrazio/2025_87fe0ad8
Add bridge management CLI
2025-10-06 14:23:35 +02:00
Florent de Lamotte
341b69e3c9 sensor list command 2025-10-06 14:08:16 +02:00
João Brázio
13a0202062 Add BRIDGE_DEBUG flag 2025-10-06 12:57:32 +01:00
João Brázio
fb46e5cc8a Refactor debug logging across bridge implementations 2025-10-06 12:57:04 +01:00
Florent de Lamotte
7be65c148e cli_gps: remove callbacks and add generic sensor set/get. 2025-10-06 10:25:10 +02:00
Florent
e4f2d63b0a cli_gps: use sensormanger to toggle gps on/off to keep state coherent 2025-10-05 20:31:25 +02:00
Florent
0502bc370d CommonCLI: gps management commands 2025-10-05 19:23:52 +02:00
Florent
45ab0e8cf7 sensecap_indicator: initial espnow support 2025-10-05 13:58:25 +02:00
João Brázio
9b4d93d112 Add bridge type command to CLI for reporting bridge configuration 2025-10-05 11:48:05 +01:00
ripplebiz
5ae574b426 Merge pull request #878 from WattleFoxxo/tdeck
Scaling fixes for TDeck
2025-10-05 15:18:51 +11:00
ViezeVingertjes
c568edc8d0 Add MAX_LORA_TX_POWER build flag for Heltec V4 configuration 2025-10-04 23:04:47 +02:00
tekstrand
3e3fa5b443 trim trailing whitespace, clarify repeater gps, remove outdated instructions 2025-10-04 10:54:24 -05:00
WattleFoxxo
69e6d69798 Fix font and icon scaling issues for TDeck 2025-10-03 22:55:32 +10:00
ripplebiz
54675ed1b2 Merge pull request #812 from khudson/source-cleanup
Ikoka Stick: Naming Convention, LED behavior, device strings
2025-10-03 14:04:00 +10:00
João Brázio
e48f3a58ae Remove WITH_ESPNOW_BRIDGE_SECRET definition from platformio.ini files and update documentation to use _prefs->bridge_secret 2025-10-03 00:23:09 +01:00
João Brázio
8edcb46a28 Bridge: enhance CLI configuration options 2025-10-03 00:20:09 +01:00
Florent
262e9864e7 stm32: upd repeater targets 2025-10-02 12:18:47 +02:00
ripplebiz
3912bbdf7d Merge pull request #821 from fdlamotte/ui_gps_page
ui_task: initial gps page
2025-10-02 18:54:23 +10:00
João Brázio
aa946bbe36 WITH_BRIDGE was not implementing setBridgeState() 2025-10-02 09:47:00 +01:00
Scott Powell
f5f5886327 Merge branch 'dev' 2025-10-02 12:52:48 +10:00
Scott Powell
8d8b9a6141 * ver 1.9.1 2025-10-02 12:52:19 +10:00
Florent de Lamotte
18bfc2d81a DisplayDriver: introduce drawTextRightAlign and drawTextLeftAlign 2025-10-01 18:07:59 +02:00
Jonathan Stöcklmayer
6ee0b85195 Fix debug log: use c->extra.room.push_failures instead of non-existent c->push_failures 2025-10-01 09:50:41 +02:00
ripplebiz
86225cd24a Merge pull request #869 from LitBomb/patch-19
Update faq.md
2025-10-01 13:46:44 +10:00
uncle lit
f594f2c7e6 Update faq.md
added pyMC_core to meshcore projects
mentioned Cisien's meshcoretomqtt fork from Andrew-a-g
updated Coding Rate explanation and recommendation
updated radio presets and added how to update presets listed in the app
2025-09-30 16:01:11 -07:00
ripplebiz
219297172a Merge pull request #863 from liamcottle/fix/repeater-login
Fix: repeater login
2025-09-29 21:38:54 +10:00
liamcottle
6a1f8d65c9 add missing null terminator for login payload 2025-09-30 00:31:10 +13:00
ripplebiz
b82f5ea7cd Merge pull request #859 from liamcottle/feature/board-cli-command
Add CLI Command: board
2025-09-29 13:28:21 +10:00
liamcottle
ec48e6acfc added 'board' cli command to get board name 2025-09-29 15:24:25 +13:00
Liam Cottle
e381f03bc2 Merge pull request #854 from liamcottle/fix/missing-build-flags
Fix: add missing build flags
2025-09-29 13:49:57 +13:00
Liam Cottle
8ac6dcb644 Merge pull request #858 from csrutil/fix/tiny-relay-compile
Fix: add missing build flags for tiny_relay
2025-09-29 13:49:31 +13:00
csrutil
fc0cf5f370 🔧 chore: update tiny_relay platformio.ini configuration
- Add ADVERT_LAT and ADVERT_LON definitions for both repeater and sensor variants
- Set MAX_NEIGHBOURS to 50 for improved network capacity
- Fix repeater build source filter path to include entire directory
2025-09-29 07:48:26 +08:00
Liam Cottle
3dc04deabf Merge pull request #837 from silverphish-io/typo-fix
Typo fix
2025-09-29 10:42:23 +13:00
ripplebiz
c8a6bcf57f Update README.md 2025-09-28 21:43:30 +10:00
liamcottle
914001344f add missing build flags for failed builds 2025-09-28 23:32:04 +13:00
Scott Powell
b92d9bd972 * ver 1.9.0 2025-09-28 19:24:00 +10:00
Scott Powell
3335b49d9f Merge branch 'main' into dev
# Conflicts:
#	variants/heltec_vision_master_e290/platformio.ini
2025-09-28 19:21:48 +10:00
ripplebiz
e5de6e6600 Merge pull request #820 from fdlamotte/gps_reset_fix
ESM: delegate gps management to LocationProvider
2025-09-28 19:08:35 +10:00
ripplebiz
cd7e7d9bbe Merge pull request #852 from liamcottle/increase-max-neighbours
Increase MAX_NEIGHBOURS to 50
2025-09-28 18:32:10 +10:00
ripplebiz
4bb16ef5a7 Merge pull request #850 from liamcottle/fix/legacy-neighbours-cli
Backwards Compatibility: Legacy Neighbours CLI
2025-09-28 18:30:11 +10:00
Liam Cottle
70ec996c08 Merge pull request #853 from liamcottle/fix-calc-shared-secret
fix multiple candidates warning
2025-09-28 21:05:03 +13:00
liamcottle
3f4f9eff17 fix multiple candidates warning 2025-09-28 21:01:41 +13:00
Florent
db7635102d gps_page: enable if gps enabled 2025-09-28 09:43:28 +02:00
fdlamotte
0767fc49e5 Merge pull request #843 from dotdavid/main
Create Xiao_S3_WIO_companion_radio_usb profile
2025-09-28 09:24:23 +02:00
fdlamotte
c83abbeff6 ESM: add gps reset after begin 2025-09-28 09:20:59 +02:00
fdlamotte
030f0d5d82 location provider: reduce reset delay 2025-09-28 09:16:45 +02:00
liamcottle
0307b6119e increase MAX_NEIGHBOURS from 8 to 50 2025-09-28 16:11:58 +13:00
Liam Cottle
2e92137d10 Merge pull request #851 from liamcottle/build-script-suffix
build script should check for firmware type suffix
2025-09-28 15:04:22 +13:00
liamcottle
58ed14d971 build script should check for firmware type suffix 2025-09-28 15:00:45 +13:00
liamcottle
f8f5f00549 admin cli neighbors command should sort newest to oldest 2025-09-28 14:38:13 +13:00
Liam Cottle
f9b2613e57 Merge pull request #844 from liamcottle/refactor-variant-suffixes
refactor variants to use standard firmware type suffixes
2025-09-28 14:20:04 +13:00
liamcottle
f3b9c06646 refactor variants to use standard firmware type suffixes 2025-09-27 23:45:33 +12:00
Liam Cottle
2992062bbe Merge pull request #770 from Meshcore-Portugal/jbrazio/2025_44aa3add
Normalize repeater target names
2025-09-27 23:15:23 +12:00
ripplebiz
0beaa323ed Merge pull request #842 from liamcottle/feature/custom-build-flags
Build Script Improvements
2025-09-27 20:32:20 +10:00
David Hall
cc822c029b Create Xiao_S3_WIO_companion_radio_usb profile
Create Xiao_S3_WIO_companion_radio_usb profile from Xiao_S3_WIO_companion_radio_ble profile
2025-09-27 11:14:28 +01:00
Scott Powell
95e533d60b * repeater & room server fix for blank guest password 2025-09-27 01:56:27 +10:00
liamcottle
e49eef5588 allow building multiple specific targets at same time 2025-09-26 22:59:20 +12:00
liamcottle
3fbdaf7ce6 don't overwrite existing platformio build flags in build script 2025-09-26 22:46:38 +12:00
ripplebiz
7bcf1f1b47 Merge pull request #828 from recrof/meshadventurer-build-fix
fixed meshadventurer failing build
2025-09-26 20:05:34 +10:00
fdlamotte
84feb63ed5 Merge pull request #835 from oltaco/wio-L1-revert-pins
fix: revert ENV_PIN_SDA for Wio Tracker L1 non-eink
2025-09-26 07:19:40 +02:00
silverphish-io
4e886bfa90 Typo fix in faq and payloads 2025-09-25 15:01:39 +01:00
silverphish-io
816d4e2fa3 Update faq.md 2025-09-25 14:59:25 +01:00
taco
a3e6b79c2f Revert addition of ENV_PIN_SDA 2025-09-25 20:08:18 +10:00
ripplebiz
74e1b6c75b Merge pull request #833 from liamcottle/feature/binary-neighbours-request
Implement binary request/response for Repeater Neighbours
2025-09-25 14:04:12 +10:00
liamcottle
418ae08b4d add FIRMWARE_VER_LEVEL to companion PUSH_CODE_LOGIN_SUCCESS 2025-09-25 15:21:58 +12:00
liamcottle
b8394a4e62 use pointer array 2025-09-25 14:55:36 +12:00
liamcottle
1c7a0ce2bd use uint16_t to allow fetching up to 65535 neighbours 2025-09-25 14:55:36 +12:00
liamcottle
02c178dae7 implement new binary request/response for paginated neighbours 2025-09-25 14:55:36 +12:00
Scott Powell
a5af1b5bcd * companion: disabled processing/sending of keep_alive packets (deprecated)
* FIRMWARE_VER_LEVEL now moved to end of response payloads
2025-09-25 09:39:11 +10:00
Scott Powell
e988531f6a Merge commit '3bc8ec2006917670695b3a74e7bb7df2c764e9e5' into dev 2025-09-25 09:14:10 +10:00
Scott Powell
76be66313e * repeater: reduce FS writes on login 2025-09-25 09:11:48 +10:00
Scott Powell
c21596341a * Login response payload: now includes FIRMWARE_VER_LEVEL 2025-09-25 09:07:59 +10:00
fdlamotte
3bc8ec2006 Merge pull request #830 from SoulOfNoob/feat/add_t-echo-lite_variant
Feat: add `T-Echo-Lite` Variant to MeshCore
2025-09-24 20:59:58 +02:00
João Brázio
2297d24013 Minor fixes 2025-09-24 16:46:03 +01:00
João Brázio
1d45c7ec66 Add bridge management CLI 2025-09-24 16:30:00 +01:00
Jan Ryklikas
088b8fd98c fix: revert to orignal default scaling and fix it in variant config 2025-09-24 15:10:51 +02:00
Jan Ryklikas
128119fe40 refactor: remove redundant import statement 2025-09-24 14:45:40 +02:00
recrof
f2cff53b0e fixed meshadventurer failing build 2025-09-24 09:04:16 +02:00
Jan Ryklikas
20b0fd1dc9 refactor: readability 2025-09-23 22:28:54 +02:00
Jan Ryklikas
f85db18242 refactor: use macro from ttgo repo for readability 2025-09-23 22:18:04 +02:00
Jan Ryklikas
955b7321e8 chore: cleanup 2025-09-23 22:10:27 +02:00
Jan Ryklikas
e2fa70d6f3 chore: refactor to use GxEPD2 fork 2025-09-23 21:57:35 +02:00
Jan Ryklikas
b11f08422e add T-Echo-Lite Device Variant 2025-09-23 19:39:11 +02:00
Jan Ryklikas
db40a9cea6 import missing eInk display 2025-09-23 19:38:45 +02:00
Florent
76aa7cf488 ui_task: initial gps page 2025-09-23 12:08:34 +02:00
Florent
c1915a1133 ESM: delegate gps management to LocationProvider 2025-09-23 11:12:07 +02:00
ripplebiz
ea13fa899e Merge pull request #814 from WattleFoxxo/tdeck
LilyGo TDeck support
2025-09-23 16:00:10 +10:00
ripplebiz
4aa58ade8a Merge pull request #811 from fdlamotte/tracker_l1_environment_sensors
Tracker l1: environment sensors
2025-09-23 15:34:22 +10:00
ripplebiz
3885d47ec9 Merge pull request #818 from silverphish-io/faq-spellcheck
Updated some typos and spelling mistakes in FAQ
2025-09-23 15:15:24 +10:00
silverphish-io
adecd1e58d Updated some typos and spelling mistakes in FAQ 2025-09-22 21:49:56 +01:00
Florent
611d61b6c6 tracker_l1: fix bme226 init in ESM to include all sensors 2025-09-22 19:10:01 +02:00
WattleFoxxo
f100894882 LillyGo TDeck support 2025-09-22 23:48:46 +10:00
ripplebiz
4579a1bcaf Merge pull request #813 from Quency-D/dev-heltec_v4
add heltec v4 board.
2025-09-22 22:32:01 +10:00
Quency-D
669bea04a0 add heltec_v4 board. 2025-09-22 19:58:27 +08:00
Quency-D
881396eeaf Merge pull request #10 from meshcore-dev/dev
merge dev
2025-09-22 19:49:49 +08:00
Florent
0cb34740d2 tracker-l1: correct bad definition for PIN_GPS_EN 2025-09-22 12:06:05 +02:00
Florent
c9b060aefb Merge branch 'dev' into tracker_l1_environment_sensors 2025-09-22 07:30:42 +02:00
ripplebiz
d85d364431 Merge pull request #808 from fdlamotte/wio-l1-eink
wio-l1-eink initial support
2025-09-22 15:07:22 +10:00
Scott Powell
52d5cc6068 * tidy and minor fix for offline queue deletion 2025-09-22 15:01:28 +10:00
ripplebiz
28d673ee15 Merge pull request #796 from 446564/mutable-queue
make offline queue channel messages mutable
2025-09-22 14:54:09 +10:00
kelsey hudson
9e460560bf Merge branch 'source-cleanup' of github.com:khudson/MeshCore into source-cleanup 2025-09-21 14:14:28 -07:00
kelsey hudson
9d009074da Ikoka Stick: Move to unified code naming conventions 2025-09-21 14:12:15 -07:00
Florent
f9543bb7bb tracker_l1: support for EnvironmentSensorManager 2025-09-21 22:14:22 +02:00
kelsey hudson
7b3a0bba97 Merge remote-tracking branch 'upstream/dev' into dev 2025-09-21 08:28:16 -07:00
Florent
59ea6cdb89 wio-l1-eink initial support 2025-09-20 21:45:13 +02:00
ripplebiz
695473f842 Merge pull request #805 from csrutil/tiny-relay-variant
Tiny relay variant
2025-09-21 00:03:58 +10:00
ripplebiz
4daad75f7d Merge pull request #806 from oltaco/safer-lfs-traverse
Safer _countLfsBlock / _getLfsUsedBlockCount
2025-09-21 00:00:19 +10:00
taco
2922b62888 add bounds check to _countLfsBlock / _getLfsUsedBlockCount 2025-09-20 17:36:52 +10:00
Florent
757ff9fb55 stm32: force the use of Adafruit BusIO v1.17.2 as 1.17.3 won't compile on this platform 2025-09-20 08:54:30 +02:00
csrutil
a1622bad75 🔗 fix: update tiny_relay board URL to proper STM32WLE5CC documentation link 2025-09-20 14:07:22 +08:00
csrutil
b3af4d9c72 feat: add tiny_relay board configuration
Add board configuration for BB-STM32WL tiny relay variant with STM32WLE5CC MCU support including debug and upload protocols.
2025-09-20 10:59:36 +08:00
csrutil
736118fe6b Add tiny_relay variant files
- platformio.ini: Build configuration for tiny relay variant
- target.cpp/h: Hardware-specific implementation
- variant.h: Variant identification header
2025-09-20 10:58:02 +08:00
ripplebiz
b464f5c640 Merge pull request #801 from recrof/sensecap_solar_env_manager
use sensor_base for seeed sensecap solar
2025-09-19 13:47:26 +10:00
recrof
985b290d02 use sensor_base for seeed sensecap solar 2025-09-18 09:15:01 +02:00
Scott Powell
384b02bec4 * GenericVibration: code style refactor 2025-09-18 13:19:54 +10:00
ripplebiz
b3e9fd76ce Merge pull request #708 from csrutil/feature/vibration-feedback
 feat: add vibration feedback system
2025-09-18 13:12:36 +10:00
ripplebiz
f77fd15707 Merge pull request #730 from michaelhart/node-displayname-improvements
Adds name filtering and text truncation for display in HomeScreen
2025-09-18 12:42:10 +10:00
ripplebiz
e35e4bb23e Merge pull request #745 from ViezeVingertjes/fix-pin-display
Fix: Set device as connected after successful authentication
2025-09-18 12:02:08 +10:00
ripplebiz
8ddabfcffa Merge pull request #783 from sschueller/eora-s3
feat: Added EByte EoRa-S3-XXXTB Support #740
2025-09-18 11:13:40 +10:00
Scott Powell
9ba8d6f23f Merge branch 'rep-room-acl' into dev 2025-09-17 17:25:26 +10:00
csrutil
6f8ce425d8 remove the unnecessary blank line 2025-09-17 09:19:18 +08:00
csrutil
043f37a08e ♻️ refactor: unify UI notification methods into single notify() function
Consolidates soundBuzzer() and triggerVibration() into a unified notify() method
that handles both audio and haptic feedback based on UIEventType.
2025-09-17 08:56:18 +08:00
csrutil
2da50882c0 feat: add vibration feedback support for UI events
- Add genericVibration class with 5-second cooldown and 1-second pulse
- Integrate vibration triggers for new messages and contact discoveries
- Add conditional compilation support with PIN_VIBRATION guard
- Implement abstract interface for vibration in UITask system
2025-09-17 08:56:18 +08:00
Michael Hart
bd6aa983a3 feat: add DisplayDriver methods for UTF-8 filtering and text ellipsis
- Add translateUTF8ToBlocks() method to convert UTF-8 characters to displayable blocks
- Add drawTextEllipsized() method for text truncation with ellipsis
- Apply UTF-8 filtering to node names, recent contacts, and message content
- Use ellipsized text rendering for recent contacts to prevent overflow
- Addresses PR feedback by moving text processing to DisplayDriver level
2025-09-16 17:17:15 -07:00
446564
fca16f1b71 make offline queue channel messages mutable
older channel messages can be overwritten, keeping other mssagage types

this allows a user to be away for a long time and still get the most recent
channel messages without losing any direct messages for exampe
2025-09-16 15:40:21 -07:00
Liam Cottle
47c57a52cc Merge pull request #795 from tahnok/python3-build-sh
Use python3 not python in build.sh
2025-09-17 10:26:09 +12:00
Wesley Ellis
19fb7aae63 Use python3 not python in build.sh
Since the bin/uf2conv/uf2conf.py script uses python3, use python3 as the command instead of python.
On my ubuntu 24.04 machine, I don't have a python command in my path by default
2025-09-16 18:15:14 -04:00
ripplebiz
d86851b881 Merge pull request #787 from recrof/rak-wishmesh-tag-fix
fix building errors for wismesh tag companion ble
2025-09-16 13:09:30 +10:00
Scott Powell
98b524bfcf Merge branch 'dev' into rep-room-acl 2025-09-16 13:07:14 +10:00
Scott Powell
a288ac06a6 Merge branch 'dev' into reciprocal-path-retry 2025-09-16 13:03:41 +10:00
fdlamotte
88786a906f Merge pull request #786 from recrof/xiao-nrf52-cleanup
tidy up xiao nrf52 variant
2025-09-15 15:45:38 +02:00
recrof
845a497604 fix compilation errors for wismesh tag 2025-09-15 14:56:04 +02:00
recrof
81180bbf8c xiao nrf52: add all available sensors, remove *_alt envs, cleanup 2025-09-15 14:46:10 +02:00
ripplebiz
f9428b7d27 Merge pull request #785 from liamcottle/feature/new-message-timestamps
Update lastmod when a new message is received
2025-09-15 19:34:26 +10:00
Scott Powell
fa3e4f9715 Merge branch 'dev' into reciprocal-path-retry 2025-09-15 18:34:39 +10:00
ripplebiz
d377ffd393 Merge pull request #784 from liamcottle/fix/ble-advertising-interval
revert unexpected change to ble advertising interval on nrf52
2025-09-15 11:42:48 +10:00
liamcottle
400e09f318 revert unexpected change to ble advertising interval on nrf52 2025-09-15 13:06:35 +12:00
liamcottle
561dbea30f update lastmod when a new message is received 2025-09-15 12:28:26 +12:00
Kelsey Hudson
2536fa6bcf Merge remote-tracking branch 'upstream/dev' into dev 2025-09-14 14:51:05 -07:00
Stefan Schüller
ded81780a4 fix: removed display reset (NC), set SDA and SCL for display 2025-09-14 13:53:45 +02:00
Stefan Schüller
21ea63bcd9 feat: Added EByte EoRa Pi 2025-09-14 13:53:38 +02:00
Scott Powell
5ccacb2a91 * bug fix 2025-09-14 21:51:32 +10:00
Scott Powell
ce08db6238 * room server: ClientACL added 2025-09-14 21:22:12 +10:00
ripplebiz
5377d7cc17 Merge pull request #782 from askpatrickw/patch-1
Update FAQ with new server administration screenshot
2025-09-14 14:13:14 +10:00
ripplebiz
3ef2aa6a95 Merge pull request #776 from liamcottle/fix/nrf52-ble-pin-display
Fix: BLE pin disappearing too quickly on nrf52 devices
2025-09-14 13:23:10 +10:00
Patrick
9b2dbf51cb fix markdown 2025-09-13 14:05:57 -07:00
Patrick
a6a0183d44 Update FAQ with new server administration screenshot 2025-09-13 14:04:31 -07:00
Scott Powell
de2e0cf59c * repeater now using ClientACL class 2025-09-13 19:37:15 +10:00
Scott Powell
c69d78b62e Merge branch 'dev' into reciprocal-path-retry 2025-09-13 18:48:24 +10:00
Scott Powell
9df6e8a6b6 Merge branch 'dev' into rep-room-acl 2025-09-13 18:43:02 +10:00
Liam Cottle
5cd0470879 Merge pull request #777 from bryantkelley/docs/add-ble-firmware-troubleshooting-q-a
[Docs] Add companion not showing up over Bluetooth to FAQ
2025-09-13 14:23:51 +12:00
Bryant Kelley
b5820b1ce0 Add companion not showing up over BLE to FAQ 2025-09-12 11:31:05 -07:00
liamcottle
25ea953cc3 don't mark as connected until connection secured 2025-09-12 20:23:21 +12:00
Scott Powell
281591f147 * refactor: moved ACL out of SensorMesh -> ClientACL 2025-09-12 15:35:31 +10:00
ripplebiz
d929d32569 Merge pull request #768 from 446564/fix/nano-g2-notification
fix nano g2 notification
2025-09-12 12:07:36 +10:00
João Brázio
510472bfa0 Normalize repeater target names 2025-09-10 23:56:07 +01:00
446564
e42ecc3bb3 fix nano g2 notification
revert change to disable buzzer before hibernate

needs more work as the buzzer pin is a macro and can't be changed at runtime
2025-09-10 09:44:58 -07:00
ripplebiz
95d1f052c2 Merge pull request #762 from oltaco/new-ldscript-for-extrafs
New linker scripts for NRF52 companion envs
2025-09-10 18:25:07 +10:00
ripplebiz
ce39df599c Merge pull request #763 from csrutil/fix-environment-sensor-node-altitude
Fix node_altitude not being set in EnvironmentSensorManager
2025-09-10 17:45:06 +10:00
Scott Powell
3b82224db6 Merge branch 'rep-room-acl' into dev 2025-09-10 17:35:05 +10:00
Scott Powell
c8a10cc3b3 * RAK wishmesh tag: build fix 2025-09-10 17:34:06 +10:00
ripplebiz
1257c6b181 Merge pull request #739 from fdlamotte/ui_sensors_page
ui: sensors page
2025-09-10 17:23:34 +10:00
Scott Powell
65ef6c2fd0 * repeater and room server build_src_filter fixes 2025-09-10 17:04:58 +10:00
Liam Cottle
f35e259fd6 Merge pull request #767 from liamcottle/fix/wismeshtag-poweroff-wakeup
Fix: WisMeshTag power off and wake up
2025-09-10 17:44:37 +12:00
liamcottle
80d5e2d8bc fix wismesh tag power off and wake up 2025-09-10 17:04:03 +12:00
Florent de Lamotte
d83cdc501f ui: use LPPDataHelper and conditionals for sensors page 2025-09-09 16:32:41 +02:00
Florent de Lamotte
2d4b77c998 Merge remote-tracking branch 'upstream/dev' into ui_sensors_page 2025-09-09 15:36:14 +02:00
csrutil
cf93109cd5 feat: add altitude support to environment sensor node telemetry
- Include actual node altitude in GPS telemetry instead of hardcoded 0.0f
- Extract altitude data from both ublox_GNSS and serial GPS sources
- Update debug logging to display altitude alongside lat/lon coordinates
2025-09-09 19:20:39 +08:00
Scott Powell
3666cd72e5 * room refactor: extracted MyMesh class 2025-09-09 20:52:19 +10:00
Scott Powell
e35183ae41 Merge branch 'dev' into rep-room-acl
# Conflicts:
#	examples/simple_repeater/main.cpp
2025-09-09 19:02:23 +10:00
Scott Powell
5344f04d89 * Repeater: slight refactor of 'bridge' instantiation 2025-09-09 18:46:30 +10:00
Scott Powell
08f91f8d95 Merge branch 'dev' into rep-room-acl
# Conflicts:
#	examples/simple_repeater/main.cpp
2025-09-09 18:02:05 +10:00
Scott Powell
18d6d54c07 Merge branch 'dev' into reciprocal-path-retry 2025-09-09 17:51:55 +10:00
taco
f92bd0db9e fix inconsistencies across nrf companion roles 2025-09-09 17:00:29 +10:00
taco
e8314c9c8c new ldscript for extrafs nrf companion envs 2025-09-09 16:55:46 +10:00
fdlamotte
ea33f39557 Merge pull request #454 from jbrazio/jbrazio/2025_3f11ad35
RS232/ESP-NOW Bridge/cross repeater implementation
2025-09-09 07:34:31 +02:00
ripplebiz
ecd2e12894 Merge pull request #760 from fschrempf/readme-repeat-clarification
README.md: Explain that companion nodes do not repeat messages
2025-09-09 14:25:37 +10:00
ripplebiz
bb29b66b29 Update README.md 2025-09-09 14:05:07 +10:00
Frieder Schrempf
0dfd2bcbb8 README.md: Explain that companion nodes do not repeat messages
This is a key difference compared to other systems and I see people
asking this a lot. It is mentioned in the FAQ but let's make it more
prominent in the README.
2025-09-08 23:04:32 +02:00
João Brázio
a55fa8d8ec Add BRIDGE_DELAY as a buffer to prevent immediate processing conflicts in the mesh network 2025-09-08 20:21:33 +01:00
João Brázio
1c93c162a1 Add ESPNow bridge configurations for all ESP32 targets 2025-09-08 18:49:33 +01:00
João Brázio
1d25c87c57 Refactor bridge packet handling to use common magic number and size constants 2025-09-08 18:16:50 +01:00
ripplebiz
c44d84ca9b Merge pull request #756 from oltaco/correct-max-contacts-channels
Set correct new MAX_CONTACTS and MAX_GROUP_CHANNELS for some NRF devices
2025-09-08 23:37:43 +10:00
ripplebiz
adaad00b19 Merge pull request #755 from recrof/wismesh_rak_customlfs
rak wismesh: set the `MAX_CONTACTS` and `MAX_GROUP_CHANNELS` in line with earlier CustomLFS changes
2025-09-08 23:37:24 +10:00
taco
a0e7b47e29 correct max contacts and channels for some nrf devices 2025-09-08 22:06:15 +10:00
Scott Powell
f2e8fb0259 * refactor: MyMesh class extracted 2025-09-08 21:46:19 +10:00
recrof
a44b8e626a set the max_contacts and max_group channels in line with other nrf52 targets 2025-09-08 13:26:19 +02:00
Scott Powell
74dea260e5 * proposed change for re-trying reciprocal path transmit 2025-09-08 19:22:59 +10:00
ripplebiz
6a9dedf0b4 Merge pull request #751 from fdlamotte/t1000e_revert_gps_resetb
T1000e revert gps resetb
2025-09-08 15:35:10 +10:00
kelsey hudson
7b08acf56d Ikoka Stick: Move to unified code naming conventions 2025-09-07 21:29:10 -07:00
João Brázio
7fca20475a Merge remote-tracking branch 'upstream/dev' into jbrazio/2025_3f11ad35 2025-09-08 02:04:14 +01:00
João Brázio
0051ccef26 Refactor bridge implementations to inherit from BridgeBase 2025-09-08 02:03:08 +01:00
João Brázio
537449e6af Refactor ESPNowBridge packet handling to use 2-byte magic header and improve packet size validation 2025-09-08 01:20:54 +01:00
João Brázio
04e70829a4 Rename RS232 bridge environments 2025-09-07 21:46:51 +01:00
João Brázio
5b9d11ac8f Support ESPNow and improve documentation 2025-09-07 21:39:54 +01:00
Florent
006605ce1d t1000e: revert GPS_RESETB as an INPUT 2025-09-07 19:48:02 +02:00
fdlamotte
73b49ea14d Merge pull request #736 from ViezeVingertjes/t1000e-low-power
Introduce BLE low-power mode and enable DC/DC converter
2025-09-07 16:01:22 +02:00
ViezeVingertjes
5370667bd8 Replaced BLE_LOW_POWER with BLE_TX_POWER & updated usages. 2025-09-07 15:44:24 +02:00
ViezeVingertjes
7363a4f67d Few adjustments after testing. 2025-09-07 14:08:53 +02:00
fdlamotte
f6f0cfd603 Merge pull request #744 from ViezeVingertjes/fix-t1000e-sleep
T1000-E: ensure rails off and radio idle before system off; fix button wake pin
2025-09-07 12:33:40 +02:00
ripplebiz
b0c7ea45c0 Merge pull request #741 from recrof/rak_wismesh_tag
new variant: RAK WisMesh Tag
2025-09-07 20:28:53 +10:00
ripplebiz
0088509df4 Merge pull request #749 from oltaco/thinknode-m1-companion-usb
Add companion usb to ThinkNode M1
2025-09-07 20:17:38 +10:00
ripplebiz
ea4ed2abec Merge pull request #748 from oltaco/t-echo-qspi-pins
Add QSPI pins for Lilygo T-Echo
2025-09-07 20:14:44 +10:00
ripplebiz
6da6504b80 Merge pull request #747 from oltaco/customlfs-versionbump
CustomLFS version bump
2025-09-07 20:13:31 +10:00
taco
18be92615b add QSPI pins to Lilygo T-Echo 2025-09-07 20:00:44 +10:00
taco
acf6110001 add companion usb to ThinkNode M1 2025-09-07 19:59:01 +10:00
taco
8521b0eb08 new version of CustomLFS lib 2025-09-07 19:54:42 +10:00
kelsey hudson
951d2dfdbb Merge remote-tracking branch 'upstream/dev' into dev 2025-09-06 15:13:58 -07:00
ViezeVingertjes
c10c010736 fix: only hide pin after successful authentication in SerialBLEInterface 2025-09-06 22:06:47 +02:00
ViezeVingertjes
ac8ec172ef T1000-E: refactor GPS initialization; set GPS_RESETB pin as OUTPUT and remove redundant pin settings 2025-09-06 20:42:11 +02:00
ViezeVingertjes
132ca72735 T1000-E: ensure rails off and radio idle before system off; fix button wake pin 2025-09-06 20:10:09 +02:00
ripplebiz
84623938c3 Merge pull request #732 from jbrazio/jbrazio/2025_b5813561
Heltec T114 without display
2025-09-06 22:46:46 +10:00
ripplebiz
1c0154279a Merge pull request #727 from recrof/waveshare_rp2040_lora_refactor
tidy up waveshare rp2040 lora variant
2025-09-06 22:39:42 +10:00
ripplebiz
605210dd07 Merge pull request #726 from recrof/xiao_rp2040_refactor
tidy up xiao rp2040 variant
2025-09-06 22:38:07 +10:00
ripplebiz
5b8c8b0bf6 Merge pull request #653 from oltaco/CustomLFS
Extra filesystem support for NRF52 (CustomLFS)
2025-09-06 17:45:20 +10:00
taco
bcfc8d3771 improved RescueCLI for dual FS 2025-09-06 14:15:40 +10:00
taco
3d83556829 refactor: use _getContactsChannelsFS() instead of ifdefs 2025-09-06 14:15:40 +10:00
taco
accd1e0a97 nrf52 targets: increase limits for contacts and channels 2025-09-06 14:15:40 +10:00
taco
2b24c575c7 support dual filsystems on nrf52
store identity and prefs in UserData and contacts, channels and adv_blobs in ExtraData
2025-09-06 14:15:40 +10:00
taco
bdfe9ad27b switch to using QSPI bus for external flash 2025-09-06 14:15:40 +10:00
taco
c5180d4588 initial commit: CustomLFS 2025-09-06 14:15:40 +10:00
João Brázio
2ef38422e9 Delete the variant-specific NullDisplayDriver.h and update target.h to use the shared implementation from #735 2025-09-05 17:59:59 +01:00
João Brázio
808214d7b5 Merge remote-tracking branch 'upstream/dev' into jbrazio/2025_b5813561 2025-09-05 17:54:45 +01:00
recrof
d59724acd0 new variant: RAK WisMesh Tag 2025-09-05 16:21:19 +02:00
fdlamotte
0ebca4b88e Merge pull request #734 from recrof/lilygo_techo_refactor
lilygo t-echo enhancements and cleanup
2025-09-05 16:11:04 +02:00
fdlamotte
ec332c442b Merge pull request #735 from recrof/t1000_refactor
t1000 cleanup + move NullDisplayDriver.h out of t1000e folder
2025-09-05 15:58:59 +02:00
João Brázio
cb99eb4ae8 Remove retransmit check for RS232 bridge in logTx
Since the flag is preserved and respected by the mesh processing on the receiving end, there's no risk of these packets being retransmitted endlessly.
2025-09-05 14:49:06 +01:00
Florent de Lamotte
8fdaaceb1c ui: refresh sensors on gps toggle 2025-09-05 15:35:04 +02:00
Florent de Lamotte
f974cb2a4f ui: ENTER on SENSORS page toggles gps 2025-09-05 15:32:02 +02:00
Florent de Lamotte
2d651221c4 ui: sensors page 2025-09-05 15:20:52 +02:00
João Brázio
5843a12c71 Rename SerialBridge to RS232Bridge 2025-09-05 11:28:40 +01:00
ripplebiz
6fae950814 Merge pull request #738 from recrof/lilygo_tlora_c6_new_radio_init
tlora_c6 to use new radio init
2025-09-05 19:55:29 +10:00
ripplebiz
8f3c0a3ad2 Merge pull request #737 from recrof/generic_e22_radio_init
variant generic-e22 to use new radio init
2025-09-05 19:53:29 +10:00
recrof
24b2953861 tlora_c6 to use new radio init 2025-09-05 11:33:48 +02:00
recrof
8549696e4d generic e22 uses new radio init 2025-09-05 11:17:57 +02:00
recrof
c9e6ae9e6c fix typo in pin configuration 2025-09-05 11:12:17 +02:00
ripplebiz
2aa6835064 Merge pull request #725 from recrof/rpi_picow_refactor
tidy up rpi picow variant
2025-09-05 19:04:21 +10:00
ViezeVingertjes
963556f9ba Updated BLE functionality for low power mode in SerialBLEInterface. Updated platformio.ini to enable low power mode and added DC/DC converter support in T1000eBoard for improved power efficiency. 2025-09-05 10:46:51 +02:00
João Brázio
375093f78d Add nRF52 support and refactor packet handling
This commit introduces several improvements to the SerialBridge helper:

- Adds support for the nRF52 platform by implementing the `setPins` configuration.
- Corrects the type cast for the RP2040 platform from `HardwareSerial` to `SerialUART`.
- Refactors packet deserialization to use a new `Packet::readFrom()` method instead of a direct `memcpy`, improving encapsulation.
- Updates the packet length validation to use the more appropriate `MAX_TRANS_UNIT` constant.
2025-09-05 09:22:06 +01:00
ripplebiz
0e3933f18a Merge pull request #731 from oltaco/tracker-l1-platformio-tidy
Wio Tracker L1: correct platformio.ini defines
2025-09-05 13:44:58 +10:00
ripplebiz
c396ed9a05 Merge pull request #706 from recrof/patch-5
fixed max_contacts to 300 for heltec v3 companion_ble
2025-09-05 13:22:52 +10:00
João Brázio
77ab19153e Add serial logging for TX/RX packets 2025-09-05 02:07:26 +01:00
João Brázio
2b920dfed3 Rework packet serialization and parsing 2025-09-05 01:50:50 +01:00
João Brázio
ee3c4baea5 Prevent packet loops and duplicates
Implement a "seen packets" table to track packets that have already been processed by the serial bridge.

This prevents packets from being re-transmitted over the serial link if they have already been seen, and it stops inbound packets from serial from being re-injected into the mesh if they are duplicates.

Duplicate inbound packets are now freed to prevent memory leaks.
2025-09-04 23:50:13 +01:00
João Brázio
1948d284a0 Extract serial bridge into dedicated classes
This commit refactors the serial bridge functionality out of the `simple_repeater` example and into a more reusable, object-oriented structure.

An `AbstractBridge` interface has been introduced, along with a concrete `SerialBridge` implementation. This encapsulates all the logic for packet framing, checksum calculation, and serial communication, cleaning up the main example file significantly.

The `simple_repeater` example now instantiates and uses the `SerialBridge` class, resulting in better separation of concerns and improved code organization.
2025-09-04 23:43:05 +01:00
recrof
9b9c7289e6 moved pindefs from board to platformio.ini 2025-09-04 23:31:05 +02:00
recrof
816bbf925f t1000 cleanup + move NullDisplayDriver.h to helpers/ui for other variants to use 2025-09-04 23:12:57 +02:00
recrof
5b2c1715f4 lilygo t-echo cleanup, add AUTO_SHUTDOWN_MILLIVOLTS 2025-09-04 21:45:42 +02:00
João Brázio
d8f80f259a Refactor display driver inclusion for Heltec T114 to support configurations without a display 2025-09-04 13:26:48 +01:00
taco
1f20722f51 fix: wio tracker L1: tidy platformio.ini 2025-09-04 19:59:33 +10:00
ripplebiz
f9079985b6 Merge pull request #724 from recrof/thinknode_m1_refactor
tidy up thinknode_m1 variant
2025-09-04 19:33:49 +10:00
ripplebiz
46b3910d81 Merge pull request #713 from Quency-D/dev-meshpocket
add heltec meshpocket board.
2025-09-04 19:31:40 +10:00
Liam Cottle
a3aa66ac16 Merge pull request #729 from liamcottle/fix/thinknodem1
ThinkNode M1: add missing crc lib dep
2025-09-04 20:42:15 +12:00
liamcottle
d56b725256 add missing crc32 libdep after gxepd display driver changes 2025-09-04 20:07:37 +12:00
Quency-D
8fa31e00aa -D DISABLE_DIAGNOSTIC_OUTPUT this one will make GxEPD less verbose ;) 2025-09-04 15:39:08 +08:00
Quency-D
f4df94a20e Delete the sensor part and adapt to the latest crc display. 2025-09-04 14:04:00 +08:00
Quency-D
6e6c59d2ce Merge pull request #9 from meshcore-dev/dev
Dev
2025-09-04 13:50:09 +08:00
ripplebiz
a9fef1aefa Merge pull request #723 from recrof/heltec_t114_refactor
tidy up heltec_t114 variant
2025-09-04 13:52:23 +10:00
Quency-D
13d046892a Merge branch 'dev' into dev-meshpocket 2025-09-04 11:47:55 +08:00
ripplebiz
5782c2e799 Merge pull request #720 from oltaco/newui-multiclick-toggles
new-ui: add double/triple clicks, buzzer and gps toggle functions
2025-09-04 13:41:54 +10:00
ripplebiz
3e7459ae2e Merge pull request #719 from recrof/vision_master_refactor
renamend and refactored vision master, added usb roles
2025-09-04 13:33:48 +10:00
ripplebiz
6334971e2b Merge pull request #722 from fdlamotte/techo_epd_damage
Techo epd damage
2025-09-04 13:25:09 +10:00
recrof
c2fc70047a waveshare rp2040 lora cleanup 2025-09-03 21:37:07 +02:00
recrof
72b267092f xiao rp2040 cleanup 2025-09-03 21:28:46 +02:00
recrof
cbf3a03d2e rpi picow cleanup 2025-09-03 20:52:58 +02:00
recrof
d610b7be86 thinknode m1 refactor 2025-09-03 20:17:55 +02:00
recrof
1c91298b3a tidy up heltec_t114 variant 2025-09-03 19:38:38 +02:00
Florent
9f97edcb21 gxepd: use a crc to track damage ! 2025-09-03 18:17:37 +02:00
Florent
cb3049e706 cleanups (remove statics and typos) 2025-09-03 17:41:05 +02:00
taco
96a71bb21b alter keycode keycode handling 2025-09-03 16:28:58 +10:00
taco
afbfc6c6ed add new keycodes 2025-09-03 15:48:50 +10:00
taco
a9ab1f072a increase gps/buzzer alert times
600 is a bit short for eink
2025-09-03 14:02:35 +10:00
taco
9f185303b4 long press cancels multi click 2025-09-03 12:29:20 +10:00
taco
5de0dc1fd6 sliding multiclick window 2025-09-03 12:03:31 +10:00
taco
43c3105bf1 wake screen on double and triple clicks 2025-09-03 08:31:38 +10:00
taco
ce31fd7c57 multi click support including buzzer toggle 2025-09-03 08:25:59 +10:00
recrof
ddc900c8c8 renamend and refactored vision master to play better with build system 2025-09-02 22:23:32 +02:00
ripplebiz
a93a0fecba Merge pull request #717 from oltaco/promicro-hibernate
fix: promicro: add powerOff
2025-09-02 21:38:37 +10:00
taco
03358b33c2 fix: promicro: add powerOff 2025-09-02 21:30:51 +10:00
Scott Powell
90cb1e73f9 * HeltecV3: powerOff() fix 2025-09-02 21:18:05 +10:00
Florent de Lamotte
3cdf2f9b4d techo: display backlight behavior 2025-09-02 11:43:48 +02:00
Quency-D
c9671d7d8d add heltec meshpocket board. 2025-09-02 13:56:24 +08:00
Quency-D
88fbb41016 Merge pull request #7 from Quency-D/dev
merge Dev
2025-09-02 13:43:15 +08:00
ripplebiz
1a41da6bf2 Merge pull request #700 from fdlamotte/techo_env_sensors
techo: use EnvironmentSensor to get BME280 data
2025-09-02 14:58:57 +10:00
ripplebiz
2546a5da07 Merge pull request #711 from oltaco/heltec-vision-master-rename-companion-target
fix: Heltec Vision Master E290: rename companion target
2025-09-02 14:57:38 +10:00
Quency-D
b863a1a673 Merge pull request #6 from Quency-D/dev
merge Dev
2025-09-02 11:25:36 +08:00
taco
b64e78b7eb fix: Heltec Vision Master E290: rename companion target 2025-09-02 08:06:43 +10:00
ripplebiz
c3fb3bcefe Update README.md 2025-09-01 22:14:21 +10:00
ripplebiz
4849b863e9 Update README.md 2025-09-01 22:07:36 +10:00
ripplebiz
f3c52d84db Update README.md 2025-09-01 22:00:06 +10:00
Rastislav Vysoky
accacd9d74 fixed max_contacts to 300 for v3 2025-09-01 12:21:03 +02:00
João Brázio
9fd7e9427a Add bridge support for WSL3 board 2025-09-01 10:53:51 +01:00
João Brázio
cf4720bd34 Merge remote-tracking branch 'upstream/dev' into jbrazio/2025_3f11ad35 2025-09-01 10:47:19 +01:00
Scott Powell
1130cf13ab Merge branch 'dev' 2025-09-01 19:32:54 +10:00
Scott Powell
637891b814 * ver bump 2025-09-01 19:32:15 +10:00
Liam Cottle
a4c2da9d50 Merge pull request #704 from liamcottle/fix/wismesh-pocket-user-button
Fix: WisMesh Pocket user button
2025-09-01 21:09:54 +12:00
liamcottle
3ad43431d9 fixed wismesh pocket user button 2025-09-01 21:04:41 +12:00
Scott Powell
74722c24b8 * MomentaryButton: added support for analog button (with threshold)
* RAK: support for PIN_USER_BTN_ANA
2025-09-01 17:11:55 +10:00
Scott Powell
b8223e9d07 * reverting HeltecV3 _CURRENT_LIMIT change 2025-09-01 16:28:53 +10:00
Scott Powell
81afd83099 * Meshadventurer companion USB build fix 2025-09-01 16:10:45 +10:00
Scott Powell
ee194a7b19 * added CommonCLI::saveIdentity() 2025-09-01 15:22:11 +10:00
Scott Powell
c28001d1e2 * ESP platform ver > 6.11.0 seems to break Github Actions 2025-09-01 14:29:40 +10:00
ripplebiz
7bc02296ff Merge pull request #698 from recrof/esp32_companion_max_contacts
raised companion max contacts for esp32 "classic" targets; changed WSL3 to 300.
2025-09-01 14:26:42 +10:00
Florent
76711f54ce techo: let location_manager set clock 2025-08-31 21:45:47 +02:00
kelsey hudson
4b508136b4 Merge remote-tracking branch 'upstream/dev' into dev 2025-08-31 11:30:59 -07:00
Florent
fae3c284d3 techo: use EnvironmentSensor to get BME280 data 2025-08-31 18:09:05 +02:00
fdlamotte
3aa57780f1 Update library.json version 2025-08-31 17:30:31 +02:00
recrof
489bcaffc9 raised max contacts for esp32 classic companions to 160 and 170; set to 300 for WSL3 2025-08-31 16:23:21 +02:00
Scott Powell
4413e5be95 Merge branch 'dev' 2025-08-31 23:43:33 +10:00
Scott Powell
8b3c16c497 * ver bump 2025-08-31 23:42:15 +10:00
Scott Powell
7c7faaab05 * agc.reset.interval rounding warning 2025-08-31 23:15:56 +10:00
ripplebiz
009ca6d6aa Merge pull request #696 from recrof/esp32c6_pioarduino_downgrade
downgrading pioarduino because build issues
2025-08-31 22:55:40 +10:00
ripplebiz
e1ac794a81 Merge pull request #695 from recrof/esp32_c3_c6_s3_max_contacts_300
set companion radios with esp32c3 esp32c6 and esp32s3 to 300 contacts max
2025-08-31 22:45:35 +10:00
Liam Cottle
f5c7d3dd80 Merge branch 'dev' into esp32_c3_c6_s3_max_contacts_300 2025-09-01 00:38:21 +12:00
recrof
7a00f3060e downgrading pioarduino because build issues 2025-08-31 14:33:49 +02:00
recrof
50cab44473 set companion radios with esp32c3 esp32c6 and esp32s3 boards to max 300 contacts 2025-08-31 14:27:44 +02:00
ripplebiz
8a39e80359 Merge pull request #694 from recrof/dev_xiao_s3_wio_serial_fix
fix: add xiao s3 wio serial companion to new ui
2025-08-31 21:00:01 +10:00
ripplebiz
615316f443 Merge pull request #693 from recrof/dev_meshadventurer_fix
fix: migrate meshadventurer to new ui
2025-08-31 20:59:13 +10:00
ripplebiz
e8d4ab5977 Merge pull request #692 from liamcottle/feature/thinknode-m1-poweroff
ThinkNode M1: low battery auto shutdown
2025-08-31 20:56:58 +10:00
recrof
7854244026 fix: add xiao s3 wio serial companion to new ui 2025-08-31 12:11:07 +02:00
recrof
0f23c0120a fix: migrate meshadventurer to new ui 2025-08-31 12:09:04 +02:00
Liam Cottle
d8c4fa456a Merge pull request #690 from mattzzw/main
Update faq.md, add information on how to configure wifi
2025-08-31 18:02:50 +12:00
kelsey hudson
65be15e6be Merge remote-tracking branch 'upstream/dev' into dev 2025-08-30 17:54:42 -07:00
Matthias Wientapper
b3adaa790a Update faq.md 2025-08-30 20:53:57 +02:00
liamcottle
18ef1ba804 add low battery shutdown alert for thinknode m1 2025-08-30 23:09:01 +12:00
liamcottle
6172537459 auto shutdown thinknode m1 at 3.3v 2025-08-30 21:56:00 +12:00
liamcottle
5a34bd5460 turn off tx led when powering off 2025-08-30 21:54:46 +12:00
ripplebiz
d4856a5275 Merge pull request #617 from Quency-D/dev-heltec_t190_board
Add heltec_vision_master_t190 board.
2025-08-29 20:11:24 +10:00
ripplebiz
e1c169b20a Merge pull request #687 from Quency-D/new-ui-heltec-paper
New UI for heltec paper
2025-08-29 19:59:40 +10:00
Quency-D
fee7975668 Remove duplicate rows. 2025-08-29 17:31:28 +08:00
ripplebiz
31006857fe Merge pull request #686 from Quency-D/new-ui-e213
New UI heltec e213.
2025-08-29 19:18:06 +10:00
ripplebiz
bc8c95fcb3 Merge pull request #685 from liamcottle/fix/wifi-companion-clients
WiFi Companion: always accept new connections
2025-08-29 19:16:52 +10:00
Quency-D
c5b28da41d Merge pull request #5 from Quency-D/dev
Merge Dev
2025-08-29 17:16:30 +08:00
Quency-D
4eaaeebfca Remove duplicate rows. 2025-08-29 17:12:35 +08:00
Quency-D
3e3e364dae Merge pull request #4 from Quency-D/dev
Merge Dev
2025-08-29 16:49:08 +08:00
ripplebiz
4785240608 Merge pull request #683 from taedryn/t114-power-consumption
Improving T114 power consumption
2025-08-29 17:50:30 +10:00
liamcottle
796b4c705c disconnect existing wifi client when new connection established 2025-08-29 19:50:05 +12:00
ripplebiz
4d6e33b365 Merge pull request #684 from liamcottle/new-ui/heltec-v3-wifi
Add new UI to Heltec v3 WiFi Companion
2025-08-29 17:48:02 +10:00
ripplebiz
980c3445d0 Merge pull request #679 from Quency-D/new-ui-e290
New UI heltec e290.
2025-08-29 17:06:15 +10:00
ripplebiz
a0b037ecd7 Merge pull request #680 from 446564/nano-g2-hibernate
add power off to nano g2
2025-08-29 17:04:17 +10:00
Scott Powell
6984d9f496 * minor compilation fix 2025-08-29 17:01:39 +10:00
liamcottle
09e45f25b7 add new ui to heltec v3 wifi companion 2025-08-29 18:58:54 +12:00
ripplebiz
d012dc7fd7 Merge pull request #663 from liamcottle/feature/remove-neighbour
Add CLI command to remove neighbour
2025-08-29 16:50:08 +10:00
liamcottle
9ee0152084 add default no op implementation for remove neighbor function 2025-08-29 18:17:01 +12:00
liamcottle
c49ecc121e use new instance of neighbour info object when removing neighbour 2025-08-29 18:08:06 +12:00
Laura J
19978d6b6e Merge branch 'dev' into t114-power-consumption 2025-08-28 19:42:08 -07:00
fdlamotte
f9f1c2e340 Merge pull request #673 from 446564/t1000e-roles
add remaining roles to t1000e
2025-08-28 18:14:06 +02:00
446564
13cd849fcd add power off to nano g2 2025-08-28 08:37:25 -07:00
446564
789629f5f8 remove display class from repeater and room 2025-08-28 08:13:33 -07:00
Quency-D
3fe2d48a61 Remove duplicate rows. 2025-08-28 19:20:11 +08:00
Quency-D
d93e03bb6e Merge pull request #3 from Quency-D/dev
Merge Dev
2025-08-28 18:56:56 +08:00
Quency-D
ec6d119900 Adapt the new UI for heltec t190. 2025-08-28 17:07:33 +08:00
Quency-D
bb63f8165d Merge pull request #2 from Quency-D/dev
Merging changes
2025-08-28 15:36:59 +08:00
Quency-D
2e49eef337 Adapt the new UI for heltec e290. 2025-08-28 15:00:27 +08:00
Quency-D
d5bec3d6a5 Remove duplicate rows. 2025-08-28 14:36:56 +08:00
Quency-D
1415792141 Adapt the new UI for heltec e213. 2025-08-28 14:29:56 +08:00
Quency-D
666b036d3d Adapt the new UI for heltec paper. 2025-08-28 14:03:20 +08:00
ripplebiz
3f5c772663 Merge pull request #671 from aveao/why2025-badge-pr
Add WHY2025 badge as a variant
2025-08-28 09:45:16 +10:00
ripplebiz
2d6e714ccd Merge pull request #675 from fdlamotte/sensormesh_additions
SensorMesh: handleIncomingMsg from admin
2025-08-28 09:25:13 +10:00
Florent
136f733df5 SensorMesh: add the possibility to receive msgs from admin 2025-08-27 21:19:12 +02:00
446564
c10b387e63 add remaining roles to t1000e
usb companion, repeater and room server
2025-08-27 10:30:56 -07:00
kelsey hudson
1b0999fc7e Merge remote-tracking branch 'upstream/dev' into dev 2025-08-27 00:39:35 -07:00
kelsey hudson
2e2e677b0a Ikoka Stick: Board IDs, LED behavior
Updates the manufacturer identifier with the EBYTE module. Makes the LED
behave properly. Turns the bright blue LED off after the first time you
transmit anything via LoRa.
2025-08-27 00:37:16 -07:00
ave
6536e9931d add why2025 badge as a target 2025-08-27 08:34:38 +02:00
Florent
0959e64d11 lib_build: add UI_FLAVOR and some cleanup 2025-08-26 13:28:42 +02:00
Laura J
a16e011bd2 modified T114 code to disable many unused peripherals, and set up the LOWPWR power mode. all changes should be quite safe, but testing for a couple days just in case. 2025-08-25 22:10:18 -07:00
ripplebiz
24cc6a40a6 Merge pull request #665 from jbrazio/jbrazio/2025_9776d79d
Fix Heltec v3 433MHz crash while transmitting
2025-08-26 12:55:18 +10:00
ripplebiz
0ed8921153 Merge pull request #662 from fdlamotte/lib_build_display_support
lib_build: Support display and example build
2025-08-26 10:28:20 +10:00
ripplebiz
4a166078db Merge pull request #667 from LitBomb/patch-18
Update faq.md
2025-08-26 10:25:04 +10:00
uncle lit
02ad2bed4d Update faq.md
update instruction to add a node to the Internet Map from the app, and note that you can use the same companion radio to remove the nodes you added previously

add channel and contact QR code URL format
2025-08-25 17:20:13 -07:00
João Brázio
78fcb704bc Increase power limit for Heltec v3 433 MHz 2025-08-25 17:44:14 +01:00
Florent
df18dfb481 lib_build: exclude file from example 2025-08-25 18:34:50 +02:00
Florent
15249bb8d5 lib_build: include example code in build 2025-08-25 17:50:48 +02:00
Florent
033706adcf lib_build: fix ST7789 so we don't have to add helpers/ui in INC_DIRS 2025-08-25 16:33:34 +02:00
liamcottle
2d5016bac3 add ability to remove neighbour via cli 2025-08-25 23:45:50 +12:00
Florent
d0fb8d2f30 lib_build: support display 2025-08-25 12:11:39 +02:00
ripplebiz
08b49c3ac5 Merge pull request #660 from khudson/station_g2_logger
Station G2: Adds repeater variant with packet logging on
2025-08-25 12:05:22 +10:00
ripplebiz
0fd24c8e5d Merge pull request #656 from khudson/dev
Ikoka Stick: Adding variant support for different Ebyte S22 modules
2025-08-25 12:04:08 +10:00
ripplebiz
44fb4d1bce Merge pull request #659 from fdlamotte/use_as_lib
Use as lib
2025-08-25 11:58:00 +10:00
kelsey hudson
bbee057b03 Station G2: Adds repeater variant with packet logging on
Adds a variant to Station G2 which turns on mesh packet logging to
serial. Useful for telemetry logging. Sites such as map.w0z.is depend
on this functionality.
2025-08-24 15:54:05 -07:00
Florent
b88a360ada lib_build: add nrf52 and RP2040 2025-08-24 14:47:03 +02:00
Florent
228bac0add simplify src_filter creation 2025-08-24 13:09:55 +02:00
Florent
685f75234b let users compile their projects against meshcore as a lib 2025-08-24 13:06:19 +02:00
kelsey hudson
dedef49315 Ikoka Stick: Adding variant support for Ebyte S22 modules
The Ebyte S22 module comes in three variants, 22dBm, 30dBm, and 33dBm. Each
requires a different TX power max setting to avoid frying the PA frontend.

Breaks out variants and roles by module type.
2025-08-22 23:29:28 -07:00
Scott Powell
cb96503b92 * Companion: new-ui, power off now labelled "hibernate" 2025-08-23 14:45:18 +10:00
João Brázio
7f142245e6 Merge remote-tracking branch 'origin/dev' into jbrazio/2025_3f11ad35 2025-08-22 23:00:35 +01:00
ripplebiz
5cd1df48ad Merge pull request #651 from awolden/awolden/ina226
Add INA226 to environmental sensors
2025-08-22 17:58:04 +10:00
Alex Wolden
0c37eafd01 Fixed shunt value for ina226 2025-08-21 13:23:05 -07:00
ripplebiz
e0d548c71e Merge pull request #650 from LitBomb/patch-17
Update faq.md
2025-08-21 16:58:02 +10:00
Alex Wolden
c636536599 Add INA226 to rak 2025-08-20 22:23:54 -07:00
uncle lit
82184c5836 Update faq.md
update verbiage on room server's repeat functionality to discourage turning repeat on on room server.

Update repeater flood advert to 3 hours and mentioning pending PR to change that to 12 hours.
2025-08-20 22:08:19 -07:00
ripplebiz
5772756b30 Merge pull request #649 from LitBomb/patch-16
Update faq.md
2025-08-21 11:28:23 +10:00
uncle lit
f462113f4c Update faq.md
updated .mp3 file list for sound customization on t-deck
added instruction to take a screenshot on t-deck
Added link to MeshCore Ultra firmware user guide
update github link from /meshcore to /meshcore-dev
Update current hardware list to point to flasher.meshcore.co.uk
2025-08-20 12:20:06 -07:00
ripplebiz
412e9d4678 Merge pull request #645 from recrof/dev
set default flood advert interval to 12 hours
2025-08-20 22:01:07 +10:00
recrof
5dc930410c set default flood advert interval to 12 hours 2025-08-20 13:44:41 +02:00
Scott Powell
a9d4cf1d21 * various repeaters: fix for missing MomentaryButton module 2025-08-19 23:14:11 +10:00
ripplebiz
e846cc6798 Merge pull request #642 from fdlamotte/techo_power_off
techo_ui: implement poweroff + led fixes
2025-08-19 21:23:49 +10:00
Florent
ff03b041d0 techo_ui: implement poweroff + led fixes 2025-08-19 09:03:34 +02:00
ripplebiz
a825a3d4bc Merge pull request #638 from recrof/dev
fix RAK build errors
2025-08-18 22:12:31 +10:00
recrof
d145d5936d fix RAK build errors 2025-08-18 12:53:44 +02:00
ripplebiz
b8c4c75025 Merge pull request #636 from fdlamotte/t1000_wait_button_release_before_poweroff
t1000: wait for button release before powering off
2025-08-18 13:52:12 +10:00
Florent
b8f80afee9 t1000: wait for button release before powering off 2025-08-17 16:28:02 +02:00
ripplebiz
6e296e8db1 Merge pull request #633 from oltaco/dev
WioTrackerL1: add joystick left and right for new UI
2025-08-17 22:17:59 +10:00
ripplebiz
cb85600572 Merge pull request #634 from recrof/dev
station g2: switch to New UI
2025-08-17 22:15:01 +10:00
recrof
a4916f81eb station g2: switch to new_ui 2025-08-17 11:57:38 +02:00
taco
cb8ca91d27 WioTrackerL1: add joystick left and right for new UI 2025-08-17 19:01:28 +10:00
ripplebiz
3bb55b590c Merge pull request #632 from oltaco/dev
WioTrackerL1: add poweroff support
2025-08-17 18:13:14 +10:00
taco
8f1ccb65ae WioTrackerL1: add poweroff support 2025-08-17 18:10:58 +10:00
Scott Powell
e6152f9d6c * Xiao_s3_wio: ui-new 2025-08-17 17:52:05 +10:00
ripplebiz
ed3f52775a Merge pull request #629 from fdlamotte/techo_ui_tweaks
techo_ui: some tweaks
2025-08-17 17:48:47 +10:00
Scott Powell
7613b9455d * Xiao_nRF and Xiao_rp2040 build fixes 2025-08-17 17:36:35 +10:00
Scott Powell
76a53bf84d * Wio-e5-mini: ui-orig
* WioTrackerL1: ui-new
2025-08-17 17:23:28 +10:00
Florent
b332b06304 techo_ui: some tweaks 2025-08-17 08:52:57 +02:00
Scott Powell
fe376e8c35 * RAK_4631: ui-new 2025-08-17 16:49:08 +10:00
Scott Powell
f5ad1df103 * Minewsemi: ui-orig 2025-08-17 16:35:39 +10:00
Scott Powell
276a057693 * lilygo_tlora_v2_1: ui-new 2025-08-17 16:31:50 +10:00
Scott Powell
2477d60fae * TBeam variants: ui-new 2025-08-17 16:18:39 +10:00
Scott Powell
8f8830047b * T3S3 variants, ui-new 2025-08-17 16:06:26 +10:00
Scott Powell
c30a103baf * WSL3 fixes. Heltec V2 ui-new 2025-08-17 15:50:25 +10:00
ripplebiz
95c9d17dc5 Merge pull request #631 from khudson/new-companion-ui
Ikoka Stick: Use New Companion UI. Fix repeater & room server roles.
2025-08-17 08:24:09 +10:00
kelsey hudson
022bfc4f4b Ikoka Stick: Use new UI, make repeater & room server work
* Enable the new UI on the BLE and USB Companion roles.
* Fix compilation issues with the repeater and room server roles.
* Remove ESP32-related alternate pinout cruft from the NRF build tree.
* build.sh: add build-matching-firmwares command to allow e.g. building
  all roles for a given variant by passing the variant name.
2025-08-16 15:09:42 -07:00
kelsey hudson
0359df6cb5 Merge commit 'e9ffc3ea93d7912460c38cbaafb726f5455ad8cf' into new-companion-ui
Merging ikoka stick repeater/room server commit to simplify pull request later.
2025-08-16 12:26:34 -07:00
ripplebiz
f9284cdf4a Merge pull request #616 from haylinmoore/nix-add-python3
default.nix: add python3 to the shell
2025-08-17 00:32:41 +10:00
Scott Powell
37d7257f04 * Heltec tracker, now using /ui-new
* variants with no DISPLAY_CLASS .ini fixes
2025-08-16 21:53:36 +10:00
Scott Powell
e14b022a7c * original UITask now in /ui-orig folder 2025-08-16 21:09:35 +10:00
Scott Powell
acde9921b5 * Refactor of UITask, moved to /ui-new 2025-08-16 20:04:54 +10:00
ripplebiz
29fd5da5e8 Merge pull request #624 from oltaco/new-companion-ui
Support NewUI on WioTrackerL1
2025-08-16 13:51:18 +10:00
kelsey hudson
e9ffc3ea93 Ikoka Stick: repeater/room server functionality
Make Repeater and Room Server work as build targets.

Remove esp32-related alternate pinout cruft from the Ikoka Stick
NRF build tree.
2025-08-15 19:29:22 -07:00
taco
86671c0ff8 Support NewUI on WioTrackerL1 2025-08-16 09:29:48 +10:00
Quency-D
bd6bd065ac Add heltec_vision_master_t190 board. 2025-08-15 15:54:24 +08:00
Scott Powell
a5ebac6236 Merge branch 'dev' into new-companion-ui 2025-08-15 15:39:11 +10:00
ripplebiz
9108a709ee Merge pull request #612 from Quency-D/dec-heltec_e290
Add heltec_vision_master_e290 board.
2025-08-15 13:59:42 +10:00
ripplebiz
655d4a78f5 Merge pull request #615 from MikesAllotment/new-companion-ui
UI Refresh changes for HeltecV2 and Faketec ProMicro
2025-08-15 13:04:38 +10:00
Haylin Moore
24ef375fc7 default.nix: add python3 to the shell
There are many systems that chose to not have a global python install,
namely my own systems :p. I end up having to nix-shell -p python3 anytime
I want to run the build.sh as the last step uf2conv depends on python
2025-08-14 15:52:04 -07:00
MikesAllotment
d7c2293cb8 Added support for new EnhancedUI MomentaryButton
for Heltec V2 and Faketec ProMicro variants
2025-08-14 14:17:26 +01:00
ripplebiz
a7dcd112ac Merge pull request #608 from Quency-D/dev-heltec_e213
Add heltec_vision_master_e213 board.
2025-08-14 21:20:21 +10:00
Quency-D
aa7f9d8df6 Use the base class to optimize screen display code. 2025-08-14 17:43:46 +08:00
ripplebiz
82206fd281 Merge pull request #609 from 446564/nan-g2-usb
add nano g2 usb companion
2025-08-14 15:58:25 +10:00
ripplebiz
e47a1df67f Merge pull request #587 from alexbegoon/feature/xiao-c6-external-antenna-support
[Feature] Add external antenna support for XIAO ESP32C6
2025-08-14 15:41:09 +10:00
Quency-D
6d18e2c57b Add heltec_vision_master_e290 board. 2025-08-14 10:30:27 +08:00
Quency-D
fad4a7fb51 Modify the flash size to 16MB. 2025-08-14 10:26:26 +08:00
446564
dc9b4f8e84 add nano g2 usb companion 2025-08-13 09:47:01 -07:00
Quency-D
be243a2663 Add heltec_vision_master_e213 board. 2025-08-13 18:12:48 +08:00
Quency-D
dc6b830970 * Heltec CT62: sensor role (with 2 channel relay support + 1 digital …
* Heltec CT62: sensor role (with 2 channel relay support + 1 digital …
2025-08-13 17:00:17 +08:00
Scott Powell
86ec82fd06 * Heltec CT62: sensor role (with 2 channel relay support + 1 digital input) 2025-08-12 20:56:59 +10:00
Scott Powell
e84e3066ff * MomentaryButton: pullupdown param moved to constructor 2025-08-12 10:01:35 +10:00
ripplebiz
1897f51458 Merge pull request #601 from khudson/dev
Adding support for Ikoka Stick with Seeed Xiao nRF54 baseboard.
2025-08-11 11:46:11 +10:00
ripplebiz
a2eed714f5 Merge pull request #595 from gumbero/main
Added room option to T-Beam SX1276
2025-08-11 11:30:29 +10:00
kelsey hudson
bed311313a Adding support for Ikoka Stick with Seeed Xiao nRF54 baseboard.
Adds a new variant 'ikoka_stick_nrf' and associated support files. This is
based on the Xiao nRF54 code with pin numbers and functions changed to suit the
differences in hardware between the WIO SX1262 board and the Ikoka Stick.

Sets the default LoRa transmit power to 9dBm to avoid burning up the frontend
in Ikoka Sticks equipped with the Ebyte 33dBm S22 module on first boot.

Adds support for an SSD1306 display connected to the display header. Note the
display pinout is the same as the RAK4631 display header so make sure to use a
display wired accordingly (aliexpress etc. SSD1306s typically have Vcc & GND
reversed from what this board expects).

Adds support for display rotation to SSD1306Display via a platformIO define.
This support was added following the same paradigms found elsewhere in the code
for rotating a display.
2025-08-10 10:44:00 -07:00
gumbero
af7db5593b Update platformio.ini 2025-08-10 14:25:43 +02:00
ripplebiz
c8bbec6549 Merge pull request #598 from 446564/nano-g2-new-ui
add new UI to nano g2
2025-08-10 14:44:04 +10:00
446564
153051ab82 add new UI to nano g2 2025-08-09 20:47:35 -07:00
Scott Powell
67529d0cf3 Merge branch 'dev' into new-companion-ui 2025-08-10 12:28:25 +10:00
ripplebiz
72d13ca867 Merge pull request #594 from wel97459/dev
Changed waveshare_rp2040_lora radio_init function to use radio.std_init
2025-08-10 12:22:07 +10:00
ripplebiz
b9270aff5c Merge pull request #597 from 446564/ignore-clangd
add lsp ignores
2025-08-10 12:13:32 +10:00
446564
cdc762ada2 add lsp ignores
adds cache and ccls dirs and clangd files to git ignore
2025-08-09 17:37:51 -07:00
Tomas Gabor
6e26a6a78c Added room option to T-Beam SX1276 2025-08-09 21:28:31 +02:00
ripplebiz
cc065c84ba Merge pull request #589 from fdlamotte/techo_new_ui
TEcho: New companion UI
2025-08-09 18:53:51 +10:00
wel97459
331a29b082 Changed radio_init to use radio.std_init this also changes the preamble to 16 as before it was 8 2025-08-08 20:17:06 -07:00
Alexander Begoon
6902dd81fa Move variant specific code 2025-08-08 23:04:14 +02:00
fdlamotte
af72db6834 Merge branch 'new-companion-ui' into techo_new_ui 2025-08-08 15:40:19 +02:00
Florent
1e711f57f4 techo: initial support of new companion ui 2025-08-08 15:34:58 +02:00
ripplebiz
1b93ceaa30 Merge pull request #588 from liamcottle/feature/new-companion-ui-thinknode-m1
add support for new companion ui on thinknode m1
2025-08-08 22:24:55 +10:00
liamcottle
8d7a49867f add support for new companion ui on thinknode m1 2025-08-09 00:21:10 +12:00
Scott Powell
4b95c981bb * UI revamp for companion radios 2025-08-08 20:01:31 +10:00
Alexander Begoon
ce4e559c01 Add support for Xiao ESP32C6 with external antenna configuration 2025-08-07 22:36:40 +02:00
ripplebiz
a310a5c4d5 Merge pull request #584 from 446564/nano-g2-gps-fix
nano g2 gps fixes
2025-08-07 12:57:07 +10:00
Ded
4d97bee02a good oops 2025-08-06 18:52:57 -07:00
ripplebiz
6b2836ea07 Merge pull request #579 from alexbegoon/feature/add_meshimi_support
Add Meshimi support
2025-08-07 11:35:39 +10:00
446564
53c1f70412 various fixes for nano g2 gps
- baud rate changed to default
- switch state detected at boot to enable position
- small edge cases fixed
- more mesh debugging output added

Co-authored-by: LitBomb <lithangw@hotmail.com>
Co-authored-by: Nick from BOSTON
2025-08-06 11:41:37 -07:00
ripplebiz
4b653408a6 Merge pull request #575 from Quency-D/dev
Add HELTEC MeshSolar board.
2025-08-06 11:18:07 +10:00
Alexander Begoon
fa3500944b Add Meshimi configuration and environment setups in platformio.ini 2025-08-05 18:45:20 +02:00
Scott Powell
d1e13d0b9e Revert "disable led light on t-echo device"
This reverts commit 55453e1136.
2025-08-05 18:45:20 +02:00
TasmanDevil
6214b75e83 disable led light on t-echo device 2025-08-05 18:45:20 +02:00
Rastislav Vysoky
28360ba459 replaced Andy Kirby's discord with MeshCore discord. 2025-08-05 18:45:20 +02:00
Rastislav Vysoky
ca9687e212 faq: fix broken links, replace discord link from Andy's discord to MeshCore discord 2025-08-05 18:45:20 +02:00
Rastislav Vysoky
fc334a05c6 remove hardware compatibility list - it was outdated. 2025-08-05 18:45:19 +02:00
uncle lit
00dc193b0d Update faq.md
- rewrite Linux firmware update with more detailed instructions 
- fix T114 reset typo: double click twice, not once
- add link reference to MeshCore logo on github
- add public channel key for t-deck to the t-deck section
- reference the verbiage "what is meshcore?" on meshcore.co.uk homepage
2025-08-05 18:45:19 +02:00
Quency-D
cf9bcb5f4f refactor variants #393
refactor variants #393
2025-08-05 15:26:24 +08:00
Quency-D
fb8a4d12b1 refactor variants #393 2025-08-05 15:24:51 +08:00
Quency-D
612dde73e9 Add HELTEC MeshSolar board. 2025-08-04 14:29:49 +08:00
ripplebiz
2853708f38 Merge pull request #573 from recrof/sensor_template
platformio sensor template, use it for v3 and RAK.
2025-08-04 11:03:53 +10:00
ripplebiz
112e60a14a Merge pull request #569 from recrof/dev
esp32c6: pin the pioarduino version to last working one
2025-08-03 12:53:45 +10:00
recrof
6861b0702f create sensor template in platformio.ini, update heltec v3 and rak4631 to use new template 2025-08-02 21:40:56 +02:00
Rastislav Vysoky
a5c78f2f19 Merge branch 'ripplebiz:dev' into dev 2025-08-02 20:54:26 +02:00
recrof
8d3bdc6945 pin the pioarduino version to last working one 2025-08-02 16:26:21 +02:00
ripplebiz
d13dc10bf3 Merge pull request #564 from oltaco/fix-wiotracker-l1-board
WioTracker L1 various fixes
2025-08-02 19:36:57 +10:00
taco
a49b5aaba7 fix: wrong QSPI pins for wio tracker l1 2025-08-02 04:07:07 +10:00
Scott Powell
febc63d286 * fix: init rx_air_time to 0 2025-08-01 20:05:37 +10:00
ripplebiz
b17196828d Merge pull request #563 from Cisien/cisien/add-rx-time
Add a counter to track rx time for repeater stats
2025-08-01 19:59:20 +10:00
Scott Powell
28af68c187 * new CommonCLI commands: "get prv.key", "set prv.key {hex}" 2025-08-01 19:28:44 +10:00
ripplebiz
0a2d132d84 Merge pull request #547 from fdlamotte/sensors_gpio
sensors: gpio command
2025-08-01 19:06:44 +10:00
Scott Powell
2824fc31a4 * CMD_SEND_PATH_DISCOVERY_REQ: now force the sendRequest() to use flood mode 2025-07-31 14:38:11 +10:00
Scott Powell
32e8ce4130 * REQ_TYPE_GET_TELEMETRY_DATA, first reserved byte (of 4) is now inverse mask to apply to permissions 2025-07-31 13:45:53 +10:00
Scott Powell
fcdf342db6 * Companion: experimental CMD_SEND_DISCOVERY_REQ -> PUSH_CODE_DISCOVERY_RESPONSE 2025-07-31 13:04:16 +10:00
taco
1dfc0e6975 fix: Wio Tracker L1: use correct max ram and flash size for S140 v7.3.0 softdevice 2025-07-31 07:03:58 +10:00
Chris
ea2ce93c02 Add a counter to track rx time for repeater stats 2025-07-30 09:41:20 -07:00
Scott Powell
f87e856347 * companion: fix for CMD_IMPORT_PRIVATE_KEY, to re-calc shared secrets 2025-07-30 16:00:47 +10:00
Scott Powell
f66d900ae2 * companion: bug fix for CMD_ADD_UPDATE_CONTACT 2025-07-30 14:57:38 +10:00
ripplebiz
84eafe4752 Merge pull request #559 from 446564/wsl3-usb-comp
add wsl3 usb companion
2025-07-30 14:12:43 +10:00
446564
dca20ea994 add wsl3 usb companion 2025-07-29 15:56:07 -07:00
João Brázio
85273a6dc6 Merge remote-tracking branch 'origin/dev' into jbrazio/2025_3f11ad35 2025-07-29 00:31:52 +01:00
ripplebiz
131e7a5a23 Merge pull request #558 from mkudlacek/dev
Added support for TI INA260 and Sensirion SHT4x
2025-07-28 23:10:38 +10:00
Martin Kudlacek
822850b4d5 Support for Sensirion SHT4x 2025-07-28 10:02:31 +02:00
Martin Kudlacek
a96d1022a0 Added support for TI INA260 2025-07-28 09:41:06 +02:00
ripplebiz
5f9210b5db Merge pull request #554 from oltaco/esm-bmp280-altitude-fix
fix: use correct library for BMP280 altitude read
2025-07-28 15:02:42 +10:00
taco
ef58ef460b fix: BMP280 altitude was using incorrect library 2025-07-28 11:29:55 +10:00
Scott Powell
b0946b3f6b Revert "disable led light on t-echo device"
This reverts commit 55453e1136.
2025-07-27 20:38:20 +10:00
ripplebiz
16820c5289 Merge pull request #553 from ch4r13/main
Disable LED lights on t-echo device
2025-07-27 17:54:26 +10:00
ripplebiz
39eb5502af Merge pull request #552 from recrof/dev
promicro: added sensor role, removed non-functional llcc68 variant envs
2025-07-27 17:53:47 +10:00
TasmanDevil
55453e1136 disable led light on t-echo device 2025-07-25 22:53:56 +02:00
Rastislav Vysoky
12f5177229 Merge branch 'ripplebiz:dev' into dev 2025-07-25 15:10:15 +02:00
Scott Powell
ad19ac1ab3 * Companion: CMD_ADD_UPDATE_CONTACT now with optional extra 'last_mod' timestamp 2025-07-25 22:59:48 +10:00
recrof
2e346bc61c promicro: added sensor role 2025-07-24 17:37:35 +02:00
Scott Powell
c1041af5a1 Merge branch 'dev' 2025-07-24 20:31:13 +10:00
Scott Powell
365cb89634 * ver bump to 1.7.4 2025-07-24 20:30:35 +10:00
ripplebiz
048fa03784 Merge pull request #548 from recrof/dev
SenseCap Solar compilation fix: bad linker directory; added companion ble and usb roles
2025-07-24 19:40:05 +10:00
Rastislav Vysoky
3139d509c2 Merge branch 'ripplebiz:dev' into dev 2025-07-24 09:38:41 +02:00
Scott Powell
4689f9b425 * CommonCLI: reverted "set radio ..." command, added new "tempradio ..." command 2025-07-23 22:04:47 +10:00
Scott Powell
ea4aa93594 * CommonCLI: "set radio " now with optional 5th param timeout_mins, for applying temporary radio params for that many mins
* "advert" command now with longer delay, so that CLI reply is sent first
2025-07-23 21:40:37 +10:00
Rastislav Vysoky
9485488f6e Merge branch 'ripplebiz:dev' into dev 2025-07-23 12:18:05 +02:00
recrof
e48e64ae84 fix: bad linker directory; added companion ble and usb roles 2025-07-23 12:17:40 +02:00
Florent
479b8ed0ce sensors: gpio apply masks 2025-07-23 08:02:57 +02:00
ripplebiz
c2266026a0 Merge pull request #541 from recrof/dev
enable all ESM sensors on RAK4631
2025-07-23 13:44:23 +10:00
Florent
b5a8a1a883 sensors: gpio command 2025-07-22 21:08:15 +02:00
ripplebiz
e42d8f972e Merge pull request #540 from oltaco/wiotrackerl1-pinfix
Wio Tracker L1: fix incorrect joystick pin.
2025-07-21 23:47:41 +10:00
recrof
f88ebad604 enable all sensors on RAK4631 2025-07-21 15:30:14 +02:00
taco
296a1e45fb fix: Wio Tracker L1: correct joystick press button pin 2025-07-21 18:17:32 +10:00
ripplebiz
0a9da09a67 Merge pull request #539 from liamcottle/fix/missed-packets
Start receive immediately after packet received
2025-07-20 21:57:44 +10:00
liamcottle
599e3a187c start rx again immediately after receive 2025-07-20 23:27:54 +12:00
ripplebiz
c6d4b7513f Merge pull request #538 from oltaco/ct62-std-init
Heltec CT62: use radio.std_init()
2025-07-19 17:25:10 +10:00
taco
c5783660c4 radio.std_init() for heltec ct62 2025-07-19 16:09:54 +10:00
ripplebiz
a2e3e6607e Merge pull request #534 from mikenz/heltec-v3-sensor
Allow the SDA and SCL pins for Environment sensors to be configured independently of the OLED I2C
2025-07-18 20:33:48 +10:00
ripplebiz
64cc4cf60a Merge pull request #535 from fdlamotte/rak3x72_sensor
rak3x72: sensor target
2025-07-18 20:25:20 +10:00
Florent
9be28c2002 rak3x72: sensor target 2025-07-18 12:18:03 +02:00
Mike Cochrane
93802fe250 Add VL53L0X time-of-flight distance sensor to Heltec V3 Sensor 2025-07-18 22:01:47 +12:00
Mike Cochrane
9f2a77c92e Add Melexis Contact-less Infrared Sensor - MLX90614 to Heltec V3 Sensor 2025-07-18 18:51:00 +12:00
Mike Cochrane
e4f7b9e37f Allow the SDA and SCL pins for Environment sensors to be configured independantly. Add Heltec V3 Sensor. 2025-07-18 18:16:59 +12:00
Scott Powell
855e4831f5 * updates to packet/payload structure docs 2025-07-18 12:56:31 +10:00
ripplebiz
e9a8fcb1cd Merge pull request #531 from cod3doomy/dev
RAK4631 ESM Migration
2025-07-18 11:53:48 +10:00
cod3doomy
6b4592bfe2 Cleanup and fixes
-Added RAK_4631 define back
-Added includes for common RAK sensors that are currently supported in ESM
-Set global variables to static
-Reduced delay time within the RAK gps init sequence
2025-07-17 10:42:18 -07:00
cod3doomy
73b1ac5190 Merge branch 'ripplebiz:dev' into dev 2025-07-17 08:49:02 -07:00
ripplebiz
46d30f6bfe Merge pull request #521 from recrof/dev
cleanup: move radiolib wrappers to dedicated directory
2025-07-17 13:49:58 +10:00
cod3doomy
660ab0692f RAK4631 ESM Migration
Changes to migrate sensor code to the ESM.

Added a separate GPS init sequence for the RAK that scans I2C and Serial1 on the various sockets of the various base boards to find the RAK12500. (and soon the RAK12501)

Removed the GPS specific envs from platformio.ini and enabled GPS for all envs.

Verified working with RAK12500 on RAK19007 sockets A and D, as well as RAK19003.
2025-07-16 19:04:50 -07:00
Rastislav Vysoky
2c9dc8d351 Merge branch 'ripplebiz:dev' into dev 2025-07-16 20:05:21 +02:00
ripplebiz
6a6221f44e Merge pull request #529 from marcelverdult/patch-1
Fixed Barometric Pressure Reading for BMP280
2025-07-16 23:06:37 +10:00
ripplebiz
46fa3f2026 Merge pull request #527 from oltaco/wio-tracker-l1-radiofix
fix: Wio Tracker L1: add DIO2 as rfSwitch and correct TCXO voltage.
2025-07-16 23:05:47 +10:00
ripplebiz
122f5fa10a Merge pull request #526 from oltaco/uitask-add-gps-alert
add GPS UI alert to quad-press
2025-07-16 23:04:39 +10:00
marcelverdult
58cffa8f76 Fixed Barometric Pressure Reading for BMP280
Measurement has to be divided by 100 same as BME280
2025-07-16 13:50:23 +02:00
Scott Powell
3358783039 * sensor: "setperm {pubkey-hex} 0" command can now remove by partial pubkey
* sensor: login with blank password now just checks if sender is in ACL, and returns permissions (if so)
2025-07-16 21:16:05 +10:00
Scott Powell
5881b04a31 * companion: optional double ACKs, new prefs.multi_acks 2025-07-16 19:25:28 +10:00
Scott Powell
6bc8dd28d4 * CommonCLI: new "multi.acks" config setting 2025-07-16 18:51:18 +10:00
Scott Powell
3a0dfc1bf3 Merge branch 'dev' into double-acks 2025-07-16 18:02:41 +10:00
Scott Powell
d15b374c29 * Sensor permission levels renamed. Misc sensor fixes. 2025-07-16 14:18:05 +10:00
taco
3f996ef4fc fix: Wio Tracker L1: add DIO2 as rfSwitch and correct TCXO voltage. 2025-07-16 12:25:16 +10:00
taco
57f93a4196 add GPS UI alert to quad-press 2025-07-16 10:35:48 +10:00
Rastislav Vysoky
a6c8dc4866 Merge branch 'ripplebiz:dev' into dev 2025-07-15 12:19:51 +02:00
Scott Powell
c26418016b Merge branch 'dev' into double-acks 2025-07-15 17:02:20 +10:00
Scott Powell
c6b469fa47 Merge branch 'dev' 2025-07-15 16:00:11 +10:00
Scott Powell
f74819f8db * ver bump 2025-07-15 15:59:10 +10:00
Scott Powell
fccb3b6c39 * companion: added CMD_FACTORY_RESET (51) 2025-07-15 15:56:59 +10:00
Scott Powell
7947e8a2d8 * simple_sensor: redesigned permissions
* companion:  PUSH_CODE_LOGIN_SUCCESS now has extra byte in frame for ACL permissions
2025-07-15 15:05:38 +10:00
Scott Powell
da8bd717a4 * companion: serial protocol ver bump (FIRMWARE_VER_CODE) now 7 2025-07-14 13:09:22 +10:00
Scott Powell
1930dc347e * companion: reverted PUSH_CODE_TELEMETRY_RESPONSE, added new PUSH_CODE_BINARY_RESPONSE 2025-07-14 12:46:51 +10:00
Scott Powell
df33321bdc * companion: added CMD_SEND_BINARY_REQ (50) 2025-07-14 12:25:34 +10:00
ripplebiz
2c9a2ee18f Merge pull request #523 from recrof/patch-12
sensecap_solar: disable GPS until it's supported
2025-07-14 10:51:38 +10:00
Scott Powell
8c104b8a8f Merge commit '9117798a41ce1538dae824e18a54a1fa3a735126' into dev 2025-07-14 10:50:23 +10:00
ripplebiz
9117798a41 Merge pull request #522 from recrof/patch-11
Heltec Wireless Paper fix: radio init failed: -2
2025-07-14 10:49:12 +10:00
Scott Powell
4a2978736e * Sensor: "get acl" command 2025-07-14 10:12:27 +10:00
Rastislav Vysoky
3c92c6aa3b sensecap_solar: disable GPS until it's supported 2025-07-13 22:41:27 +02:00
Rastislav Vysoky
f9e595687e Heltec Wireless Paper fix: radio init failed: -2 2025-07-13 15:21:02 +02:00
Rastislav Vysoky
3adbb5042e Merge branch 'ripplebiz:dev' into dev 2025-07-13 11:39:02 +02:00
recrof
4fcbc00bea Merge branch 'dev' of github.com:recrof/MeshCore into dev 2025-07-13 11:37:58 +02:00
recrof
6be8e19a9f move radiolib wrappers to dedicated directory 2025-07-13 11:37:33 +02:00
Scott Powell
be68aaed20 * simple_sensor: new REQ_TYPE_GET_ACCESS_LIST 2025-07-13 18:50:52 +10:00
Scott Powell
339ee035aa * simple_sensor: handleCustomCommand() hook 2025-07-13 15:30:49 +10:00
ripplebiz
ced14d65db Merge pull request #517 from recrof/dev
platformio.ini cleanup: move rak to nrf52_core, remove nrf52840_core
2025-07-13 14:47:21 +10:00
recrof
854a8dfe2f move rak to nrf52_core, remove nrf52840_core 2025-07-12 20:06:56 +02:00
Scott Powell
0d1b5b17d3 * simple_sensor: added alert send queue, with retries, checks for ACKs, etc. Low pri alerts only 1 send attempt, otherwise 4 attempts 2025-07-12 12:26:16 +10:00
Scott Powell
d84feacc60 Merge branch 'dev' into double-acks 2025-07-12 10:36:03 +10:00
ripplebiz
fc541bdf42 Merge pull request #511 from oltaco/wio-tracker-l1
Seeed Wio Tracker L1: initial support
2025-07-11 21:31:39 +10:00
ripplebiz
fe2616d19c Merge pull request #514 from recrof/patch-10
replaced Andy Kirby's discord with MeshCore discord.
2025-07-11 21:22:35 +10:00
ripplebiz
7958b920fa Merge pull request #513 from recrof/patch-9
faq: fix broken links, replace discord link from Andy's discord to MeshCore discord
2025-07-11 21:21:06 +10:00
Rastislav Vysoky
10bb05c31a replaced Andy Kirby's discord with MeshCore discord. 2025-07-11 11:39:50 +02:00
Rastislav Vysoky
6aa41bd67d faq: fix broken links, replace discord link from Andy's discord to MeshCore discord 2025-07-11 11:37:01 +02:00
taco
78cd655789 Seeed Wio Tracker L1: initial support 2025-07-11 01:08:38 +10:00
ripplebiz
e8b1f317f3 Merge pull request #503 from fdlamotte/buzzer--disable-when-quiet
Buzzer  disable when quiet
2025-07-10 14:58:42 +10:00
ripplebiz
cd1cf71f39 Merge pull request #506 from 446564/cleanup-rak4631
move rak4631 specific files into variant folder
2025-07-10 14:55:05 +10:00
ripplebiz
55a259b0a1 Merge pull request #508 from ngavars/cleanup-minewsemi
Clean up Minewsemi ME25LS01 variant
2025-07-10 14:54:20 +10:00
ripplebiz
75486f5d41 Merge pull request #507 from ngavars/cleanup-promicro
Clean up Promicro variant
2025-07-10 14:53:47 +10:00
ripplebiz
90db5f7e39 Merge pull request #505 from fdlamotte/wio_e5_mini_sensor
wio-e5-mini: simple_sensor target
2025-07-10 14:51:48 +10:00
Normunds Gavars
ed7ca6fb60 393 clean up Minewsemi ME25LS01 variant 2025-07-10 00:55:38 +03:00
Normunds Gavars
cdd44212a1 393 clean up Promicro variant 2025-07-10 00:08:59 +03:00
Rob Loranger
9d0dd7947f move rak4631 specific files into variant folder 2025-07-09 10:21:24 -07:00
Florent
5f7bd0fe77 wio-e5-mini: simple_sensor target 2025-07-09 17:22:31 +02:00
Scott Powell
781f7e99f6 * companion: added CMD_GET_TUNING_PARAMS -> RESP_CODE_TUNING_PARAMS 2025-07-09 23:10:33 +10:00
João Brázio
04042e3ca0 Refactor serial bridge handling 2025-07-09 11:03:35 +01:00
Scott Powell
797ab85283 * sensor node: now have two alert priorities, LO, HI 2025-07-09 15:50:36 +10:00
Scott Powell
1f23632751 Merge branch 'dev' into double-acks 2025-07-09 14:59:25 +10:00
ripplebiz
91b911320b Merge pull request #504 from jaspersonneveldt/dev
Changed the Barometric Pressure value for the BME280 sensor since it was a factor 100 to high
2025-07-09 14:35:23 +10:00
João Brázio
97b51900f8 More robust handling of pkt len 2025-07-08 21:45:49 +01:00
jasper
7d47608985 Changed the Barometric Pressure value since it was a factor 100 to high 2025-07-08 21:16:03 +02:00
João Brázio
92ee1820c4 Add null check for packet allocation and clean up Dispatcher 2025-07-08 16:02:10 +01:00
Scott Powell
541cd8cfd9 * misc 2025-07-08 23:19:35 +10:00
Scott Powell
2715058eb2 * misc fixes 2025-07-08 23:19:35 +10:00
Scott Powell
112b360ef4 * implemented encoding responses to REQ_TYPE_GET_AVG_MIN_MAX 2025-07-08 23:19:35 +10:00
Scott Powell
29435342b0 * implemented getter methods for telemetry value types 2025-07-08 23:19:35 +10:00
Scott Powell
9cecbad2a7 * refactor: CommonCLI, processing of optional command prefix moved to handleCommand() call sites
* Sensor, anon_req now just for admin login (guest password now unused)
* special CLI command, "setperm {pubkey-hex} {permissions-int16}" for admin(s) to manage user access (permissions 0 = remove)
2025-07-08 23:19:35 +10:00
Scott Powell
ac834922de * simplified alertIf()
* refactored TimeSeriesData to top-level class
2025-07-08 23:19:35 +10:00
Scott Powell
de3e4bc27c * added REQ_TYPE_GET_AVG_MIN_MAX
* TimeSeriesData
* very basic SensorMesh::sendAlert()
2025-07-08 23:19:35 +10:00
Scott Powell
810b1f8fe7 * Mesh::onAnonDataRecv() slight optimisation, so that shared-secret calc doesn't need to be repeated
* SensporMesh: req_type now optionally encoded in anon_req payload (so can send various requests without a prior login)
2025-07-08 23:19:35 +10:00
Scott Powell
7fb7b69bbc * first cut of new simple_sensor sketch 2025-07-08 23:19:34 +10:00
João Brázio
ac056fb0b9 Remove serial bridge implementation and implement simplified version directly in the repeater source code. 2025-07-08 14:04:21 +01:00
Scott Powell
d3831821c7 * XiaoC3 custom, .ini fixes 2025-07-08 22:59:07 +10:00
Scott Powell
7bec45b3dd Merge branch 'dev' into double-acks 2025-07-08 22:14:48 +10:00
Florent
1c7c5ecb2b buzzer: disable when quiet 2025-07-08 14:01:31 +02:00
ripplebiz
58f4db1f19 Merge pull request #502 from jankowski-t/main
Migrate Meshadventurer to std_init()
2025-07-08 15:39:20 +10:00
jankowski-t
00ebb090e7 Migrate Meshadventurer to std_init() 2025-07-07 18:33:31 +02:00
ripplebiz
35374947ba Merge pull request #501 from fdlamotte/xiao_c3--small-fixups
xiao_c3: small fixups
2025-07-07 23:39:58 +10:00
Florent de Lamotte
d30412bf65 xiao_c3: small fixups 2025-07-07 10:41:29 +02:00
ripplebiz
02645be9df Merge pull request #500 from liamcottle/fix/nrf52-ble-refactor
Refactor nRF52 BLE to use connection callbacks
2025-07-07 17:00:24 +10:00
liamcottle
67f9204e88 refactor nrf52 ble to use callbacks 2025-07-07 16:36:55 +12:00
ripplebiz
992c8e49d4 Merge pull request #499 from jrkalf/dev
Xiao ESP32 C3 updates
2025-07-07 14:28:12 +10:00
ripplebiz
987c42409a Merge pull request #495 from recrof/dev
Seeed SenseCap Solar: correct LED behaviour: Lit when TX
2025-07-07 14:23:55 +10:00
ripplebiz
71f46ddaea Merge pull request #496 from recrof/patch-8
remove hardware compatibility list - it was outdated.
2025-07-07 14:20:08 +10:00
ripplebiz
0f2f1bc8be Merge pull request #490 from Noki/tbeam-sx1262-room
add room server role for TBeam SX1262
2025-07-07 14:19:33 +10:00
Jelle Kalf
5ec89dff5b Xiao ESP32 C3:
* Fixed pins for mainstream wio sx1262
* Moved previous sx1262 support to _custom version
* companion firmware added
2025-07-06 19:52:12 +02:00
Rastislav Vysoky
62f1ab4b06 remove hardware compatibility list - it was outdated. 2025-07-06 17:40:52 +02:00
recrof
88cbe3fddc Merge branch 'dev' of github.com:recrof/MeshCore into dev 2025-07-06 15:23:35 +02:00
recrof
e47755c8e9 Seeed SenseCap Solar: invert leds 2025-07-06 15:22:51 +02:00
ripplebiz
99e6b75743 Merge pull request #493 from liamcottle/fix/cli-messages
Don't show CLI replies on display
2025-07-06 17:54:18 +10:00
liamcottle
0914056a09 tidy logic for devices with display 2025-07-06 14:16:43 +12:00
liamcottle
7ea6a98513 dont show cli data replies on display 2025-07-06 14:07:56 +12:00
Tobias Schwarz
013787556d add room server role for TBeam SX1262 2025-07-05 16:08:49 +02:00
ripplebiz
54890421bb Merge pull request #475 from rightup/NRF52-BLE-FIX
Remove ScanResponse.addName() to fix re-advertising after disconnect
2025-07-05 22:02:27 +10:00
ripplebiz
0ddd3b9ade Merge pull request #474 from ngavars/dev
Add support for Minewsemi ME25LS01
2025-07-05 20:48:05 +10:00
ripplebiz
ae5e3588ba Merge pull request #484 from liquidraver/dev
LR's (corrected) calculation instead of SX and minor changes
2025-07-05 20:38:42 +10:00
Lloyd
d32fa5c004 Manually restart BLE advertising after disconnect to prevent stack freeze
Replaced use of `restartOnDisconnect(true)` with explicit (existing) manual re-advertising logic.
This avoids Bluetooth stack instability caused by overlapping advertising state,
Changes:
- Added explicit `Bluefruit.Advertising.stop()` and data clears in `startAdv()`
- Disabled automatic restart with `restartOnDisconnect(false)`
- Re-advertising now fully handled in `checkRecvFrame()` loop

Tested on: iPhone, Android, Windows, and Chrome – confirmed stable reconnects and name visibility.
2025-07-04 21:07:55 +01:00
Normunds Gavars
aa3c702ffd Read battery voltage on Minewsemi ME25LS01 2025-07-04 19:27:11 +03:00
liquidraver
fa481e832b LR's corrected calculation override (instead of SX) and minor changes according to radiolib's wiki 2025-07-04 16:40:19 +02:00
ripplebiz
ff9699c071 Merge pull request #482 from recrof/dev
initial support for Seeed Studio SenseCap Solar board
2025-07-05 00:31:23 +10:00
ripplebiz
2c1f61c03d Merge pull request #483 from fdlamotte/stm32_preamble
stm32 targets: set preamble to 16
2025-07-04 23:57:43 +10:00
Florent de Lamotte
71255e00f1 stm32 targets: set preamble to 16 2025-07-04 15:42:56 +02:00
recrof
2941388041 initial support for Seeed Studio SenseCap Solar board 2025-07-04 15:03:25 +02:00
Scott Powell
3d70a0d02c * added RADIOLIB_EXLUDE_'s for faster builds 2025-07-04 21:33:07 +10:00
João Brázio
3375389181 Merge remote-tracking branch 'upstream/dev' into jbrazio/2025_3f11ad35 2025-07-04 11:57:09 +01:00
ripplebiz
3d2404f249 Merge pull request #479 from 446564/cleanup-xio-nrf
cleanup xiao nrf52
2025-07-04 16:18:14 +10:00
ripplebiz
cf35daddc2 Merge pull request #481 from oltaco/heltecV3-gps_pin_fix
fix: Heltec V3 amended GPS pins
2025-07-04 15:49:08 +10:00
taco
2bb7e6dad4 fix: heltec v3: change gps enable pin 2025-07-04 14:12:57 +10:00
taco
74818d0594 fix: change GPS pins
Pin 45 and 46 are strapping pins on ESP32-S3, which can lead to unintended consequences on boot. I have amended the pins and added an enable pin as well.
2025-07-04 13:55:39 +10:00
ripplebiz
484b7b8144 Merge pull request #476 from WattleFoxxo/xiao-rp2040
Adds support for the XIAO-RP2040 board
2025-07-04 10:08:31 +10:00
ripplebiz
cb423bcb71 Merge pull request #471 from 446564/rak-usr-btn
move rak usr btn to companions
2025-07-04 10:03:26 +10:00
ripplebiz
837870169a Merge pull request #468 from recrof/dev
EnvironmentSensorManager: add support for SHTC3 and LPS22HB
2025-07-04 07:36:22 +10:00
Rob Loranger
90656e7d06 clean up xiao nrf52
move variant specific code out of src/helpers
redefine RXEN for alternate radio pinout
2025-07-03 09:18:26 -07:00
Rastislav Vysoky
d82b2a28e4 Merge branch 'ripplebiz:dev' into dev 2025-07-03 15:07:16 +02:00
Scott Powell
eb978f1b50 Merge branch 'LR1110-workaround' into dev 2025-07-03 19:38:20 +10:00
ripplebiz
910ec59887 Merge pull request #469 from jquatier/heltec-paper-include-fix
Fixing radio include and BT pin for Heltec Paper
2025-07-03 16:43:18 +10:00
WattleFoxxo
d23378cff6 Add XIAO RP2040 support 2025-07-03 11:42:53 +10:00
Lloyd
ec98d5f8a5 BLE: Remove ScanResponse.addName() to fix re-advertising after disconnect
Removed the call to Bluefruit.ScanResponse.addName() in startAdv(), as it was preventing BLE from reliably restarting advertising after a disconnect.

Hypothesis: adding the device name to the scan response exceeds internal buffer limits or causes a conflict with advertising timing, leading to the BLE stack silently failing to re-advertise.

Tested successfully (on T-1000) without this line, advertising now resumes correctly after disconnection (on Iphone)
2025-07-02 23:41:31 +01:00
JQ
ca422bbafb fix ble pin 2025-07-02 14:37:11 -07:00
Normunds Gavars
70a9990f45 Merge branch 'dev' into minewsemi-me25ls01 2025-07-03 00:14:39 +03:00
Normunds Gavars
6440bcaf48 Clean up pins in variant.h 2025-07-03 00:07:50 +03:00
Rob Loranger
ad2e015a5b move rak usr btn to companions
repeaters do not typically have user buttons and
there is only one analog pin available on most, if
not all, base boards. so this allows repeaters to
add custom peripherals or alternate battery signals
2025-07-02 10:24:45 -07:00
JQ
dcb7ffa92e fixing radio include order for heltec paper 2025-07-02 08:32:36 -07:00
recrof
539f99a90f removed unsupported(?) readAltitude 2025-07-02 16:50:47 +02:00
recrof
3832836eb2 EnvironmentSensorManager: add support for SHTC3 and LPS22HB 2025-07-02 16:42:35 +02:00
Scott Powell
0963341f79 Merge branch 'dev' 2025-07-02 21:11:38 +10:00
Scott Powell
483b31665c * ver bump to v1.7.2 2025-07-02 21:11:07 +10:00
Normunds Gavars
af2628bb00 Use EnvironmentSensorManager in Minewsemi variant 2025-07-02 12:27:39 +03:00
ripplebiz
54fd7049df Merge pull request #467 from LitBomb/patch-14
Update faq.md
2025-07-02 15:26:48 +10:00
uncle lit
811ea175fa Update faq.md
- rewrite Linux firmware update with more detailed instructions 
- fix T114 reset typo: double click twice, not once
- add link reference to MeshCore logo on github
- add public channel key for t-deck to the t-deck section
- reference the verbiage "what is meshcore?" on meshcore.co.uk homepage
2025-07-01 22:04:16 -07:00
ripplebiz
79a75b8b0e Merge pull request #465 from fdlamotte/t1000e_preamble_16
t1000e: set preamble to 16 at init
2025-07-01 23:56:24 +10:00
Florent de Lamotte
b80d99edd1 t1000e: set preamble to 16 at init 2025-07-01 15:42:54 +02:00
ripplebiz
1d1bafb3eb Merge pull request #455 from jquatier/wireless-paper
Initial Support for Heltec Wireless Paper
2025-07-01 15:23:58 +10:00
ripplebiz
f8d277de83 Merge pull request #426 from 446564/feat-GH109
allows manual BLE pin even when device has display
2025-07-01 15:09:43 +10:00
ripplebiz
387e2c7e74 Merge pull request #464 from oltaco/lilygo_t3s3-radio.std_init
refactor: lilygo_t3s3 with CustomSX1262::std_init()
2025-07-01 12:26:43 +10:00
Normunds Gavars
6f94c8148a Add Minewsemi ME25LS01 variant 2025-07-01 01:56:34 +03:00
Scott Powell
3dc4607d89 * PAYLOAD_TYPE_PATH: reserving upper 4 bits if 'extra_type' field, for future use 2025-06-30 23:18:16 +10:00
Scott Powell
8c80c10d2a * CustomLR1110::getTimeOnAir(), copied from sx1262 2025-06-30 18:57:24 +10:00
Scott Powell
a72fafcbf1 Merge branch 'main' into dev 2025-06-30 17:07:01 +10:00
ripplebiz
d04fd377b6 Merge pull request #463 from jankowski-t/main
Support MeshAdventurer
2025-06-30 17:06:19 +10:00
ripplebiz
28a38e674b Merge pull request #462 from seagull9000/Refactor-Heltec-Tracker-radiolib-init
Refactor radiolib for Heltec Wireless Tracker
2025-06-30 17:01:55 +10:00
jankowski-t
c91356016b Fixed MeshAdventurer repeater build failing
Update build_src_filter in platformio.ini
2025-06-30 05:40:07 +02:00
jankowski-t
4541380632 Support MeshAdventurer
Added support for MeshAdventurer, including radio, display, button, GPS, voltage reading
2025-06-30 03:46:18 +02:00
taco
c56da5e6aa refactor: lilgo_t3s3 with CustomSX1262::std_init() 2025-06-30 08:51:18 +10:00
seagull9000
1bfa3d338c Refactor radiolib for Heltec Wireless Tracker
Made changes and tested transmission and reception.

Note:
TX to T1000E would not work direct, but always went through a repeater.

TX to two Thinknode M1's went through direct..
2025-06-30 09:48:18 +12:00
João Brázio
2f77cef04b Add config flags to variants 2025-06-29 16:28:11 +01:00
ripplebiz
eb4f81f9ae Merge pull request #459 from liquidraver/dev
change fixed preamble to match the new 16
2025-06-30 00:26:19 +10:00
liquidraver
ddbf27c245 change fixed preamble to match the new 16 2025-06-29 15:17:15 +02:00
Scott Powell
f7920114c5 Merge branch 'dev' into double-acks 2025-06-29 21:10:43 +10:00
Scott Powell
165fb33d5c * ver bump to v1.7.1 2025-06-29 20:06:24 +10:00
Scott Powell
e31017be1a Merge branch 'main' into dev 2025-06-29 20:04:03 +10:00
Scott Powell
187eea1b18 * Preamble now 16 (for most variants) 2025-06-29 20:03:10 +10:00
ripplebiz
c4c5d18a79 Merge pull request #456 from recrof/dev
add support for BMP280 temperature+pressure sensor, enable sensor support for tlora 2.1_1.6
2025-06-29 15:28:31 +10:00
recrof
bcd31b7cdf fix: missing dependency 2025-06-29 00:28:01 +02:00
recrof
9530744ff4 add support for BMP280 temperature+pressure sensor 2025-06-29 00:17:46 +02:00
ripplebiz
cea16bad89 Merge pull request #453 from recrof/dev
sx1276 boards: migrate to std_init()
2025-06-28 21:14:23 +10:00
Rastislav Vysoky
5fa6533291 Merge branch 'ripplebiz:dev' into dev 2025-06-28 11:03:15 +02:00
recrof
1ce180d6ea remove spi.begin in targets 2025-06-28 11:00:13 +02:00
JQ
ff3e888dfd formatting 2025-06-27 23:30:52 -07:00
Scott Powell
3bd1dc3ffa * minor tidy ups 2025-06-28 16:10:53 +10:00
ripplebiz
7c9cf2a5ee Merge pull request #446 from cod3doomy/dev
RAK4631: BME680 add and GPS cleanup
2025-06-28 16:00:36 +10:00
JQ
e417c43c30 wireless paper board support 2025-06-27 22:57:49 -07:00
João Brázio
4b70ee863d Serial bridge implementation 2025-06-27 20:16:14 +01:00
recrof
0e197254a2 remove old tbeam def 2025-06-27 17:38:07 +02:00
recrof
e16f5349fa manual-merge tbeam conflicts 2025-06-27 15:30:01 +02:00
recrof
95e69cf273 RadioWrapper::std_init: add tbeam, unify coding style 2025-06-27 15:17:51 +02:00
recrof
f666b8c8cf RadioWrapper::std_init: add missing definitions for rx/tx switching 2025-06-27 15:16:37 +02:00
recrof
07f25ccac8 sx1276 boards: migrate to std_init() 2025-06-27 15:12:48 +02:00
ripplebiz
ba34cff4d4 Merge pull request #452 from fdlamotte/custom_sx1262_TXEN_fix
CustomSX1262: fix typo that would prevent compile when TXEN or RXEN i…
2025-06-27 21:37:57 +10:00
Florent de Lamotte
0f259d3b51 CustomSX1262: fix typo that would prevent compile when TXEN or RXEN is not set 2025-06-27 11:11:12 +02:00
ripplebiz
4e282a423a Merge pull request #451 from fdlamotte/wio-e5-dev_uart
wio-e5-sdk: adjust uart location
2025-06-26 21:51:11 +10:00
Florent
408ed549a8 wio-e5-sdk: adjust uart location 2025-06-26 13:04:15 +02:00
cod3doomy
63247667d0 String removed
Removed all string type casting
2025-06-25 21:12:36 -07:00
cod3doomy
c872f72584 Merge branch 'ripplebiz:dev' into dev 2025-06-25 21:08:38 -07:00
ripplebiz
6e670aa2a4 Merge pull request #450 from rfmoz/main
Update faq.md
2025-06-26 13:16:14 +10:00
ripplebiz
fe0234d208 Merge pull request #449 from recrof/dev
Station G2 refactor for radio.std_init, set max tx power to 19dBm
2025-06-26 13:10:06 +10:00
Ricardo F.
669ff39cd6 Update faq.md
Order last other questions and add fix to WebFlasher from linux
2025-06-25 22:41:14 +02:00
recrof
f15f32e138 Station G2 refactor for radio.std_init, set max tx power to 19dBm 2025-06-25 22:21:22 +02:00
ripplebiz
56df7d15a7 Merge pull request #448 from fdlamotte/rak3x72_LP_Support
rak3x72: support variations in platformio.ini
2025-06-25 22:27:06 +10:00
Florent
387579922b rak3x72: support variations in platformio.ini 2025-06-25 13:55:54 +02:00
ripplebiz
816f3f8a6b Merge pull request #447 from fdlamotte/stm32_halt_reset
stm32: implement halt and reset
2025-06-25 19:04:15 +10:00
Scott Powell
55ff69bd25 * RAK: 'start ota' returned MAC address was reversed 2025-06-25 19:02:16 +10:00
Florent
8ccd4f3660 stm32: implement halt and reset 2025-06-25 11:00:24 +02:00
Scott Powell
556051955d * ESP32Board: added support for Neopixel TX led 2025-06-25 14:54:13 +10:00
Scott Powell
8191c0901b * new variant board: Tenstar C3 2025-06-25 14:34:27 +10:00
Scott Powell
b37c8017d9 * Fix: /helpers/esp32/TBeamBoard was breaking non-TBeam builds 2025-06-25 14:04:29 +10:00
Scott Powell
127f3a7640 Merge branch 'dev' into double-acks 2025-06-25 13:52:11 +10:00
cod3doomy
001b996a24 RAK4631: BME680 add and GPS cleanup
- Added the BME680 environment sensor functionality
- Added the GPS Repeater env for those wanting it
- Cleaned up the GPS and other RAK4631SensorManager code

Verified build and functionality on normal and GPS repeater and companion envs.

IAQ readout is still a work in progress, but a placeholder can be seen on Channel 2 of the app telemetry.
2025-06-24 17:46:01 -07:00
ripplebiz
213f01cd40 Merge pull request #443 from fdlamotte/wio_e5_mini_rescue_cli
wio_e5_mini: led and rescue cli
2025-06-24 23:30:52 +10:00
Florent
d94f469d53 wio_e5_mini: led and rescue cli 2025-06-24 14:34:42 +02:00
Scott Powell
70252b010c Merge branch 'dev' into double-acks 2025-06-24 13:07:36 +10:00
ripplebiz
ba7839a60d Merge pull request #442 from oltaco/env-sens-manage-gps-revert
Fix: EnvironmentSensorManager.cpp: revert swapped GPS pins
2025-06-24 12:44:19 +10:00
taco
84c2cfdcf2 fix: revert swapped GPS pins
reverted GPS pin behaviour and swapped GPS pins for tbeam variants.
2025-06-24 12:39:07 +10:00
Scott Powell
6d8fae26da Merge commit '299e85b830f4bf51c2e4d90e3e1bbb59025f608d' into dev 2025-06-24 12:05:00 +10:00
Scott Powell
bd020c6167 * removed deprecated tbeam variant 2025-06-24 12:03:51 +10:00
ripplebiz
299e85b830 Merge pull request #441 from oltaco/heltecv3-spi_begin_fix
fix: remove extra spi.begin() on heltec v3
2025-06-24 11:57:08 +10:00
ripplebiz
6ae6f8955a Merge pull request #439 from cod3doomy/dev
T-Beam refactor
2025-06-24 11:48:19 +10:00
ripplebiz
b6b15e55ba Merge pull request #428 from 446564/radio-init-nano-g2
update nano g2 to use radio.std_init
2025-06-24 11:38:11 +10:00
taco
b8db628ce8 fix: remove extra spi.begin() on heltec v3 2025-06-24 11:27:13 +10:00
Scott Powell
60d0064080 * room server: new posts now delayed by 6 seconds before syncing to clients 2025-06-23 15:56:19 +10:00
cod3doomy
218b96e4aa T-Beam refactor
There is a lot to this PR, so if there are any questions let me know.

The idea here is to merge T-Beam fw so that there is less redundant code. Most versions (except the 0.7) share PMU code, init sequence, and most IO pin definitions.

- Merged all T-Beam board.h files into one TBeamBoard.
- Added PMU code to identify different AXP chips.
- Modified "lilygo tbeam SX1276" variant to cover all T-Beam SX1276 versions
- Modified "lilygo tbeam SX1262" variant to cover all T-Beam SX1262 versions
- Enabled GPS on all T-Beam versions/models
- Enabled BME280 on the Supreme

I am also updating EnvironmentSensorManager to allow for boards that do or don't have GPS enable pins, as well as a PERSISTANT_GPS define check for boards that want GPS to stay active after boot.
2025-06-22 17:46:30 -07:00
Rob Loranger
b99d29494e remove begin() 2025-06-22 09:10:49 -07:00
Scott Powell
b1ca3d1eb1 * new PAYLOAD_TYPE_MULTIPART
* experimental double ACK's (at each hop), sent 300ms apart (direct mode only)
2025-06-23 01:14:08 +10:00
Scott Powell
478a57a6bd * AdvertDataParser: lat/lon can now be zeroes 2025-06-22 21:07:43 +10:00
Scott Powell
12a2f34598 * companion serial protocol ver bump to 6 2025-06-22 21:03:30 +10:00
ripplebiz
e7609364ea Merge pull request #438 from liamcottle/storage/nrf52
Add support for storage stats on nRF52/LittleFS
2025-06-22 19:44:14 +10:00
liamcottle
583cdd4980 fix indentation 2025-06-22 21:38:35 +12:00
liamcottle
37c20a348e add support for storage stats on nrf52 2025-06-22 21:35:21 +12:00
Scott Powell
9df3c8c663 * companion: new 'advert_loc_policy' pref. Defaults to ADVERT_LOC_NONE (ie. do Not share location in adverts) 2025-06-22 16:21:04 +10:00
ripplebiz
4f9207f3eb Merge pull request #437 from jquatier/t114-display-flicker
Fix T114 display flicker
2025-06-22 15:15:04 +10:00
ripplebiz
727a044dde Merge pull request #436 from 446564/fix-nano-g2-ota-name
update nano g2 ultra BLE name for OTA
2025-06-22 15:11:30 +10:00
ripplebiz
ea7a84b7a3 Merge pull request #427 from cod3doomy/dev
T-Beam refactor for radio.std_init
2025-06-22 15:07:59 +10:00
JQ
3719c0983c increase delay slightly 2025-06-21 18:17:38 -07:00
JQ
d680852c99 fix t114 display flicker 2025-06-21 16:13:53 -07:00
cod3doomy
ff10f37e7c T-Beam removed redundancy
Removed redundant SPI begin calls
2025-06-21 14:18:38 -07:00
cod3doomy
aa9eac16a6 Merge branch 'ripplebiz:dev' into dev 2025-06-21 14:12:29 -07:00
Rob Loranger
5f2ea7ca87 update nano g2 ultra BLE name for OTA 2025-06-21 11:28:47 -07:00
Rob Loranger
0bf03f2309 remove SPI set pins 2025-06-21 11:22:14 -07:00
Scott Powell
1295c4633b * companion: minor refactor of who should invoke UITask::loop() 2025-06-21 20:48:28 +10:00
ripplebiz
39cc221125 Merge pull request #433 from oltaco/HeltecV3-GPS
Heltec v3 GPS support
2025-06-21 20:40:04 +10:00
Scott Powell
205624824a * added std_init() to CustomSX1268 2025-06-21 15:27:58 +10:00
ripplebiz
80d2b6c6bc Merge pull request #432 from oltaco/CustomLLCC68-std_init
added CustomLLCC68::std_init()
2025-06-21 13:56:41 +10:00
ripplebiz
5b1f4b0166 Merge pull request #431 from mattsains/packet-structure
minor changes and fixes to docs
2025-06-21 13:54:53 +10:00
ripplebiz
485749a053 Merge pull request #430 from oltaco/gps-update-fix
fix: EnvironmentSensorManager.cpp: don't update location if GPS is turned off
2025-06-21 13:49:07 +10:00
ripplebiz
8090992342 Merge pull request #429 from oltaco/rak4631-radioinit-refactor
refactor: RAK4631 with CustomSX1262::std_init()
2025-06-21 13:48:22 +10:00
ripplebiz
81a0816e22 Merge pull request #424 from 446564/fix-GH162
fix Heltec v2 getBattMilliVolts ADC multiplier
2025-06-21 13:42:03 +10:00
ripplebiz
00b5d3bcd5 Merge pull request #423 from 446564/fix-GH133
heltec v3 update ADC multipler to fix voltage reading
2025-06-21 13:41:04 +10:00
ripplebiz
7c421c1d2c Merge pull request #420 from 446564/feat-GH142
return range with advert interval setting error
2025-06-21 13:40:27 +10:00
ripplebiz
553e3c10f6 Merge pull request #419 from 446564/feat-GH44
add time and date feedback to cli commands
2025-06-21 13:36:30 +10:00
ripplebiz
5d85ed41c3 Merge pull request #407 from fdlamotte/seeed_xiao_c6
Seeed xiao c6 support
2025-06-21 13:32:15 +10:00
taco
4d2b176ccc feature: GPS support on HeltecV3
GPS support via EnvironmentSensorManager. Connect GPS RX to pin 45, TX to pin 46.
Note that while you can disable using the GPS there is no way to power down the GPS without using a mosfet and adjusting PIN_GPS_EN.
2025-06-21 13:04:39 +10:00
Matthew Sainsbury
1de5753a16 add advert detail 2025-06-20 19:41:07 -07:00
taco
14ff7bfbcd added std_init to CustomLLCC68.h 2025-06-21 11:03:25 +10:00
Matthew Sainsbury
0d78df1b8a minor changes and fixes to docs 2025-06-20 17:59:55 -07:00
taco
83842e4b25 fix: EnvironmentSensorManager.cpp: don't update location if GPS is turned off.
previously the location would always snap to the last heard GPS location after GPS had been on.
2025-06-21 10:09:28 +10:00
taco
9eff882e18 refactor: RAK4631 with CustomSX1262::std_init() 2025-06-21 09:52:39 +10:00
Rob Loranger
bf2908faa6 update nano g2 to use radio.std_init 2025-06-20 16:46:16 -07:00
cod3doomy
7bcfbd3243 T-Beam refactor for radio.std_init
Changed radio init for both T-beam (SX1262) and Supreme (SX1262) to include radio.std_init()
2025-06-20 15:06:01 -07:00
Rob Loranger
52a579a366 fix Heltec v2 getBattMilliVolts 2025-06-20 15:00:46 -07:00
Rob Loranger
f4463154cf allows manual BLE pin even when device has display
also updates remaining variants to use default of
123456 instead of 0 for random pin
2025-06-20 14:20:42 -07:00
Rob Loranger
e5ecf29d0c return range with advert interval set error
updates both local and flood advert preference
setting errors to include the allowable range and
time units
2025-06-20 09:22:49 -07:00
Rob Loranger
f30698eacb add time output to both clock sync and time <epoch> cli 2025-06-20 08:40:06 -07:00
Rob Loranger
dbee0d8b8e update ADC multipler to fix voltage reading 2025-06-20 08:25:19 -07:00
ripplebiz
7f0f3b7753 Merge pull request #418 from fdlamotte/xiao_nrf52-xiao_s3-techo_remove_lora_cr_fallback_from_target
remove LORA_CR fallback from target.cpp on xiao_nrf52, xiao_s3 and t-…
2025-06-20 18:37:16 +10:00
Florent de Lamotte
4579aa25d7 xiao_c6: fallback for LORA_CR is set in std_init 2025-06-20 09:51:35 +02:00
Florent de Lamotte
56e3bb153b remove LORA_CR fallback from target.cpp on xiao_nrf52, xiao_s3 and t-echo 2025-06-20 09:47:58 +02:00
Scott Powell
a7c959631f * companion: added Datastore methods: getStorageUsedKb(), getStorageTotalKb()
* companion: CMD_GET_BATTERY now changed to CMD_GET_BATT_AND_STORAGE
2025-06-20 16:47:59 +10:00
Scott Powell
85b164bcf1 * PicoW refactor, now using radio.std_init() 2025-06-20 16:42:49 +10:00
ripplebiz
b37f61d720 Merge pull request #416 from jquatier/analog-button
Button handling fix
2025-06-20 14:58:19 +10:00
JQ
e6ba025f77 add new quad press 2025-06-19 21:52:57 -07:00
JQ
cdca6fa52a Merge branch 'dev' into analog-button 2025-06-19 21:50:16 -07:00
ripplebiz
61301daf51 Merge pull request #415 from jquatier/thinknode-std_init
Thinknode radio.std_init refactor
2025-06-20 13:48:48 +10:00
ripplebiz
5eb08474f1 Merge pull request #417 from oltaco/promicro-CustomSX1262
refactor: promicro with CustomSX1262::std_init()
2025-06-20 13:47:40 +10:00
Scott Powell
b865ac6c23 * refactored SensorManager::toggleGps() 2025-06-20 13:44:58 +10:00
ripplebiz
27388fcf2a Merge pull request #404 from fdlamotte/t1000_gps_toggle
Gps toggle on 4 clicks

Will merge, but I'll do a refactor of the gpsToggle()
2025-06-20 13:36:56 +10:00
taco
e7b0e9e526 refactor: promicro with CustomSX1262::std_init()
added check in CustomSX1262.h to support both txco and non-txco radios
switched promicro to use CustomSX1262::std_init()
2025-06-20 11:22:34 +10:00
JQ
ee68401ad0 fixing button handling to allow both button types simultaneously 2025-06-19 16:47:31 -07:00
JQ
bbde446bdf refactoring thinknode to use radio.std_init 2025-06-19 16:27:42 -07:00
Florent de Lamotte
588a986976 t1000e: gps toggle not using board class 2025-06-19 17:26:58 +02:00
ripplebiz
eb5826645e Merge pull request #406 from fdlamotte/techo_rx1262_refactor
Techo rx1262 refactor
2025-06-20 00:27:03 +10:00
ripplebiz
b9ffd51890 Merge pull request #405 from fdlamotte/xiao_sx1262_init_refactor
Apply refactoring to xiao_nrf52 and xiao_s3
2025-06-20 00:23:50 +10:00
Florent de Lamotte
725ee477ff xiao_c6: apply sx1262 init refactoring 2025-06-19 15:49:30 +02:00
Florent de Lamotte
c5167d0fd9 Merge branch 'dev' into seeed_xiao_c6 2025-06-19 15:30:55 +02:00
Florent de Lamotte
574822cafe techo: follow refactoring of CustomSX1262 2025-06-19 15:26:46 +02:00
Florent de Lamotte
b65b4d51eb Apply refactoring to xiao_nrf52 and xiao_s3 2025-06-19 15:18:58 +02:00
Scott Powell
587d9d8818 * added CustomSX1262::std_init()
* refactored variants to use std_init(): heltec_v3, t114, xiao_c3
2025-06-19 10:58:10 +10:00
Florent de Lamotte
8765b3d040 Gps toggle on 4 clicks 2025-06-18 11:52:16 +02:00
Scott Powell
b3184eb94c * T114 repeater build fix 2025-06-18 17:20:38 +10:00
ripplebiz
6972704c64 Merge pull request #402 from jquatier/t114-variants-display
Adding display support to all T114 builds
2025-06-18 16:49:01 +10:00
ripplebiz
673d577032 Merge pull request #401 from marrold/Seeed_NRF_RTC
Add RTC support to Seeed NRF
2025-06-18 16:45:43 +10:00
ripplebiz
a5273883d5 Merge pull request #397 from fdlamotte/t1000e_gps_off_position_fix
t1000e: don't update position if gps is off
2025-06-18 16:40:28 +10:00
Scott Powell
e6ce3c896d * companion: new CMD_GET_ADVERT_PATH -> RESP_CODE_ADVERT_PATH 2025-06-18 16:02:09 +10:00
Scott Powell
2a4b55a555 Merge commit 'e30eef73f7603bbc96e44ed5bae7a4588065c9a7' into dev 2025-06-18 14:59:19 +10:00
ripplebiz
e30eef73f7 Merge pull request #396 from jbrazio/jbrazio/2025_5dba32d2
Adds support for the Waveshare RP2040-LoRa board
2025-06-18 14:57:45 +10:00
JQ
b1fe57e892 adding display support to all T114 builds 2025-06-17 16:06:07 -07:00
Matthew Harrold
83b70b3167 Add support for Seeed NRF + RTC 2025-06-17 23:12:10 +01:00
Scott Powell
9363478d6f * noise floor can now be queried even when int.thresh = 0 2025-06-18 01:27:53 +10:00
ripplebiz
fab84925c3 Merge pull request #387 from awolden/awolden/T3S3-sx1276
Add support T3S3 v1.2 (SX1726)
2025-06-17 12:30:03 +10:00
ripplebiz
ec712c446f Merge pull request #384 from recrof/patch-6
Add companion roles to Station G2
2025-06-17 12:23:46 +10:00
João Brázio
24464d0c4e Update VBAT schematic 2025-06-16 21:28:59 +01:00
João Brázio
110bd49407 VBAT schematic 2025-06-16 19:51:53 +01:00
João Brázio
f3e85a6fba Update SX126X_CURRENT_LIMIT 2025-06-16 16:57:43 +01:00
Florent de Lamotte
5c6f3457e2 t1000e: don't update position if gps is off 2025-06-16 09:14:42 +02:00
Scott Powell
0f9efa2ee8 * room server: suggested keep_alive interval now disabled 2025-06-16 17:02:44 +10:00
ripplebiz
7175decaf3 Merge pull request #380 from recrof/dev
re-introduce tlora c6 with fixed arduino versions
2025-06-16 16:38:14 +10:00
João Brázio
3448db6e36 Rename LED pin 2025-06-16 02:01:16 +01:00
João Brázio
52acae1fe7 Set default upload protocol 2025-06-16 02:01:04 +01:00
João Brázio
8f6b2b75d7 Waveshare RP2040-LoRa board support 2025-06-15 23:48:49 +01:00
ripplebiz
5b1c7fe250 Merge pull request #391 from LitBomb/patch-13
Update faq.md
2025-06-14 12:21:13 +10:00
uncle lit
7fffe7755a Update faq.md
add full erase instructions using flasher.meshcore.co.uk
add nRF fault tolerant bootloader by discord@che aporeps
2025-06-13 13:36:00 -07:00
Rastislav Vysoky
a9ea7105e8 Merge branch 'ripplebiz:dev' into dev 2025-06-13 09:59:06 +02:00
Scott Powell
8a7ec9d7fe * interference threshold now disabled by default 2025-06-13 17:24:47 +10:00
Scott Powell
466bd6d596 * fix for when AGC reset is disabled (interval = 0) 2025-06-13 14:25:09 +10:00
Scott Powell
32ca3dc9d0 * repeater and room server: new CLI setting "agc.reset.interval" (seconds) 2025-06-13 14:15:21 +10:00
ripplebiz
f7dcf01e81 Merge pull request #378 from recrof/patch-4
add mising config for `openocd_target`
2025-06-11 17:40:06 +10:00
Alex Wolden
fca86d93f3 Added support for t3s3 sx1276 2025-06-10 22:10:24 -07:00
Matthew Sainsbury
a2a9455dc0 corrections and style 2025-06-10 22:09:23 -07:00
Bence T.
deaa0ec2c8 Create packet_structure.md
As mentioned by @mofosyne at issue #72
2025-06-10 22:09:23 -07:00
ripplebiz
aa230d2bd8 Merge pull request #386 from jquatier/thinknode-led
ThinkNode M1 TX LED
2025-06-10 18:51:30 +10:00
JQ
e1ceaab7ed add TX led to thinknode M1 2025-06-09 17:35:00 -07:00
ripplebiz
3f0c89d7be Merge pull request #379 from jquatier/ui-fixes
Minor companion ui fixes
2025-06-10 02:22:28 +10:00
Scott Powell
c6f6e088fc * some HT-CT62 fixes 2025-06-09 17:34:04 +10:00
ripplebiz
c5869c78a2 Merge pull request #382 from fdlamotte/ct62_usb_companion
ct62: adding companion radios
2025-06-09 14:23:13 +10:00
Rastislav Vysoky
516f6a36c4 Add companion roles to Station G2 2025-06-08 21:01:04 +02:00
Florent
f208f04324 ct62: adding companion radios 2025-06-08 18:46:11 +02:00
JQ
7c011324f2 feedback 2025-06-08 08:25:54 -07:00
recrof
71982d4391 Merge branch 'dev' of github.com:recrof/MeshCore into dev 2025-06-08 17:02:53 +02:00
recrof
e44f1eebb1 fix duplicate flag 2025-06-08 17:02:34 +02:00
Rastislav Vysoky
4679b03091 Merge branch 'ripplebiz:dev' into dev 2025-06-08 14:26:32 +02:00
Scott Powell
fd4885e9aa * HT-CT62 SPI fixes 2025-06-08 20:11:35 +10:00
Scott Powell
dafb5d3e98 * added repeater target for Heltec-CT62 2025-06-08 18:41:29 +10:00
JQ
42ef297241 set text width ahead of width calculation 2025-06-07 22:35:59 -07:00
JQ
1bc94c2ec3 minor companion ui fixes 2025-06-07 15:57:22 -07:00
Rastislav Vysoky
7525877f6c add mising config for openocd_target 2025-06-07 10:48:09 +02:00
Rastislav Vysoky
9d1c85526e Merge branch 'ripplebiz:dev' into dev 2025-06-07 09:39:36 +02:00
Scott Powell
3f1b2c5fc5 Merge branch 'dev' 2025-06-07 16:15:58 +10:00
Scott Powell
af0c409cbb * ver bump to v1.7.0 2025-06-07 16:15:17 +10:00
ripplebiz
c506aba30e Merge pull request #367 from 446564/companion-alerts
add basic alert system to companion UI
2025-06-07 16:09:09 +10:00
Scott Powell
79eff3499c Merge branch 'datastore' into dev 2025-06-07 16:04:35 +10:00
ripplebiz
381bb50eb7 Merge pull request #377 from liamcottle/rescue/cli-file-manager
Basic File Manager for Rescue CLI
2025-06-07 16:00:49 +10:00
liamcottle
7f79d0c514 close roor dir after listing files 2025-06-07 17:56:20 +12:00
liamcottle
28edff43fd simplify serial print 2025-06-07 17:42:18 +12:00
liamcottle
a50f89f16f ensure root path is usable 2025-06-07 17:38:22 +12:00
Scott Powell
7dd7b715cd * enabling _PRIVATE_KEY import/export for ALL companions. 2025-06-07 14:20:59 +10:00
liamcottle
a814bfb00b don't create file when trying to open for read 2025-06-07 16:17:45 +12:00
liamcottle
9d574b2de0 ensure user isn't removing invalid path 2025-06-07 16:03:04 +12:00
liamcottle
a22c176d45 add rm command to remove file 2025-06-07 15:44:36 +12:00
liamcottle
0f601752e4 implement ls and cat commands for rescue mode 2025-06-07 15:23:55 +12:00
Rob Loranger
da5b0f8524 add basic alert system to companion UI
Adds `_alert[80]` which can be set along with `_needs_refresh`
to trigger a simple on screen alert that lasts 1s at this time.

Implements POC with double press to advert action
2025-06-06 09:11:47 -07:00
Scott Powell
9c833486bf * DataStore, advert blob record format change 2025-06-06 21:35:54 +10:00
Rastislav Vysoky
7deb82823c Merge branch 'ripplebiz:dev' into dev 2025-06-06 12:35:00 +02:00
ripplebiz
e0483c0c82 Merge pull request #376 from liamcottle/fix/buzzer-power-draw
Fix Buzzer Power Draw
2025-06-06 20:11:26 +10:00
liamcottle
4b9eac81c6 fix 150mA power draw on ThinkNode M1 2025-06-06 21:55:03 +12:00
Scott Powell
dd808ee6c7 * new nRF52 impl for advert blobs 2025-06-06 19:50:51 +10:00
Scott Powell
6e0b505a2a * companion: refactor of all filesystem access to new DataStore module 2025-06-06 15:30:35 +10:00
ripplebiz
5be09ff570 Merge pull request #375 from mattsains/packet-structure
Create packet_structure.md
2025-06-06 13:39:07 +10:00
Matthew Sainsbury
9d53fc2679 corrections and style 2025-06-05 20:16:18 -07:00
Scott Powell
93e584f758 Merge branch 'main' into dev 2025-06-06 12:39:01 +10:00
ripplebiz
1b32853564 Merge pull request #374 from recrof/patch-3
Disable LFS_ASSERT to stop freezing the nrf52 boards on LFS errors
2025-06-06 12:38:11 +10:00
Rastislav Vysoky
6e5c865c21 Disable LFS_ASSERT to stop freezing the boards on LFS errors 2025-06-06 00:23:57 +02:00
recrof
bb1e5c5a1c nrf52 fix: don't allow LFS_ASSERT to freeze the board 2025-06-06 00:07:03 +02:00
Scott Powell
7b49ed4a67 Merge branch 'main' into dev 2025-06-05 19:15:30 +10:00
ripplebiz
47b1854bef Merge pull request #372 from liamcottle/design/logo
add logo files
2025-06-05 19:14:33 +10:00
Rastislav Vysoky
0de12b02f8 Merge branch 'ripplebiz:dev' into dev 2025-06-05 11:05:47 +02:00
liamcottle
22058c0ee5 add logo files 2025-06-05 20:35:40 +12:00
Scott Powell
9bcab0949e * noise floor lower bound now clamped to -120 2025-06-05 14:04:33 +10:00
Rastislav Vysoky
572dc56401 Merge branch 'ripplebiz:dev' into dev 2025-06-04 13:39:39 +02:00
Scott Powell
647d712ae8 * Companion: long-press in first 8 seconds now enters CLI Rescue mode 2025-06-04 21:33:48 +10:00
Scott Powell
5d15a68d0d * SERVER_RESPONSE_DELAY now applied to: login responses, companion telemetry responses 2025-06-04 18:10:47 +10:00
Scott Powell
0535919d63 * Mesh: reciprocal path send now with slightly less priority and 500ms delay 2025-06-03 20:28:05 +10:00
Scott Powell
75503ed52a * Companion now can be configured with TXT_ACK_DELAY (default is 200ms) 2025-06-03 20:27:09 +10:00
Scott Powell
6e2a0f3a9c * ESP32-C3 targets, now 80Mhz cpu 2025-06-03 19:01:45 +10:00
Scott Powell
bdc369be67 * repeater & room server: new SERVER_RESPONSE_DELAY and TXT_ACK_DELAY defines. 2025-06-03 19:01:03 +10:00
ripplebiz
2204cb3a65 Merge pull request #360 from fdlamotte/t1000e_sensors
t1000e: light and temp sensor support
2025-06-03 14:09:53 +10:00
ripplebiz
4293b25835 Merge pull request #361 from fdlamotte/wio_sx1262_rxen
sx1262_wio: hook rxen, specify txen as not connected
2025-06-03 14:06:53 +10:00
ripplebiz
5bc8756cd4 Merge pull request #362 from jquatier/station-g2-display
Add display to station G2 firmwares
2025-06-03 14:00:53 +10:00
Florent
8f5e521717 sx1262_wio: hook rxen, specify txen as not connected 2025-06-02 23:23:08 +02:00
JQ
203a7f2bd3 add display to station G2 firmwares 2025-06-02 14:10:10 -07:00
Florent
a3f8c21ff4 t1000e: light and temp sensor support 2025-06-02 19:33:48 +02:00
recrof
f7e79ada1e re-introduce tlora c6 with fixed arduino versions 2025-06-02 17:36:45 +02:00
Scott Powell
8cf20c7c24 * Room server fix: re-tries for pushPostToClient() used to have same packet hash 2025-06-02 22:19:46 +10:00
Scott Powell
1ba69f3b8d * self telemetry response simpler now 2025-06-02 20:44:05 +10:00
Scott Powell
870b5d2b70 * companion: 'self telemetry' request with CMD_SEND_TELEMETRY_REQ (with no pubkey param) 2025-06-02 20:28:00 +10:00
Scott Powell
006cd425e5 * removing ESP32C6 stuff. (causing cache corruptions) 2025-06-02 15:27:33 +10:00
Scott Powell
5729d66a9e * companion: some further refactors after the MyMesh refactor 2025-06-02 15:25:55 +10:00
ripplebiz
accbe3b307 Merge pull request #353 from hank/mymesh-refactor2
MyMesh Refactor and Advert Button
2025-06-02 14:55:33 +10:00
hank
884d8f1a98 Reverting UITask.h changes 2025-06-01 20:45:18 -07:00
hank
33d5f85556 Re-merging 92c2963 2025-06-01 20:42:40 -07:00
hank
9fe218e0d8 Reverting format changes to NodePrefs
But changing to pragma once.
2025-06-01 20:41:04 -07:00
hank
335df61c1c Merge branch 'mymesh-refactor2' of https://github.com/hank/MeshCore into mymesh-refactor2 2025-06-01 20:31:50 -07:00
hank
4e2786c516 Re-applying 73a7a96, formatting, MyMesh reformat 2025-06-01 20:31:29 -07:00
hank
69b431a517 Re-applying 73a7a96, formatting, MyMesh reformat 2025-06-01 20:28:29 -07:00
hank
9247ce460a Reverting changes to simple_secure_chat main 2025-06-01 20:16:29 -07:00
hank
40bf7bbb9f Reverting changes to Button code 2025-06-01 20:15:16 -07:00
hank
e15ad108af Merge branch 'dev' of https://github.com/ripplebiz/MeshCore into mymesh-refactor2
Applying a987efe
2025-06-01 20:07:41 -07:00
hank
91134ecfa5 Merge branch 'mymesh-refactor2' of https://github.com/hank/MeshCore into mymesh-refactor2 2025-06-01 20:03:06 -07:00
hank
42efbda40a Re-applying ecd2b0b 2025-06-01 20:02:35 -07:00
Scott Powell
3749264e07 * MicroNMEALocationProvider: clock param now NULL by default 2025-06-01 20:02:35 -07:00
Florent
14cd4ea010 t1000: remove sync custom var 2025-06-01 20:02:35 -07:00
Florent
49da6957b5 micronmea: was using global rtc_clock to sync instead of _clock 2025-06-01 20:02:35 -07:00
Florent
31cbf9ed0e gps : sync time on fix 2025-06-01 20:02:35 -07:00
Florent
92c296308a wioe5: integrate sensor in sensor mgr 2025-06-01 20:02:35 -07:00
Florent
73a7a96ae4 wio_e5 : bme280 support 2025-06-01 20:02:34 -07:00
hank
9959475c0d Reformatting code 2025-06-01 20:02:31 -07:00
Scott Powell
a987efeca1 * companion: disabling interference threshold for now 2025-06-02 12:54:40 +10:00
ripplebiz
4eccc9e5a5 Update README.md 2025-06-02 11:18:37 +10:00
hank
c13f676e57 Merge branch 'dev' of https://github.com/ripplebiz/MeshCore into mymesh-refactor2 2025-06-01 09:34:09 -07:00
hank
f7f96ad372 Reformatting code 2025-06-01 09:25:17 -07:00
hank
5bf5812755 Removing debug mode 2025-06-01 09:24:32 -07:00
hank
053aa0b3d6 Adding clang-format 2025-06-01 09:24:10 -07:00
Florent
211cf00a74 initial support for xiao_c6 2025-06-01 17:13:07 +02:00
Scott Powell
6481ab1e31 * MicroNMEALocationProvider: clock param now NULL by default 2025-06-01 23:55:57 +10:00
ripplebiz
ed6373edea Merge pull request #348 from fdlamotte/gps_time_sync
gps : sync time on fix
2025-06-01 23:51:44 +10:00
Florent
1ac03f5592 t1000: remove sync custom var 2025-06-01 15:32:02 +02:00
Florent
c42e414a09 micronmea: was using global rtc_clock to sync instead of _clock 2025-06-01 14:12:22 +02:00
ripplebiz
d755c6d6f0 Merge pull request #356 from jquatier/channel-name-fix
Fix for channel name display
2025-06-01 18:48:29 +10:00
ripplebiz
057b0f6a25 Merge pull request #351 from fdlamotte/stm32_sensors
wio_e5 : bme280 support
2025-06-01 16:38:25 +10:00
Florent
4c6f146b8b wioe5: integrate sensor in sensor mgr 2025-06-01 08:30:53 +02:00
ripplebiz
dc7af76c43 Merge pull request #357 from LitBomb/patch-12
faq.md: update OTA firmware instructions
2025-06-01 15:19:11 +10:00
uncle lit
8b780ddd7b faq.md: update OTA firmware instructions
added ESP32 OTA firmware update instructions
added nRF OTA firmware update instructions to use the new nRF DFU app on android and iOS
2025-05-31 21:59:14 -07:00
JQ
ecd2b0be89 fixing channel name display 2025-05-31 20:55:53 -07:00
hank
f58a34f5f4 Refactored MyMesh, advert on doublepress
Pulled the class out of main.cpp, made a header to go along with it, externed globals in headers to make them accessible to button code. Added button code to send an advert on double press. Refactored ini files to prevent linker errors.
2025-05-31 19:11:28 -07:00
ripplebiz
3d6c42978c Merge pull request #352 from jquatier/GxEPDDisplay-fonts
GxEPDDisplay larger font (T-echo & Thinknode M1)
2025-06-01 10:51:16 +10:00
JQ
9cfeb6285f better fonts for GxEPDDisplay 2025-05-31 15:22:59 -07:00
Florent
c8877b3bc7 wio_e5 : bme280 support 2025-05-31 20:29:03 +02:00
ripplebiz
fb5ddcd94e Merge pull request #350 from fdlamotte/wio-e5-adc
wio-e5 : make distinct targets for dev board and mini dev board
2025-06-01 00:42:11 +10:00
Florent
2a645ee427 wio-e5 : make distinct targets for dev board and mini dev board 2025-05-31 15:52:59 +02:00
ripplebiz
19c896f088 Merge pull request #343 from jquatier/button-management
Improved Button Management
2025-05-31 20:55:27 +10:00
Florent
08aad7338b gps : sync time on fix 2025-05-31 10:57:22 +02:00
ripplebiz
b60f2fa65f Merge pull request #346 from recrof/dev
added basic support for LilyGo Tlora C6
2025-05-31 18:21:43 +10:00
Rastislav Vysoky
390694137c fixed old def 2025-05-31 08:06:53 +02:00
JQ
4ec3675091 update sound 2025-05-30 22:58:30 -07:00
JQ
cf171af72c add ack for quiet mode 2025-05-30 22:55:53 -07:00
JQ
f69efaf027 removing pinmode 2025-05-30 22:26:29 -07:00
JQ
c445bbeaf2 simplify logic 2025-05-30 22:14:37 -07:00
JQ
db8e72791c usability fixes, fix t114 build src filter 2025-05-30 20:32:49 -07:00
JQ
0b97b23025 Merge branch 'dev' into button-management 2025-05-30 19:19:08 -07:00
recrof
585558a9bb added basic support for LilyGo Tlora C6 2025-05-30 14:31:44 +02:00
ripplebiz
22055c2240 Merge pull request #344 from jquatier/techo-gps
Add T-Echo GPS
2025-05-30 13:04:31 +10:00
JQ
25850cbc78 fix pins 2025-05-28 23:21:28 -07:00
JQ
ece7479843 add gps for techo 2025-05-28 22:21:51 -07:00
ripplebiz
1b02e1986c Merge pull request #342 from jquatier/thinknode-m1-gps
ThinkNode m1 GPS support
2025-05-29 12:49:44 +10:00
JQ
ce87156a43 cleanup 2025-05-28 16:45:41 -07:00
JQ
2f7aa6d9a1 Merge remote-tracking branch 'jquatier/dev' into button-management 2025-05-28 15:57:17 -07:00
Scott Powell
4b16cda03a * RAK4632 targets, now requiring ENV_INCLUDE_GPS to enable GPS 2025-05-28 23:31:31 +10:00
ripplebiz
4a7d273db4 Merge pull request #332 from cod3doomy/dev
RAK4631: Add GPS support
2025-05-28 23:11:44 +10:00
ripplebiz
1dbb1fa119 Merge pull request #341 from jquatier/m1-display-and-buzzer
Enable buzzer for Thinknode M1, add scaling to bitmaps for GxEPDDisplay
2025-05-28 17:52:33 +10:00
JQ
1072da0eeb handle gps switch 2025-05-27 23:24:08 -07:00
JQ
59a236effb add GPS support to thinknode M1 2025-05-27 21:38:48 -07:00
JQ
d47c0cfccf add scaling to bitmaps for EPD display, and enable buzzer for Thinknode M1 2025-05-27 19:20:35 -07:00
cod3doomy
6ec7d9bd5d Merge branch 'ripplebiz:dev' into dev 2025-05-27 19:14:20 -07:00
JQ
e7761dc9dc initial button manager 2025-05-27 19:10:56 -07:00
Scott Powell
d8c2b3ab47 * TBeam: fix for debug output 2025-05-27 23:37:59 +10:00
ripplebiz
cac9a481ff Merge pull request #337 from hank/dev
TBeam 1.1 PMU fixes
2025-05-27 23:32:09 +10:00
Scott Powell
fec064c1a2 * companion: interference threshold default (14) 2025-05-27 22:48:28 +10:00
Scott Powell
4c3f8ac6b6 * Room server: stats refactor -> noise_floor 2025-05-27 22:38:01 +10:00
Scott Powell
f38b3a3331 Merge branch 'scan_exp' into dev 2025-05-27 21:51:18 +10:00
ripplebiz
9ba1d8262f Merge pull request #335 from seagull9000/RTTTL-tone-for-shutdown
Connect RTTTL  shutdown melody to shutdown procedure
2025-05-27 20:34:07 +10:00
Scott Powell
3ee54d0e07 Merge branch 'dev' into scan_exp 2025-05-27 18:58:48 +10:00
Scott Powell
b3fc6bedf9 * companion: saveContacts() now deferred for 5 secs (lazy writes) 2025-05-27 18:45:06 +10:00
ripplebiz
0c94918f37 Merge pull request #338 from mattsains/payloads
initial try at documenting payload formats
2025-05-27 17:57:03 +10:00
seagull9000
049909dde5 Merge branch 'dev' into RTTTL-tone-for-shutdown 2025-05-27 14:21:14 +12:00
Matthew Sainsbury
bb5509d43e initial try at documenting payload formats 2025-05-26 18:22:31 -07:00
hank
67462cb861 Fixing compilation issue, missing tbeam func 2025-05-26 17:41:55 -07:00
hank
ffb5151255 Merge branch 'main' of https://github.com/hank/MeshCore into dev 2025-05-26 17:21:17 -07:00
hank
97c43a8937 Merge branch 'dev' of https://github.com/ripplebiz/MeshCore into dev 2025-05-26 17:18:57 -07:00
hank
468ccf02cf Merge branch 'main' into main 2025-05-26 17:11:23 -07:00
seagull9000
30488e6f67 Connect RTTTL shutdown melody to shutdown procedure
Added a new UITask shutdown method to run non-board specific shutdown code.  This avoids having to update all the board files for different hardware.

UITask::shutdown(bool restart = false);

Where the buzzer is available and defined, the RTTTL shutdown melody is played when the button is held down for >5s.
2025-05-27 11:07:51 +12:00
Scott Powell
a86364e6d8 * stats: curr_free_queue_len now repurposed to noise_floor 2025-05-27 00:28:23 +10:00
Scott Powell
0e90b73110 * companion: PUSH_CODE_LOGIN_SUCCESS frame, now includes server clock timestamp 2025-05-26 19:52:32 +10:00
Scott Powell
b3d78ac8a7 * interference threshold now stored in prefs, CLI: set/get "int.thresh" 2025-05-26 17:18:49 +10:00
Scott Powell
4593a484fb Merge branch 'dev' into scan_exp 2025-05-26 16:44:27 +10:00
cod3doomy
2f675119e1 Merge branch 'dev' of https://github.com/cod3doomy/MeshCore_HW_Dev into dev 2025-05-25 22:57:36 -07:00
cod3doomy
0e8b807a8b RAK4631: Add RAK12500 GPS support
Added RAK12500 GPS support
Added socket scan capability to determine which socket the GPS is connected to

T-beam supreme: added conditional to displaying location data to only when gps is active
2025-05-25 22:48:04 -07:00
Scott Powell
3ae2e851a0 * minor tidy ups 2025-05-26 14:39:44 +10:00
ripplebiz
8718b8bc3b Merge pull request #308 from cod3doomy/dev
t-beam supreme: display fix, BME add, user btn fix
2025-05-26 14:34:09 +10:00
cod3doomy
4b103ca0de t-beam supreme: fixes and consolidation
Made changes requested by Scott
Simplified gps init sequence and removed unnecessary code
Reverted SensorManager change
Updated PMU flow to enable header outputs
2025-05-25 21:23:31 -07:00
cod3doomy
64f30e82a4 Merge branch 'ripplebiz:dev' into dev 2025-05-25 21:11:07 -07:00
ripplebiz
9eff9d56a1 Merge pull request #326 from memo-567/heltec_v3_sensors
Adding sensor classes support to Heltec v3
2025-05-26 12:34:12 +10:00
Scott Powell
e5ddb8a598 * RAK: "start ota" now replies with Bluetooth MAC address 2025-05-26 12:23:52 +10:00
cod3doomy
de29a435d1 Merge branch 'ripplebiz:dev' into dev 2025-05-25 10:05:56 -07:00
Scott Powell
0e35ae5ec6 * dynamic noise floor sampling 2025-05-25 21:44:15 +10:00
Scott Powell
f2243b78ae * added Radio::loop() virtual function
* RadioLibWrapper:  new isChannelActive() based on current RSSI being above noise_floor + THRESHOLD
2025-05-24 21:24:44 +10:00
Memo
79f60e0675 Merge branch 'ripplebiz:main' into heltec_v3_sensors 2025-05-24 10:42:22 +00:00
Scott Powell
2f8d9cf96a * refactor of RadioLibWrapper::isReceiving() 2025-05-24 20:42:00 +10:00
Memo
42284edcfe Update platformio.ini 2025-05-24 10:39:05 +00:00
Scott Powell
4449fd3a24 Merge branch 'dev' 2025-05-24 17:40:52 +10:00
Scott Powell
0bad7ee106 * ver bump to 1.6.2 2025-05-24 16:19:19 +10:00
ripplebiz
cf9861e683 Merge pull request #330 from recrof/dev
heltec wireless tracker: added repeater and room server roles
2025-05-24 15:11:39 +10:00
recrof
5cb2ba8c62 added repeater and room server roles to heltec wireless tracker 2025-05-24 07:05:33 +02:00
ripplebiz
900de5befe Merge pull request #329 from ngavars/xiao-nrf-sensors
Add sensor support to Xiao Nrf
2025-05-24 14:23:43 +10:00
ripplebiz
72d2b05664 Merge pull request #327 from seagull9000/RTTTL-tone-for-Channel-Message
RTTTL-tone-for-Channel-Message
2025-05-24 14:16:30 +10:00
Normunds Gavars
f8b45ec01e Add sensor support to Xiao Nrf 2025-05-23 21:24:02 +03:00
Scott Powell
0defa837d8 * EnvironmentSensorManager: some tidy ups 2025-05-23 19:12:32 +10:00
ripplebiz
3b41d863c8 Merge pull request #321 from oltaco/sensor-class-with-gps
GPS support added to EnvironmentSensorClass
2025-05-23 19:05:02 +10:00
taco
5987e95ce9 refactor: more conditionals for GPS
also re-added some missing returns.
2025-05-23 18:58:45 +10:00
seagull9000
7dc8a52784 Merge branch 'RTTTL-tone-for-Channel-Message' of https://github.com/seagull9000/MeshCore into RTTTL-tone-for-Channel-Message 2025-05-23 20:44:42 +12:00
seagull9000
fe8db0f9ff Merge branch 'RTTTL-tone-for-Channel-Message' of https://github.com/seagull9000/MeshCore into RTTTL-tone-for-Channel-Message 2025-05-23 20:44:00 +12:00
seagull9000
4fc0a67e58 Merge branch 'RTTTL-tone-for-Channel-Message' of https://github.com/seagull9000/MeshCore into RTTTL-tone-for-Channel-Message 2025-05-23 20:42:44 +12:00
seagull9000
5630533d22 RTTTL-tone-for-Channel-Message
I was a bit remiss in removing the tone for channel message event - this puts one in.

So: DM event - plays a tone (per current)
      Channel Message - new shorter tone

All others aren't defined at present.  Need muting function before we get too carried away.
2025-05-23 20:32:52 +12:00
taco
400c4353dc REFACTOR: sensors are now wrapped in conditionals 2025-05-23 17:08:23 +10:00
seagull9000
efa2b4b1b7 RTTTL-tone-for-Channel-Message
I was a bit remiss in removing the tone for channel message event - this puts one in.

So: DM event - plays a tone (per current)
      Channel Message - new shorter tone

All others aren't defined at present.  Need muting function before we get too carried away.
2025-05-23 17:58:13 +12:00
taco
23f54dd924 fix: remove stray initSerialGPS call 2025-05-23 14:34:34 +10:00
Memo
7d8ae5a4ac Merge branch 'ripplebiz:main' into heltec_v3_sensors 2025-05-23 04:26:48 +00:00
ripplebiz
a2ff22dffb Merge pull request #322 from fdlamotte/rak3x72
rak3x72 : first commit
2025-05-23 13:45:31 +10:00
ripplebiz
22b80a9be7 Merge pull request #289 from adam2872/RAK4631-user-button
Implement user button on RAK4631 using analogue pin 31 (same as MT)
2025-05-23 13:19:32 +10:00
cod3doomy
e742d1f722 t-beam supreme: minor GPS and BME fixes
Fixed GPS initial state to default to off after init.
Removed redundant current limit define
2025-05-22 16:50:06 -07:00
cod3doomy
77bfc0db1c Merge branch 'ripplebiz:dev' into dev 2025-05-22 09:23:14 -07:00
Memo
e1351effb1 Update platformio.ini 2025-05-22 15:50:54 +00:00
Florent de Lamotte
c7fe211840 rak3x72 : report bat voltage 2025-05-22 16:24:20 +02:00
Memo
cd7fc59f06 Update platformio.ini 2025-05-22 13:24:26 +00:00
Florent
f9473235c6 rak3x72 : first commit 2025-05-22 14:47:44 +02:00
Memo
0caa2b4cd1 Update target.h 2025-05-22 12:07:45 +00:00
Memo
648953ce8d Update target.cpp 2025-05-22 12:07:06 +00:00
Memo
1d94df1d04 Update platformio.ini 2025-05-22 12:06:34 +00:00
ripplebiz
8ecb5def87 Merge pull request #305 from ngavars/dev
Telemetry: Create sensor classes that can be shared across variants
2025-05-22 15:46:28 +10:00
taco
a466d3cf80 added serial GPS support to EnvironmentSensorClass
based on T114 serial GPS and EnvironmentSensorClass.
2025-05-22 15:36:20 +10:00
Scott Powell
02b6f4a285 * Companion: telemetry_mode_env added to prefs 2025-05-22 15:26:30 +10:00
Normunds Gavars
c4df0ed1c5 Remove NUM_SENSOR_SETTINGS 2025-05-22 00:38:51 +03:00
Normunds Gavars
5a0ac2a031 Add sensors to build path for ProMicroLLCC68 2025-05-22 00:35:03 +03:00
Normunds Gavars
375a31a436 Remove INA219 wrapper 2025-05-22 00:28:20 +03:00
Normunds Gavars
af0d55548c Remove unused defines 2025-05-22 00:22:43 +03:00
Normunds Gavars
98d94d9423 Remove sensor wrapper classes and simplify. Switch to Adafruit libs for sensors. 2025-05-22 00:19:00 +03:00
ripplebiz
a29b099150 Merge pull request #317 from webmonkey/webmonkey-faq-proofread
Proof-reading fixes to the FAQ
2025-05-21 13:54:00 +10:00
webmonkey
7839cb29a1 Small fixes 2025-05-20 21:42:36 +01:00
cod3doomy
4f503de743 t-beam supreme: fixes and cleanup
Reverted the SensorManager changes
Moved BME into TbeamSupSensorManager
Moved printBMEValues into TbeamSupSensorManager
Moved scanDevices out of TBeamS3SupremeBoard
2025-05-20 11:37:41 -07:00
webmonkey
1c8aaebb90 Proof-reading fixes to the FAQ
Fixed spelling and grammar issues. Also changed the number of stored Room server messages from 16 to 32
2025-05-20 19:24:20 +01:00
Adam Mealings
009173ab9e added missing variable defs and pinmode 2025-05-20 15:16:56 +01:00
adam2872
726273f548 Merge branch 'Dev' into RAK4631-user-button 2025-05-20 14:25:01 +01:00
adam2872
036caaba86 Merge branch 'ripplebiz:main' into main 2025-05-20 14:00:24 +01:00
Adam Mealings
9a0b6e5326 Updated to use #if defined... instead of #ifdef 2025-05-20 13:54:31 +01:00
ripplebiz
16a283ac5b Merge pull request #316 from recrof/dev
lilygo tbeam sx1276, tbeam supreme: added SX12XX_CURRENT_LIMIT
2025-05-20 22:24:08 +10:00
recrof
e14ea72699 fix: missing SX126X_CURRENT_LIMIT 2025-05-20 14:20:42 +02:00
recrof
d42c3f91a2 lilygo tbeam sx1276: forgot to add SX127X_CURRENT_LIMIT=120 2025-05-20 14:05:11 +02:00
ripplebiz
3dff284db6 Merge pull request #315 from liamcottle/feature/companion-advert-name
Set default companion node name via build flags
2025-05-20 19:46:22 +10:00
liamcottle
d9c1cffac2 allow setting default node name for companion via build flag 2025-05-20 20:51:46 +12:00
ripplebiz
ecfeb2ff63 Merge pull request #314 from seagull9000/RTTTL-tweaks1
RTTTL on message types
2025-05-20 17:44:19 +10:00
seagull9000
7507f889a5 fix location and naming of enum 2025-05-20 19:33:21 +12:00
seagull9000
f82844f43f RTTTL on message types 2025-05-20 19:09:49 +12:00
Scott Powell
56b84408e4 * workaround for nRF + LittleFS glitch with seek/truncate 2025-05-20 16:29:09 +10:00
ripplebiz
e5376f0c0a Merge pull request #313 from 446564/ext-notify-nano-g2
enable external notify for nano g2 ultra
2025-05-20 16:13:35 +10:00
Rob Loranger
c31c48025a enable external notify for nano g2 ultra
uses new non blocking rtttl
2025-05-19 19:28:44 -07:00
Scott Powell
7e90d386e2 * refactored buzzer concept to UITask
* moved buzzer.h/cpp to helpers/ui
2025-05-20 11:52:55 +10:00
ripplebiz
4a60548b7d Merge pull request #312 from seagull9000/RTTTL-generic-buzzer
initial support for generic RTTTL (Ring Tone Transfer Language) notifier
2025-05-20 11:34:53 +10:00
seagull9000
be88bea42d initial support for generic RTTTL notifier 2025-05-20 13:26:40 +12:00
ripplebiz
b202580ae2 Merge pull request #310 from 446564/nano-g2-gps
add GPS for nano g2
2025-05-20 11:02:22 +10:00
ripplebiz
43f09f302c Merge pull request #306 from AndreaCCIE/T114-GPS-fix
Increase the delay to 1500 to allow enough time for T114 GPS to start up successfully.
2025-05-20 10:52:57 +10:00
Rob Loranger
4a90042b08 add GPS for nano g2
hardcoded interval of 1 minute after first fix obtained
2025-05-19 15:19:54 -07:00
cod3doomy
4990fe40e7 t-beam supreme: current limit increase
Added the current limit increase define
2025-05-19 13:15:01 -07:00
cod3doomy
fd37810022 t-beam supreme: display fix, BME add, user btn fix
-Fixed build issues after display refactor
-Added BME280 support and updated SensorManager to include this data
-Fixed user button and verified it turns the display on
2025-05-19 12:55:56 -07:00
Normunds Gavars
5d9e7b4567 Remove unnecessary include 2025-05-19 20:30:58 +03:00
Normunds Gavars
3cf78a952b Telemetry: Create BME280 sensor that can bu used across variants. Add to promicro. 2025-05-19 19:37:30 +03:00
AndreaB
a950343f05 Increase the delay to 1500 to allow enough time for T114 GPS to start up successfully. 2025-05-19 16:52:24 +01:00
Normunds Gavars
8a27743e43 Create sensor classes that can be shared across variants 2025-05-19 17:24:54 +03:00
Scott Powell
f9c0056955 * bug fix for CommonCLI, when entering long unknown command 2025-05-19 23:39:34 +10:00
Scott Powell
5d0a8d9d7c * AdvertDataHelpers: reverting parsing logic, but changed meanings of 'battery' and 'temperature' to just two generic uint16 'feature' properties 2025-05-19 23:21:57 +10:00
Scott Powell
d5eb83a921 * AdvertDataHelpers: prospective changes to first byte bit-field 2025-05-19 22:40:53 +10:00
ripplebiz
fa0456549a Merge pull request #290 from adam2872/Modern-battery-icon
Slightly better battery icon
2025-05-19 14:30:16 +10:00
Scott Powell
a73eb9823d * big refactor of the 'display' object. Now defined in variants/*/target modules. 2025-05-19 14:16:55 +10:00
ripplebiz
bc4e0b52fa Merge pull request #298 from 446564/add-nano-g2-ultra
Initial support for nano g2 ultra
2025-05-19 11:09:02 +10:00
ripplebiz
519ebb549b Merge pull request #300 from cod3doomy/dev
t-beam supreme: PMU and i2c fixes
2025-05-19 10:56:42 +10:00
ripplebiz
4e70bc5af8 Merge pull request #301 from memo-567/Removes-green-LED-continuous-light
Removes T114 green LED continuous light
2025-05-19 10:53:23 +10:00
ripplebiz
54c3f019b8 Merge pull request #304 from jquatier/altitude-telemetry
Add altitude to GPS telemetry
2025-05-19 10:50:31 +10:00
JQ
d4e6ece75d fix altitude for telemetry, instead of using zero 2025-05-18 16:36:45 -07:00
cod3doomy
a79e9a79e0 t-beam supreme: debug move
Moved scanDevices into ifdef MESH_DEBUG since it only needs to run under debug sequence
2025-05-18 10:20:32 -07:00
Scott Powell
a155587b7f * possible bug when forwarding direct mode packets 2025-05-18 21:22:27 +10:00
Memo
b59606d5b5 Update variant.h 2025-05-18 06:14:08 +00:00
cod3doomy
ee41d6e2d3 t-beam supreme: PMU and i2c fixes
Fixed i2c (Wire) init issue by defining pins in platformio
Added an i2c scanning function for debug
Corrected the pmu power up sequence
2025-05-17 22:01:13 -07:00
Rob Loranger
7e14fb3f65 Initial support for nano g2 ultra
not yet implemented are GPS and external notification LED and buzzer
2025-05-17 14:18:37 -07:00
Scott Powell
9048142f63 Merge branch 'main' into dev 2025-05-18 01:31:27 +10:00
ripplebiz
37ee90b20f Merge pull request #297 from liamcottle/docs/readme-update
A few adjustments to the readme
2025-05-18 01:29:33 +10:00
liamcottle
86d1c80704 fix formatting 2025-05-18 02:54:53 +12:00
liamcottle
69a70c4f71 update get support 2025-05-18 02:53:05 +12:00
liamcottle
bb5650a998 update how to get started 2025-05-18 02:47:09 +12:00
liamcottle
aa272ecc0c adjust getting started info 2025-05-18 02:26:53 +12:00
liamcottle
2f5cc94d04 add info about flasher and clients 2025-05-18 02:18:32 +12:00
ripplebiz
885cfe9667 Merge pull request #294 from 446564/SH1106-display
Sh1106 display
2025-05-17 23:32:14 +10:00
ripplebiz
d13ff7ea84 Merge pull request #293 from ngavars/dev
Telemetry: add support of AHT10/AHT20 temp/humidity sensor to Promicro
2025-05-17 22:35:03 +10:00
ripplebiz
8f1afbbe58 Merge pull request #295 from LitBomb/patch-10
Update faq.md to undo a merge from the dev branch that should not have included the faq.md file, update to note both SF 10 and SF 11 are viable
2025-05-17 21:54:43 +10:00
Scott Powell
65d398fcbc * ver bump to v1.6.1 2025-05-17 20:04:55 +10:00
Scott Powell
436a99f088 * BLE_WRITE_MIN_INTERVAL upped to 60 millis 2025-05-17 19:54:31 +10:00
uncle lit
4196fd4ab7 Update faq.md
revert a bad merge 2818749a09 in main that wiped out the last changes to faq.md

Update to note both SF 10 and SF 11 can be used based on local use case needs.  There are presets in Liam's smartphone apps for both SF 10 and SF 11.
2025-05-16 17:09:17 -07:00
Rob Loranger
25b534a29d add support for SH1106 OLED display 2025-05-16 08:45:55 -07:00
Normunds Gavars
e5925e5f41 Telemetry: add support of AHT10/AHT20 temp/humidity sensor to Promicro 2025-05-16 15:03:42 +03:00
Scott Powell
b11f43987b * companion: fix for importContact(). Now removes the packet-hash from table, before 'replaying' 2025-05-16 19:57:09 +10:00
Scott Powell
1680eb29aa * repeater: MAX_CLIENTS now defaults to 32 2025-05-15 20:36:09 +10:00
ripplebiz
6dc9920be7 Merge pull request #287 from ngavars/dev
Promicro: add INA219 current sensor support
2025-05-15 14:37:37 +10:00
ripplebiz
f38532b56d Merge pull request #292 from cod3doomy/dev
t-beam supreme: enabled lora tx led
2025-05-15 14:32:32 +10:00
cod3doomy
7576d45a8d t-beam supreme: enabled lora tx led
enabled lora tx led and verified it flashes with message transmit
2025-05-14 20:27:59 -07:00
Normunds Gavars
1de46eae4c Promicro: add support for INA219 current sensor 2025-05-15 00:21:51 +03:00
Adam Mealings
22ee164ff6 Make the battery fill based on the percentage slightly smaller to give it a more modern look 2025-05-14 22:17:54 +01:00
adam2872
14ffde567a Merge pull request #3 from adam2872/revert-2-RAK4631-user-button
Revert "RAK4631 analogue user button on input 31"
2025-05-14 22:05:23 +01:00
adam2872
f1df9f7c3b Revert "RAK4631 analogue user button on input 31" 2025-05-14 22:04:28 +01:00
adam2872
e7872fb4d3 Merge pull request #2 from adam2872/RAK4631-user-button
RAK4631 analogue user button on input 31
2025-05-14 21:58:35 +01:00
Adam Mealings
faf043327d RAK4631 analogue user button on input 31 2025-05-14 21:46:39 +01:00
Normunds Gavars
9f5d7a28ce 283 Promicro: add INA3221 library dependency to all build targets 2025-05-14 18:19:53 +03:00
ripplebiz
3c02ac604d Merge pull request #285 from liamcottle/feature/offline-queue-increase
Increase offline queue size to 256 for all companion ble firmwares
2025-05-14 21:28:02 +10:00
Scott Powell
8007aad7a3 * Promicro: some refactors, minor fixes for INA3221 sensors 2025-05-14 21:22:26 +10:00
liamcottle
d2377c91ab fix offline queue size for xiao nrf52 2025-05-14 23:10:27 +12:00
ripplebiz
cf1c863cc2 Merge pull request #284 from ngavars/main
Telemetry: INA3221 current sensor support for Promicro
2025-05-14 21:07:22 +10:00
liamcottle
6c0d94aa2d increase offline queue size from 16 to 256 for all companion ble firmwares 2025-05-14 23:02:49 +12:00
Normunds Gavars
74c1ff3d6d 283 minor cleanup 2025-05-14 13:58:52 +03:00
Normunds Gavars
8b3d60abe7 283 add new permision for access to environment sensors 2025-05-14 13:55:45 +03:00
Normunds Gavars
c69657a13b 283 remove settingsManager and avoid the String class 2025-05-14 13:27:57 +03:00
Scott Powell
e291b57a07 * Dispatcher::checkSend() bug: getOutboundCount() should only count non-future packets 2025-05-14 16:50:11 +10:00
Scott Powell
a56e9ef62f * TBeam Supreme: refactor for readStringUntil() 2025-05-14 13:11:10 +10:00
ripplebiz
ed01859c12 Merge pull request #281 from cod3doomy/dev
t-beam supreme: added GPS functionality
2025-05-14 12:46:22 +10:00
Normunds Gavars
a9b64b31b7 Merge pull request #1 from ngavars/promicro-INA3221
283 Add support of INA3221 to Promicro telemetry
2025-05-13 23:57:08 +03:00
Normunds Gavars
b035487101 283 Add support of INA3221 to Promicro telemetry 2025-05-13 23:52:49 +03:00
Scott Powell
805ca7b900 * CommonCLI: added "clear stats" command 2025-05-13 18:12:58 +10:00
cod3doomy
2ea05a5182 t-beam supreme: added GPS functionality
Enabled GPS and verified with meshcli.
All supreme envs build.
2025-05-12 23:21:37 -07:00
Scott Powell
177dd90ca1 * Repeater/Room server: new diagnostics, stats.n_full_events now repurposed to 'err_events' (bit flags)
* new Radio::isInRecvMode() method
2025-05-13 15:38:10 +10:00
Scott Powell
62a5115cc9 * T114: lib_deps missing MicroNMEA 2025-05-12 19:20:02 +10:00
ripplebiz
64b7a14a66 Merge pull request #274 from hank/tbeamsupreme-pmu-fix-1
Fixes to the TBeam Supreme PMU calls
2025-05-12 19:08:34 +10:00
ripplebiz
11b90e8876 Merge pull request #273 from recrof/dev
raise current limit to max for sx126x and sx127x
2025-05-12 18:36:39 +10:00
recrof
76639e2a68 raise current limit to max for sx126x and sx127x 2025-05-12 10:19:33 +02:00
hank
3c2781cce1 Disabling MESH_DEBUG by default on TBeam Supreme companion 2025-05-12 01:17:28 -07:00
hank
6218c1e7ae Fixes to the PMU calls 2025-05-12 01:09:16 -07:00
hank
73d066375d Fixes to the PMU calls 2025-05-12 01:02:46 -07:00
Scott Powell
b08436eba7 * startSendRaw() now returns false if fail 2025-05-12 17:26:44 +10:00
hank
0c3c162835 Merge branch 'dev' of https://github.com/ripplebiz/MeshCore into dev 2025-05-11 22:34:17 -07:00
ripplebiz
dd16197eae Merge pull request #268 from jquatier/t114-blue-led
Disable LED flashing during BLE advertising on T114
2025-05-12 12:42:12 +10:00
Scott Powell
c37622b4a0 * repeater: neighbors CLI, now returns secs ago, not timestamp 2025-05-12 12:23:58 +10:00
ripplebiz
7a83f75e60 Merge pull request #266 from jquatier/t114-gps
T114 GPS Support
2025-05-12 10:06:14 +10:00
ripplebiz
7693274edd Merge pull request #264 from recrof/patch-1
tbeam supreme companion: raise channels to 8
2025-05-12 10:03:07 +10:00
JQ
e88a710d0f don't expose GPD setting unless GPS is connected. 2025-05-11 09:32:34 -07:00
ripplebiz
4a15b8b0c9 Merge pull request #269 from fdlamotte/wio-e5
wio-e5 : initial port
2025-05-11 20:00:13 +10:00
Florent
35e1901d0e wio-e5 : initial port 2025-05-11 09:28:15 +02:00
Jacob Quatier
bce5dc9796 Disable LED flashing during BLE advertising 2025-05-10 20:47:13 -07:00
JQ
b92e2abe75 remove debug 2025-05-09 20:31:28 -07:00
JQ
ae5052fec7 t114 gps support 2025-05-09 20:30:11 -07:00
hank
e224ff372e Merge branch 'dev' of https://github.com/ripplebiz/MeshCore into dev 2025-05-09 15:57:19 -07:00
Rastislav Vysoky
445179f53a tbeam supreme companion: raise channels to 8 2025-05-09 16:22:31 +02:00
Scott Powell
d072e7b575 * ver bump to v1.6.0 2025-05-09 18:12:42 +10:00
Scott Powell
d8952f3710 * ESP32Board: can now download entire log file via OTA webserver (URL: /log) 2025-05-09 16:17:36 +10:00
hank
58ce90b29d Merge branch 'main' of https://github.com/hank/MeshCore into dev 2025-05-08 16:20:05 -07:00
hank
3a8dfc8fe9 Delete .vscode/settings.json
Removing vscode file incorrectly committed
2025-05-08 01:10:56 -07:00
Scott Powell
810fc8b8f0 * Heltec tracker: new 'periph_power' shared pin (between Display & GPS) 2025-05-08 15:50:53 +10:00
Scott Powell
997261a68e * Heltec tracker: added GPS to custom HWTSensorManager 2025-05-08 13:55:09 +10:00
Scott Powell
98f1785104 * refactor: LocationProvider classes moved to src/helpers/sensors
* refactor:  Heltec_Wireless_Tracker* env moved to new variants/heltec_tracker dir
2025-05-08 13:23:53 +10:00
Scott Powell
60b7897665 * ST7735Display: now applies SCALE_X, SCALE_Y 2025-05-08 12:48:34 +10:00
Scott Powell
7a7f436921 * Heltec Wireless Tracker fixes: getTextWidth() missing, PIN_BOARD_SDA/SCL 2025-05-08 12:42:28 +10:00
ripplebiz
0e208f01cd Merge pull request #258 from seagull9000/Heltec-Wireless-Tracker-support
Heltec Wireless Tracker support
2025-05-08 12:29:02 +10:00
ripplebiz
eba0daf70a Merge pull request #255 from jquatier/bitmap-scaling-7789
fixing scaling of bitmaps for 7789 display
2025-05-08 11:33:49 +10:00
JQ
94db70d511 new implementation 2025-05-07 18:14:56 -07:00
seagull9000
c2ef0a3f0b Heltec Wireless Tracker support 2025-05-07 21:42:29 +12:00
seagull9000
e076e797e6 Heltec Wireless Tracker support 2025-05-07 21:40:27 +12:00
ripplebiz
90b3b1b6fe Merge pull request #257 from liamcottle/fix/valid-ble-pin
ble pin must be zero or a valid 6 digit pin
2025-05-07 19:03:57 +10:00
liamcottle
f18a3b78ad ble pin must be zero or a valid 6 digit pin 2025-05-07 20:53:59 +12:00
ripplebiz
6962a043e2 Merge pull request #256 from liamcottle/feature/enable-repeater-neighbours
enable neighbours feature for all repeater variants
2025-05-07 18:34:05 +10:00
liamcottle
d04eda9f16 enable neighbours feature for all repeater variants 2025-05-07 20:26:15 +12:00
JQ
941d2d5c13 fixing scaling of bitmaps for 7789 display 2025-05-06 20:47:14 -07:00
hank
5e7c9a229f Cleaning up power code for the TBeam 2025-05-05 23:58:21 -07:00
hank
0263b6632c Adding support for TBeam 1.1 2025-05-05 23:03:14 -07:00
Scott Powell
f855523481 * refactor: removed mesh::Mesh dependency from CommonCLI 2025-05-06 11:51:51 +10:00
ripplebiz
6dd85880e4 Merge pull request #246 from liamcottle/dev
Use identity key as default node name
2025-05-06 10:39:58 +10:00
ripplebiz
dfe3561f39 Merge pull request #251 from recrof/dev
Disable debug flags that were not commented out after debugging
2025-05-06 10:37:04 +10:00
ripplebiz
bff90a5102 Merge pull request #250 from fdlamotte/fix_set_custom_var
fix for set_custom_var
2025-05-06 10:35:30 +10:00
Rastislav Vysoky
078a60040d Merge branch 'ripplebiz:dev' into dev 2025-05-05 22:48:56 +02:00
recrof
eaea26267b disable debug flags that were not commented out after debugging 2025-05-05 22:48:21 +02:00
Florent de Lamotte
a39c000f5d fix for set_custom_var 2025-05-05 16:40:00 +02:00
ripplebiz
fb5fcae614 Merge pull request #249 from recrof/dev
lilygo t-echo, elecrow thinknode m1: correct display scalling
2025-05-05 19:30:39 +10:00
Rastislav Vysoky
81863a5995 Delete src/helpers/CustomLR1121Wrapper.h 2025-05-05 08:34:41 +02:00
Rastislav Vysoky
310e6c64d4 Delete src/helpers/CustomLR1121.h 2025-05-05 08:34:24 +02:00
recrof
5780b50a48 echo, m1: correct display scalling; all nrf52 boards jsons: added debug.openocd_target 2025-05-05 08:30:12 +02:00
Scott Powell
791da53c7b * ST7789Display: now with SCALE_X,SCALE_Y
* fix for GxEPDDisplay
2025-05-05 15:54:31 +10:00
ripplebiz
5b27bef485 Merge pull request #248 from jquatier/t114-landscape
T114 landscape display
2025-05-05 15:43:35 +10:00
JQ
d3a88e9206 T114 Landscape 2025-05-04 21:54:47 -07:00
JQ
67d709b3aa T114 Landscape 2025-05-04 21:51:58 -07:00
Scott Powell
136f3d1000 * GxEPDDIsplay: driver now applying SCALE_X, SCALE_Y 2025-05-05 13:37:48 +10:00
ripplebiz
458f309065 Merge pull request #243 from recrof/dev
initial support for Elecrow ThinkNode M1
2025-05-05 13:17:32 +10:00
Scott Powell
af606343a7 * FIX: UI should show "< Room Server >" 2025-05-05 13:11:43 +10:00
ripplebiz
1f06d22bde Merge pull request #247 from jquatier/ui-text-width
UI Text Width - minor improvement
2025-05-05 11:53:47 +10:00
Scott Powell
bcb64d8a4c * companion: fix for _GET_STATUS response 2025-05-05 11:49:17 +10:00
Scott Powell
cb80ceee47 * companion: protocol ver bump to 5
* companion: new prefs: telemetry_mode_base, telemetry_mode_loc
* companion: CMD_SET_OTHER_PARAMS, now optionally can set telemetry_modes
2025-05-05 11:21:55 +10:00
JQ
9d967388f7 cleanup 2025-05-04 18:20:53 -07:00
JQ
678f36a57b Implement getTextWidth for display classes
- Added getTextWidth method to DisplayDriver interface
- Implemented getTextWidth in all display classes
- Updated examples to use getTextWidth directly
2025-05-04 18:17:18 -07:00
liamcottle
8f32ee61ce no need for prefs check before prefs are loaded 2025-05-05 11:34:02 +12:00
liamcottle
0bccf29f64 use hex of first 4 bytes of identity public key as default node name 2025-05-05 11:21:31 +12:00
Scott Powell
e442e94e3d * SensorManager: now can influence advert lat/lon, new custom name:value pairs for custom settings (eg, gps on/off)
* companion: new CMD_GET_CUSTOM_VARS, CMD_SET_CUSTOM_VAR
* T1000e: now supports "gps" custom setting (value "0" or "1")
2025-05-05 00:15:35 +10:00
ripplebiz
cd9691ba81 Merge pull request #244 from fdlamotte/t1000e_telemetry_gps
t1000e quick and dirty integration of gps into telemetry framework
2025-05-04 23:46:59 +10:00
Florent
933e7ba847 t1000e quick and dirty integration of gps into telemetry framework 2025-05-03 17:00:53 +02:00
recrof
b407f923e0 initial support for Elecrow ThinkNode M1 2025-05-03 15:42:10 +02:00
recrof
1e031e989d Merge branch 'dev' of github.com:recrof/MeshCore into dev 2025-05-03 14:59:06 +02:00
Scott Powell
26f01e0605 * companion: new CMD_SEND_TELEMETRY_REQ, PUSH_CODE_TELEMETRY_RESPONSE 2025-05-03 20:08:44 +10:00
Scott Powell
99774f10ac * new: SensorManager
* BasChatMesh: new onContactRequest(), for PAYLOAD_TYPE_REQ handling.
* companion, repeater and room_server: now with basic 'plumbing' to handle REQ_TYPE_GET_TELEMETRY_DATA (0x03).
* dependency: added CayenneLPP to libdeps
* all target.* modules now with a stub 'sensors' object.
2025-05-03 13:14:03 +10:00
ripplebiz
6aa4df6ca5 Merge pull request #242 from fdlamotte/xiao-nrf52_pindef_in_config
xiao-nrf : move pindef to platformio.ini
2025-05-03 12:10:44 +10:00
Florent
e1c3dfca92 xiao-nrf : move pindef in pio.ini 2025-05-02 08:27:26 +02:00
Scott Powell
c0870960d6 * repeater CLI: 'neighbors' command now responds with "-none-" if no neighbors 2025-05-02 13:24:06 +10:00
ripplebiz
73231b1d22 Merge pull request #213 from jquatier/ui-enhancements
Device UI Enhancements: Battery indicator, boot screen, radio settings
2025-05-02 11:32:09 +10:00
JQ
2818749a09 revert file 2025-05-01 18:29:25 -07:00
JQ
77f44f727e merge from dev 2025-05-01 18:10:03 -07:00
ripplebiz
8f84a5d990 Merge pull request #237 from fdlamotte/t114_monochrome
T114 monochrome
2025-05-01 16:01:36 +10:00
ripplebiz
9813ec6d96 Merge pull request #229 from recrof/dev
build.sh: detect if we have nrf52 by probing for *.zip and *.hex output files
2025-05-01 12:01:25 +10:00
ripplebiz
d63775b878 Merge pull request #234 from fdlamotte/Arduino_serial_using_stream
use Stream abstract interface for serial port in ArduinoSerialInterface
2025-04-30 22:14:55 +10:00
Scott Powell
8a8e89f282 * refactor: "neighbors" command 2025-04-30 21:41:09 +10:00
Florent de Lamotte
05254bd67b t114 display : some fixes 2025-04-30 11:26:04 +02:00
Florent de Lamotte
f68b9bbfca Merge branch 'dev' into t114_monochrome 2025-04-30 11:11:01 +02:00
Florent de Lamotte
1c67d1cb42 change screen rotation and fix bitmap 2025-04-30 11:09:43 +02:00
Scott Powell
056bcf83d9 * Repeater: neighbour table now only of other repeaters 2025-04-30 18:43:48 +10:00
Scott Powell
f261599608 * bug fix for CLI retry attempts (should be ignored) 2025-04-30 18:10:58 +10:00
Scott Powell
e6325db72b * repeater: new CLI command 'neighbors' 2025-04-30 18:01:30 +10:00
recrof
154b5e4014 New Board: Elecrow ThinkNode M1 2025-04-29 17:32:08 +02:00
ripplebiz
21756d5e1c Merge pull request #232 from fdlamotte/xiao_s3_screen
add display to companion_radio_ble target
2025-04-29 15:50:25 +10:00
Florent de Lamotte
7eebd81cd0 use Stream abstract interface for serial port in ArduinoSerialInterface 2025-04-28 16:17:29 +02:00
Florent de Lamotte
2cdb3b501c add display to companion_radio_ble target 2025-04-28 11:08:20 +02:00
Jacob Quatier
13654347c7 Merge branch 'ripplebiz:main' into ui-enhancements 2025-04-27 20:37:49 -07:00
recrof
4f2aaa47d3 detect if we have nrf52 by probing for *.zip and *.hex output files 2025-04-27 10:24:38 +02:00
ripplebiz
b614cef980 Merge pull request #228 from liamcottle/dev
remove pin mode setup from uitask
2025-04-26 20:07:48 +10:00
ripplebiz
569ef18b35 Merge pull request #225 from alesgenova/short-led
companion_radio: greatly reduce the status LED usage
2025-04-26 17:27:03 +10:00
liamcottle
8f5a2ac832 remove pin mode setup from uitask 2025-04-26 17:54:59 +12:00
Scott Powell
c942aa06f9 * Packet::readFrom() payload_len guard 2025-04-26 11:05:13 +10:00
ripplebiz
2f047da3a3 Merge pull request #223 from neutralinsomniac/add_direnv_to_gitignore
Add .direnv/ to .gitignore. This is the directory that holds the nix-generated development environment
2025-04-25 19:28:12 +10:00
Alessandro Genova
f51ab11cf1 companion_radio: greatly reduce the status LED usage 2025-04-24 23:22:14 -04:00
Florent
2a7e105c59 some tests 2025-04-24 22:37:06 +02:00
Jeremy O'Brien
0fc4d244ea Add .direnv/ to .gitignore. This is the directory that holds the nix-generated development environment 2025-04-24 12:22:52 -04:00
Scott Powell
36b981c9eb * new targets: Generic_E22_*_repeater 2025-04-24 13:50:18 +10:00
Scott Powell
e1092118d9 * ESPNOW: packet rx/tx counters 2025-04-24 12:16:55 +10:00
Scott Powell
00f0bb7471 * ESPNOW: now using hardware RNG for radio_new_identity() 2025-04-24 10:59:01 +10:00
ripplebiz
10df19d3a3 Merge pull request #222 from rusty-labs/tbeam_sx1262_support
Support for TBeam SX1262 board /dev
2025-04-24 10:28:56 +10:00
rusty.labs
da1febdd88 Support for TBeam SX1262 board 2025-04-23 20:23:06 -04:00
ripplebiz
70b6e01c49 Merge pull request #205 from neutralinsomniac/add_default_nix
Add default.nix/.envrc for automagic dev environment on NixOS
2025-04-24 09:56:48 +10:00
ripplebiz
285423ca55 Merge pull request #220 from fdlamotte/xiao-nrf52-targets
xiao_nrf52-missing_targets
2025-04-23 19:23:37 +10:00
Florent
8c992d5037 xiao_nrf52-missing_targets 2025-04-23 11:20:28 +02:00
ripplebiz
977b76c47e Merge pull request #219 from recrof/dev
bugfix: Faketec: only include SSD1306Display during build
2025-04-23 19:06:47 +10:00
recrof
669597ea4f bugfix: only include SSD1306Display during build 2025-04-23 10:43:56 +02:00
Scott Powell
a87b5231cc * RP2040 IdentityStore begin(), to ensure mkdir() 2025-04-22 15:26:04 +10:00
ripplebiz
2ba3f42f30 Merge pull request #217 from AeroXuk/feature/rp2040_picow_dev
Support for Pi PicoW
2025-04-22 15:04:09 +10:00
AeroXuk
26efe2fb19 Hopefully the correct ADC_MULTIPLIER value. 2025-04-21 23:01:44 +01:00
AeroXuk
4d9964ff98 Correct opens to use "w" filemode instead of "w+" filemode. 2025-04-21 21:49:41 +01:00
AeroXuk
b1c8963e1e Merge 'dev' into 'feature/rp2040_picow_dev'. 2025-04-21 21:21:10 +01:00
AeroXuk
99246e6b6f Added Pi PIcoW support in the following modes:
- Companion Radio over USB Serial
- Repeater
- Room Server
- Terminal Chat
2025-04-21 21:17:03 +01:00
Scott Powell
76847a7756 Merge branch 'dev' 2025-04-21 21:57:55 +10:00
Scott Powell
9d82911e18 * ver bump to v1.5.1 2025-04-21 21:50:55 +10:00
Scott Powell
631f593895 * companion: bug fix for 'export contact' 2025-04-21 21:38:57 +10:00
Scott Powell
933764546a Merge branch 'dev' 2025-04-21 17:39:57 +10:00
Scott Powell
1e263cab2b * ver bump to v1.5.0 2025-04-21 17:39:36 +10:00
ripplebiz
a81e8b4b54 Merge pull request #211 from fdlamotte/techo-display
Techo display
2025-04-21 16:44:52 +10:00
Scott Powell
8f70d48ea1 * fix for AutoDiscoverRTCClock 2025-04-21 16:35:55 +10:00
ripplebiz
c0eb5bffaa Merge pull request #212 from fdlamotte/xiao_nrf52-batread
xiao-nrf keep vbat_en to low to prevent issues ...
2025-04-21 16:29:26 +10:00
ripplebiz
1b25a63996 Merge pull request #210 from fdlamotte/xiao_expansion
support for xiao expansion board screen
2025-04-21 16:25:51 +10:00
ripplebiz
7669b97b8b Merge pull request #208 from cod3doomy/dev
updated: t-beam supreme sx1262 to be merged
2025-04-21 16:23:06 +10:00
JQ
7d7692a13b adding connected check 2025-04-20 19:17:20 -07:00
Jacob Quatier
c34dd2a40c UI: battery indicator, boot screen, radio settings 2025-04-20 19:17:02 -07:00
Florent
6735960a4e xiao-nrf keep vbat_en to low to prevent issues ... 2025-04-20 21:15:59 +02:00
Florent
2d6c834887 std behaviour 2025-04-20 17:10:57 +02:00
Florent
052ca9f12f fix screen boot 2025-04-20 16:44:30 +02:00
Florent
512f0900da led and button assigned in ui 2025-04-20 16:41:33 +02:00
Florent
04fe2f567f support for xiao expansion board screen 2025-04-20 11:03:01 +02:00
cod3doomy
f64470c581 t-beam s3 supreme: repeater, room server, and ble companion verified working. RTC working. No screen, GPS or sensors. 2025-04-19 19:51:01 -07:00
cod3doomy
50f6e8a089 Merge branch 'dev' of https://github.com/cod3doomy/MeshCore_HW_Dev into dev 2025-04-17 19:27:08 -07:00
Scott Powell
7b1582a0b9 * room server keep_alive ACKs now have unsynced_count appended. 2025-04-17 15:46:51 +10:00
Jeremy O'Brien
21564ae494 add default.nix/.envrc for automagic platformio dev environment on NixOS 2025-04-16 12:18:49 -04:00
Scott Powell
b17196acb4 * room server login response now includes unsynced posts counter 2025-04-16 16:51:04 +10:00
Florent
ea24a12ba3 techo-display: first bits 2025-04-15 22:37:50 +02:00
ripplebiz
1f1d39d179 Merge pull request #193 from fdlamotte/t114-display
T114 display
2025-04-15 18:18:16 +10:00
Florent
f9bc3a1ebb Merge branch 'dev' into t114-display 2025-04-15 07:46:45 +02:00
Scott Powell
fbfa8bbe57 * fix: compilation error for T1000e 2025-04-15 15:15:06 +10:00
cod3doomy
310ab9710c Merge branch 'dev' into dev 2025-04-14 20:43:33 -07:00
ripplebiz
69d1d920bb Merge pull request #202 from fdlamotte/rx_boost_toggle_lr1110
permit access to rx_boosted_mode at runtime for LR1110
2025-04-15 12:03:02 +10:00
Florent
7f7b03e442 permit access to rx_boosted_mode at runtime for LR1110 (for dpm tests on that setting) 2025-04-14 12:23:28 +02:00
ripplebiz
2a875d9930 Merge pull request #192 from fdlamotte/prevent-errors-when-built-against-XiaoNrf52Board-by-error
compiles xiao_nrf52 board files only if we compile for xiao_nrf52
2025-04-13 13:39:53 +10:00
ripplebiz
5848080f58 Merge pull request #196 from liamcottle/dev
Fix RAK4631 builds after addition of Xio nRF52 board
2025-04-13 13:22:58 +10:00
liamcottle
e825e4474f fix rak4631 builds after addition of xio nrf52 board 2025-04-13 13:36:39 +12:00
Scott Powell
04118f01fc * companion: protocol ver (FIRMWARE_VER_CODE) now 4 2025-04-12 22:06:47 +10:00
Scott Powell
34faa49685 * new CMD_SET_OTHER_PARAMS (38) 2025-04-12 22:00:05 +10:00
Scott Powell
561d289ea5 Companion: new 'manual_add_contacts' pref. New PUSH_CODE_NEW_ADVERT frames 2025-04-12 21:43:30 +10:00
ripplebiz
2de87d1875 Merge pull request #189 from fdlamotte/t1000_sensors_disable
t1000 : power bat sensor only when necessary
2025-04-12 13:32:01 +10:00
cod3doomy
67ca4a1c8e T-Beam Supreme: Repeater and BLE working. Added PCF8563 RTC 2025-04-11 18:17:20 -07:00
Florent
cf3d55201f ui : manage colors and ensure fw using ssd1306 still compile 2025-04-11 22:23:47 +02:00
Florent
b4330e376c compiles xiao_nrf52 board files only if we compile for xiao_nrf52 2025-04-11 14:51:10 +02:00
ripplebiz
8ee251a19e Merge pull request #185 from fdlamotte/xiao-nrf52
Xiao nrf52
2025-04-11 20:32:44 +10:00
Scott Powell
1d4ae9f3c4 minor refactor 2025-04-11 19:11:06 +10:00
Florent de Lamotte
82bcd74932 xiao-nrf52 : initial support for meshcore
initial config for xiao_nrf52

repeater role for xiao-nrf52

xiao-nrf52 correction on bat voltage

xiao-nrf52 this file should not be here ...
2025-04-11 08:10:18 +02:00
Scott Powell
4704ea8dae Merge branch 'trans-codes' into dev 2025-04-11 15:12:14 +10:00
Scott Powell
ab8cd85d8e * added Packet::getRawLength() helper 2025-04-11 15:12:04 +10:00
Scott Powell
366461a3a1 * companion: onRawDataRecv() guard for payload_len too long 2025-04-11 14:12:09 +10:00
Florent
96d6ffefad t1000 : power bat sensor only when necessary 2025-04-10 22:00:25 +02:00
Scott Powell
3c7ff8da29 * Packet::header, new: ROUTE_TYPE_TRANS_FLOOD, ROUTE_TYPE_TRANS_DIRECT
* Packet wire format change: (optional) extra 4 bytes for two trans_codes
2025-04-11 04:56:13 +10:00
Florent de Lamotte
7534c5143f display and btn handling starts working ... 2025-04-10 16:24:17 +02:00
ripplebiz
a5f210779f Merge pull request #177 from fdlamotte/t114_usb
add companion radio usb to t114
2025-04-10 19:24:04 +10:00
ripplebiz
87ca6e19ae Merge pull request #188 from recrof/dev
lilygo t-echo: disable gps to conserve battery, move init stuff to variant.cpp; lilygo t-beam: report battery voltage
2025-04-10 17:09:16 +10:00
cod3doomy
c4c175cab8 T-Beam Supreme: added PMU config, enabled pwr button. Repeater env verified working. 2025-04-09 18:28:46 -07:00
recrof
a3c8597747 LilyGo T-Beam: added battery voltage reporting 2025-04-09 14:08:13 +02:00
recrof
511a935bbf move gps standby pin to gps section 2025-04-09 13:21:34 +02:00
recrof
1718657829 lilygo t-echo: move init stuff to variant.cpp, disable gps to conserve battery 2025-04-09 13:18:35 +02:00
ripplebiz
cc5c7b3ab7 Merge pull request #187 from oltaco/rak-oled-pins
add defines for RAK OLED pins
2025-04-09 20:45:41 +10:00
ripplebiz
d4544804b5 Merge pull request #186 from oltaco/wire-setpins-buildfix
Wire.setpins buildfix
2025-04-09 19:55:20 +10:00
taco
be64fa7ca0 build: fix RAK, T114, T1000 builds 2025-04-09 18:22:01 +10:00
taco
5c2c248f70 build: fix RAK, T114, T1000e builds 2025-04-09 18:19:13 +10:00
taco
9b3e7e5a21 FIX: define OLED pins for RAK 2025-04-09 18:07:01 +10:00
ripplebiz
c4b221f386 Merge pull request #184 from adrian-immel/Fix-Floating-Pin
Fix Floating Pin on FakeTec/Promicro: Update BUTTON_PIN to INPUT_PULLUP
2025-04-09 10:27:58 +10:00
cod3doomy
3eded4581a Checkpoint: Repeater env built and works with HW. No screen or other periphs 2025-04-08 17:08:28 -07:00
cod3doomy
6092f5737c Initial commit with t-beam supreme sx1262 additions 2025-04-08 09:12:43 -07:00
Adrian
329c76629d Fix Floating Pin on Promicro
change INPUT to INPUT_PULLUP
2025-04-08 16:08:04 +02:00
ripplebiz
b98668150b Merge pull request #183 from liamcottle/dev
Show version in build info for devices with a screen
2025-04-08 21:37:45 +10:00
liamcottle
c4d32eba74 remove unused variables 2025-04-08 23:17:22 +12:00
liamcottle
bc820ae93e show firmware version and build date on room server screen 2025-04-08 23:09:55 +12:00
liamcottle
4a51cb98c6 show firmware version and build date on repeater screen 2025-04-08 23:05:27 +12:00
liamcottle
28aa94b899 show firmware version and build date on companion screen 2025-04-08 22:58:17 +12:00
ripplebiz
348db9b82f Merge pull request #182 from oltaco/tbeam-8-group-channels
set TBeam MAX_GROUP_CHANNELS=8
2025-04-08 11:06:58 +10:00
taco
a0d9449e21 set TBeam MAX_GROUP_CHANNELS=8 2025-04-08 11:04:20 +10:00
Scott Powell
b2b755c0fb Merge branch 'dev' 2025-04-07 22:01:08 +10:00
Scott Powell
d7e6a361b5 * ver bump to v1.4.3 2025-04-07 21:59:53 +10:00
Scott Powell
396a7a24b1 * default SF now 11 2025-04-07 21:55:24 +10:00
Scott Powell
9498d2e824 * ID hash 0x00 and 0xFF now reserved for future. 2025-04-06 12:34:09 +10:00
Florent
019a829121 add companion radio usb to t114 2025-04-05 17:28:25 +02:00
ripplebiz
86a3f592b9 Merge pull request #172 from recrof/dev
set repeater/room server Lat & Lon to 0.0 as default
2025-04-04 19:26:30 +11:00
ripplebiz
4d2380d168 Merge pull request #173 from oltaco/promicro-rfswitch
FIX: Set RfSwitch pins properly.
2025-04-04 19:25:12 +11:00
taco
96faf423e3 FIX: Need to explicitly setRfSwitchPins to drive RXEN high when in receive mode. 2025-04-04 15:39:11 +11:00
recrof
04ad06b8be set repeater/room server Lat & Lon to 0.0 as default 2025-04-03 14:59:20 +02:00
ripplebiz
259f4ec169 Merge pull request #171 from LitBomb/patch-9
Update faq.md
2025-04-02 19:15:33 +11:00
uncle lit
49d24283f7 Update faq.md
Add table of content
Add http://config.meshcore.dev for repeater and room server setup
Add T-Deck GPS info screen sentences counter
Add explanation who 869.525MHz is the chosen frequency for EU and UK and why 867.5MHz isn't good comparing to 869.525
2025-04-01 22:49:09 -07:00
ripplebiz
2bec0f1418 Merge pull request #167 from fdlamotte/xiao_s3_serial_onpins
Allow the use companion radio on other serial interfaces
2025-04-02 00:02:46 +11:00
Florent de Lamotte
c762d88edd Merge branch 'dev' into xiao_s3_serial_onpins 2025-04-01 11:33:00 +02:00
Florent de Lamotte
87f476354f initial commit 2025-04-01 11:32:04 +02:00
ripplebiz
accd80db77 Merge pull request #165 from liamcottle/dev
Show please wait message on boot
2025-04-01 14:42:59 +11:00
liamcottle
4d4a0ae4e3 init display before radio 2025-04-01 16:10:12 +13:00
liamcottle
7e583d7f98 show please wait message on room server boot 2025-04-01 16:04:06 +13:00
liamcottle
f93a5156bb show please wait message on repeater boot 2025-04-01 16:00:09 +13:00
liamcottle
af070af554 show please wait message on companion boot 2025-04-01 15:50:24 +13:00
ripplebiz
ec320cb5a8 Merge pull request #164 from liamcottle/dev
Fix Companion Display Noise
2025-04-01 13:02:57 +11:00
liamcottle
87443ad43f clear display on init to avoid static 2025-04-01 14:46:48 +13:00
ripplebiz
0a62ab663f Merge pull request #155 from oltaco/promicro-refactor
ProMicro refactoring
2025-04-01 12:43:09 +11:00
ripplebiz
7d24c65c4e Merge pull request #163 from LitBomb/patch-7
Update faq.md
2025-04-01 12:37:08 +11:00
uncle lit
5e553b1fc8 Update faq.md
added the following to FAQ:

public/private flood and repeater set flood.max CLI
public key in hex and base64
How paths are created and reuse to minimize utilization
T-Deck Diag explanation
Update repeater with a Raspberry Pi
clients don't repeat explanation
other meshcore projects
fix discord link to build instruction
2025-03-31 14:51:52 -07:00
Scott Powell
3a6b8fda93 * room server: faster sync of unread posts, MAX_UNSYNCED_POSTS now 32 (was 16) 2025-03-31 14:01:49 +11:00
ripplebiz
6e109779f3 Merge pull request #149 from jameshall9327/main
TBeam: Added Repeater
2025-03-31 13:10:20 +11:00
Scott Powell
3a920986ca * Tbeam fix: GPIO assignments wrong 2025-03-31 13:03:33 +11:00
Scott Powell
8740528d37 Merge commit '5493dbc12096f3f090cc48e70547a4491f5a06b1' into dev 2025-03-31 00:15:38 +11:00
ripplebiz
5493dbc120 Merge pull request #157 from fdlamotte/t1000e_clock
Remove rtc auto-detect on t1000
2025-03-31 00:14:17 +11:00
Florent
2f6427ce21 Remove rtc auto-detect on t1000 2025-03-30 15:09:40 +02:00
Scott Powell
97b6a1874a Merge branch 'dev' 2025-03-30 19:18:35 +11:00
ripplebiz
05fa1ba50e Merge pull request #145 from recrof/main
change new default freq to 869.525
2025-03-30 19:01:55 +11:00
Scott Powell
fc6aa0ed0f * ver bump to v1.4.2 2025-03-30 18:56:21 +11:00
taco
b8f09531c4 fix: give ProMicroLLCC68 a different definition 2025-03-30 15:57:20 +11:00
taco
01e98caea7 Refactor: FaketecBoard to PromicroBoard 2025-03-30 15:52:25 +11:00
Scott Powell
75eabd5c66 * minor refactor 2025-03-30 14:47:52 +11:00
ripplebiz
2e5b4eb910 Merge pull request #154 from recrof/dev
added new CommonCLI get commands: `get role` and `get public.key`
2025-03-30 14:40:49 +11:00
recrof
b77701ced0 added new CommonCLI get commands: get role and get public.key 2025-03-29 19:40:35 +01:00
Scott Powell
0d5c17f7ed * ESP-Now: long range mode 2025-03-29 13:27:17 +11:00
Scott Powell
022b43ef3d * isReceiving() now includes either preamble detect or header detect 2025-03-28 22:20:42 +11:00
Scott Powell
89bd6c3416 * Dispatcher: now impose a max time for CAD fail (ie. channel busy), defined by getCADFailMaxDuration(), default 4 seconds.
(an sx126x bug _might_ be making radio->isReceiving() return true indefinitely)
2025-03-28 20:50:42 +11:00
Scott Powell
ba93867037 * companion: temp fix: logRxRaw() is blowing the MAX_FRAME_SIZE 2025-03-28 14:14:59 +11:00
James Hall
74e7af3f57 TBeam: Added Repeater 2025-03-27 09:21:29 -04:00
Scott Powell
c0cb57be5c * refactor: rtc_clock now defined by variants/*/target modules 2025-03-27 21:28:06 +11:00
Scott Powell
2224bddcb5 * new ESPNOWRadio driver
* refactored the examples/*/main.cpp modules, moving radio specifics to variants/*/target modules
* new Generic_ESPNOW_* target envs
2025-03-27 19:34:16 +11:00
Scott Powell
9c165add61 Merge branch 'dev' into esp-now 2025-03-27 17:24:56 +11:00
Scott Powell
d5cc28b0c5 * room server: now support "log start/stop..." 2025-03-27 13:00:40 +11:00
recrof
8a248bb47d change new default freq to 869.525 2025-03-26 18:06:20 +01:00
ripplebiz
32edc934fa Merge pull request #144 from adrian-immel/Fix-Typo
Fix build issue for FakeTec board
2025-03-26 16:22:01 +11:00
Adrian
7cab681697 Update FaketecBoard.cpp 2025-03-25 23:21:05 +01:00
Adrian
4d262e9e5d Rename faketecBoard.h to FaketecBoard.h 2025-03-25 23:16:08 +01:00
Adrian
ee230ab2ca Rename faketecBoard.cpp to FaketecBoard.cpp 2025-03-25 23:14:48 +01:00
Scott Powell
321a9425da * experiment: enabling forwarding in terminal chat 2025-03-26 03:57:36 +11:00
Scott Powell
88b88cbc90 * ver bump to 1.4.1 2025-03-25 22:02:37 +11:00
Scott Powell
753e6a69dc * flood_advert_interval" now defaults to 3 hours for upgrading nodes (not just fresh install)
* companion: "node_prefs" -> "new_prefs" migration
2025-03-25 20:20:03 +11:00
Scott Powell
d32e641225 * fix for double radio.begin(). RNG seed from pressing ENTER 2025-03-25 17:40:36 +11:00
Scott Powell
1220c69aa9 * wifi power max 2025-03-25 15:13:07 +11:00
Scott Powell
8355543366 * more experiments 2025-03-25 01:26:46 +11:00
Scott Powell
7bd7bfb14a * ESP-NOW experiment with terminal-chat 2025-03-24 21:16:00 +11:00
Scott Powell
f33e1b22b3 * build fixes 2025-03-24 13:11:08 +11:00
ripplebiz
16039eebfb Merge pull request #128 from Noki/xiao-s3-wio-room-server
xiao s3 wio: add room server
2025-03-24 11:59:05 +11:00
ripplebiz
0d9201b560 Merge pull request #127 from jameshall9327/main
Added screen and button support for the lilygo tbeam
2025-03-24 11:55:22 +11:00
ripplebiz
02edc645bb Merge pull request #135 from recrof/dev
LilyGo T-ECHO: report correct battery voltage
2025-03-24 11:48:52 +11:00
recrof
ac71bac4cf cleanup 2025-03-23 18:31:39 +01:00
Rastislav Vysoky
1677d4db65 Merge branch 'ripplebiz:dev' into dev 2025-03-23 18:27:02 +01:00
recrof
0d114ecfbd LilyGo T-ECHO: report correct battery voltage 2025-03-23 15:57:33 +01:00
Scott Powell
edb201ccbe * repeater & room server: "node_prefs" -> "com_prefs" migration 2025-03-24 00:50:28 +11:00
Scott Powell
d07abc39b6 * room server: new config "allow.read.only" 2025-03-24 00:25:36 +11:00
Scott Powell
39a4476194 * repeater & room server: new config "flood.advert.interval" 2025-03-23 23:23:02 +11:00
Scott Powell
7010123619 * companion: CMD_SEND_TXT_MSG fix for attempt number 2025-03-23 20:25:03 +11:00
Scott Powell
f861b68a09 * refactor: ESP32 OTA lib-deps now selectively added 2025-03-23 17:36:31 +11:00
Scott Powell
a4bb3782a4 * OTA update for ESP32 targets 2025-03-22 23:51:44 +11:00
Scott Powell
30c6a0bc76 * workaround for > 3 retry attempts 2025-03-22 22:21:54 +11:00
ripplebiz
2b8b6aacbb Merge pull request #131 from fdlamotte/t1000e_range_fix
Some fixes for range issue
2025-03-22 11:54:10 +11:00
Florent de Lamotte
1ff3033372 Some fixes for range issue 2025-03-21 15:08:13 +01:00
Scott Powell
0163c4034b * faketec/promicro fix 2025-03-21 21:53:53 +11:00
Scott Powell
965e40eb9e * fix for Faketec/Promicro 2025-03-21 21:53:23 +11:00
Scott Powell
bfb4b1c496 * BIG refactor: 'board' and 'radio' objects now defined in 'target.h/.cpp'
* mesh::RTCClock class moved to MeshCore.h
2025-03-21 18:57:12 +11:00
Tobias Schwarz
e1d8179f72 xiao s3 wio: add room server 2025-03-20 16:49:24 +00:00
James Hall
1299b6f813 added button support 2025-03-20 12:26:52 -04:00
James Hall
8b4662a40a removed repeater code not working properly 2025-03-20 11:48:35 -04:00
James Hall
ae08ecf8fd Screen support for tbeam 2025-03-20 11:44:12 -04:00
ripplebiz
0a5a115875 Merge pull request #124 from recrof/dev
added battery voltage support for Heltec T114
2025-03-20 22:22:33 +11:00
recrof
41e01a0e25 added battery voltage support for Heltec T114 2025-03-20 11:08:13 +01:00
ripplebiz
390e8407c0 Merge pull request #123 from oltaco/faketec-support
Faketec display and button support.
2025-03-20 15:27:25 +11:00
Scott Powell
182c6d479d * minor refactor, SNR from packet 2025-03-20 15:26:23 +11:00
taco
de67ee29eb Fix builds for repeater, room server and companion usb. 2025-03-20 12:50:35 +11:00
taco
1c14482bd4 Remove PIN_OLED_RESET from board header, will leave in build target for now. 2025-03-20 10:05:01 +11:00
taco
61f7f15dc1 Changed BLE pin back to 123456 now - dynamic display sensing happening. 2025-03-20 09:46:40 +11:00
taco
bd0ce731f1 Add faketec changes back after dev merge 2025-03-20 09:27:11 +11:00
taco
74ec702136 Merge branch 'dev' into faketec-support 2025-03-20 09:26:23 +11:00
Scott Powell
a9dde51a9b * build.sh: .uf2 step also for Faketec/ProMicro targets 2025-03-19 20:22:46 +11:00
Scott Powell
6a093743d3 * ver bump to v1.4.0 2025-03-19 19:32:07 +11:00
Scott Powell
fd55837eec * companion: CMD_SET_DEVICE_PIN now uint32 param, RESP_CODE_DEVICE_INFO now includes ble_pin 2025-03-19 18:21:35 +11:00
Scott Powell
4aeafbd034 * companion: added CMD_SET_DEVICE_PIN 2025-03-19 17:54:55 +11:00
Scott Powell
089ac96f2b * verify() fix moved to Identity class 2025-03-19 17:30:35 +11:00
Scott Powell
4943b388c0 * workaround for Identity::verify() bug. 2025-03-19 14:31:48 +11:00
Scott Powell
69a6d76b87 * experimental workaround for sig verify() bug 2025-03-19 13:54:43 +11:00
Scott Powell
38667dabb1 * refactored platformio.ini, breaking up into variants/*.ini files 2025-03-18 23:57:04 +11:00
Scott Powell
d21274db41 * TBeam: minor refactor. 2025-03-18 21:34:32 +11:00
ripplebiz
c7f791963e Merge pull request #100 from jameshall9327/main
Added Support for the LilyGo TBeam v1.1 and v1.2 with the SX1276
2025-03-18 21:29:38 +11:00
Scott Powell
50b62c9252 * room server: now handles REQ_TYPE_GET_STATUS, replies with ServerStats (same as RepeaterStats, with extra fields: n_posted, n_post_push) 2025-03-18 16:49:40 +11:00
Scott Powell
f08a30cf24 * companion: RESP_CODE_ERR now has err_code byte 2025-03-18 15:27:55 +11:00
ripplebiz
d15630660b Merge pull request #114 from lincomatic/pr-llcc68
Add ProMicroLLCC68 builds
2025-03-18 13:45:03 +11:00
Scott Powell
13679f9ff1 * CMD_SEND_TRACE_PATH, now replies with RESP_CODE_SENT 2025-03-18 00:14:57 +11:00
Scott Powell
691c135c22 * workaround for TRACE packets so they can follow a return path 2025-03-17 19:35:08 +11:00
Scott Powell
807b9bdc19 * companion support for TRACE packets. (CMD_SEND_TRACE_PATH, PUSH_CODE_TRACE_DATA) 2025-03-17 18:15:38 +11:00
Scott Powell
fe4fdeb236 * redesigned TRACE packet structure 2025-03-17 17:56:12 +11:00
taco
6a78cfd00d match changes to other nrf52 boards, add pin definitions to platformio.ini 2025-03-17 13:51:26 +11:00
taco
f671b753da revert variant.h pins 2025-03-17 13:50:05 +11:00
taco
88dfa42e47 Merge branch 'faketec-testing' into dev 2025-03-17 13:15:54 +11:00
taco
86ece04fe2 move DISPLAY_CLASS definition 2025-03-17 13:09:26 +11:00
taco
d59b1d235e define PIN_OLED_RESET -1 2025-03-17 13:09:02 +11:00
Scott Powell
156741e563 Merge branch 'dev' into trace
# Conflicts:
#	examples/companion_radio/main.cpp
2025-03-17 12:18:27 +11:00
taco
a67bb8e1e3 tidy up 2025-03-17 12:17:36 +11:00
lincomatic
bdeec374ef add ProMicroLLCC68 for Faketec w/ LLCC68 2025-03-16 17:48:52 -07:00
lincomatic
0eed29b99e fix compilation error 2025-03-16 16:49:55 -07:00
Scott Powell
25a68f5ca4 * build fix 2025-03-16 22:11:27 +11:00
ripplebiz
6c434328b5 Merge pull request #111 from recrof/dev
added display support for RAK4631
2025-03-16 21:36:19 +11:00
recrof
882377e4d6 fixed: added back pin inits when SDA and SCL are set. 2025-03-16 10:17:04 +01:00
recrof
d525680b71 added display support for RAK4631, removed Wire.begin(int, int) from nrf52 devices, cosmetic changes 2025-03-16 09:07:21 +01:00
ripplebiz
f700fd5a36 Merge pull request #107 from recrof/dev
heltec v2: added display, room server role
2025-03-16 19:04:38 +11:00
Rastislav Vysoky
32436b953e Merge branch 'ripplebiz:dev' into dev 2025-03-16 07:11:53 +01:00
Scott Powell
81bf4f0a08 * companion: SSD1306 display now dynamically detected at runtime. 2025-03-16 13:42:36 +11:00
taco
8b2f783d04 OLED and button support, some refactoring. 2025-03-16 13:24:43 +11:00
James Hall
395349d208 Merge branch 'dev' into main 2025-03-15 15:10:17 -04:00
recrof
c691cbae8e heltec v2: added display, room server role 2025-03-15 20:10:07 +01:00
James Hall
aeda218402 Update TBeamBoard.h 2025-03-15 13:09:15 -04:00
James Hall
b6990c73bb Merge branch 'ripplebiz:main' into main 2025-03-15 13:03:49 -04:00
ripplebiz
4113b20b4c Merge pull request #105 from recrof/dev
added display support for t3s3
2025-03-15 23:44:09 +11:00
recrof
7ee81f4f07 added display support for t3s3 2025-03-15 13:07:18 +01:00
Scott Powell
31f8576640 * CMD_SIGN_DATA null check 2025-03-15 22:06:57 +11:00
Scott Powell
6056c303c1 * companion: can now sign arbitrary data (up to 8K) 2025-03-15 21:41:44 +11:00
Scott Powell
9aa2edf9ba Merge branch 'dev' into trace
# Conflicts:
#	examples/companion_radio/main.cpp
#	src/Dispatcher.cpp
2025-03-15 15:12:50 +11:00
Scott Powell
27aa7a7bb0 * minor refactor for RAK_4631 SerialInterface 2025-03-15 14:55:52 +11:00
ripplebiz
06c666843e Merge pull request #90 from oltaco/faketec-support
Faketec support
2025-03-15 14:47:18 +11:00
ripplebiz
f844f9e02a Merge pull request #65 from awolden/awolden/h3-pin-fix
Fix heltec v3.2 pin polarity reversal
2025-03-15 12:09:47 +11:00
James Hall
bc6e4930d9 Cleaned up code 2025-03-14 19:54:46 -04:00
taco
6931887424 remove old unused board.json 2025-03-15 10:54:37 +11:00
James Hall
c2f92534df removed unnecessary defines 2025-03-14 14:27:10 -04:00
James Hall
aca0bcc919 removed unnecessary constants 2025-03-14 14:22:13 -04:00
Scott Powell
6a4b7463ef * some fixes around the powerOff(). Tidy ups 2025-03-14 19:08:41 +11:00
ripplebiz
99b376c512 Merge pull request #87 from fdlamotte/t1000e_ui
enhancement on the UI and support for power off and status_led
2025-03-14 18:52:00 +11:00
taco
fbb879600d MAX_GROUP_CHANNELS=8 for faketec 2025-03-14 15:24:58 +11:00
taco
5632e2771e added conditional to room server radio bringup for supporting RA01sh radio on faketec 2025-03-14 15:22:42 +11:00
James Hall
b41d1a56f6 Delete .vscode/settings.json 2025-03-13 20:42:36 -04:00
James Hall
6d8aa5817b removed pmu flag 2025-03-13 20:41:32 -04:00
James Hall
aca3486f88 Update settings.json 2025-03-13 20:35:44 -04:00
ripplebiz
0fe6f79f3c Merge pull request #94 from LitBomb/patch-5
Update faq.md for new EU and UK frequency, additional steps to setup repeater frequency
2025-03-14 11:29:34 +11:00
ripplebiz
87462b20d5 Update README.md 2025-03-14 09:55:48 +11:00
James Hall
2edbd92b3b Added Support for the LilyGo TBeam v1.2 SX1276 2025-03-13 14:07:54 -04:00
fdlamotte
c62f09d92e Merge branch 'ripplebiz:main' into t1000e_ui 2025-03-13 09:44:10 +01:00
taco
9c3b4dd520 added SX126X_RX_BOOSTED_GAIN=1 to faketec target 2025-03-13 17:46:58 +11:00
oltaco
c8104563a0 Merge branch 'ripplebiz:main' into faketec-support 2025-03-13 16:22:02 +11:00
Scott Powell
658094f654 * ver bump: 1.3.0 2025-03-13 13:46:01 +11:00
Scott Powell
38b9834261 * missing param 2025-03-13 13:32:46 +11:00
uncle lit
6b6534ed79 Update faq.md
update UK and EU frequency to 869.525MHz per Andy and Recrof
add steps to set frequency on repeater after flash and before disconnecting USB cable
2025-03-12 10:45:07 -07:00
oltaco
883f591ccd Merge branch 'ripplebiz:main' into faketec-support 2025-03-12 18:31:37 +11:00
fdlamotte
bb826a2634 Merge branch 'ripplebiz:main' into t1000e_ui 2025-03-11 20:38:52 +01:00
Scott Powell
04d85c687f Merge branch 'main' into dev 2025-03-11 20:09:59 +11:00
ripplebiz
9180e5c65f Merge pull request #83 from fdlamotte/configure-cpu-frequency-at-build-time-for-esp32
Add an ESP32_CPU_FREQ build flag to lower freq
2025-03-11 20:06:28 +11:00
Florent de Lamotte
dc4a139f88 resolve conflict 2025-03-11 09:18:50 +01:00
Florent de Lamotte
4a0f4f4b68 set cpu freq in ESP32Board.h 2025-03-11 09:11:14 +01:00
fdlamotte
d367f7d7bb Merge branch 'ripplebiz:main' into configure-cpu-frequency-at-build-time-for-esp32 2025-03-11 09:01:45 +01:00
Scott Powell
b94fed4e4e * companion: channel names 2025-03-11 17:58:12 +11:00
taco
1a21a08845 updated to MIT licensed board variant 2025-03-11 15:38:37 +11:00
Scott Powell
adf9b24867 * companion: channels now persisted. RESP_CODE_DEVICE_INFO now includes MAX_CONTACTS (div 2) and MAX_GROUP_CHANNELS 2025-03-11 15:31:38 +11:00
Scott Powell
8c68dbb6e9 * Companion: new CMD_GET_CHANNEL, CMD_SET_CHANNEL 2025-03-11 14:50:40 +11:00
Scott Powell
f9b2428dcd * BLE_NAME_PREFIX refactor 2025-03-11 13:25:48 +11:00
Scott Powell
8d12cfc9af Merge branch 'main' into dev 2025-03-11 13:20:52 +11:00
Scott Powell
4175be87ab Merge branch 'main' into dev 2025-03-11 13:19:13 +11:00
ripplebiz
7d572cf4e8 Merge pull request #74 from ddmunhoz/add-bool-meshcore-prefix
add: BLE_NAME_PREFIX flag
2025-03-11 13:02:54 +11:00
ripplebiz
877bef5408 Merge pull request #85 from recrof/dev
Enabled sx1262 boosted RX gain for all supported radios + platformio.ini: Made quoted -D flags more readable
2025-03-11 12:54:44 +11:00
ripplebiz
6fe5f9bed4 Merge pull request #71 from fdlamotte/t1000e_txpower
tx_power can be raised to 22dBm on LR1110
2025-03-11 12:43:26 +11:00
ripplebiz
ce55182752 Merge pull request #88 from LitBomb/patch-4
Update faq.md
2025-03-11 12:40:30 +11:00
taco
92bb6a844f added conditional to radio bringup for RA01-SH support on faketec 2025-03-11 09:34:52 +11:00
taco
c1faaf5e82 build fix to support RTC detection code 2025-03-11 09:34:52 +11:00
taco
027b7d83cb Added logic to companion_radio firmware to hopefully fix the radio bringup for Faketec with RA01-SH. 2025-03-11 09:34:52 +11:00
taco
a57053207f Added defines for SX126X_RXEN, SX126X_TXEN.
Updated build target to enable privkey import/export.
2025-03-11 09:34:52 +11:00
taco
8e793dc55e Faketec board support, including build targets 2025-03-11 09:34:52 +11:00
Florent
4cfdb0ef7c better handling of BTN_USER_PRESSED definition 2025-03-10 22:42:52 +01:00
uncle lit
648cdf6945 Update faq.md
update Canada to use USA frequency
add guide to add nodes to map
add guide to do OTA firmware update for nRF devices
update donation links
general text cleanup
2025-03-10 11:52:39 -07:00
Florent de Lamotte
7bb16cd7f3 enhancement on the UI and support for power off and status_led for t1000e 2025-03-10 18:11:15 +01:00
Scott Powell
5c72969e2c * repeater & room server: new CLI config "flood.max" 2025-03-10 23:28:19 +11:00
recrof
20198c9dbf Merge branch 'dev' of github.com:recrof/MeshCore into dev 2025-03-09 23:07:36 +01:00
recrof
de3f11d16c - Enabled sx1262 boosted RX gain for all supported radios
- Made quoted -D flags more readable
2025-03-09 22:57:31 +01:00
Florent
a706d90598 Add an ESP32_CPU_FREQ build flag to lower freq 2025-03-09 15:49:35 +01:00
ripplebiz
676ba6d066 Merge pull request #81 from recrof/dev
roles: t-echo, t114: +room_server; WSL3: +room_server, +repeater
2025-03-10 00:22:33 +11:00
Scott Powell
2cb742b100 ver bump to 1.2.2 2025-03-09 23:46:03 +11:00
Scott Powell
291b98cd56 updating RadioLib to ver 7.1.2 2025-03-09 23:44:34 +11:00
Scott Powell
a259d27cfe * trying setCRC(1) 2025-03-09 22:15:58 +11:00
Scott Powell
3778c0a8ff * repeater and room server: MESH_PACKET_LOGGING, now dumps RAW: rx packet contents
* Dispatcher: MESH_PACKET_LOGGING,  added " hash={packet-hash}"
2025-03-09 20:36:49 +11:00
Rastislav Vysoky
a16393e2d7 Merge branch 'ripplebiz:dev' into dev 2025-03-09 07:16:50 +01:00
Scott Powell
f77a6944f9 * PUSH_CODE_LOG_RX_DATA: is now just: {snr*4},{rssi},{raw-lora-packet} 2025-03-09 17:04:22 +11:00
Scott Powell
8f609524bd * companion: added new PUSH_CODE_LOG_RX_DATA (0x88) for inspecting all received packets 2025-03-09 15:41:32 +11:00
Scott Powell
c49e6ac37b Merge branch 'main' into dev
# Conflicts:
#	platformio.ini
2025-03-09 14:56:39 +11:00
ripplebiz
6771b0e837 Merge pull request #78 from awolden/awolden/enable-SSD13060-lilygo-tlora
Enable SSD1306 display class for LilyGo_TLora_V2_1_1_6
2025-03-09 14:43:54 +11:00
Alex Wolden
3dea712d37 Fix heltec v3.2 pin polarity reversal 2025-03-08 11:21:19 -08:00
Scott Powell
9b5a294695 * T1000e battery measure fix 2025-03-08 20:18:15 +11:00
Rastislav Vysoky
9844296643 Merge branch 'ripplebiz:dev' into dev 2025-03-08 10:05:27 +01:00
Scott Powell
5acfe52417 * new build option: SX126X_RX_BOOSTED_GAIN 2025-03-08 19:59:07 +11:00
Scott Powell
2889867c4c * Dispatcher: added guard for packet payload size too large 2025-03-08 19:38:36 +11:00
Rastislav Vysoky
b1a5badf98 added room server roles to t114 and t-echo; added repeater and room server roles to WSL3; unified json intendations in /boards 2025-03-08 09:15:51 +01:00
ripplebiz
115deda8e8 Merge pull request #70 from recrof/dev
added new board: Station G2; fix: added t114 and t-echo boards to uf2conv release workflow
2025-03-08 15:10:49 +11:00
Scott Powell
87d4285cf1 * doc updates 2025-03-08 13:40:39 +11:00
Bence T.
5089268ef0 Create packet_structure.md
As mentioned by @mofosyne at issue #72
2025-03-08 00:04:43 +01:00
Alex Wolden
37652459a1 Enable SSD1306 display class for LilyGo_TLora_V2_1_1_6 2025-03-07 14:30:11 -08:00
Diego Munhoz
a5fb3acc9b add: BLE_NAME_PREFIX flag 2025-03-07 11:41:53 -06:00
Rastislav Vysoky
acac20dc89 Added basic support for Station G2 2025-03-07 15:34:00 +01:00
Florent de Lamotte
708065a0ba tx_power can be raised to 22dBm on LR1110 2025-03-07 13:52:47 +01:00
Rastislav Vysoky
ae7bf7eae2 Merge branch 'ripplebiz:dev' into dev 2025-03-07 13:42:56 +01:00
Rastislav Vysoky
477f2e1d81 fix: added t114 and t-echo boards to uf2conv release workflow 2025-03-07 13:17:46 +01:00
Scott Powell
808d3933c1 Version bump to v1.2.1 2025-03-07 22:01:30 +11:00
Scott Powell
ae8fb5d9b1 * Heltec v3.2 VEXT fix
* Heltec T114 LED fix, (now flashes with LoRa TX)
2025-03-07 21:37:05 +11:00
Scott Powell
cf17091588 * display.begin() delayed in setup().
* all firmwares now bumped to v1.2.0
2025-03-07 17:19:27 +11:00
Scott Powell
790898dbc5 * companion: better incoming ACK processing (match prev attempts) 2025-03-07 15:09:29 +11:00
Scott Powell
e534e1b529 * companion: FIRMWARE_VER_CODE now bumped to 3.
* companion: new RESP_CODE_CONTACT_MSG_RECV_V3, and _CHANNEL_MSG_RECV_V3. (now with packet SNR included)
2025-03-07 14:17:37 +11:00
Scott Powell
544adec2b6 * refactor Packet::_snr to single byte 2025-03-07 12:32:23 +11:00
Scott Powell
b2fcc692ea * TRACE packet logging fix 2025-03-07 12:24:18 +11:00
Scott Powell
b03aac18c0 Merge branch 'dev' into trace
# Conflicts:
#	src/Dispatcher.cpp
#	src/Mesh.cpp
#	src/helpers/BaseChatMesh.cpp
2025-03-07 12:14:26 +11:00
Scott Powell
1f4a81360b * companion: new command: CMD_GET_CONTACT_BY_KEY (30) 2025-03-07 12:00:11 +11:00
ripplebiz
abb8b54c58 Merge pull request #68 from recrof/dev
Added basic support for Heltec t114, LilyGo T-Echo
2025-03-07 10:22:34 +11:00
Rastislav Vysoky
03458269ac moved nrf sdk headers to ./lib/ and added Repeater envs for t114 & t-echo 2025-03-07 00:16:22 +01:00
Rastislav Vysoky
2dd2571154 Added support for LilyGo T-Echo 2025-03-06 21:39:17 +01:00
Rastislav Vysoky
e105e4184f fix: T114 reset pin value 2025-03-06 21:37:24 +01:00
Rastislav Vysoky
b74ae1302b Added support for Heltec t114 2025-03-06 20:43:56 +01:00
Scott Powell
5c5b9aa2e3 * room server: version bump to v1.1.0. This is now NOT compatible with previous clients (TDeck and companion radio). 2025-03-06 18:36:43 +11:00
Scott Powell
284ac17009 * Room Server post ACK bug fix! 2025-03-06 18:16:48 +11:00
ripplebiz
a3d46a3e8a Merge pull request #62 from awolden/awolden/t3lora
Add LILYGO T-LoRa V2.1-1.6 firmware
2025-03-06 16:33:27 +11:00
Alex Wolden
0fc85b8c59 Revert identity change 2025-03-05 19:38:08 -08:00
Alex Wolden
86389579eb Merge remote-tracking branch 'origin/dev' into awolden/t3lora 2025-03-04 23:23:03 -08:00
Alex Wolden
d36da0ed8e Refactor naming 2025-03-04 22:00:48 -08:00
Alex Wolden
ed320ac1f5 add libsodium 2025-03-04 20:04:19 -08:00
Alex Wolden
21ba6116a3 fix memory 2025-03-04 12:13:45 -08:00
Alex Wolden
1f25575b94 readded 1262 radio 2025-03-04 09:03:36 -08:00
Alex Wolden
b777264eb7 Remove duplicate entries from platformio.ini
- Remove unnecessary T3S3 configurations
- Keep only the LilyGo T3 with SX1276 configurations
- Clean up the platformio.ini file to remove duplication
2025-03-04 00:16:35 -08:00
Alex Wolden
e1022791e8 Add support for LilyGo T3 with SX1276 module
- Add custom partition table for fitting larger firmware
- Create LilyGoT3S3Board.h for board-specific functionality
- Update all example files to support the T3 board with SX1276
- Configure build environment for optimizing firmware size
- Set up the right pin configuration for SX1276 on LilyGo T3
2025-03-04 00:07:36 -08:00
Scott Powell
0db15db625 * new Packet type: PAYLOAD_TYPE_TRACE 2025-02-17 19:22:31 +11:00
638 changed files with 70757 additions and 4582 deletions

84
.clang-format Normal file
View File

@@ -0,0 +1,84 @@
# .clang-format
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: No
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: true
BeforeElse: true
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 110
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
IncludeBlocks: Regroup
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 100000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 2
UseTab: Never
AlignEscapedNewlines: LeftWithLastLine

View File

@@ -0,0 +1,45 @@
{
"name": "MeshCore",
"image": "mcr.microsoft.com/devcontainers/python:3-bookworm",
"features": {
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
"packages": [
"sudo"
]
}
},
"runArgs": [
"--privileged",
"--network=host",
"--volume=/dev/bus/usb:/dev/bus/usb:ro",
// arch tty* is owned by uucp (986)
// debian tty* is owned by dialout (20)
"--group-add=20",
"--group-add=986"
],
"postCreateCommand": {
"platformio": "pipx install platformio"
},
"customizations": {
"vscode": {
"settings": {
"platformio-ide.disablePIOHomeStartup": true,
"editor.formatOnSave": false,
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#0d1a2b",
"titleBar.activeForeground": "#ffffff",
"titleBar.inactiveBackground": "#0d1a2b99",
"titleBar.inactiveForeground": "#ffffff99"
}
},
"extensions": [
"platformio.platformio-ide",
"github.vscode-github-actions",
"GitHub.vscode-pull-request-github"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
}
}

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use nix

36
.github/workflows/github-pages.yml vendored Normal file
View File

@@ -0,0 +1,36 @@
name: Build and deploy Docs site to GitHub Pages
on:
workflow_dispatch:
push:
branches:
- main
permissions:
contents: write
jobs:
github-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
ruby-version: 3.x
- name: Build
run: |
pip install mkdocs-material
mkdocs build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
cname: docs.meshcore.nz
publish_dir: ./site
publish_branch: 'gh-pages'

43
.github/workflows/pr-build-check.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: PR Build Check
on:
pull_request:
branches: [main, dev]
paths:
- 'src/**'
- 'examples/**'
- 'variants/**'
- 'platformio.ini'
- '.github/workflows/pr-build-check.yml'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
environment:
# ESP32-S3 (most common platform)
- Heltec_v3_companion_radio_ble
- Heltec_v3_repeater
- Heltec_v3_room_server
# nRF52
- RAK_4631_companion_radio_ble
- RAK_4631_repeater
- RAK_4631_room_server
# RP2040
- PicoW_repeater
# STM32
- wio-e5-mini_repeater
# ESP32-C6
- LilyGo_Tlora_C6_repeater_
steps:
- name: Clone Repo
uses: actions/checkout@v4
- name: Setup Build Environment
uses: ./.github/actions/setup-build-environment
- name: Build ${{ matrix.environment }}
run: pio run -e ${{ matrix.environment }}

12
.gitignore vendored
View File

@@ -1,6 +1,18 @@
.direnv
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
out/
.direnv/
.DS_Store
.vscode/settings.json
.vscode/extensions.json
.idea
cmake-*
.cache
.ccls
compile_commands.json
.venv/
venv/

1
CNAME Normal file
View File

@@ -0,0 +1 @@
docs.meshcore.nz

114
README.md
View File

@@ -9,7 +9,10 @@ MeshCore provides the ability to create wireless mesh networks, similar to Mesht
## ⚡ Key Features
* Multi-Hop Packet Routing Devices can forward messages across multiple nodes, extending range beyond a single radio's reach. MeshCore supports up to a configurable number of hops to balance network efficiency and prevent excessive traffic.
* Multi-Hop Packet Routing
* Devices can forward messages across multiple nodes, extending range beyond a single radio's reach.
* Supports up to a configurable number of hops to balance network efficiency and prevent excessive traffic.
* Nodes use fixed roles where "Companion" nodes are not repeating messages at all to prevent adverse routing paths from being used.
* Supports LoRa Radios Works with Heltec, RAK Wireless, and other LoRa-based hardware.
* Decentralized & Resilient No central server or internet required; the network is self-healing.
* Low Power Consumption Ideal for battery-powered or solar-powered devices.
@@ -25,45 +28,90 @@ MeshCore provides the ability to create wireless mesh networks, similar to Mesht
## 🚀 How to Get Started
Flash the Firmware: Download the pre-built firmware binary for Heltec V3 and flash it using Adafruit ESPTool.
Install [PlatformIO](https://docs.platformio.org) in Visual Studio Code (optional for developers who want to modify the firmware).
Download & Open the MeshCore repository.
Select a Sample Application: Choose from chat, ping, repeater, or admin test tools.
Monitor & Communicate using the Serial Monitor (e.g., Serial USB Terminal on Android).
- Watch the [MeshCore Intro Video](https://www.youtube.com/watch?v=t1qne8uJBAc) by Andy Kirby.
- Read through our [Frequently Asked Questions](./docs/faq.md) section.
- Flash the MeshCore firmware on a supported device.
- Connect with a supported client.
📁 Included Example Applications
* 📡 Terminal Chat: Secure text communication between devices.
* 📡 Simple Repeater: Extends network coverage by relaying messages.
* 📡 Companion Radio: For use with an external chat app, over BLE or USB.
* 📡 Room Server: A simple BBS server for shared Posts.
* 📡 Ping Client, Ping Server & Client: Basic client/server example.
* 📡 Test Admin: Monitors and manages repeaters remotely.
For developers;
- Install [PlatformIO](https://docs.platformio.org) in [Visual Studio Code](https://code.visualstudio.com).
- Clone and open the MeshCore repository in Visual Studio Code.
- See the example applications you can modify and run:
- [Companion Radio](./examples/companion_radio) - For use with an external chat app, over BLE, USB or WiFi.
- [KISS Modem](./examples/kiss_modem) - Serial KISS protocol bridge for host applications. ([protocol docs](./docs/kiss_modem_protocol.md))
- [Simple Repeater](./examples/simple_repeater) - Extends network coverage by relaying messages.
- [Simple Room Server](./examples/simple_room_server) - A simple BBS server for shared Posts.
- [Simple Secure Chat](./examples/simple_secure_chat) - Secure terminal based text communication between devices.
- [Simple Sensor](./examples/simple_sensor) - Remote sensor node with telemetry and alerting.
The Simple Secure Chat example can be interacted with through the Serial Monitor in Visual Studio Code, or with a Serial USB Terminal on Android.
## ⚡️ MeshCore Flasher
We have prebuilt firmware ready to flash on supported devices.
- Launch https://flasher.meshcore.co.uk
- Select a supported device
- Flash one of the firmware types:
- Companion, Repeater or Room Server
- Once flashing is complete, you can connect with one of the MeshCore clients below.
## 📱 MeshCore Clients
**Companion Firmware**
The companion firmware can be connected to via BLE, USB or WiFi depending on the firmware type you flashed.
- Web: https://app.meshcore.nz
- Android: https://play.google.com/store/apps/details?id=com.liamcottle.meshcore.android
- iOS: https://apps.apple.com/us/app/meshcore/id6742354151?platform=iphone
- NodeJS: https://github.com/liamcottle/meshcore.js
- Python: https://github.com/fdlamotte/meshcore-cli
**Repeater and Room Server Firmware**
The repeater and room server firmwares can be setup via USB in the web config tool.
- https://config.meshcore.dev
They can also be managed via LoRa in the mobile app by using the Remote Management feature.
## 🛠 Hardware Compatibility
MeshCore is designed for use with:
* Heltec V3 LoRa Boards
* RAK4631
* XiaoS3 WIO (sx1262 combo)
* XiaoC3 (plus external sx126x module)
* LilyGo T3S3
* Heltec T114
* Station G2
MeshCore is designed for devices listed in the [MeshCore Flasher](https://flasher.meshcore.co.uk)
## 📜 License
MeshCore is open-source software released under the MIT License. You are free to use, modify, and distribute it for personal and commercial projects.
## Contributing
Please submit PR's using 'dev' as the base branch!
For minor changes just submit your PR and I'll try to review it, but for anything more 'impactful' please open an Issue first and start a discussion. Is better to sound out what it is you want to achieve first, and try to come to a consensus on what the best approach is, especially when it impacts the structure or architecture of this codebase.
Here are some general principals you should try to adhere to:
* Keep it simple. Please, don't think like a high-level lang programmer. Think embedded, and keep code concise, without any unnecessary layers.
* No dynamic memory allocation, except during setup/begin functions.
* Use the same brace and indenting style that's in the core source modules. (A .clang-format is prob going to be added soon, but please do NOT retroactively re-format existing code. This just creates unnecessary diffs that make finding problems harder)
## Road-Map / To-Do
There are a number of fairly major features in the pipeline, with no particular time-frames attached yet. In very rough chronological order:
- [X] Companion radio: UI redesign
- [X] Repeater + Room Server: add ACL's (like Sensor Node has)
- [X] Standardise Bridge mode for repeaters
- [ ] Repeater/Bridge: Standardise the Transport Codes for zoning/filtering
- [X] Core + Repeater: enhanced zero-hop neighbour discovery
- [ ] Core: round-trip manual path support
- [ ] Companion + Apps: support for multiple sub-meshes (and 'off-grid' client repeat mode)
- [ ] Core + Apps: support for LZW message compression
- [ ] Core: dynamic CR (Coding Rate) for weak vs strong hops
- [ ] Core: new framework for hosting multiple virtual nodes on one physical device
- [ ] V2 protocol spec: discussion and consensus around V2 packet protocol, including path hashes, new encryption specs, etc
## 📞 Get Support
Check out the GitHub Issues page to report bugs or request features.
You will be able to find additional guides and components at [my site](https://buymeacoffee.com/ripplebiz), or [join Andy Kirby's Discord](https://discord.gg/GBxVx2JMAy) for discussions.
## RAK Wireless Board Support in PlatformIO
Before building/flashing the RAK4631 targets in this project, there is, unfortunately, some patching you have to do to your platformIO packages to make it work. There is a guide here on the process:
[RAK Wireless: How to Perform Installation of Board Support Package in PlatformIO](https://learn.rakwireless.com/hc/en-us/articles/26687276346775-How-To-Perform-Installation-of-Board-Support-Package-in-PlatformIO)
After building, you will need to convert the output firmware.hex file into a .uf2 file you can copy over to your RAK4631 device (after doing a full erase) by using the command `uf2conv.py -f 0xADA52840 -c firmware.hex` with the python script available from:
[GitHub: Microsoft - uf2](https://github.com/Microsoft/uf2/blob/master/utils/uf2conv.py)
- Report bugs and request features on the [GitHub Issues](https://github.com/ripplebiz/MeshCore/issues) page.
- Find additional guides and components on [my site](https://buymeacoffee.com/ripplebiz).
- Join [MeshCore Discord](https://discord.gg/BMwCtwHj5V) to chat with the developers and get help from the community.

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Ayush Sharma
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,2 @@
AsyncElegantOTA KEYWORD1
begin KEYWORD2

View File

@@ -0,0 +1,9 @@
name=AsyncElegantOTA
version=2.2.8
author=Ayush Sharma
category=Communication
maintainer=Ayush Sharma <asrocks5@gmail.com>
sentence=Perform OTAs for ESP8266 & ESP32 Asynchronously.
paragraph=A User Interface Library which provides interactive elements for your Over the Air Updates on ESP8266/ESP32.
url=https://github.com/ayushsharma82/AsyncElegantOTA
architectures=esp8266,esp32

View File

@@ -0,0 +1,129 @@
#include <AsyncElegantOTA.h>
AsyncElegantOtaClass AsyncElegantOTA;
void AsyncElegantOtaClass::setID(const char* id){
_id = id;
}
void AsyncElegantOtaClass::begin(AsyncWebServer *server, const char* username, const char* password){
_server = server;
if(strlen(username) > 0){
_authRequired = true;
_username = username;
_password = password;
}else{
_authRequired = false;
_username = "";
_password = "";
}
_server->on("/update/identity", HTTP_GET, [&](AsyncWebServerRequest *request){
if(_authRequired){
if(!request->authenticate(_username.c_str(), _password.c_str())){
return request->requestAuthentication();
}
}
#if defined(ESP8266)
request->send(200, "application/json", "{\"id\": \""+_id+"\", \"hardware\": \"ESP8266\"}");
#elif defined(ESP32)
request->send(200, "application/json", "{\"id\": \""+_id+"\", \"hardware\": \"ESP32\"}");
#endif
});
_server->on("/update", HTTP_GET, [&](AsyncWebServerRequest *request){
if(_authRequired){
if(!request->authenticate(_username.c_str(), _password.c_str())){
return request->requestAuthentication();
}
}
AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", ELEGANT_HTML, ELEGANT_HTML_SIZE);
response->addHeader("Content-Encoding", "gzip");
request->send(response);
});
_server->on("/update", HTTP_POST, [&](AsyncWebServerRequest *request) {
if(_authRequired){
if(!request->authenticate(_username.c_str(), _password.c_str())){
return request->requestAuthentication();
}
}
// the request handler is triggered after the upload has finished...
// create the response, add header, and send response
AsyncWebServerResponse *response = request->beginResponse((Update.hasError())?500:200, "text/plain", (Update.hasError())?"FAIL":"OK");
response->addHeader("Connection", "close");
response->addHeader("Access-Control-Allow-Origin", "*");
request->send(response);
restart();
}, [&](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) {
//Upload handler chunks in data
if(_authRequired){
if(!request->authenticate(_username.c_str(), _password.c_str())){
return request->requestAuthentication();
}
}
if (!index) {
if(!request->hasParam("MD5", true)) {
return request->send(400, "text/plain", "MD5 parameter missing");
}
if(!Update.setMD5(request->getParam("MD5", true)->value().c_str())) {
return request->send(400, "text/plain", "MD5 parameter invalid");
}
#if defined(ESP8266)
int cmd = (filename == "filesystem") ? U_FS : U_FLASH;
Update.runAsync(true);
size_t fsSize = ((size_t) &_FS_end - (size_t) &_FS_start);
uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
if (!Update.begin((cmd == U_FS)?fsSize:maxSketchSpace, cmd)){ // Start with max available size
#elif defined(ESP32)
int cmd = (filename == "filesystem") ? U_SPIFFS : U_FLASH;
if (!Update.begin(UPDATE_SIZE_UNKNOWN, cmd)) { // Start with max available size
#endif
Update.printError(Serial);
return request->send(400, "text/plain", "OTA could not begin");
}
}
// Write chunked data to the free sketch space
if(len){
if (Update.write(data, len) != len) {
return request->send(400, "text/plain", "OTA could not begin");
}
}
if (final) { // if the final flag is set then this is the last frame of data
if (!Update.end(true)) { //true to set the size to the current progress
Update.printError(Serial);
return request->send(400, "text/plain", "Could not end OTA");
}
}else{
return;
}
});
}
// deprecated, keeping for backward compatibility
void AsyncElegantOtaClass::loop() {
}
void AsyncElegantOtaClass::restart() {
yield();
delay(1000);
yield();
ESP.restart();
}
String AsyncElegantOtaClass::getID(){
String id = "";
#if defined(ESP8266)
id = String(ESP.getChipId());
#elif defined(ESP32)
id = String((uint32_t)ESP.getEfuseMac(), HEX);
#endif
id.toUpperCase();
return id;
}

View File

@@ -0,0 +1,52 @@
#ifndef AsyncElegantOTA_h
#define AsyncElegantOTA_h
#warning AsyncElegantOTA library is deprecated, Please consider moving to newer ElegantOTA library which now comes with an Async Mode. Learn More: https://docs.elegantota.pro/async-mode/
#include "Arduino.h"
#include "stdlib_noniso.h"
#if defined(ESP8266)
#include "ESP8266WiFi.h"
#include "ESPAsyncTCP.h"
#include "flash_hal.h"
#include "FS.h"
#elif defined(ESP32)
#include "WiFi.h"
#include "AsyncTCP.h"
#include "Update.h"
#include "esp_int_wdt.h"
#include "esp_task_wdt.h"
#endif
#include "Hash.h"
#include "ESPAsyncWebServer.h"
#include "FS.h"
#include "elegantWebpage.h"
class AsyncElegantOtaClass{
public:
void
setID(const char* id),
begin(AsyncWebServer *server, const char* username = "", const char* password = ""),
loop(),
restart();
private:
AsyncWebServer *_server;
String getID();
String _id = getID();
String _username = "";
String _password = "";
bool _authRequired = false;
};
extern AsyncElegantOtaClass AsyncElegantOTA;
#endif

View File

@@ -0,0 +1,38 @@
/**
* @file Hash.h
* @date 20.05.2015
* @author Markus Sattler
*
* Copyright (c) 2015 Markus Sattler. All rights reserved.
* This file is part of the esp8266 core for Arduino environment.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef HASH_H_
#define HASH_H_
//#define DEBUG_SHA1
void sha1(const uint8_t* data, uint32_t size, uint8_t hash[20]);
void sha1(const char* data, uint32_t size, uint8_t hash[20]);
void sha1(const String& data, uint8_t hash[20]);
String sha1(const uint8_t* data, uint32_t size);
String sha1(const char* data, uint32_t size);
String sha1(const String& data);
#endif /* HASH_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,198 @@
"""
Bluefruit BLE Patch Script
Patches Bluefruit library to fix semaphore leak bug that causes device lockup
when BLE central disconnects unexpectedly (e.g., going out of range, supervision timeout).
Patches applied:
1. BLEConnection.h: Add _hvn_qsize member to track semaphore queue size
2. BLEConnection.cpp: Store hvn_qsize and restore semaphore on disconnect
Bug description:
- When a BLE central disconnects unexpectedly (reason=8 supervision timeout),
the BLE_GATTS_EVT_HVN_TX_COMPLETE event may never fire
- This leaves the _hvn_sem counting semaphore in a decremented state
- Since BLEConnection objects are reused (destructor never called), the
semaphore count is never restored
- Eventually all semaphore counts are exhausted and notify() blocks/fails
"""
from pathlib import Path
Import("env") # pylint: disable=undefined-variable
def _patch_ble_connection_header(source: Path) -> bool:
"""
Add _hvn_qsize member variable to BLEConnection class.
This is needed to restore the semaphore to its correct count on disconnect.
Returns True if patch was applied or already applied, False on error.
"""
try:
content = source.read_text()
# Check if already patched
if "_hvn_qsize" in content:
return True # Already patched
# Find the location to insert - after _phy declaration
original_pattern = ''' uint8_t _phy;
uint8_t _role;'''
patched_pattern = ''' uint8_t _phy;
uint8_t _hvn_qsize;
uint8_t _role;'''
if original_pattern not in content:
print("Bluefruit patch: WARNING - BLEConnection.h pattern not found")
return False
content = content.replace(original_pattern, patched_pattern)
source.write_text(content)
# Verify
if "_hvn_qsize" not in source.read_text():
return False
return True
except Exception as e:
print(f"Bluefruit patch: ERROR patching BLEConnection.h: {e}")
return False
def _patch_ble_connection_source(source: Path) -> bool:
"""
Patch BLEConnection.cpp to:
1. Store hvn_qsize in constructor
2. Restore _hvn_sem semaphore to full count on disconnect
Returns True if patch was applied or already applied, False on error.
"""
try:
content = source.read_text()
# Check if already patched (look for the restore loop)
if "uxSemaphoreGetCount(_hvn_sem)" in content:
return True # Already patched
# Patch 1: Store queue size in constructor
constructor_original = ''' _hvn_sem = xSemaphoreCreateCounting(hvn_qsize, hvn_qsize);'''
constructor_patched = ''' _hvn_qsize = hvn_qsize;
_hvn_sem = xSemaphoreCreateCounting(hvn_qsize, hvn_qsize);'''
if constructor_original not in content:
print("Bluefruit patch: WARNING - BLEConnection.cpp constructor pattern not found")
return False
content = content.replace(constructor_original, constructor_patched)
# Patch 2: Restore semaphore on disconnect
disconnect_original = ''' case BLE_GAP_EVT_DISCONNECTED:
// mark as disconnected
_connected = false;
break;'''
disconnect_patched = ''' case BLE_GAP_EVT_DISCONNECTED:
// Restore notification semaphore to full count
// This fixes lockup when disconnect occurs with notifications in flight
while (uxSemaphoreGetCount(_hvn_sem) < _hvn_qsize) {
xSemaphoreGive(_hvn_sem);
}
// Release indication semaphore if waiting
if (_hvc_sem) {
_hvc_received = false;
xSemaphoreGive(_hvc_sem);
}
// mark as disconnected
_connected = false;
break;'''
if disconnect_original not in content:
print("Bluefruit patch: WARNING - BLEConnection.cpp disconnect pattern not found")
return False
content = content.replace(disconnect_original, disconnect_patched)
source.write_text(content)
# Verify
verify_content = source.read_text()
if "uxSemaphoreGetCount(_hvn_sem)" not in verify_content:
return False
if "_hvn_qsize = hvn_qsize" not in verify_content:
return False
return True
except Exception as e:
print(f"Bluefruit patch: ERROR patching BLEConnection.cpp: {e}")
return False
def _apply_bluefruit_patches(target, source, env): # pylint: disable=unused-argument
framework_path = env.get("PLATFORMFW_DIR")
if not framework_path:
framework_path = env.PioPlatform().get_package_dir("framework-arduinoadafruitnrf52")
if not framework_path:
print("Bluefruit patch: ERROR - framework directory not found")
env.Exit(1)
return
framework_dir = Path(framework_path)
bluefruit_lib = framework_dir / "libraries" / "Bluefruit52Lib" / "src"
patch_failed = False
# Patch BLEConnection.h
conn_header = bluefruit_lib / "BLEConnection.h"
if conn_header.exists():
before = conn_header.read_text()
success = _patch_ble_connection_header(conn_header)
after = conn_header.read_text()
if success:
if before != after:
print("Bluefruit patch: OK - Applied BLEConnection.h fix (added _hvn_qsize member)")
else:
print("Bluefruit patch: OK - BLEConnection.h already patched")
else:
print("Bluefruit patch: FAILED - BLEConnection.h")
patch_failed = True
else:
print(f"Bluefruit patch: ERROR - BLEConnection.h not found at {conn_header}")
patch_failed = True
# Patch BLEConnection.cpp
conn_source = bluefruit_lib / "BLEConnection.cpp"
if conn_source.exists():
before = conn_source.read_text()
success = _patch_ble_connection_source(conn_source)
after = conn_source.read_text()
if success:
if before != after:
print("Bluefruit patch: OK - Applied BLEConnection.cpp fix (restore semaphore on disconnect)")
else:
print("Bluefruit patch: OK - BLEConnection.cpp already patched")
else:
print("Bluefruit patch: FAILED - BLEConnection.cpp")
patch_failed = True
else:
print(f"Bluefruit patch: ERROR - BLEConnection.cpp not found at {conn_source}")
patch_failed = True
if patch_failed:
print("Bluefruit patch: CRITICAL - Patch failed! Build aborted.")
env.Exit(1)
# Register the patch to run before build
bluefruit_action = env.VerboseAction(_apply_bluefruit_patches, "Applying Bluefruit BLE patches...")
env.AddPreAction("$BUILD_DIR/${PROGNAME}.elf", bluefruit_action)
# Also run immediately to patch before any compilation
_apply_bluefruit_patches(None, None, env)

View File

@@ -0,0 +1 @@
This is LittleFS from Adafruit, stripped from things that makes it not compile with stm32 (refs to TinyUSB and free_rtos, mostly)

View File

@@ -0,0 +1,10 @@
name=Adafruit Little File System Libraries
version=0.11.0
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=Arduino library for ARM Little File System
paragraph=Arduino library for ARM Little File System
category=Data Storage
url=https://github.com/adafruit/Adafruit_nRF52_Arduino
architectures=*
includes=Adafruit_LittleFS.h

View File

@@ -0,0 +1,273 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Ha Thach for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <Arduino.h>
#include <string.h>
#include "Adafruit_LittleFS.h"
//#include <Adafruit_TinyUSB.h> // for Serial
using namespace Adafruit_LittleFS_Namespace;
#define memclr(buffer, size) memset(buffer, 0, size)
#define varclr(_var) memclr(_var, sizeof(*(_var)))
//--------------------------------------------------------------------+
// Implementation
//--------------------------------------------------------------------+
Adafruit_LittleFS::Adafruit_LittleFS (void)
: Adafruit_LittleFS(NULL)
{
}
Adafruit_LittleFS::Adafruit_LittleFS (struct lfs_config* cfg)
{
varclr(&_lfs);
_lfs_cfg = cfg;
_mounted = false;
// _mutex = xSemaphoreCreateMutexStatic(&this->_MutexStorageSpace);
}
Adafruit_LittleFS::~Adafruit_LittleFS ()
{
}
// Initialize and mount the file system
// Return true if mounted successfully else probably corrupted.
// User should format the disk and try again
bool Adafruit_LittleFS::begin (struct lfs_config * cfg)
{
_lockFS();
bool ret;
// not a loop, just an quick way to short-circuit on error
do {
if (_mounted) { ret = true; break; }
if (cfg) { _lfs_cfg = cfg; }
if (nullptr == _lfs_cfg) { ret = false; break; }
// actually attempt to mount, and log error if one occurs
int err = lfs_mount(&_lfs, _lfs_cfg);
PRINT_LFS_ERR(err);
_mounted = (err == LFS_ERR_OK);
ret = _mounted;
} while(0);
_unlockFS();
return ret;
}
// Tear down and unmount file system
void Adafruit_LittleFS::end(void)
{
_lockFS();
if (_mounted)
{
_mounted = false;
int err = lfs_unmount(&_lfs);
PRINT_LFS_ERR(err);
(void)err;
}
_unlockFS();
}
bool Adafruit_LittleFS::format (void)
{
_lockFS();
int err = LFS_ERR_OK;
bool attemptMount = _mounted;
// not a loop, just an quick way to short-circuit on error
do
{
// if already mounted: umount first -> format -> remount
if (_mounted)
{
_mounted = false;
err = lfs_unmount(&_lfs);
if ( LFS_ERR_OK != err) { PRINT_LFS_ERR(err); break; }
}
err = lfs_format(&_lfs, _lfs_cfg);
if ( LFS_ERR_OK != err ) { PRINT_LFS_ERR(err); break; }
if (attemptMount)
{
err = lfs_mount(&_lfs, _lfs_cfg);
if ( LFS_ERR_OK != err ) { PRINT_LFS_ERR(err); break; }
_mounted = true;
}
// success!
} while(0);
_unlockFS();
return LFS_ERR_OK == err;
}
// Open a file or folder
Adafruit_LittleFS_Namespace::File Adafruit_LittleFS::open (char const *filepath, uint8_t mode)
{
// No lock is required here ... the File() object will synchronize with the mutex provided
return Adafruit_LittleFS_Namespace::File(filepath, mode, *this);
}
// Check if file or folder exists
bool Adafruit_LittleFS::exists (char const *filepath)
{
struct lfs_info info;
_lockFS();
bool ret = (0 == lfs_stat(&_lfs, filepath, &info));
_unlockFS();
return ret;
}
// Create a directory, create intermediate parent if needed
bool Adafruit_LittleFS::mkdir (char const *filepath)
{
bool ret = true;
const char* slash = filepath;
if ( slash[0] == '/' ) slash++; // skip root '/'
_lockFS();
// make intermediate parent directory(ies)
while ( NULL != (slash = strchr(slash, '/')) )
{
char parent[slash - filepath + 1] = { 0 };
memcpy(parent, filepath, slash - filepath);
int rc = lfs_mkdir(&_lfs, parent);
if ( rc != LFS_ERR_OK && rc != LFS_ERR_EXIST )
{
PRINT_LFS_ERR(rc);
ret = false;
break;
}
slash++;
}
// make the final requested directory
if (ret)
{
int rc = lfs_mkdir(&_lfs, filepath);
if ( rc != LFS_ERR_OK && rc != LFS_ERR_EXIST )
{
PRINT_LFS_ERR(rc);
ret = false;
}
}
_unlockFS();
return ret;
}
// Remove a file
bool Adafruit_LittleFS::remove (char const *filepath)
{
_lockFS();
int err = lfs_remove(&_lfs, filepath);
PRINT_LFS_ERR(err);
_unlockFS();
return LFS_ERR_OK == err;
}
// Rename a file
bool Adafruit_LittleFS::rename (char const *oldfilepath, char const *newfilepath)
{
_lockFS();
int err = lfs_rename(&_lfs, oldfilepath, newfilepath);
PRINT_LFS_ERR(err);
_unlockFS();
return LFS_ERR_OK == err;
}
// Remove a folder
bool Adafruit_LittleFS::rmdir (char const *filepath)
{
_lockFS();
int err = lfs_remove(&_lfs, filepath);
PRINT_LFS_ERR(err);
_unlockFS();
return LFS_ERR_OK == err;
}
// Remove a folder recursively
bool Adafruit_LittleFS::rmdir_r (char const *filepath)
{
/* adafruit: lfs is modified to remove non-empty folder,
According to below issue, comment these 2 line won't corrupt filesystem
at least when using LFS v1. If moving to LFS v2, see tracked issue
to see if issues (such as the orphans in threaded linked list) are resolved.
https://github.com/ARMmbed/littlefs/issues/43
*/
_lockFS();
int err = lfs_remove(&_lfs, filepath);
PRINT_LFS_ERR(err);
_unlockFS();
return LFS_ERR_OK == err;
}
//------------- Debug -------------//
#if CFG_DEBUG
const char* dbg_strerr_lfs (int32_t err)
{
switch ( err )
{
case LFS_ERR_OK : return "LFS_ERR_OK";
case LFS_ERR_IO : return "LFS_ERR_IO";
case LFS_ERR_CORRUPT : return "LFS_ERR_CORRUPT";
case LFS_ERR_NOENT : return "LFS_ERR_NOENT";
case LFS_ERR_EXIST : return "LFS_ERR_EXIST";
case LFS_ERR_NOTDIR : return "LFS_ERR_NOTDIR";
case LFS_ERR_ISDIR : return "LFS_ERR_ISDIR";
case LFS_ERR_NOTEMPTY : return "LFS_ERR_NOTEMPTY";
case LFS_ERR_BADF : return "LFS_ERR_BADF";
case LFS_ERR_INVAL : return "LFS_ERR_INVAL";
case LFS_ERR_NOSPC : return "LFS_ERR_NOSPC";
case LFS_ERR_NOMEM : return "LFS_ERR_NOMEM";
default:
static char errcode[10];
sprintf(errcode, "%ld", err);
return errcode;
}
return NULL;
}
#endif

View File

@@ -0,0 +1,102 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Ha Thach for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef ADAFRUIT_LITTLEFS_H_
#define ADAFRUIT_LITTLEFS_H_
#include <Stream.h>
// Internal Flash uses ARM Little FileSystem
// https://github.com/ARMmbed/littlefs
#include "littlefs/lfs.h"
#include "Adafruit_LittleFS_File.h"
//#include "rtos.h" // tied to FreeRTOS for serialization
class Adafruit_LittleFS
{
public:
Adafruit_LittleFS (void);
Adafruit_LittleFS (struct lfs_config* cfg);
virtual ~Adafruit_LittleFS ();
bool begin(struct lfs_config * cfg = NULL);
void end(void);
// Open the specified file/directory with the supplied mode (e.g. read or
// write, etc). Returns a File object for interacting with the file.
// Note that currently only one file can be open at a time.
Adafruit_LittleFS_Namespace::File open (char const *filename, uint8_t mode = Adafruit_LittleFS_Namespace::FILE_O_READ);
// Methods to determine if the requested file path exists.
bool exists (char const *filepath);
// Create the requested directory hierarchy--if intermediate directories
// do not exist they will be created.
bool mkdir (char const *filepath);
// Delete the file.
bool remove (char const *filepath);
// Rename the file.
bool rename (char const *oldfilepath, char const *newfilepath);
// Delete a folder (must be empty)
bool rmdir (char const *filepath);
// Delete a folder (recursively)
bool rmdir_r (char const *filepath);
// format file system
bool format (void);
/*------------------------------------------------------------------*/
/* INTERNAL USAGE ONLY
* Although declare as public, it is meant to be invoked by internal
* code. User should not call these directly
*------------------------------------------------------------------*/
lfs_t* _getFS (void) { return &_lfs; }
void _lockFS (void) { }//xSemaphoreTake(_mutex, portMAX_DELAY); }
void _unlockFS(void) { }//xSemaphoreGive(_mutex); }
protected:
bool _mounted;
struct lfs_config* _lfs_cfg;
lfs_t _lfs;
// SemaphoreHandle_t _mutex;
private:
// StaticSemaphore_t _MutexStorageSpace;
};
#if !CFG_DEBUG
#define VERIFY_LFS(...) _GET_3RD_ARG(__VA_ARGS__, VERIFY_ERR_2ARGS, VERIFY_ERR_1ARGS)(__VA_ARGS__, NULL)
#define PRINT_LFS_ERR(_err)
#else
#define VERIFY_LFS(...) _GET_3RD_ARG(__VA_ARGS__, VERIFY_ERR_2ARGS, VERIFY_ERR_1ARGS)(__VA_ARGS__, dbg_strerr_lfs)
#define PRINT_LFS_ERR(_err) do { if (_err) { VERIFY_MESS((long int)_err, dbg_strerr_lfs); } } while(0) // LFS_ERR are of type int, VERIFY_MESS expects long_int
const char* dbg_strerr_lfs (int32_t err);
#endif
#endif /* ADAFRUIT_LITTLEFS_H_ */

View File

@@ -0,0 +1,420 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Ha Thach for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <Arduino.h>
#include "Adafruit_LittleFS.h"
#include "littlefs/lfs.h"
//--------------------------------------------------------------------+
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
//--------------------------------------------------------------------+
using namespace Adafruit_LittleFS_Namespace;
File::File (Adafruit_LittleFS &fs)
{
_fs = &fs;
_is_dir = false;
_name[0] = 0;
_name[LFS_NAME_MAX] = 0;
_dir_path = NULL;
_dir = NULL;
_file = NULL;
}
File::File (char const *filename, uint8_t mode, Adafruit_LittleFS &fs)
: File(fs)
{
// public constructor calls public API open(), which will obtain the mutex
this->open(filename, mode);
}
bool File::_open_file (char const *filepath, uint8_t mode)
{
int flags = (mode == FILE_O_READ) ? LFS_O_RDONLY :
(mode == FILE_O_WRITE) ? (LFS_O_RDWR | LFS_O_CREAT) : 0;
if ( flags )
{
_file = (lfs_file_t*) malloc(sizeof(lfs_file_t));
if (!_file) return false;
int rc = lfs_file_open(_fs->_getFS(), _file, filepath, flags);
if ( rc )
{
// failed to open
PRINT_LFS_ERR(rc);
// free memory
free(_file);
_file = NULL;
return false;
}
// move to end of file
if ( mode == FILE_O_WRITE ) lfs_file_seek(_fs->_getFS(), _file, 0, LFS_SEEK_END);
_is_dir = false;
}
return true;
}
bool File::_open_dir (char const *filepath)
{
_dir = (lfs_dir_t*) malloc(sizeof(lfs_dir_t));
if (!_dir) return false;
int rc = lfs_dir_open(_fs->_getFS(), _dir, filepath);
if ( rc )
{
// failed to open
PRINT_LFS_ERR(rc);
// free memory
free(_dir);
_dir = NULL;
return false;
}
_is_dir = true;
_dir_path = (char*) malloc(strlen(filepath) + 1);
strcpy(_dir_path, filepath);
return true;
}
bool File::open (char const *filepath, uint8_t mode)
{
bool ret = false;
_fs->_lockFS();
ret = this->_open(filepath, mode);
_fs->_unlockFS();
return ret;
}
bool File::_open (char const *filepath, uint8_t mode)
{
bool ret = false;
// close if currently opened
if ( this->isOpen() ) _close();
struct lfs_info info;
int rc = lfs_stat(_fs->_getFS(), filepath, &info);
if ( LFS_ERR_OK == rc )
{
// file existed, open file or directory accordingly
ret = (info.type == LFS_TYPE_REG) ? _open_file(filepath, mode) : _open_dir(filepath);
}
else if ( LFS_ERR_NOENT == rc )
{
// file not existed, only proceed with FILE_O_WRITE mode
if ( mode == FILE_O_WRITE ) ret = _open_file(filepath, mode);
}
else
{
PRINT_LFS_ERR(rc);
}
// save bare file name
if (ret)
{
char const* splash = strrchr(filepath, '/');
strncpy(_name, splash ? (splash + 1) : filepath, LFS_NAME_MAX);
}
return ret;
}
size_t File::write (uint8_t ch)
{
return write(&ch, 1);
}
size_t File::write (uint8_t const *buf, size_t size)
{
lfs_ssize_t wrcount = 0;
_fs->_lockFS();
if (!this->_is_dir)
{
wrcount = lfs_file_write(_fs->_getFS(), _file, buf, size);
if (wrcount < 0)
{
wrcount = 0;
}
}
_fs->_unlockFS();
return wrcount;
}
int File::read (void)
{
// this thin wrapper relies on called function to synchronize
int ret = -1;
uint8_t ch;
if (read(&ch, 1) > 0)
{
ret = static_cast<int>(ch);
}
return ret;
}
int File::read (void *buf, uint16_t nbyte)
{
int ret = 0;
_fs->_lockFS();
if (!this->_is_dir)
{
ret = lfs_file_read(_fs->_getFS(), _file, buf, nbyte);
}
_fs->_unlockFS();
return ret;
}
int File::peek (void)
{
int ret = -1;
_fs->_lockFS();
if (!this->_is_dir)
{
uint32_t pos = lfs_file_tell(_fs->_getFS(), _file);
uint8_t ch = 0;
if (lfs_file_read(_fs->_getFS(), _file, &ch, 1) > 0)
{
ret = static_cast<int>(ch);
}
(void) lfs_file_seek(_fs->_getFS(), _file, pos, LFS_SEEK_SET);
}
_fs->_unlockFS();
return ret;
}
int File::available (void)
{
int ret = 0;
_fs->_lockFS();
if (!this->_is_dir)
{
uint32_t size = lfs_file_size(_fs->_getFS(), _file);
uint32_t pos = lfs_file_tell(_fs->_getFS(), _file);
ret = size - pos;
}
_fs->_unlockFS();
return ret;
}
bool File::seek (uint32_t pos)
{
bool ret = false;
_fs->_lockFS();
if (!this->_is_dir)
{
ret = lfs_file_seek(_fs->_getFS(), _file, pos, LFS_SEEK_SET) >= 0;
}
_fs->_unlockFS();
return ret;
}
uint32_t File::position (void)
{
uint32_t ret = 0;
_fs->_lockFS();
if (!this->_is_dir)
{
ret = lfs_file_tell(_fs->_getFS(), _file);
}
_fs->_unlockFS();
return ret;
}
uint32_t File::size (void)
{
uint32_t ret = 0;
_fs->_lockFS();
if (!this->_is_dir)
{
ret = lfs_file_size(_fs->_getFS(), _file);
}
_fs->_unlockFS();
return ret;
}
bool File::truncate (uint32_t pos)
{
int32_t ret=LFS_ERR_ISDIR;
_fs->_lockFS();
if (!this->_is_dir)
{
ret = lfs_file_truncate(_fs->_getFS(), _file, pos);
}
_fs->_unlockFS();
return ( ret == 0 );
}
bool File::truncate (void)
{
int32_t ret=LFS_ERR_ISDIR;
uint32_t pos;
_fs->_lockFS();
if (!this->_is_dir)
{
pos = lfs_file_tell(_fs->_getFS(), _file);
ret = lfs_file_truncate(_fs->_getFS(), _file, pos);
}
_fs->_unlockFS();
return ( ret == 0 );
}
void File::flush (void)
{
_fs->_lockFS();
if (!this->_is_dir)
{
lfs_file_sync(_fs->_getFS(), _file);
}
_fs->_unlockFS();
return;
}
void File::close (void)
{
_fs->_lockFS();
this->_close();
_fs->_unlockFS();
}
void File::_close(void)
{
if ( this->isOpen() )
{
if ( this->_is_dir )
{
lfs_dir_close(_fs->_getFS(), _dir);
free(_dir);
_dir = NULL;
if ( this->_dir_path ) free(_dir_path);
_dir_path = NULL;
}
else
{
lfs_file_close(this->_fs->_getFS(), _file);
free(_file);
_file = NULL;
}
}
}
File::operator bool (void)
{
return isOpen();
}
bool File::isOpen(void)
{
return (_file != NULL) || (_dir != NULL);
}
// WARNING -- although marked as `const`, the values pointed
// to may change. For example, if the same File
// object has `open()` called with a different
// file or directory name, this same pointer will
// suddenly (unexpectedly?) have different values.
char const* File::name (void)
{
return this->_name;
}
bool File::isDirectory (void)
{
return this->_is_dir;
}
File File::openNextFile (uint8_t mode)
{
_fs->_lockFS();
File ret(*_fs);
if (this->_is_dir)
{
struct lfs_info info;
int rc;
// lfs_dir_read returns 0 when reaching end of directory, 1 if found an entry
// Skip the "." and ".." entries ...
do
{
rc = lfs_dir_read(_fs->_getFS(), _dir, &info);
} while ( rc == 1 && (!strcmp(".", info.name) || !strcmp("..", info.name)) );
if ( rc == 1 )
{
// string cat name with current folder
char filepath[strlen(_dir_path) + 1 + strlen(info.name) + 1]; // potential for significant stack usage
strcpy(filepath, _dir_path);
if ( !(_dir_path[0] == '/' && _dir_path[1] == 0) ) strcat(filepath, "/"); // only add '/' if cwd is not root
strcat(filepath, info.name);
(void)ret._open(filepath, mode); // return value is ignored ... caller is expected to check isOpened()
}
else if ( rc < 0 )
{
PRINT_LFS_ERR(rc);
}
}
_fs->_unlockFS();
return ret;
}
void File::rewindDirectory (void)
{
_fs->_lockFS();
if (this->_is_dir)
{
lfs_dir_rewind(_fs->_getFS(), _dir);
}
_fs->_unlockFS();
}

View File

@@ -0,0 +1,108 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Ha Thach for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef ADAFRUIT_LITTLEFS_FILE_H_
#define ADAFRUIT_LITTLEFS_FILE_H_
// Forward declaration
class Adafruit_LittleFS;
namespace Adafruit_LittleFS_Namespace
{
// avoid conflict with other FileSystem FILE_READ/FILE_WRITE
enum
{
FILE_O_READ = 0,
FILE_O_WRITE = 1,
};
class File : public Stream
{
public:
File (Adafruit_LittleFS &fs);
File (char const *filename, uint8_t mode, Adafruit_LittleFS &fs);
public:
bool open (char const *filename, uint8_t mode);
//------------- Stream API -------------//
virtual size_t write (uint8_t ch);
virtual size_t write (uint8_t const *buf, size_t size);
size_t write(const char *str) {
if (str == NULL) return 0;
return write((const uint8_t *)str, strlen(str));
}
size_t write(const char *buffer, size_t size) {
return write((const uint8_t *)buffer, size);
}
virtual int read (void);
int read (void *buf, uint16_t nbyte);
virtual int peek (void);
virtual int available (void);
virtual void flush (void);
bool seek (uint32_t pos);
uint32_t position (void);
uint32_t size (void);
bool truncate (uint32_t pos);
bool truncate (void);
void close (void);
operator bool (void);
bool isOpen(void);
char const* name (void);
bool isDirectory (void);
File openNextFile (uint8_t mode = FILE_O_READ);
void rewindDirectory (void);
private:
Adafruit_LittleFS* _fs;
bool _is_dir;
union {
lfs_file_t* _file;
lfs_dir_t* _dir;
};
char* _dir_path;
char _name[LFS_NAME_MAX+1];
bool _open(char const *filepath, uint8_t mode);
bool _open_file(char const *filepath, uint8_t mode);
bool _open_dir (char const *filepath);
void _close(void);
};
}
#endif /* ADAFRUIT_LITTLEFS_FILE_H_ */

View File

@@ -0,0 +1,24 @@
Copyright (c) 2017, Arm Limited. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
- Neither the name of ARM nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,177 @@
## The little filesystem
A little fail-safe filesystem designed for embedded systems.
```
| | | .---._____
.-----. | |
--|o |---| littlefs |
--| |---| |
'-----' '----------'
| | |
```
**Bounded RAM/ROM** - The littlefs is designed to work with a limited amount
of memory. Recursion is avoided and dynamic memory is limited to configurable
buffers that can be provided statically.
**Power-loss resilient** - The littlefs is designed for systems that may have
random power failures. The littlefs has strong copy-on-write guarantees and
storage on disk is always kept in a valid state.
**Wear leveling** - Since the most common form of embedded storage is erodible
flash memories, littlefs provides a form of dynamic wear leveling for systems
that can not fit a full flash translation layer.
## Example
Here's a simple example that updates a file named `boot_count` every time
main runs. The program can be interrupted at any time without losing track
of how many times it has been booted and without corrupting the filesystem:
``` c
#include "lfs.h"
// variables used by the filesystem
lfs_t lfs;
lfs_file_t file;
// configuration of the filesystem is provided by this struct
const struct lfs_config cfg = {
// block device operations
.read = user_provided_block_device_read,
.prog = user_provided_block_device_prog,
.erase = user_provided_block_device_erase,
.sync = user_provided_block_device_sync,
// block device configuration
.read_size = 16,
.prog_size = 16,
.block_size = 4096,
.block_count = 128,
.lookahead = 128,
};
// entry point
int main(void) {
// mount the filesystem
int err = lfs_mount(&lfs, &cfg);
// reformat if we can't mount the filesystem
// this should only happen on the first boot
if (err) {
lfs_format(&lfs, &cfg);
lfs_mount(&lfs, &cfg);
}
// read current count
uint32_t boot_count = 0;
lfs_file_open(&lfs, &file, "boot_count", LFS_O_RDWR | LFS_O_CREAT);
lfs_file_read(&lfs, &file, &boot_count, sizeof(boot_count));
// update boot count
boot_count += 1;
lfs_file_rewind(&lfs, &file);
lfs_file_write(&lfs, &file, &boot_count, sizeof(boot_count));
// remember the storage is not updated until the file is closed successfully
lfs_file_close(&lfs, &file);
// release any resources we were using
lfs_unmount(&lfs);
// print the boot count
printf("boot_count: %d\n", boot_count);
}
```
## Usage
Detailed documentation (or at least as much detail as is currently available)
can be found in the comments in [lfs.h](lfs.h).
As you may have noticed, littlefs takes in a configuration structure that
defines how the filesystem operates. The configuration struct provides the
filesystem with the block device operations and dimensions, tweakable
parameters that tradeoff memory usage for performance, and optional
static buffers if the user wants to avoid dynamic memory.
The state of the littlefs is stored in the `lfs_t` type which is left up
to the user to allocate, allowing multiple filesystems to be in use
simultaneously. With the `lfs_t` and configuration struct, a user can
format a block device or mount the filesystem.
Once mounted, the littlefs provides a full set of POSIX-like file and
directory functions, with the deviation that the allocation of filesystem
structures must be provided by the user.
All POSIX operations, such as remove and rename, are atomic, even in event
of power-loss. Additionally, no file updates are actually committed to the
filesystem until sync or close is called on the file.
## Other notes
All littlefs have the potential to return a negative error code. The errors
can be either one of those found in the `enum lfs_error` in [lfs.h](lfs.h),
or an error returned by the user's block device operations.
In the configuration struct, the `prog` and `erase` function provided by the
user may return a `LFS_ERR_CORRUPT` error if the implementation already can
detect corrupt blocks. However, the wear leveling does not depend on the return
code of these functions, instead all data is read back and checked for
integrity.
If your storage caches writes, make sure that the provided `sync` function
flushes all the data to memory and ensures that the next read fetches the data
from memory, otherwise data integrity can not be guaranteed. If the `write`
function does not perform caching, and therefore each `read` or `write` call
hits the memory, the `sync` function can simply return 0.
## Reference material
[DESIGN.md](DESIGN.md) - DESIGN.md contains a fully detailed dive into how
littlefs actually works. I would encourage you to read it since the
solutions and tradeoffs at work here are quite interesting.
[SPEC.md](SPEC.md) - SPEC.md contains the on-disk specification of littlefs
with all the nitty-gritty details. Can be useful for developing tooling.
## Testing
The littlefs comes with a test suite designed to run on a PC using the
[emulated block device](emubd/lfs_emubd.h) found in the emubd directory.
The tests assume a Linux environment and can be started with make:
``` bash
make test
```
## License
The littlefs is provided under the [BSD-3-Clause](https://spdx.org/licenses/BSD-3-Clause.html)
license. See [LICENSE.md](LICENSE.md) for more information. Contributions to
this project are accepted under the same license.
Individual files contain the following tag instead of the full license text.
SPDX-License-Identifier: BSD-3-Clause
This enables machine processing of license information based on the SPDX
License Identifiers that are here available: http://spdx.org/licenses/
## Related projects
[Mbed OS](https://github.com/ARMmbed/mbed-os/tree/master/features/filesystem/littlefs) -
The easiest way to get started with littlefs is to jump into [Mbed](https://os.mbed.com/),
which already has block device drivers for most forms of embedded storage. The
littlefs is available in Mbed OS as the [LittleFileSystem](https://os.mbed.com/docs/latest/reference/littlefilesystem.html)
class.
[littlefs-fuse](https://github.com/geky/littlefs-fuse) - A [FUSE](https://github.com/libfuse/libfuse)
wrapper for littlefs. The project allows you to mount littlefs directly on a
Linux machine. Can be useful for debugging littlefs if you have an SD card
handy.
[littlefs-js](https://github.com/geky/littlefs-js) - A javascript wrapper for
littlefs. I'm not sure why you would want this, but it is handy for demos.
You can see it in action [here](http://littlefs.geky.net/demo.html).

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,501 @@
/*
* The little filesystem
*
* Copyright (c) 2017, Arm Limited. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef LFS_H
#define LFS_H
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C"
{
#endif
/// Version info ///
// Software library version
// Major (top-nibble), incremented on backwards incompatible changes
// Minor (bottom-nibble), incremented on feature additions
#define LFS_VERSION 0x00010007
#define LFS_VERSION_MAJOR (0xffff & (LFS_VERSION >> 16))
#define LFS_VERSION_MINOR (0xffff & (LFS_VERSION >> 0))
// Version of On-disk data structures
// Major (top-nibble), incremented on backwards incompatible changes
// Minor (bottom-nibble), incremented on feature additions
#define LFS_DISK_VERSION 0x00010001
#define LFS_DISK_VERSION_MAJOR (0xffff & (LFS_DISK_VERSION >> 16))
#define LFS_DISK_VERSION_MINOR (0xffff & (LFS_DISK_VERSION >> 0))
/// Definitions ///
// Type definitions
typedef uint32_t lfs_size_t;
typedef uint32_t lfs_off_t;
typedef int32_t lfs_ssize_t;
typedef int32_t lfs_soff_t;
typedef uint32_t lfs_block_t;
// Max name size in bytes
#ifndef LFS_NAME_MAX
#define LFS_NAME_MAX 255
#endif
// Max file size in bytes
#ifndef LFS_FILE_MAX
#define LFS_FILE_MAX 2147483647
#endif
// Possible error codes, these are negative to allow
// valid positive return values
enum lfs_error {
LFS_ERR_OK = 0, // No error
LFS_ERR_IO = -5, // Error during device operation
LFS_ERR_CORRUPT = -52, // Corrupted
LFS_ERR_NOENT = -2, // No directory entry
LFS_ERR_EXIST = -17, // Entry already exists
LFS_ERR_NOTDIR = -20, // Entry is not a dir
LFS_ERR_ISDIR = -21, // Entry is a dir
LFS_ERR_NOTEMPTY = -39, // Dir is not empty
LFS_ERR_BADF = -9, // Bad file number
LFS_ERR_FBIG = -27, // File too large
LFS_ERR_INVAL = -22, // Invalid parameter
LFS_ERR_NOSPC = -28, // No space left on device
LFS_ERR_NOMEM = -12, // No more memory available
};
// File types
enum lfs_type {
LFS_TYPE_REG = 0x11,
LFS_TYPE_DIR = 0x22,
LFS_TYPE_SUPERBLOCK = 0x2e,
};
// File open flags
enum lfs_open_flags {
// open flags
LFS_O_RDONLY = 1, // Open a file as read only
LFS_O_WRONLY = 2, // Open a file as write only
LFS_O_RDWR = 3, // Open a file as read and write
LFS_O_CREAT = 0x0100, // Create a file if it does not exist
LFS_O_EXCL = 0x0200, // Fail if a file already exists
LFS_O_TRUNC = 0x0400, // Truncate the existing file to zero size
LFS_O_APPEND = 0x0800, // Move to end of file on every write
// internally used flags
LFS_F_DIRTY = 0x10000, // File does not match storage
LFS_F_WRITING = 0x20000, // File has been written since last flush
LFS_F_READING = 0x40000, // File has been read since last flush
LFS_F_ERRED = 0x80000, // An error occured during write
};
// File seek flags
enum lfs_whence_flags {
LFS_SEEK_SET = 0, // Seek relative to an absolute position
LFS_SEEK_CUR = 1, // Seek relative to the current file position
LFS_SEEK_END = 2, // Seek relative to the end of the file
};
// Configuration provided during initialization of the littlefs
struct lfs_config {
// Opaque user provided context that can be used to pass
// information to the block device operations
void *context;
// Read a region in a block. Negative error codes are propogated
// to the user.
int (*read)(const struct lfs_config *c, lfs_block_t block,
lfs_off_t off, void *buffer, lfs_size_t size);
// Program a region in a block. The block must have previously
// been erased. Negative error codes are propogated to the user.
// May return LFS_ERR_CORRUPT if the block should be considered bad.
int (*prog)(const struct lfs_config *c, lfs_block_t block,
lfs_off_t off, const void *buffer, lfs_size_t size);
// Erase a block. A block must be erased before being programmed.
// The state of an erased block is undefined. Negative error codes
// are propogated to the user.
// May return LFS_ERR_CORRUPT if the block should be considered bad.
int (*erase)(const struct lfs_config *c, lfs_block_t block);
// Sync the state of the underlying block device. Negative error codes
// are propogated to the user.
int (*sync)(const struct lfs_config *c);
// Minimum size of a block read. This determines the size of read buffers.
// This may be larger than the physical read size to improve performance
// by caching more of the block device.
lfs_size_t read_size;
// Minimum size of a block program. This determines the size of program
// buffers. This may be larger than the physical program size to improve
// performance by caching more of the block device.
// Must be a multiple of the read size.
lfs_size_t prog_size;
// Size of an erasable block. This does not impact ram consumption and
// may be larger than the physical erase size. However, this should be
// kept small as each file currently takes up an entire block.
// Must be a multiple of the program size.
lfs_size_t block_size;
// Number of erasable blocks on the device.
lfs_size_t block_count;
// Number of blocks to lookahead during block allocation. A larger
// lookahead reduces the number of passes required to allocate a block.
// The lookahead buffer requires only 1 bit per block so it can be quite
// large with little ram impact. Should be a multiple of 32.
lfs_size_t lookahead;
// Optional, statically allocated read buffer. Must be read sized.
void *read_buffer;
// Optional, statically allocated program buffer. Must be program sized.
void *prog_buffer;
// Optional, statically allocated lookahead buffer. Must be 1 bit per
// lookahead block.
void *lookahead_buffer;
// Optional, statically allocated buffer for files. Must be program sized.
// If enabled, only one file may be opened at a time.
void *file_buffer;
};
// Optional configuration provided during lfs_file_opencfg
struct lfs_file_config {
// Optional, statically allocated buffer for files. Must be program sized.
// If NULL, malloc will be used by default.
void *buffer;
};
// File info structure
struct lfs_info {
// Type of the file, either LFS_TYPE_REG or LFS_TYPE_DIR
uint8_t type;
// Size of the file, only valid for REG files
lfs_size_t size;
// Name of the file stored as a null-terminated string
char name[LFS_NAME_MAX+1];
};
/// littlefs data structures ///
typedef struct lfs_entry {
lfs_off_t off;
struct lfs_disk_entry {
uint8_t type;
uint8_t elen;
uint8_t alen;
uint8_t nlen;
union {
struct {
lfs_block_t head;
lfs_size_t size;
} file;
lfs_block_t dir[2];
} u;
} d;
} lfs_entry_t;
typedef struct lfs_cache {
lfs_block_t block;
lfs_off_t off;
uint8_t *buffer;
} lfs_cache_t;
typedef struct lfs_file {
struct lfs_file *next;
lfs_block_t pair[2];
lfs_off_t poff;
lfs_block_t head;
lfs_size_t size;
const struct lfs_file_config *cfg;
uint32_t flags;
lfs_off_t pos;
lfs_block_t block;
lfs_off_t off;
lfs_cache_t cache;
} lfs_file_t;
typedef struct lfs_dir {
struct lfs_dir *next;
lfs_block_t pair[2];
lfs_off_t off;
lfs_block_t head[2];
lfs_off_t pos;
struct lfs_disk_dir {
uint32_t rev;
lfs_size_t size;
lfs_block_t tail[2];
} d;
} lfs_dir_t;
typedef struct lfs_superblock {
lfs_off_t off;
struct lfs_disk_superblock {
uint8_t type;
uint8_t elen;
uint8_t alen;
uint8_t nlen;
lfs_block_t root[2];
uint32_t block_size;
uint32_t block_count;
uint32_t version;
char magic[8];
} d;
} lfs_superblock_t;
typedef struct lfs_free {
lfs_block_t off;
lfs_block_t size;
lfs_block_t i;
lfs_block_t ack;
uint32_t *buffer;
} lfs_free_t;
// The littlefs type
typedef struct lfs {
const struct lfs_config *cfg;
lfs_block_t root[2];
lfs_file_t *files;
lfs_dir_t *dirs;
lfs_cache_t rcache;
lfs_cache_t pcache;
lfs_free_t free;
bool deorphaned;
bool moving;
} lfs_t;
/// Filesystem functions ///
// Format a block device with the littlefs
//
// Requires a littlefs object and config struct. This clobbers the littlefs
// object, and does not leave the filesystem mounted. The config struct must
// be zeroed for defaults and backwards compatibility.
//
// Returns a negative error code on failure.
int lfs_format(lfs_t *lfs, const struct lfs_config *config);
// Mounts a littlefs
//
// Requires a littlefs object and config struct. Multiple filesystems
// may be mounted simultaneously with multiple littlefs objects. Both
// lfs and config must be allocated while mounted. The config struct must
// be zeroed for defaults and backwards compatibility.
//
// Returns a negative error code on failure.
int lfs_mount(lfs_t *lfs, const struct lfs_config *config);
// Unmounts a littlefs
//
// Does nothing besides releasing any allocated resources.
// Returns a negative error code on failure.
int lfs_unmount(lfs_t *lfs);
/// General operations ///
// Removes a file or directory
//
// If removing a directory, the directory must be empty.
// Returns a negative error code on failure.
int lfs_remove(lfs_t *lfs, const char *path);
// Rename or move a file or directory
//
// If the destination exists, it must match the source in type.
// If the destination is a directory, the directory must be empty.
//
// Returns a negative error code on failure.
int lfs_rename(lfs_t *lfs, const char *oldpath, const char *newpath);
// Find info about a file or directory
//
// Fills out the info structure, based on the specified file or directory.
// Returns a negative error code on failure.
int lfs_stat(lfs_t *lfs, const char *path, struct lfs_info *info);
/// File operations ///
// Open a file
//
// The mode that the file is opened in is determined by the flags, which
// are values from the enum lfs_open_flags that are bitwise-ored together.
//
// Returns a negative error code on failure.
int lfs_file_open(lfs_t *lfs, lfs_file_t *file,
const char *path, int flags);
// Open a file with extra configuration
//
// The mode that the file is opened in is determined by the flags, which
// are values from the enum lfs_open_flags that are bitwise-ored together.
//
// The config struct provides additional config options per file as described
// above. The config struct must be allocated while the file is open, and the
// config struct must be zeroed for defaults and backwards compatibility.
//
// Returns a negative error code on failure.
int lfs_file_opencfg(lfs_t *lfs, lfs_file_t *file,
const char *path, int flags,
const struct lfs_file_config *config);
// Close a file
//
// Any pending writes are written out to storage as though
// sync had been called and releases any allocated resources.
//
// Returns a negative error code on failure.
int lfs_file_close(lfs_t *lfs, lfs_file_t *file);
// Synchronize a file on storage
//
// Any pending writes are written out to storage.
// Returns a negative error code on failure.
int lfs_file_sync(lfs_t *lfs, lfs_file_t *file);
// Read data from file
//
// Takes a buffer and size indicating where to store the read data.
// Returns the number of bytes read, or a negative error code on failure.
lfs_ssize_t lfs_file_read(lfs_t *lfs, lfs_file_t *file,
void *buffer, lfs_size_t size);
// Write data to file
//
// Takes a buffer and size indicating the data to write. The file will not
// actually be updated on the storage until either sync or close is called.
//
// Returns the number of bytes written, or a negative error code on failure.
lfs_ssize_t lfs_file_write(lfs_t *lfs, lfs_file_t *file,
const void *buffer, lfs_size_t size);
// Change the position of the file
//
// The change in position is determined by the offset and whence flag.
// Returns the old position of the file, or a negative error code on failure.
lfs_soff_t lfs_file_seek(lfs_t *lfs, lfs_file_t *file,
lfs_soff_t off, int whence);
// Truncates the size of the file to the specified size
//
// Returns a negative error code on failure.
int lfs_file_truncate(lfs_t *lfs, lfs_file_t *file, lfs_off_t size);
// Return the position of the file
//
// Equivalent to lfs_file_seek(lfs, file, 0, LFS_SEEK_CUR)
// Returns the position of the file, or a negative error code on failure.
lfs_soff_t lfs_file_tell(lfs_t *lfs, lfs_file_t *file);
// Change the position of the file to the beginning of the file
//
// Equivalent to lfs_file_seek(lfs, file, 0, LFS_SEEK_CUR)
// Returns a negative error code on failure.
int lfs_file_rewind(lfs_t *lfs, lfs_file_t *file);
// Return the size of the file
//
// Similar to lfs_file_seek(lfs, file, 0, LFS_SEEK_END)
// Returns the size of the file, or a negative error code on failure.
lfs_soff_t lfs_file_size(lfs_t *lfs, lfs_file_t *file);
/// Directory operations ///
// Create a directory
//
// Returns a negative error code on failure.
int lfs_mkdir(lfs_t *lfs, const char *path);
// Open a directory
//
// Once open a directory can be used with read to iterate over files.
// Returns a negative error code on failure.
int lfs_dir_open(lfs_t *lfs, lfs_dir_t *dir, const char *path);
// Close a directory
//
// Releases any allocated resources.
// Returns a negative error code on failure.
int lfs_dir_close(lfs_t *lfs, lfs_dir_t *dir);
// Read an entry in the directory
//
// Fills out the info structure, based on the specified file or directory.
// Returns a negative error code on failure.
int lfs_dir_read(lfs_t *lfs, lfs_dir_t *dir, struct lfs_info *info);
// Change the position of the directory
//
// The new off must be a value previous returned from tell and specifies
// an absolute offset in the directory seek.
//
// Returns a negative error code on failure.
int lfs_dir_seek(lfs_t *lfs, lfs_dir_t *dir, lfs_off_t off);
// Return the position of the directory
//
// The returned offset is only meant to be consumed by seek and may not make
// sense, but does indicate the current position in the directory iteration.
//
// Returns the position of the directory, or a negative error code on failure.
lfs_soff_t lfs_dir_tell(lfs_t *lfs, lfs_dir_t *dir);
// Change the position of the directory to the beginning of the directory
//
// Returns a negative error code on failure.
int lfs_dir_rewind(lfs_t *lfs, lfs_dir_t *dir);
/// Miscellaneous littlefs specific operations ///
// Traverse through all blocks in use by the filesystem
//
// The provided callback will be called with each block address that is
// currently in use by the filesystem. This can be used to determine which
// blocks are in use or how much of the storage is available.
//
// Returns a negative error code on failure.
int lfs_traverse(lfs_t *lfs, int (*cb)(void*, lfs_block_t), void *data);
// Prunes any recoverable errors that may have occured in the filesystem
//
// Not needed to be called by user unless an operation is interrupted
// but the filesystem is still mounted. This is already called on first
// allocation.
//
// Returns a negative error code on failure.
int lfs_deorphan(lfs_t *lfs);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif

View File

@@ -0,0 +1,31 @@
/*
* lfs util functions
*
* Copyright (c) 2017, Arm Limited. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "lfs_util.h"
// Only compile if user does not provide custom config
#ifndef LFS_CONFIG
// Software CRC implementation with small lookup table
void lfs_crc(uint32_t *restrict crc, const void *buffer, size_t size) {
static const uint32_t rtable[16] = {
0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac,
0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c,
0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c,
0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c,
};
const uint8_t *data = buffer;
for (size_t i = 0; i < size; i++) {
*crc = (*crc >> 4) ^ rtable[(*crc ^ (data[i] >> 0)) & 0xf];
*crc = (*crc >> 4) ^ rtable[(*crc ^ (data[i] >> 4)) & 0xf];
}
}
#endif

View File

@@ -0,0 +1,197 @@
/*
* lfs utility functions
*
* Copyright (c) 2017, Arm Limited. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef LFS_UTIL_H
#define LFS_UTIL_H
// Users can override lfs_util.h with their own configuration by defining
// LFS_CONFIG as a header file to include (-DLFS_CONFIG=lfs_config.h).
//
// If LFS_CONFIG is used, none of the default utils will be emitted and must be
// provided by the config file. To start I would suggest copying lfs_util.h and
// modifying as needed.
#ifdef LFS_CONFIG
#define LFS_STRINGIZE(x) LFS_STRINGIZE2(x)
#define LFS_STRINGIZE2(x) #x
#include LFS_STRINGIZE(LFS_CONFIG)
#else
// System includes
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#ifndef LFS_NO_MALLOC
#include <stdlib.h>
#endif
#ifndef LFS_NO_ASSERT
#include <assert.h>
#endif
#if !CFG_DEBUG
#define LFS_NO_DEBUG
#define LFS_NO_WARN
#define LFS_NO_ERROR
#endif
#if !defined(LFS_NO_DEBUG) || !defined(LFS_NO_WARN) || !defined(LFS_NO_ERROR)
#include <stdio.h>
#endif
#ifdef __cplusplus
extern "C"
{
#endif
// Macros, may be replaced by system specific wrappers. Arguments to these
// macros must not have side-effects as the macros can be removed for a smaller
// code footprint
// Logging functions
#ifndef LFS_NO_DEBUG
#define LFS_DEBUG(fmt, ...) \
printf("lfs debug:%d: " fmt "\n", __LINE__, __VA_ARGS__)
#else
#define LFS_DEBUG(fmt, ...)
#endif
#ifndef LFS_NO_WARN
#define LFS_WARN(fmt, ...) \
printf("lfs warn:%d: " fmt "\n", __LINE__, __VA_ARGS__)
#else
#define LFS_WARN(fmt, ...)
#endif
#ifndef LFS_NO_ERROR
#define LFS_ERROR(fmt, ...) \
printf("lfs error:%d: " fmt "\n", __LINE__, __VA_ARGS__)
#else
#define LFS_ERROR(fmt, ...)
#endif
// Runtime assertions
#ifndef LFS_NO_ASSERT
#define LFS_ASSERT(test) assert(test)
#else
#define LFS_ASSERT(test)
#endif
// Builtin functions, these may be replaced by more efficient
// toolchain-specific implementations. LFS_NO_INTRINSICS falls back to a more
// expensive basic C implementation for debugging purposes
// Min/max functions for unsigned 32-bit numbers
static inline uint32_t lfs_max(uint32_t a, uint32_t b) {
return (a > b) ? a : b;
}
static inline uint32_t lfs_min(uint32_t a, uint32_t b) {
return (a < b) ? a : b;
}
// Find the next smallest power of 2 less than or equal to a
static inline uint32_t lfs_npw2(uint32_t a) {
#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM))
return 32 - __builtin_clz(a-1);
#else
uint32_t r = 0;
uint32_t s;
a -= 1;
s = (a > 0xffff) << 4; a >>= s; r |= s;
s = (a > 0xff ) << 3; a >>= s; r |= s;
s = (a > 0xf ) << 2; a >>= s; r |= s;
s = (a > 0x3 ) << 1; a >>= s; r |= s;
return (r | (a >> 1)) + 1;
#endif
}
// Count the number of trailing binary zeros in a
// lfs_ctz(0) may be undefined
static inline uint32_t lfs_ctz(uint32_t a) {
#if !defined(LFS_NO_INTRINSICS) && defined(__GNUC__)
return __builtin_ctz(a);
#else
return lfs_npw2((a & -a) + 1) - 1;
#endif
}
// Count the number of binary ones in a
static inline uint32_t lfs_popc(uint32_t a) {
#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM))
return __builtin_popcount(a);
#else
a = a - ((a >> 1) & 0x55555555);
a = (a & 0x33333333) + ((a >> 2) & 0x33333333);
return (((a + (a >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24;
#endif
}
// Find the sequence comparison of a and b, this is the distance
// between a and b ignoring overflow
static inline int lfs_scmp(uint32_t a, uint32_t b) {
return (int)(unsigned)(a - b);
}
// Convert from 32-bit little-endian to native order
static inline uint32_t lfs_fromle32(uint32_t a) {
#if !defined(LFS_NO_INTRINSICS) && ( \
(defined( BYTE_ORDER ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \
(defined(__BYTE_ORDER ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \
(defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
return a;
#elif !defined(LFS_NO_INTRINSICS) && ( \
(defined( BYTE_ORDER ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \
(defined(__BYTE_ORDER ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \
(defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
return __builtin_bswap32(a);
#else
return (((uint8_t*)&a)[0] << 0) |
(((uint8_t*)&a)[1] << 8) |
(((uint8_t*)&a)[2] << 16) |
(((uint8_t*)&a)[3] << 24);
#endif
}
// Convert to 32-bit little-endian from native order
static inline uint32_t lfs_tole32(uint32_t a) {
return lfs_fromle32(a);
}
// Calculate CRC-32 with polynomial = 0x04c11db7
void lfs_crc(uint32_t *crc, const void *buffer, size_t size);
// Allocate memory, only used if buffers are not provided to littlefs
static inline void *lfs_malloc(size_t size) {
#ifndef LFS_NO_MALLOC
//extern void *pvPortMalloc( size_t xWantedSize );
//return pvPortMalloc(size);
return malloc(size);
#else
(void)size;
return NULL;
#endif
}
// Deallocate memory, only used if buffers are not provided to littlefs
static inline void lfs_free(void *p) {
#ifndef LFS_NO_MALLOC
//extern void vPortFree( void *pv );
//vPortFree(p);
free(p);
#else
(void)p;
#endif
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif
#endif

10
arch/stm32/build_hex.py Normal file
View File

@@ -0,0 +1,10 @@
Import("env")
# Make custom HEX from ELF
env.AddPostAction(
"$BUILD_DIR/${PROGNAME}.elf",
env.VerboseAction(" ".join([
"$OBJCOPY", "-O", "ihex", "-R", ".eeprom",
'"$BUILD_DIR/${PROGNAME}.elf"', '"$BUILD_DIR/${PROGNAME}.hex"'
]), "Building $BUILD_DIR/${PROGNAME}.hex")
)

View File

@@ -0,0 +1,39 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld"
},
"core": "esp32",
"extra_flags": [
"-D ARDUINO_USB_CDC_ON_BOOT=0",
"-D ARDUINO_USB_MSC_ON_BOOT=0",
"-D ARDUINO_USB_DFU_ON_BOOT=0",
"-D ARDUINO_USB_MODE=0",
"-D ARDUINO_RUNNING_CORE=1",
"-D ARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [["0x303A", "0x1001"]],
"mcu": "esp32s3",
"variant": "ESP32-S3-WROOM-1-N4"
},
"connectivity": ["wifi", "bluetooth"],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": ["esp-builtin"],
"openocd_target": "esp32s3.cfg"
},
"frameworks": ["arduino", "espidf"],
"name": "ESP32-S3-WROOM-1-N4 (4 MB Flash, No PSRAM)",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 524288,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 921600
},
"url": "https://www.espressif.com/sites/default/files/documentation/esp32-s3-wroom-1_wroom-1u_datasheet_en.pdf",
"vendor": "Espressif"
}

45
boards/ebyte_eora-s3.json Normal file
View File

@@ -0,0 +1,45 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"partitions": "default.csv",
"memory_type": "qio_qspi"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_LILYGO_T3_S3_V1_X",
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1",
"-DARDUINO_USB_MODE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Ebyte EoRa-S3-XXXTB Radio",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 460800
},
"url": "https://www.cdebyte.com/products/EoRa-S3-900TB",
"vendor": "Chengdu Ebyte Electronic Technology Co., Ltd"
}

40
boards/esp32-s3-zero.json Normal file
View File

@@ -0,0 +1,40 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld"
},
"core": "esp32",
"extra_flags": [
"-D ARDUINO_USB_CDC_ON_BOOT=1",
"-D ARDUINO_USB_MSC_ON_BOOT=0",
"-D ARDUINO_USB_DFU_ON_BOOT=0",
"-D ARDUINO_USB_MODE=1",
"-D ARDUINO_RUNNING_CORE=1",
"-D ARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [["0x303A", "0x1001"]],
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": ["wifi", "bluetooth"],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": ["esp-builtin"],
"openocd_target": "esp32s3.cfg"
},
"frameworks": ["arduino", "espidf"],
"name": "ESP32-S3-Zero",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 921600
},
"url": "https://www.espressif.com",
"vendor": "Espressif"
}

44
boards/heltec_e213.json Normal file
View File

@@ -0,0 +1,44 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"partitions": "default_16MB.csv",
"memory_type": "qio_opi"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"psram_type": "opi",
"hwids": [
["0x303A", "0x1001"],
["0x303A", "0x0002"]
],
"mcu": "esp32s3",
"variant": "heltec_vision_master_e213"
},
"connectivity": ["wifi", "bluetooth", "lora"],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": ["arduino", "espidf"],
"name": "Heltec Vision Master E213",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 8388608,
"maximum_size": 16777216,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 921600
},
"url": "https://heltec.org/project/vision-master-e213/",
"vendor": "Heltec"
}

44
boards/heltec_e290.json Normal file
View File

@@ -0,0 +1,44 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"partitions": "default_16MB.csv",
"memory_type": "qio_opi"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"psram_type": "opi",
"hwids": [
["0x303A", "0x1001"],
["0x303A", "0x0002"]
],
"mcu": "esp32s3",
"variant": "heltec_vision_master_e290"
},
"connectivity": ["wifi", "bluetooth", "lora"],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": ["arduino", "espidf"],
"name": "Heltec Vision Master E290",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 8388608,
"maximum_size": 16777216,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 921600
},
"url": "https://heltec.org/project/vision-master-e290/",
"vendor": "Heltec"
}

View File

@@ -0,0 +1,53 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
["0x239A", "0x4405"],
["0x239A", "0x0029"],
["0x239A", "0x002A"]
],
"usb_product": "HT-n5262",
"mcu": "nrf52840",
"variant": "heltec_mesh_pocket",
"variants_dir": "variants",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": ["jlink"],
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": ["arduino"],
"name": "Heltec nrf (Adafruit BSP)",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://heltec.org/project/meshpocket/",
"vendor": "Heltec"
}

View File

@@ -0,0 +1,61 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
["0x239A","0x8029"],
["0x239A","0x0029"],
["0x239A","0x002A"],
["0x239A","0x802A"]
],
"usb_product": "HT-n5262",
"mcu": "nrf52840",
"variant": "heltec_mesh_solar",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52.cfg"
},
"frameworks": [
"arduino"
],
"name": "Heltec Mesh Solar Board",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://heltec.org/",
"vendor": "Heltec"
}

61
boards/heltec_t114.json Normal file
View File

@@ -0,0 +1,61 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
["0x239A","0x8029"],
["0x239A","0x0029"],
["0x239A","0x002A"],
["0x239A","0x802A"]
],
"usb_product": "HT-n5262",
"mcu": "nrf52840",
"variant": "Heltec_T114_Board",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52.cfg"
},
"frameworks": [
"arduino"
],
"name": "Heltec T114 Board",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://heltec.org/",
"vendor": "Heltec"
}

44
boards/heltec_t190.json Normal file
View File

@@ -0,0 +1,44 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"partitions": "default_16MB.csv",
"memory_type": "qio_opi"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"psram_type": "opi",
"hwids": [
["0x303A", "0x1001"],
["0x303A", "0x0002"]
],
"mcu": "esp32s3",
"variant": "heltec_vision_master_t190"
},
"connectivity": ["wifi", "bluetooth", "lora"],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": ["arduino", "espidf"],
"name": "Heltec Vision Master T190",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 8388608,
"maximum_size": 16777216,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 921600
},
"url": "https://heltec.org/project/vision-master-t190/",
"vendor": "Heltec"
}

View File

@@ -0,0 +1,40 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"partitions": "default_8MB.csv"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [["0x303A", "0x1001"]],
"mcu": "esp32s3",
"variant": "heltec_tracker_v2"
},
"connectivity": ["wifi", "bluetooth", "lora"],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": ["esp-builtin"],
"openocd_target": "esp32s3.cfg"
},
"frameworks": ["arduino", "espidf"],
"name": "heltec_tracker v2",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 921600
},
"url": "https://heltec.org/",
"vendor": "heltec"
}

43
boards/heltec_v4.json Normal file
View File

@@ -0,0 +1,43 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"partitions": "default_16MB.csv",
"memory_type": "qio_qspi"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"psram_type": "qspi",
"hwids": [["0x303A", "0x1001"]],
"mcu": "esp32s3",
"variant": "heltec_v4"
},
"connectivity": ["wifi", "bluetooth", "lora"],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": ["esp-builtin"],
"openocd_target": "esp32s3.cfg"
},
"frameworks": ["arduino", "espidf"],
"name": "heltec_wifi_lora_32 v4 (16 MB FLASH, 2 MB PSRAM)",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 2097152,
"maximum_size": 16777216,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 921600
},
"url": "https://heltec.org/",
"vendor": "heltec"
}

79
boards/keepteen_lt1.json Normal file
View File

@@ -0,0 +1,79 @@
{
"build": {
"arduino":{
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x00B3"
],
[
"0x239A",
"0x8029"
],
[
"0x239A",
"0x0029"
],
[
"0x239A",
"0x002A"
],
[
"0x239A",
"0x802A"
]
],
"usb_product": "Keepteen LT1",
"mcu": "nrf52840",
"variant": "Keepteen LT1",
"variants_dir": "variants",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52.cfg"
},
"frameworks": [
"arduino",
"zephyr"
],
"name": "Keepteen LT1",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "http://www.keepteen.com/",
"vendor": "Keepteen"
}

74
boards/meshtiny.json Normal file
View File

@@ -0,0 +1,74 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x8029"
],
[
"0x239A",
"0x0029"
],
[
"0x239A",
"0x002A"
],
[
"0x239A",
"0x802A"
]
],
"usb_product": "Meshtiny",
"mcu": "nrf52840",
"variant": "meshtiny",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52840-mdk-rs"
},
"frameworks": [
"arduino",
"freertos"
],
"name": "Meshtiny",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://shop.mtoolstec.com/product/meshtiny",
"vendor": "MTools Tec"
}

View File

@@ -0,0 +1,59 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v7.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_WIO_WM1110 -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
["0x239A", "0x8029"],
["0x239A", "0x0029"],
["0x239A", "0x002A"],
["0x239A", "0x802A"]
],
"usb_product": "me25ls01-BOOT",
"mcu": "nrf52840",
"variant": "minewsemi_me25ls01",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "7.3.0",
"sd_fwid": "0x0123"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52.cfg"
},
"frameworks": ["arduino"],
"name": "Minewsemi ME25LS01",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink",
"cmsis-dap",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://en.minewsemi.com/lora-module/lr1110-nrf52840-me25LS01",
"vendor": "MINEWSEMI"
}

73
boards/nano-g2-ultra.json Normal file
View File

@@ -0,0 +1,73 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x8029"
],
[
"0x239A",
"0x0029"
],
[
"0x239A",
"0x002A"
],
[
"0x239A",
"0x802A"
]
],
"usb_product": "BQ nRF52840",
"mcu": "nrf52840",
"variant": "nano-g2-ultra",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52.cfg"
},
"frameworks": [
"arduino"
],
"name": "BQ nRF52840",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://wiki.uniteng.com/en/meshtastic/nano-g2-ultra",
"vendor": "BQ Consulting"
}

View File

@@ -0,0 +1,38 @@
/* Linker script to configure memory regions. */
SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)
MEMORY
{
FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xED000 - 0x26000
/* SRAM required by Softdevice depend on
* - Attribute Table Size (Number of Services and Characteristics)
* - Vendor UUID count
* - Max ATT MTU
* - Concurrent connection peripheral + central + secure links
* - Event Len, HVN queue, Write CMD queue
*/
RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000
}
SECTIONS
{
. = ALIGN(4);
.svc_data :
{
PROVIDE(__start_svc_data = .);
KEEP(*(.svc_data))
PROVIDE(__stop_svc_data = .);
} > RAM
.fs_data :
{
PROVIDE(__start_fs_data = .);
KEEP(*(.fs_data))
PROVIDE(__stop_fs_data = .);
} > RAM
} INSERT AFTER .data;
INCLUDE "nrf52_common.ld"

View File

@@ -0,0 +1,38 @@
/* Linker script to configure memory regions. */
SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)
MEMORY
{
FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xD4000 - 0x26000
/* SRAM required by Softdevice depend on
* - Attribute Table Size (Number of Services and Characteristics)
* - Vendor UUID count
* - Max ATT MTU
* - Concurrent connection peripheral + central + secure links
* - Event Len, HVN queue, Write CMD queue
*/
RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000
}
SECTIONS
{
. = ALIGN(4);
.svc_data :
{
PROVIDE(__start_svc_data = .);
KEEP(*(.svc_data))
PROVIDE(__stop_svc_data = .);
} > RAM
.fs_data :
{
PROVIDE(__start_fs_data = .);
KEEP(*(.fs_data))
PROVIDE(__stop_fs_data = .);
} > RAM
} INSERT AFTER .data;
INCLUDE "nrf52_common.ld"

View File

@@ -0,0 +1,38 @@
/* Linker script to configure memory regions. */
SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)
MEMORY
{
FLASH (rx) : ORIGIN = 0x27000, LENGTH = 0xD4000 - 0x27000
/* SRAM required by Softdevice depend on
* - Attribute Table Size (Number of Services and Characteristics)
* - Vendor UUID count
* - Max ATT MTU
* - Concurrent connection peripheral + central + secure links
* - Event Len, HVN queue, Write CMD queue
*/
RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000
}
SECTIONS
{
. = ALIGN(4);
.svc_data :
{
PROVIDE(__start_svc_data = .);
KEEP(*(.svc_data))
PROVIDE(__stop_svc_data = .);
} > RAM
.fs_data :
{
PROVIDE(__start_fs_data = .);
KEEP(*(.fs_data))
PROVIDE(__stop_fs_data = .);
} > RAM
} INSERT AFTER .data;
INCLUDE "nrf52_common.ld"

View File

@@ -0,0 +1,79 @@
{
"build": {
"arduino":{
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x00B3"
],
[
"0x239A",
"0x8029"
],
[
"0x239A",
"0x0029"
],
[
"0x239A",
"0x002A"
],
[
"0x239A",
"0x802A"
]
],
"usb_product": "ProMicro NRF52840",
"mcu": "nrf52840",
"variant": "promicro_nrf52840",
"variants_dir": "variants",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52.cfg"
},
"frameworks": [
"arduino",
"zephyr"
],
"name": "ProMicro NRF52840",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://www.nologo.tech/en/product/otherboard/NRF52840.html",
"vendor": "Nologo"
}

33
boards/rak3172.json Normal file
View File

@@ -0,0 +1,33 @@
{
"build": {
"arduino": {
"variant_h": "variant_RAK3172_MODULE.h"
},
"core": "stm32",
"cpu": "cortex-m4",
"extra_flags": "-DSTM32WL -DSTM32WLxx -DSTM32WLE5xx",
"framework_extra_flags": {
"arduino": "-DUSE_CM4_STARTUP_FILE -DARDUINO_RAK3172_MODULE"
},
"f_cpu": "48000000L",
"mcu": "stm32wle5ccu",
"product_line": "STM32WLE5xx",
"variant": "STM32WLxx/WL54CCU_WL55CCU_WLE4C(8-B-C)U_WLE5C(8-B-C)U"
},
"debug": {
"default_tools": ["stlink"],
"jlink_device": "STM32WLE5CC",
"openocd_target": "stm32wlx",
"svd_path": "STM32WLE5_CM4.svd"
},
"frameworks": ["arduino"],
"name": "BB-STM32WL",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 262144,
"protocol": "stlink",
"protocols": ["stlink", "jlink"]
},
"url": "https://store.rakwireless.com/products/wisduo-lpwan-module-rak3172",
"vendor": "RAK"
}

72
boards/rak3401.json Normal file
View File

@@ -0,0 +1,72 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x8029"
],
[
"0x239A",
"0x0029"
],
[
"0x239A",
"0x002A"
],
[
"0x239A",
"0x802A"
]
],
"usb_product": "WisCore RAK3401 Board",
"mcu": "nrf52840",
"variant": "WisCore_RAK3401_Board",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd"
},
"frameworks": [
"arduino"
],
"name": "WisCore RAK3401 Board",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://www.rakwireless.com",
"vendor": "RAKwireless"
}

72
boards/rak4631.json Normal file
View File

@@ -0,0 +1,72 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x8029"
],
[
"0x239A",
"0x0029"
],
[
"0x239A",
"0x002A"
],
[
"0x239A",
"0x802A"
]
],
"usb_product": "WisCore RAK4631 Board",
"mcu": "nrf52840",
"variant": "WisCore_RAK4631_Board",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd"
},
"frameworks": [
"arduino"
],
"name": "WisCore RAK4631 Board",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://www.rakwireless.com",
"vendor": "RAKwireless"
}

View File

@@ -0,0 +1,62 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v7.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_SEEED_WIO_TRACKER_L1 -DNRF52840_XXAA -DSEEED_WIO_TRACKER_L1 ",
"f_cpu": "64000000L",
"hwids": [
[ "0x2886", "0x1667" ],
[ "0x2886", "0x1668" ]
],
"mcu": "nrf52840",
"variant": "Seeed_Wio_Tracker_L1",
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "7.3.0",
"sd_fwid": "0x0123"
},
"bsp": {
"name": "adafruit"
},
"bootloader": {
"settings_addr": "0xFF000"
},
"usb_product": "Seeed Wio Tracker L1"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"openocd_target": "nrf52.cfg",
"svd_path": "nrf52840.svd"
},
"frameworks": [
"arduino"
],
"name": "Seeed Wio Tracker L1",
"upload": {
"maximum_ram_size": 237568,
"maximum_size": 811008,
"protocol": "nrfutil",
"speed": 115200,
"protocols": [
"jlink",
"stlink",
"nrfjprog",
"nrfutil",
"cmsis-dap",
"sam-ba",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://wiki.seeedstudio.com/wio_tracker_l1_node/",
"vendor": "Seeed Studio"
}

View File

@@ -0,0 +1,61 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v7.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_Seeed_XIAO_nRF52840 -DNRF52840_XXAA -DSEEED_XIAO_NRF52840 ",
"f_cpu": "64000000L",
"hwids": [
[ "0x2886", "0x8044" ],
[ "0x2886", "0x0044" ]
],
"mcu": "nrf52840",
"variant": "Seeed_XIAO_nRF52840",
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "7.3.0",
"sd_fwid": "0x0123"
},
"bsp": {
"name": "adafruit"
},
"bootloader": {
"settings_addr": "0xFF000"
},
"usb_product": "XIAO nRF52840"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"openocd_target": "nrf52.cfg",
"svd_path": "nrf52840.svd"
},
"frameworks": [
"arduino"
],
"name": "Seeed Studio XIAO nRF52840",
"upload": {
"maximum_ram_size": 237568,
"maximum_size": 811008,
"protocol": "nrfutil",
"speed": 115200,
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"cmsis-dap",
"sam-ba",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://wiki.seeedstudio.com/XIAO_BLE",
"vendor": "Seeed Studio"
}

View File

@@ -0,0 +1,60 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v7.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_Seeed_XIAO_nRF52840 -DNRF52840_XXAA -DSEEED_XIAO_NRF52840 ",
"f_cpu": "64000000L",
"hwids": [
[ "0x2886", "0x0059" ]
],
"mcu": "nrf52840",
"variant": "Seeed_XIAO_nRF52840",
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "7.3.0",
"sd_fwid": "0x0123"
},
"bsp": {
"name": "adafruit"
},
"bootloader": {
"settings_addr": "0xFF000"
},
"usb_product": "XIAO nRF52840"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"openocd_target": "nrf52.cfg",
"svd_path": "nrf52840.svd"
},
"frameworks": [
"arduino"
],
"name": "Seeed Studio XIAO nRF52840",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"protocol": "nrfutil",
"speed": 115200,
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"cmsis-dap",
"sam-ba",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://wiki.seeedstudio.com/meshtastic_solar_node/",
"vendor": "Seeed Studio"
}

43
boards/station-g2.json Normal file
View File

@@ -0,0 +1,43 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_opi"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=0"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [["0x303A", "0x1001"]],
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": [
"wifi"
],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": ["esp-builtin"],
"openocd_target": "esp32s3.cfg"
},
"frameworks": ["arduino", "espidf"],
"name": "BQ Station G2",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
"maximum_size": 16777216,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 921600
},
"url": "https://wiki.uniteng.com/en/meshtastic/station-g2",
"vendor": "BQ Consulting"
}

38
boards/t-deck.json Normal file
View File

@@ -0,0 +1,38 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"partitions": "default_16MB.csv",
"memory_type": "qio_opi"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_USB_MODE=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [["0x303A", "0x1001"]],
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": ["wifi", "bluetooth"],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": ["esp-builtin"],
"openocd_target": "esp32s3.cfg"
},
"frameworks": ["arduino", "espidf"],
"name": "LilyGo T-Deck (16M Flash 8M PSRAM)",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
"maximum_size": 16777216,
"require_upload_port": true,
"speed": 921600
},
"url": "https://www.lilygo.cc",
"vendor": "LilyGo"
}

63
boards/t-echo.json Normal file
View File

@@ -0,0 +1,63 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_PCA10056 -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x8029"
]
],
"usb_product": "NRF52 DK",
"mcu": "nrf52840",
"variant": "pca10056",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": [
"jlink"
],
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52.cfg"
},
"frameworks": [
"arduino"
],
"name": "LilyGo T-ECHO",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"require_upload_port": true,
"speed": 115200,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"cmsis-dap",
"blackmagic"
]
},
"url": "https://os.mbed.com/platforms/Nordic-nRF52840-DK/",
"vendor": "Nordic"
}

View File

@@ -1,45 +1,45 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"partitions": "default.csv",
"memory_type": "qio_qspi"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_LILYGO_T3_S3_V1_X",
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1",
"-DARDUINO_USB_MODE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3"
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"partitions": "default.csv",
"memory_type": "qio_qspi"
},
"connectivity": [
"wifi"
"core": "esp32",
"extra_flags": [
"-DARDUINO_LILYGO_T3_S3_V1_X",
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1",
"-DARDUINO_USB_MODE=1"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "LilyGo T3-S3 Radio",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 460800
},
"url": "https://www.lilygo.cc",
"vendor": "LilyGo"
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "LilyGo T3-S3 Radio",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 460800
},
"url": "https://www.lilygo.cc",
"vendor": "LilyGo"
}

50
boards/t_beam_1w.json Normal file
View File

@@ -0,0 +1,50 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_opi"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DLILYGO_TBEAM_1W",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"psram_type": "opi",
"hwids": [
[
"0x303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "lilygo_tbeam_1w"
},
"connectivity": [
"wifi",
"bluetooth",
"lora"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino"
],
"name": "LilyGo TBeam-1W",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
"maximum_size": 16777216,
"require_upload_port": true,
"speed": 921600
},
"url": "http://www.lilygo.cn/",
"vendor": "LilyGo"
}

View File

@@ -0,0 +1,51 @@
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld",
"partitions": "default.csv",
"memory_type": "qio_qspi"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_USB_MODE=1",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
[
"0x303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": [
"wifi"
],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": [
"esp-builtin"
],
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "LilyGo T-Beam supreme (8MB Flash 8MB PSRAM)",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 8388608,
"maximum_size": 8388608,
"require_upload_port": true,
"speed": 460800
},
"url": "https://www.lilygo.cc/products/t-beamsupreme-m",
"vendor": "LilyGo"
}

72
boards/thinknode_m1.json Normal file
View File

@@ -0,0 +1,72 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_TTGO_EINK -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x4405"
],
[
"0x239A",
"0x0029"
],
[
"0x239A",
"0x002A"
]
],
"usb_product": "elecrow_eink",
"mcu": "nrf52840",
"variant": "ELECROW-ThinkNode-M1",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": [
"jlink"
],
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52.cfg"
},
"frameworks": [
"arduino"
],
"name": "elecrow eink",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink"
]
},
"url": "https://github.com/Elecrow-RD",
"vendor": "ELECROW"
}

72
boards/thinknode_m3.json Normal file
View File

@@ -0,0 +1,72 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x4405"
],
[
"0x239A",
"0x0029"
],
[
"0x239A",
"0x002A"
]
],
"usb_product": "elecrow_eink",
"mcu": "nrf52840",
"variant": "ELECROW-ThinkNode-M3",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": [
"jlink"
],
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52.cfg"
},
"frameworks": [
"arduino"
],
"name": "elecrow nrf",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink"
]
},
"url": "https://github.com/Elecrow-RD",
"vendor": "ELECROW"
}

72
boards/thinknode_m6.json Normal file
View File

@@ -0,0 +1,72 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_ELECROW_M6 -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x4405"
],
[
"0x239A",
"0x0029"
],
[
"0x239A",
"0x002A"
]
],
"usb_product": "elecrow_solar",
"mcu": "nrf52840",
"variant": "ELECROW-ThinkNode-M6",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": [
"jlink"
],
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52.cfg"
},
"frameworks": [
"arduino"
],
"name": "elecrow solar",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink"
]
},
"url": "https://github.com/Elecrow-RD",
"vendor": "ELECROW"
}

33
boards/tiny_relay.json Normal file
View File

@@ -0,0 +1,33 @@
{
"build": {
"arduino": {
"variant_h": "variant_RAK3172_MODULE.h"
},
"core": "stm32",
"cpu": "cortex-m4",
"extra_flags": "-DSTM32WL -DSTM32WLxx -DSTM32WLE5xx",
"framework_extra_flags": {
"arduino": "-DUSE_CM4_STARTUP_FILE -DARDUINO_RAK3172_MODULE"
},
"f_cpu": "48000000L",
"mcu": "stm32wle5ccu",
"product_line": "STM32WLE5xx",
"variant": "STM32WLxx/WL54CCU_WL55CCU_WLE4C(8-B-C)U_WLE5C(8-B-C)U"
},
"debug": {
"default_tools": ["stlink"],
"jlink_device": "STM32WLE5CC",
"openocd_target": "stm32wlx",
"svd_path": "STM32WLE5_CM4.svd"
},
"frameworks": ["arduino"],
"name": "BB-STM32WL",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 262144,
"protocol": "stlink",
"protocols": ["stlink", "jlink"]
},
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32wle5cc.html",
"vendor": "YAOYAO"
}

View File

@@ -32,7 +32,8 @@
"connectivity": ["bluetooth"],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd"
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52.cfg"
},
"frameworks": ["arduino"],
"name": "Seeed T1000-E",

180
build.sh Normal file → Executable file
View File

@@ -1,17 +1,72 @@
#!/usr/bin/env bash
# usage
# sh build.sh build-firmware RAK_4631_Repeater
# sh build.sh build-firmwares
# sh build.sh build-companion-firmwares
# sh build.sh build-repeater-firmwares
# sh build.sh build-room-server-firmwares
global_usage() {
cat - <<EOF
Usage:
sh build.sh <command> [target]
Commands:
help|usage|-h|--help: Shows this message.
list|-l: List firmwares available to build.
build-firmware <target>: Build the firmware for the given build target.
build-firmwares: Build all firmwares for all targets.
build-matching-firmwares <build-match-spec>: Build all firmwares for build targets containing the string given for <build-match-spec>.
build-companion-firmwares: Build all companion firmwares for all build targets.
build-repeater-firmwares: Build all repeater firmwares for all build targets.
build-room-server-firmwares: Build all chat room server firmwares for all build targets.
Examples:
Build firmware for the "RAK_4631_repeater" device target
$ sh build.sh build-firmware RAK_4631_repeater
Build all firmwares for device targets containing the string "RAK_4631"
$ sh build.sh build-matching-firmwares <build-match-spec>
Build all companion firmwares
$ sh build.sh build-companion-firmwares
Build all repeater firmwares
$ sh build.sh build-repeater-firmwares
Build all chat room server firmwares
$ sh build.sh build-room-server-firmwares
Environment Variables:
DISABLE_DEBUG=1: Disables all debug logging flags (MESH_DEBUG, MESH_PACKET_LOGGING, etc.)
If not set, debug flags from variant platformio.ini files are used.
Examples:
Build without debug logging:
$ export FIRMWARE_VERSION=v1.0.0
$ export DISABLE_DEBUG=1
$ sh build.sh build-firmware RAK_4631_repeater
Build with debug logging (default, uses flags from variant files):
$ export FIRMWARE_VERSION=v1.0.0
$ sh build.sh build-firmware RAK_4631_repeater
EOF
}
# get a list of pio env names that start with "env:"
get_pio_envs() {
echo $(pio project config | grep 'env:' | sed 's/env://')
pio project config | grep 'env:' | sed 's/env://'
}
# Catch cries for help before doing anything else.
case $1 in
help|usage|-h|--help)
global_usage
exit 1
;;
list|-l)
get_pio_envs
exit 0
;;
esac
# cache project config json for use in get_platform_for_env()
PIO_CONFIG_JSON=$(pio project config --json-output)
# $1 should be the string to find (case insensitive)
get_pio_envs_containing_string() {
shopt -s nocasematch
@@ -23,8 +78,47 @@ get_pio_envs_containing_string() {
done
}
# $1 should be the string to find (case insensitive)
get_pio_envs_ending_with_string() {
shopt -s nocasematch
envs=($(get_pio_envs))
for env in "${envs[@]}"; do
if [[ "$env" == *${1} ]]; then
echo $env
fi
done
}
# get platform flag for a given environment
# $1 should be the environment name
get_platform_for_env() {
local env_name=$1
echo "$PIO_CONFIG_JSON" | python3 -c "
import sys, json, re
data = json.load(sys.stdin)
for section, options in data:
if section == 'env:$env_name':
for key, value in options:
if key == 'build_flags':
for flag in value:
match = re.search(r'(ESP32_PLATFORM|NRF52_PLATFORM|STM32_PLATFORM|RP2040_PLATFORM)', flag)
if match:
print(match.group(1))
sys.exit(0)
"
}
# disable all debug logging flags if DISABLE_DEBUG=1 is set
disable_debug_flags() {
if [ "$DISABLE_DEBUG" == "1" ]; then
export PLATFORMIO_BUILD_FLAGS="${PLATFORMIO_BUILD_FLAGS} -UMESH_DEBUG -UBLE_DEBUG_LOGGING -UWIFI_DEBUG_LOGGING -UBRIDGE_DEBUG -UGPS_NMEA_DEBUG -UCORE_DEBUG_LEVEL -UESPNOW_DEBUG_LOGGING -UDEBUG_RP2040_WIRE -UDEBUG_RP2040_SPI -UDEBUG_RP2040_CORE -UDEBUG_RP2040_PORT -URADIOLIB_DEBUG_SPI -UCFG_DEBUG -URADIOLIB_DEBUG_BASIC -URADIOLIB_DEBUG_PROTOCOL"
fi
}
# build firmware for the provided pio env in $1
build_firmware() {
# get env platform for post build actions
ENV_PLATFORM=($(get_platform_for_env $1))
# get git commit sha
COMMIT_HASH=$(git rev-parse --short HEAD)
@@ -46,33 +140,40 @@ build_firmware() {
# e.g: RAK_4631_Repeater-v1.0.0-SHA
FIRMWARE_FILENAME="$1-${FIRMWARE_VERSION_STRING}"
# export build flags for pio so we can inject firmware version info
export PLATFORMIO_BUILD_FLAGS="-DFIRMWARE_BUILD_DATE='\"${FIRMWARE_BUILD_DATE}\"' -DFIRMWARE_VERSION='\"${FIRMWARE_VERSION_STRING}\"'"
# add firmware version info to end of existing platformio build flags in environment vars
export PLATFORMIO_BUILD_FLAGS="${PLATFORMIO_BUILD_FLAGS} -DFIRMWARE_BUILD_DATE='\"${FIRMWARE_BUILD_DATE}\"' -DFIRMWARE_VERSION='\"${FIRMWARE_VERSION_STRING}\"'"
# disable debug flags if requested
disable_debug_flags
# build firmware target
pio run -e $1
# build merge-bin for esp32 fresh install
if [ -f .pio/build/$1/firmware.bin ]; then
# build merge-bin for esp32 fresh install, copy .bins to out folder (e.g: Heltec_v3_room_server-v1.0.0-SHA.bin)
if [ "$ENV_PLATFORM" == "ESP32_PLATFORM" ]; then
pio run -t mergebin -e $1
cp .pio/build/$1/firmware.bin out/${FIRMWARE_FILENAME}.bin 2>/dev/null || true
cp .pio/build/$1/firmware-merged.bin out/${FIRMWARE_FILENAME}-merged.bin 2>/dev/null || true
fi
# build .uf2 for RAK_4631 and t1000e
if [[ $1 == *"RAK_4631"* || $1 == *"t1000e"* ]]; then
python bin/uf2conv/uf2conv.py .pio/build/$1/firmware.hex -c -o .pio/build/$1/firmware.uf2 -f 0xADA52840
# build .uf2 for nrf52 boards, copy .uf2 and .zip to out folder (e.g: RAK_4631_Repeater-v1.0.0-SHA.uf2)
if [ "$ENV_PLATFORM" == "NRF52_PLATFORM" ]; then
python3 bin/uf2conv/uf2conv.py .pio/build/$1/firmware.hex -c -o .pio/build/$1/firmware.uf2 -f 0xADA52840
cp .pio/build/$1/firmware.uf2 out/${FIRMWARE_FILENAME}.uf2 2>/dev/null || true
cp .pio/build/$1/firmware.zip out/${FIRMWARE_FILENAME}.zip 2>/dev/null || true
fi
# copy .bin, .uf2, and .zip to out folder
# e.g: Heltec_v3_room_server-v1.0.0-SHA.bin
# e.g: RAK_4631_Repeater-v1.0.0-SHA.uf2
# for stm32, copy .bin and .hex to out folder
if [ "$ENV_PLATFORM" == "STM32_PLATFORM" ]; then
cp .pio/build/$1/firmware.bin out/${FIRMWARE_FILENAME}.bin 2>/dev/null || true
cp .pio/build/$1/firmware.hex out/${FIRMWARE_FILENAME}.hex 2>/dev/null || true
fi
# copy .bin for esp32 boards
cp .pio/build/$1/firmware.bin out/${FIRMWARE_FILENAME}.bin 2>/dev/null || true
cp .pio/build/$1/firmware-merged.bin out/${FIRMWARE_FILENAME}-merged.bin 2>/dev/null || true
# copy .zip and .uf2 of nrf52 boards
cp .pio/build/$1/firmware.uf2 out/${FIRMWARE_FILENAME}.uf2 2>/dev/null || true
cp .pio/build/$1/firmware.zip out/${FIRMWARE_FILENAME}.zip 2>/dev/null || true
# for rp2040, copy .bin and .uf2 to out folder
if [ "$ENV_PLATFORM" == "RP2040_PLATFORM" ]; then
cp .pio/build/$1/firmware.bin out/${FIRMWARE_FILENAME}.bin 2>/dev/null || true
cp .pio/build/$1/firmware.uf2 out/${FIRMWARE_FILENAME}.uf2 2>/dev/null || true
fi
}
@@ -84,6 +185,14 @@ build_all_firmwares_matching() {
done
}
# firmwares ending with $1 will be built
build_all_firmwares_by_suffix() {
envs=($(get_pio_envs_ending_with_string "$1"))
for env in "${envs[@]}"; do
build_firmware $env
done
}
build_repeater_firmwares() {
# # build specific repeater firmwares
@@ -95,7 +204,7 @@ build_repeater_firmwares() {
# build_firmware "RAK_4631_Repeater"
# build all repeater firmwares
build_all_firmwares_matching "repeater"
build_all_firmwares_by_suffix "_repeater"
}
@@ -114,8 +223,8 @@ build_companion_firmwares() {
# build_firmware "t1000e_companion_radio_ble"
# build all companion firmwares
build_all_firmwares_matching "companion_radio_usb"
build_all_firmwares_matching "companion_radio_ble"
build_all_firmwares_by_suffix "_companion_radio_usb"
build_all_firmwares_by_suffix "_companion_radio_ble"
}
@@ -126,7 +235,7 @@ build_room_server_firmwares() {
# build_firmware "RAK_4631_room_server"
# build all room server firmwares
build_all_firmwares_matching "room_server"
build_all_firmwares_by_suffix "_room_server"
}
@@ -142,8 +251,21 @@ mkdir -p out
# handle script args
if [[ $1 == "build-firmware" ]]; then
TARGETS=${@:2}
if [ "$TARGETS" ]; then
for env in $TARGETS; do
build_firmware $env
done
else
echo "usage: $0 build-firmware <target>"
exit 1
fi
elif [[ $1 == "build-matching-firmwares" ]]; then
if [ "$2" ]; then
build_firmware $2
build_all_firmwares_matching $2
else
echo "usage: $0 build-matching-firmwares <build-match-spec>"
exit 1
fi
elif [[ $1 == "build-firmwares" ]]; then
build_firmwares

64
build_as_lib.py Normal file
View File

@@ -0,0 +1,64 @@
from os.path import realpath
Import("env") # type: ignore
menv=env # type: ignore
src_filter = [
'+<*.cpp>',
'+<helpers/*.cpp>',
'+<helpers/sensors>',
'+<helpers/radiolib/*.cpp>',
'+<helpers/ui/MomentaryButton.cpp>',
'+<helpers/ui/buzzer.cpp>',
]
# add build and include dirs according to CPPDEFINES
for item in menv.get("CPPDEFINES", []):
# PLATFORM HANDLING
if item == "STM32_PLATFORM":
src_filter.append("+<helpers/stm32/*>")
elif item == "ESP32":
src_filter.append("+<helpers/esp32/*>")
elif item == "NRF52_PLATFORM":
src_filter.append("+<helpers/nrf52/*>")
elif item == "RP2040_PLATFORM":
src_filter.append("+<helpers/rp2040/*>")
# DISPLAY HANDLING
elif isinstance(item, tuple) and item[0] == "DISPLAY_CLASS":
display_class = item[1]
src_filter.append(f"+<helpers/ui/{display_class}.cpp>")
if (display_class == "ST7789Display") :
src_filter.append(f"+<helpers/ui/OLEDDisplay.cpp>")
src_filter.append(f"+<helpers/ui/OLEDDisplayFonts.cpp>")
# VARIANTS HANDLING
elif isinstance(item, tuple) and item[0] == "MC_VARIANT":
variant_name = item[1]
src_filter.append(f"+<../variants/{variant_name}>")
# INCLUDE EXAMPLE CODE IN BUILD (to provide your own support files without touching the tree)
elif isinstance(item, tuple) and item[0] == "BUILD_EXAMPLE":
example_name = item[1]
src_filter.append(f"+<../examples/{example_name}/*.cpp>")
# EXCLUDE A SOURCE FILE FROM AN EXAMPLE (must be placed after example name or boom)
elif isinstance(item, tuple) and item[0] == "EXCLUDE_FROM_EXAMPLE":
exclude_name = item[1]
if example_name is None:
print("***** PLEASE DEFINE EXAMPLE FIRST *****")
break
src_filter.append(f"-<../examples/{example_name}/{exclude_name}>")
# DEAL WITH UI VARIANT FOR AN EXAMPLE
elif isinstance(item, tuple) and item[0] == "MC_UI_FLAVOR":
ui_flavor = item[1]
if example_name is None:
print("***** PLEASE DEFINE EXAMPLE FIRST *****")
break
src_filter.append(f"+<../examples/{example_name}/{ui_flavor}/*.cpp>")
menv.Replace(SRC_FILTER=src_filter)
#print (menv.Dump())

31
create-uf2.py Normal file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/python3
# Adds PlatformIO post-processing to convert hex files to uf2 files
import os
Import("env")
firmware_hex = "${BUILD_DIR}/${PROGNAME}.hex"
uf2_file = os.environ.get("UF2_FILE_PATH", "${BUILD_DIR}/${PROGNAME}.uf2")
def create_uf2_action(source, target, env):
uf2_cmd = " ".join(
[
'"$PYTHONEXE"',
'"$PROJECT_DIR/bin/uf2conv/uf2conv.py"',
'-f', '0xADA52840',
'-c', firmware_hex,
'-o', uf2_file,
]
)
env.Execute(uf2_cmd)
env.AddCustomTarget(
name="create_uf2",
dependencies=firmware_hex,
actions=create_uf2_action,
title="Create UF2 file",
description="Use uf2conv to convert hex binary into uf2",
always_build=True,
)

11
default.nix Normal file
View File

@@ -0,0 +1,11 @@
{ pkgs ? import <nixpkgs> {} }:
let
in
pkgs.mkShell {
buildInputs = [
pkgs.platformio
pkgs.python3
# optional: needed as a programmer i.e. for esp32
pkgs.avrdude
];
}

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 139 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path d="M3.232,3.582C2.789,3.582 2.368,3.934 2.289,4.369L0.013,16.964C-0.066,17.399 0.229,17.751 0.671,17.751L3.087,17.751C3.529,17.751 3.951,17.399 4.03,16.964L4.935,11.951L6.592,17.293C6.672,17.572 6.923,17.751 7.235,17.751L10.434,17.751C10.746,17.751 11.062,17.572 11.243,17.293L14.835,11.925L13.924,16.964C13.844,17.399 14.14,17.751 14.583,17.751L16.998,17.751C17.44,17.751 17.862,17.399 17.941,16.964L20.217,4.369C20.298,3.934 20.002,3.582 19.56,3.582L16.46,3.582C16.147,3.582 15.831,3.761 15.65,4.04L9.76,12.872C9.668,13.013 9.446,12.975 9.397,12.81L6.976,4.04C6.895,3.761 6.645,3.582 6.332,3.582L3.232,3.582Z" style="fill:white;fill-rule:nonzero;"/>
<path d="M20.853,17.751C20.853,17.751 32.797,17.751 32.797,17.751C33.063,17.751 33.317,17.538 33.364,17.278L33.863,14.504C33.91,14.242 33.733,14.031 33.467,14.031L25.166,14.031C25.077,14.031 25.019,13.96 25.034,13.873L25.281,12.508C25.296,12.421 25.38,12.35 25.469,12.35L32.146,12.35C32.411,12.35 32.665,12.137 32.712,11.877L33.157,9.421C33.204,9.159 33.027,8.949 32.761,8.949L26.085,8.949C25.996,8.949 25.938,8.877 25.953,8.79L26.216,7.328C26.232,7.241 26.316,7.17 26.405,7.17L34.706,7.17C34.971,7.17 35.226,6.957 35.272,6.695L35.756,4.021C35.804,3.761 35.627,3.548 35.361,3.548L23.417,3.548C22.975,3.548 22.551,3.902 22.473,4.337L20.191,16.962C20.114,17.397 20.409,17.751 20.853,17.751Z" style="fill:white;fill-rule:nonzero;"/>
<path d="M45.291,17.749L45.291,17.751L45.705,17.751C47.783,17.751 49.767,16.095 50.136,14.052L50.375,12.727C50.744,10.685 49.359,9.029 47.28,9.029L40.882,9.029C40.617,9.029 40.44,8.818 40.487,8.556L40.649,7.664C40.696,7.402 40.95,7.191 41.215,7.191L49.87,7.191C50.313,7.191 50.735,6.839 50.814,6.404L51.183,4.368C51.262,3.931 50.966,3.579 50.523,3.579L41.063,3.579C38.985,3.579 37,5.235 36.631,7.278L36.37,8.723C36.001,10.767 37.386,12.422 39.465,12.422L45.863,12.422C46.128,12.422 46.305,12.633 46.258,12.895L46.138,13.565C46.091,13.826 45.837,14.037 45.571,14.037L36.675,14.037C36.233,14.037 35.811,14.389 35.732,14.824L35.346,16.962C35.267,17.397 35.562,17.749 36.005,17.749L45.291,17.749Z" style="fill:white;fill-rule:nonzero;"/>
<path d="M67.068,3.575C67.068,3.575 64.393,3.575 64.393,3.575C63.951,3.575 63.529,3.927 63.45,4.361L62.654,8.766C62.639,8.853 62.554,8.923 62.466,8.923L57.282,8.923C57.193,8.923 57.135,8.853 57.15,8.766L57.946,4.361C58.023,3.927 57.73,3.575 57.287,3.575L54.613,3.575C54.17,3.575 53.748,3.927 53.669,4.361L51.392,16.964C51.313,17.399 51.608,17.751 52.05,17.751L54.725,17.751C55.168,17.751 55.589,17.399 55.668,16.964L56.48,12.478C56.495,12.392 56.58,12.32 56.668,12.32L61.852,12.32C61.941,12.32 61.999,12.39 61.984,12.478L61.174,16.964C61.096,17.399 61.391,17.751 61.834,17.751L64.508,17.751C64.951,17.751 65.372,17.399 65.451,16.964L67.729,4.361C67.804,3.927 67.511,3.575 67.068,3.575Z" style="fill:white;fill-rule:nonzero;"/>
<path d="M71.102,17.751C71.102,17.751 78.96,17.751 78.96,17.751C79.402,17.751 79.824,17.399 79.903,16.964L80.288,14.824C80.367,14.389 80.072,14.037 79.629,14.037L72.808,14.037C72.542,14.037 72.365,13.826 72.412,13.565L73.48,7.686C73.527,7.426 73.781,7.213 74.045,7.213L80.866,7.213C81.309,7.213 81.73,6.861 81.81,6.427L82.188,4.335C82.267,3.9 81.971,3.548 81.529,3.548L73.691,3.548C71.618,3.548 69.638,5.197 69.265,7.234L68.011,14.046C67.639,16.091 69.022,17.751 71.102,17.751Z" style="fill:white;fill-rule:nonzero;"/>
<path d="M95.833,3.529C95.833,3.529 87.654,3.529 87.654,3.529C85.576,3.529 83.592,5.186 83.223,7.228L81.99,14.052C81.621,16.094 83.006,17.751 85.084,17.751L93.263,17.751C95.341,17.751 97.326,16.095 97.695,14.052L98.928,7.228C99.297,5.186 97.911,3.529 95.833,3.529ZM93.488,13.567C93.44,13.828 93.186,14.039 92.921,14.039L86.762,14.039C86.496,14.039 86.319,13.828 86.366,13.567L87.434,7.663C87.481,7.402 87.735,7.191 88,7.191L94.157,7.191C94.423,7.191 94.6,7.402 94.553,7.663L93.488,13.567Z" style="fill:white;fill-rule:nonzero;"/>
<path d="M99.884,17.751L102.557,17.751C102.999,17.751 103.421,17.399 103.5,16.965L103.973,14.348C103.988,14.261 104.073,14.19 104.161,14.19L107.397,14.186C107.557,14.186 107.69,14.265 107.756,14.395L109.281,17.37C109.458,17.722 109.78,17.764 110.751,17.749C111.32,17.756 112.184,17.713 113.577,17.713C114.025,17.713 114.3,17.244 114.079,16.853L112.413,13.953C112.37,13.876 112.417,13.772 112.509,13.727C113.795,13.102 114.814,11.889 115.068,10.487L115.649,7.262C116.02,5.218 114.635,3.562 112.557,3.562L102.448,3.562C102.006,3.562 101.584,3.914 101.505,4.349L99.225,16.964C99.146,17.399 99.442,17.751 99.884,17.751L99.884,17.751ZM105.255,7.268C105.27,7.181 105.354,7.11 105.443,7.11L110.674,7.11C111.069,7.11 111.331,7.424 111.261,7.812L110.877,9.933C110.806,10.319 110.431,10.634 110.038,10.634L104.806,10.634C104.718,10.634 104.66,10.564 104.675,10.475L105.255,7.268Z" style="fill:white;fill-rule:nonzero;"/>
<path d="M116.642,17.751C116.642,17.751 128.586,17.751 128.586,17.751C128.851,17.751 129.105,17.538 129.152,17.278L129.651,14.504C129.698,14.242 129.521,14.031 129.256,14.031L120.955,14.031C120.866,14.031 120.808,13.96 120.823,13.873L121.069,12.508C121.084,12.421 121.169,12.35 121.257,12.35L127.934,12.35C128.2,12.35 128.454,12.137 128.501,11.877L128.945,9.421C128.992,9.159 128.815,8.949 128.55,8.949L121.873,8.949C121.785,8.949 121.726,8.877 121.741,8.79L122.005,7.328C122.02,7.241 122.105,7.17 122.193,7.17L130.495,7.17C130.76,7.17 131.014,6.957 131.061,6.695L131.545,4.021C131.592,3.761 131.415,3.548 131.15,3.548L119.206,3.548C118.763,3.548 118.34,3.902 118.261,4.337L115.98,16.962C115.902,17.397 116.198,17.751 116.642,17.751Z" style="fill:white;fill-rule:nonzero;"/>
<path d="M134.674,0C134.674,0 132.059,0 132.059,0C131.965,0 131.877,0.074 131.86,0.166L131.783,0.594C131.766,0.686 131.828,0.76 131.921,0.76L132.745,0.76C132.764,0.76 132.776,0.775 132.773,0.793L132.406,2.819C132.39,2.91 132.452,2.984 132.545,2.984L133.108,2.984C133.201,2.984 133.29,2.91 133.307,2.819L133.673,0.793C133.676,0.775 133.694,0.76 133.713,0.76L134.536,0.76C134.629,0.76 134.718,0.686 134.735,0.594L134.812,0.166C134.828,0.074 134.767,0 134.674,0Z" style="fill:white;fill-rule:nonzero;"/>
<path d="M135.278,0.002C135.185,0.002 135.096,0.076 135.079,0.167L134.6,2.819C134.583,2.91 134.646,2.984 134.739,2.984L135.247,2.984C135.34,2.984 135.429,2.91 135.446,2.819L135.636,1.763L135.985,2.888C136.002,2.947 136.055,2.984 136.121,2.984L136.794,2.984C136.86,2.984 136.926,2.947 136.964,2.888L137.72,1.758L137.528,2.819C137.512,2.91 137.574,2.984 137.667,2.984L138.176,2.984C138.269,2.984 138.358,2.91 138.374,2.819L138.853,0.167C138.87,0.076 138.808,0.002 138.715,0.002L138.062,0.002C137.997,0.002 137.93,0.039 137.892,0.098L136.652,1.957C136.633,1.987 136.586,1.979 136.575,1.944L136.066,0.098C136.049,0.039 135.996,0.002 135.93,0.002L135.278,0.002Z" style="fill:white;fill-rule:nonzero;"/>
</svg>

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -0,0 +1,16 @@
:root {
--md-primary-fg-color: #1F2937;
--md-primary-fg-color--light: #1F2937;
--md-primary-fg-color--dark: #1F2937;
--md-accent-fg-color: #1F2937;
}
/* hide git repo version */
.md-source__fact--version {
display: none;
}
/* underline links */
.md-typeset a {
text-decoration: underline;
}

883
docs/cli_commands.md Normal file
View File

@@ -0,0 +1,883 @@
# CLI Commands
This document provides an overview of CLI commands that can be sent to MeshCore Repeaters, Room Servers and Sensors.
## Navigation
- [Operational](#operational)
- [Neighbors](#neighbors-repeater-only)
- [Statistics](#statistics)
- [Logging](#logging)
- [Information](#info)
- [Configuration](#configuration)
- [Radio](#radio)
- [System](#system)
- [Routing](#routing)
- [ACL](#acl)
- [Region Management](#region-management-v110)
- [Region Examples](#region-examples)
- [GPS](#gps-when-gps-support-is-compiled-in)
- [Sensors](#sensors-when-sensor-support-is-compiled-in)
- [Bridge](#bridge-when-bridge-support-is-compiled-in)
---
## Operational
### Reboot the node
**Usage:**
- `reboot`
---
### Reset the clock and reboot
**Usage:**
- `clkreboot`
---
### Sync the clock with the remote device
**Usage:**
- `clock sync`
---
### Display current time in UTC
**Usage:**
- `clock`
---
### Set the time to a specific timestamp
**Usage:**
- `time <epoch_seconds>`
**Parameters:**
- `epoch_seconds`: Unix epoch time
---
### Send a flood advert
**Usage:**
- `advert`
---
### Start an Over-The-Air (OTA) firmware update
**Usage:**
- `start ota`
---
### Erase/Factory Reset
**Usage:**
- `erase`
**Serial Only:** Yes
**Warning:** _**This is destructive!**_
---
## Neighbors (Repeater Only)
### List nearby neighbors
**Usage:**
- `neighbors`
**Note:** The output of this command is limited to the 8 most recent adverts.
**Note:** Each line is encoded as `{pubkey-prefix}:{timestamp}:{snr*4}`
---
### Remove a neighbor
**Usage:**
- `neighbor.remove <pubkey_prefix>`
**Parameters:**
- `pubkey_prefix`: The public key of the node to remove from the neighbors list
---
## Statistics
### Clear Stats
**Usage:** `clear stats`
---
### System Stats - Battery, Uptime, Queue Length and Debug Flags
**Usage:**
- `stats-core`
**Serial Only:** Yes
---
### Radio Stats - Noise floor, Last RSSI/SNR, Airtime, Receive errors
**Usage:** `stats-radio`
**Serial Only:** Yes
---
### Packet stats - Packet counters: Received, Sent
**Usage:** `stats-packets`
**Serial Only:** Yes
---
## Logging
### Begin capture of rx log to node storage
**Usage:** `log start`
---
### End capture of rx log to node storage
**Usage:** `log stop`
---
### Erase captured log
**Usage:** `log erase`
---
### Print the captured log to the serial terminal
**Usage:** `log`
**Serial Only:** Yes
---
## Info
### Get the Version
**Usage:** `ver`
---
### Show the hardware name
**Usage:** `board`
---
## Configuration
### Radio
#### View or change this node's radio parameters
**Usage:**
- `get radio`
- `set radio <freq>,<bw>,<sf>,<cr>`
**Parameters:**
- `freq`: Frequency in MHz
- `bw`: Bandwidth in kHz
- `sf`: Spreading factor (5-12)
- `cr`: Coding rate (5-8)
**Set by build flag:** `LORA_FREQ`, `LORA_BW`, `LORA_SF`, `LORA_CR`
**Default:** `869.525,250,11,5`
**Note:** Requires reboot to apply
---
#### View or change this node's transmit power
**Usage:**
- `get tx`
- `set tx <dbm>`
**Parameters:**
- `dbm`: Power level in dBm (1-22)
**Set by build flag:** `LORA_TX_POWER`
**Default:** Varies by board
**Notes:** This setting only controls the power level of the LoRa chip. Some nodes have an additional power amplifier stage which increases the total output. Refer to the node's manual for the correct setting to use. **Setting a value too high may violate the laws in your country.**
---
#### Change the radio parameters for a set duration
**Usage:**
- `tempradio <freq>,<bw>,<sf>,<cr>,<timeout_mins>`
**Parameters:**
- `freq`: Frequency in MHz (300-2500)
- `bw`: Bandwidth in kHz (7.8-500)
- `sf`: Spreading factor (5-12)
- `cr`: Coding rate (5-8)
- `timeout_mins`: Duration in minutes (must be > 0)
**Note:** This is not saved to preferences and will clear on reboot
---
#### View or change this node's frequency
**Usage:**
- `get freq`
- `set freq <frequency>`
**Parameters:**
- `frequency`: Frequency in MHz
**Default:** `869.525`
**Note:** Requires reboot to apply
**Serial Only:** `set freq <frequency>`
### System
#### View or change this node's name
**Usage:**
- `get name`
- `set name <name>`
**Parameters:**
- `name`: Node name
**Set by build flag:** `ADVERT_NAME`
**Default:** Varies by board
**Note:** Max length varies. If a location is set, the max length is 24 bytes; 32 otherwise. Emoji and unicode characters may take more than one byte.
---
#### View or change this node's latitude
**Usage:**
- `get lat`
- `set lat <degrees>`
**Set by build flag:** `ADVERT_LAT`
**Default:** `0`
**Parameters:**
- `degrees`: Latitude in degrees
---
#### View or change this node's longitude
**Usage:**
- `get lon`
- `set lon <degrees>`
**Set by build flag:** `ADVERT_LON`
**Default:** `0`
**Parameters:**
- `degrees`: Longitude in degrees
---
#### View or change this node's identity (Private Key)
**Usage:**
- `get prv.key`
- `set prv.key <private_key>`
**Parameters:**
- `private_key`: Private key in hex format (64 hex characters)
**Serial Only:**
- `get prv.key`: Yes
- `set prv.key`: No
**Note:** Requires reboot to take effect after setting
---
#### Change this node's admin password
**Usage:**
- `password <new_password>`
**Parameters:**
- `new_password`: New admin password
**Set by build flag:** `ADMIN_PASSWORD`
**Default:** `password`
**Note:** Command reply echoes the updated password for confirmation.
**Note:** Any node using this password will be added to the admin ACL list.
---
#### View or change this node's guest password
**Usage:**
- `get guest.password`
- `set guest.password <password>`
**Parameters:**
- `password`: Guest password
**Set by build flag:** `ROOM_PASSWORD` (Room Server only)
**Default:** `<blank>`
---
#### View or change this node's owner info
**Usage:**
- `get owner.info`
- `set owner.info <text>`
**Parameters:**
- `text`: Owner information text
**Default:** `<blank>`
**Note:** `|` characters are translated to newlines
**Note:** Requires firmware 1.12.+
---
#### Fine-tune the battery reading
**Usage:**
- `get adc.multiplier`
- `set adc.multiplier <value>`
**Parameters:**
- `value`: ADC multiplier (0.0-10.0)
**Default:** `0.0` (value defined by board)
**Note:** Returns "Error: unsupported by this board" if hardware doesn't support it
---
#### View or change this node's power saving flag (Repeater Only)
**Usage:**
- `powersaving <state>`
- `powersaving`
**Parameters:**
- `state`: `on`|`off`
**Default:** `on`
**Note:** When enabled, device enters sleep mode between radio transmissions
---
### Routing
#### View or change this node's repeat flag
**Usage:**
- `get repeat`
- `set repeat <state>`
**Parameters:**
- `state`: `on`|`off`
**Default:** `on`
---
#### View or change the retransmit delay factor for flood traffic
**Usage:**
- `get txdelay`
- `set txdelay <value>`
**Parameters:**
- `value`: Transmit delay factor (0-2)
**Default:** `0.5`
---
#### View or change the retransmit delay factor for direct traffic
**Usage:**
- `get direct.txdelay`
- `set direct.txdelay <value>`
**Parameters:**
- `value`: Direct transmit delay factor (0-2)
**Default:** `0.2`
---
#### [Experimental] View or change the processing delay for received traffic
**Usage:**
- `get rxdelay`
- `set rxdelay <value>`
**Parameters:**
- `value`: Receive delay base (0-20)
**Default:** `0.0`
---
#### View or change the airtime factor (duty cycle limit)
**Usage:**
- `get af`
- `set af <value>`
**Parameters:**
- `value`: Airtime factor (0-9)
**Default:** `1.0`
---
#### View or change the local interference threshold
**Usage:**
- `get int.thresh`
- `set int.thresh <value>`
**Parameters:**
- `value`: Interference threshold value
**Default:** `0.0`
---
#### View or change the AGC Reset Interval
**Usage:**
- `get agc.reset.interval`
- `set agc.reset.interval <value>`
**Parameters:**
- `value`: Interval in seconds rounded down to a multiple of 4 (17 becomes 16)
**Default:** `0.0`
---
#### Enable or disable Multi-Acks support
**Usage:**
- `get multi.acks`
- `set multi.acks <state>`
**Parameters:**
- `state`: `0` (disable) or `1` (enable)
**Default:** `0`
---
#### View or change the flood advert interval
**Usage:**
- `get flood.advert.interval`
- `set flood.advert.interval <hours>`
**Parameters:**
- `hours`: Interval in hours (3-168)
**Default:** `12` (Repeater) - `0` (Sensor)
---
#### View or change the zero-hop advert interval
**Usage:**
- `get advert.interval`
- `set advert.interval <minutes>`
**Parameters:**
- `minutes`: Interval in minutes rounded down to the nearest multiple of 2 (61 becomes 60) (60-240)
**Default:** `0`
---
#### Limit the number of hops for a flood message
**Usage:**
- `get flood.max`
- `set flood.max <value>`
**Parameters:**
- `value`: Maximum flood hop count (0-64)
**Default:** `64`
---
### ACL
#### Add, update or remove permissions for a companion
**Usage:**
- `setperm <pubkey> <permissions>`
**Parameters:**
- `pubkey`: Companion public key
- `permissions`:
- `0`: Guest
- `1`: Read-only
- `2`: Read-write
- `3`: Admin
**Note:** Removes the entry when `permissions` is omitted
---
#### View the current ACL
**Usage:**
- `get acl`
**Serial Only:** Yes
---
#### View or change this room server's 'read-only' flag
**Usage:**
- `get allow.read.only`
- `set allow.read.only <state>`
**Parameters:**
- `state`: `on` (enable) or `off` (disable)
**Default:** `off`
---
### Region Management (v1.10.+)
#### Bulk-load region lists
**Usage:**
- `region load`
- `region load <name> [flood_flag]`
**Parameters:**
- `name`: A name of a region. `*` represents the wildcard region
**Note:** `flood_flag`: Optional `F` to allow flooding
**Note:** Indentation creates parent-child relationships (max 8 levels)
**Note:** `region load` with an empty name will not work remotely (it's interactive)
---
#### Save any changes to regions made since reboot
**Usage:**
- `region save`
---
#### Allow a region
**Usage:**
- `region allowf <name>`
**Parameters:**
- `name`: Region name (or `*` for wildcard)
**Note:** Setting on wildcard `*` allows packets without region transport codes
---
#### Block a region
**Usage:**
- `region denyf <name>`
**Parameters:**
- `name`: Region name (or `*` for wildcard)
**Note:** Setting on wildcard `*` drops packets without region transport codes
---
#### Show information for a region
**Usage:**
- `region get <name>`
**Parameters:**
- `name`: Region name (or `*` for wildcard)
---
#### View or change the home region for this node
**Usage:**
- `region home`
- `region home <name>`
**Parameters:**
- `name`: Region name
---
#### Create a new region
**Usage:**
- `region put <name> [parent_name]`
**Parameters:**
- `name`: Region name
- `parent_name`: Parent region name (optional, defaults to wildcard)
---
#### Remove a region
**Usage:**
- `region remove <name>`
**Parameters:**
- `name`: Region name
**Note:** Must remove all child regions before the region can be removed
---
#### View all regions
**Usage:**
- `region list <filter>`
**Serial Only:** Yes
**Parameters:**
- `filter`: `allowed`|`denied`
**Note:** Requires firmware 1.12.+
---
#### Dump all defined regions and flood permissions
**Usage:**
- `region`
**Serial Only:** For firmware older than 1.12.0
---
### Region Examples
**Example 1: Using F Flag with Named Public Region**
```
region load
#Europe F
<blank line to end region load>
region save
```
**Explanation:**
- Creates a region named `#Europe` with flooding enabled
- Packets from this region will be flooded to other nodes
---
**Example 2: Using Wildcard with F Flag**
```
region load
* F
<blank line to end region load>
region save
```
**Explanation:**
- Creates a wildcard region `*` with flooding enabled
- Enables flooding for all regions automatically
- Applies only to packets without transport codes
---
**Example 3: Using Wildcard Without F Flag**
```
region load
*
<blank line to end region load>
region save
```
**Explanation:**
- Creates a wildcard region `*` without flooding
- This region exists but doesn't affect packet distribution
- Used as a default/empty region
---
**Example 4: Nested Public Region with F Flag**
```
region load
#Europe F
#UK
#London
#Manchester
#France
#Paris
#Lyon
<blank line to end region load>
region save
```
**Explanation:**
- Creates `#Europe` region with flooding enabled
- Adds nested child regions (`#UK`, `#France`)
- All nested regions inherit the flooding flag from parent
---
**Example 5: Wildcard with Nested Public Regions**
```
region load
* F
#NorthAmerica
#USA
#NewYork
#California
#Canada
#Ontario
#Quebec
<blank line to end region load>
region save
```
**Explanation:**
- Creates wildcard region `*` with flooding enabled
- Adds nested `#NorthAmerica` hierarchy
- Enables flooding for all child regions automatically
- Useful for global networks with specific regional rules
---
### GPS (When GPS support is compiled in)
#### View or change GPS state
**Usage:**
- `gps`
- `gps <state>`
**Parameters:**
- `state`: `on`|`off`
**Default:** `off`
**Note:** Output format: `{status}, {fix}, {sat count}` (when enabled)
---
#### Sync this node's clock with GPS time
**Usage:**
- `gps sync`
---
#### Set this node's location based on the GPS coordinates
**Usage:**
- `gps setloc`
---
#### View or change the GPS advert policy
**Usage:**
- `gps advert`
- `gps advert <policy>`
**Parameters:**
- `policy`: `none`|`share`|`prefs`
- `none`: don't include location in adverts
- `share`: share gps location (from SensorManager)
- `prefs`: location stored in node's lat and lon settings
**Default:** `prefs`
---
### Sensors (When sensor support is compiled in)
#### View the list of sensors on this node
**Usage:** `sensor list [start]`
**Parameters:**
- `start`: Optional starting index (defaults to 0)
**Note:** Output format: `<var_name>=<value>\n`
---
#### View or change thevalue of a sensor
**Usage:**
- `sensor get <key>`
- `sensor set <key> <value>`
**Parameters:**
- `key`: Sensor setting name
- `value`: The value to set the sensor to
---
### Bridge (When bridge support is compiled in)
#### View or change the bridge enabled flag
**Usage:**
- `get bridge.enabled`
- `set bridge.enabled <state>`
**Parameters:**
- `state`: `on`|`off`
**Default:** `off`
---
#### View the bridge source
**Usage:**
- `get bridge.source`
---
#### Add a delay to packets routed through this bridge
**Usage:**
- `get bridge.delay`
- `set bridge.delay <ms>`
**Parameters:**
- `ms`: Delay in milliseconds (0-10000)
**Default:** `500`
---
#### View or change the source of packets bridged to the external interface
**Usage:**
- `get bridge.source`
- `set bridge.source <source>`
**Parameters:**
- `source`:
- `rx`: bridges received packets
- `tx`: bridges transmitted packets
**Default:** `tx`
---
#### View or change the speed of the bridge (RS-232 only)
**Usage:**
- `get bridge.baud`
- `set bridge.baud <rate>`
**Parameters:**
- `rate`: Baud rate (`9600`, `19200`, `38400`, `57600`, or `115200`)
**Default:** `115200`
---
#### View or change the channel used for bridging (ESPNow only)
**Usage:**
- `get bridge.channel`
- `set bridge.channel <channel>`
**Parameters:**
- `channel`: Channel number (1-14)
---
#### Set the ESP-Now secret
**Usage:**
- `get bridge.secret`
- `set bridge.secret <secret>`
**Parameters:**
- `secret`: 16-character encryption secret
**Default:** Varies by board
---

939
docs/companion_protocol.md Normal file
View File

@@ -0,0 +1,939 @@
# Companion Protocol
- **Last Updated**: 2026-01-03
- **Protocol Version**: Companion Firmware v1.12.0+
> NOTE: This document is still in development. Some information may be inaccurate.
This document provides a comprehensive guide for communicating with MeshCore devices over Bluetooth Low Energy (BLE).
It is platform-agnostic and can be used for Android, iOS, Python, JavaScript, or any other platform that supports BLE.
## Official Libraries
Please see the following repos for existing MeshCore Companion Protocol libraries.
- JavaScript: [https://github.com/meshcore-dev/meshcore.js](https://github.com/meshcore-dev/meshcore.js)
- Python: [https://github.com/meshcore-dev/meshcore_py](https://github.com/meshcore-dev/meshcore_py)
## Important Security Note
All secrets, hashes, and cryptographic values shown in this guide are example values only.
- All hex values, public keys and hashes are for demonstration purposes only
- Never use example secrets in production
- Always generate new cryptographically secure random secrets
- Please implement proper security practices in your implementation
- This guide is for protocol documentation only
## Table of Contents
1. [BLE Connection](#ble-connection)
2. [Packet Structure](#packet-structure)
3. [Commands](#commands)
4. [Channel Management](#channel-management)
5. [Message Handling](#message-handling)
6. [Response Parsing](#response-parsing)
7. [Example Implementation Flow](#example-implementation-flow)
8. [Best Practices](#best-practices)
9. [Troubleshooting](#troubleshooting)
---
## BLE Connection
### Service and Characteristics
MeshCore Companion devices expose a BLE service with the following UUIDs:
- **Service UUID**: `6E400001-B5A3-F393-E0A9-E50E24DCCA9E`
- **RX Characteristic** (App → Firmware): `6E400002-B5A3-F393-E0A9-E50E24DCCA9E`
- **TX Characteristic** (Firmware → App): `6E400003-B5A3-F393-E0A9-E50E24DCCA9E`
### Connection Steps
1. **Scan for Devices**
- Scan for BLE devices advertising the MeshCore Service UUID
- Optionally filter by device name (typically contains "MeshCore" prefix)
- Note the device MAC address for reconnection
2. **Connect to GATT**
- Connect to the device using the discovered MAC address
- Wait for connection to be established
3. **Discover Services and Characteristics**
- Discover the service with UUID `6E400001-B5A3-F393-E0A9-E50E24DCCA9E`
- Discover the RX characteristic `6E400002-B5A3-F393-E0A9-E50E24DCCA9E`
- Your app writes to this, the firmware reads from this
- Discover the TX characteristic `6E400003-B5A3-F393-E0A9-E50E24DCCA9E`
- The firmware writes to this, your app reads from this
4. **Enable Notifications**
- Subscribe to notifications on the TX characteristic to receive data from the firmware
5. **Send Initial Commands**
- Send `CMD_APP_START` to identify your app to firmware and get radio settings
- Send `CMD_DEVICE_QEURY` to fetch device info and negotiate supported protocol versions
- Send `CMD_SET_DEVICE_TIME` to set the firmware clock
- Send `CMD_GET_CONTACTS` to fetch all contacts
- Send `CMD_GET_CHANNEL` multiple times to fetch all channel slots
- Send `CMD_SYNC_NEXT_MESSAGE` to fetch the next message stored in firmware
- Setup listeners for push codes, such as `PUSH_CODE_MSG_WAITING` or `PUSH_CODE_ADVERT`
- See [Commands](#commands) section for information on other commands
**Note**: MeshCore devices may disconnect after periods of inactivity. Implement auto-reconnect logic with exponential backoff.
### BLE Write Type
When writing commands to the RX characteristic, specify the write type:
- **Write with Response** (default): Waits for acknowledgment from device
- **Write without Response**: Faster but no acknowledgment
**Platform-specific**:
- **Android**: Use `BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT` or `WRITE_TYPE_NO_RESPONSE`
- **iOS**: Use `CBCharacteristicWriteType.withResponse` or `.withoutResponse`
- **Python (bleak)**: Use `write_gatt_char()` with `response=True` or `False`
**Recommendation**: Use write with response for reliability.
### MTU (Maximum Transmission Unit)
The default BLE MTU is 23 bytes (20 bytes payload). For larger commands like `SET_CHANNEL` (66 bytes), you may need to:
1. **Request Larger MTU**: Request MTU of 512 bytes if supported
- Android: `gatt.requestMtu(512)`
- iOS: `peripheral.maximumWriteValueLength(for:)`
- Python (bleak): MTU is negotiated automatically
### Command Sequencing
**Critical**: Commands must be sent in the correct sequence:
1. **After Connection**:
- Wait for BLE connection to be established
- Wait for services/characteristics to be discovered
- Wait for notifications to be enabled
- Now you can safely send commands to the firmware
2. **Command-Response Matching**:
- Send one command at a time
- Wait for a response before sending another command
- Use a timeout (typically 5 seconds)
- Match response to command by type (e.g: `CMD_GET_CHANNEL``RESP_CODE_CHANNEL_INFO`)
### Command Queue Management
For reliable operation, implement a command queue.
**Queue Structure**:
- Maintain a queue of pending commands
- Track which command is currently waiting for a response
- Only send next command after receiving response or timeout
**Error Handling**:
- On timeout, clear current command, process next in queue
- On error, log error, clear current command, process next
---
## Packet Structure
The MeshCore protocol uses a binary format with the following structure:
- **Commands**: Sent from app to firmware via RX characteristic
- **Responses**: Received from firmware via TX characteristic notifications
- **All multi-byte integers**: Little-endian byte order (except CayenneLPP which is Big-endian)
- **All strings**: UTF-8 encoding
Most packets follow this format:
```
[Packet Type (1 byte)] [Data (variable length)]
```
The first byte indicates the packet type (see [Response Parsing](#response-parsing)).
---
## Commands
### 1. App Start
**Purpose**: Initialize communication with the device. Must be sent first after connection.
**Command Format**:
```
Byte 0: 0x01
Byte 1: 0x03
Bytes 2-10: "mccli" (ASCII, null-padded to 9 bytes)
```
**Example** (hex):
```
01 03 6d 63 63 6c 69 00 00 00 00
```
**Response**: `PACKET_OK` (0x00)
---
### 2. Device Query
**Purpose**: Query device information.
**Command Format**:
```
Byte 0: 0x16
Byte 1: 0x03
```
**Example** (hex):
```
16 03
```
**Response**: `PACKET_DEVICE_INFO` (0x0D) with device information
---
### 3. Get Channel Info
**Purpose**: Retrieve information about a specific channel.
**Command Format**:
```
Byte 0: 0x1F
Byte 1: Channel Index (0-7)
```
**Example** (get channel 1):
```
1F 01
```
**Response**: `PACKET_CHANNEL_INFO` (0x12) with channel details
**Note**: The device does not return channel secrets for security reasons. Store secrets locally when creating channels.
---
### 4. Set Channel
**Purpose**: Create or update a channel on the device.
**Command Format**:
```
Byte 0: 0x20
Byte 1: Channel Index (0-7)
Bytes 2-33: Channel Name (32 bytes, UTF-8, null-padded)
Bytes 34-65: Secret (32 bytes)
```
**Total Length**: 66 bytes
**Channel Index**:
- Index 0: Reserved for public channels (no secret)
- Indices 1-7: Available for private channels
**Channel Name**:
- UTF-8 encoded
- Maximum 32 bytes
- Padded with null bytes (0x00) if shorter
**Secret Field** (32 bytes):
- For **private channels**: 32-byte secret
- For **public channels**: All zeros (0x00)
**Example** (create channel "YourChannelName" at index 1 with secret):
```
20 01 53 4D 53 00 00 ... (name padded to 32 bytes)
[32 bytes of secret]
```
**Response**: `PACKET_OK` (0x00) on success, `PACKET_ERROR` (0x01) on failure
---
### 5. Send Channel Message
**Purpose**: Send a text message to a channel.
**Command Format**:
```
Byte 0: 0x03
Byte 1: 0x00
Byte 2: Channel Index (0-7)
Bytes 3-6: Timestamp (32-bit little-endian Unix timestamp, seconds)
Bytes 7+: Message Text (UTF-8, variable length)
```
**Timestamp**: Unix timestamp in seconds (32-bit unsigned integer, little-endian)
**Example** (send "Hello" to channel 1 at timestamp 1234567890):
```
03 00 01 D2 02 96 49 48 65 6C 6C 6F
```
**Response**: `PACKET_MSG_SENT` (0x06) on success
---
### 6. Get Message
**Purpose**: Request the next queued message from the device.
**Command Format**:
```
Byte 0: 0x0A
```
**Example** (hex):
```
0A
```
**Response**:
- `PACKET_CHANNEL_MSG_RECV` (0x08) or `PACKET_CHANNEL_MSG_RECV_V3` (0x11) for channel messages
- `PACKET_CONTACT_MSG_RECV` (0x07) or `PACKET_CONTACT_MSG_RECV_V3` (0x10) for contact messages
- `PACKET_NO_MORE_MSGS` (0x0A) if no messages available
**Note**: Poll this command periodically to retrieve queued messages. The device may also send `PACKET_MESSAGES_WAITING` (0x83) as a notification when messages are available.
---
### 7. Get Battery
**Purpose**: Query device battery level.
**Command Format**:
```
Byte 0: 0x14
```
**Example** (hex):
```
14
```
**Response**: `PACKET_BATTERY` (0x0C) with battery percentage
---
## Channel Management
### Channel Types
1. **Public Channel**
- Uses a publicly known 16-byte key: `8b3387e9c5cdea6ac9e5edbaa115cd72`
- Anyone can join this channel, messages should be considered public
- Used as the default public group chat
2. **Hashtag Channels**
- Uses a secret key derived from the channel name
- It is the first 16 bytes of `sha256("#test")`
- For example hashtag channel `#test` has the key: `9cd8fcf22a47333b591d96a2b848b73f`
- Used as a topic based public group chat, separate from the default public channel
3. **Private Channels**
- Uses a randomly generated 16-byte secret key
- Messages should be considered private between those that know the secret
- Users should keep the key secret, and only share with those you want to communicate with
- Used as a secure private group chat
### Channel Lifecycle
1. **Set Channel**:
- Fetch all channel slots, and find one with empty name and all-zero secret
- Generate or provide a 16-byte secret
- Send `CMD_SET_CHANNEL` with name and secret
2. **Get Channel**:
- Send `CMD_GET_CHANNEL` with channel index
- Parse `RESP_CODE_CHANNEL_INFO` response
3. **Delete Channel**:
- Send `CMD_SET_CHANNEL` with empty name and all-zero secret
- Or overwrite with a new channel
---
## Message Handling
### Receiving Messages
Messages are received via the RX characteristic (notifications). The device sends:
1. **Channel Messages**:
- `PACKET_CHANNEL_MSG_RECV` (0x08) - Standard format
- `PACKET_CHANNEL_MSG_RECV_V3` (0x11) - Version 3 with SNR
2. **Contact Messages**:
- `PACKET_CONTACT_MSG_RECV` (0x07) - Standard format
- `PACKET_CONTACT_MSG_RECV_V3` (0x10) - Version 3 with SNR
3. **Notifications**:
- `PACKET_MESSAGES_WAITING` (0x83) - Indicates messages are queued
### Contact Message Format
**Standard Format** (`PACKET_CONTACT_MSG_RECV`, 0x07):
```
Byte 0: 0x07 (packet type)
Bytes 1-6: Public Key Prefix (6 bytes, hex)
Byte 7: Path Length
Byte 8: Text Type
Bytes 9-12: Timestamp (32-bit little-endian)
Bytes 13-16: Signature (4 bytes, only if txt_type == 2)
Bytes 17+: Message Text (UTF-8)
```
**V3 Format** (`PACKET_CONTACT_MSG_RECV_V3`, 0x10):
```
Byte 0: 0x10 (packet type)
Byte 1: SNR (signed byte, multiplied by 4)
Bytes 2-3: Reserved
Bytes 4-9: Public Key Prefix (6 bytes, hex)
Byte 10: Path Length
Byte 11: Text Type
Bytes 12-15: Timestamp (32-bit little-endian)
Bytes 16-19: Signature (4 bytes, only if txt_type == 2)
Bytes 20+: Message Text (UTF-8)
```
**Parsing Pseudocode**:
```python
def parse_contact_message(data):
packet_type = data[0]
offset = 1
# Check for V3 format
if packet_type == 0x10: # V3
snr_byte = data[offset]
snr = ((snr_byte if snr_byte < 128 else snr_byte - 256) / 4.0)
offset += 3 # Skip SNR + reserved
pubkey_prefix = data[offset:offset+6].hex()
offset += 6
path_len = data[offset]
txt_type = data[offset + 1]
offset += 2
timestamp = int.from_bytes(data[offset:offset+4], 'little')
offset += 4
# If txt_type == 2, skip 4-byte signature
if txt_type == 2:
offset += 4
message = data[offset:].decode('utf-8')
return {
'pubkey_prefix': pubkey_prefix,
'path_len': path_len,
'txt_type': txt_type,
'timestamp': timestamp,
'message': message,
'snr': snr if packet_type == 0x10 else None
}
```
### Channel Message Format
**Standard Format** (`PACKET_CHANNEL_MSG_RECV`, 0x08):
```
Byte 0: 0x08 (packet type)
Byte 1: Channel Index (0-7)
Byte 2: Path Length
Byte 3: Text Type
Bytes 4-7: Timestamp (32-bit little-endian)
Bytes 8+: Message Text (UTF-8)
```
**V3 Format** (`PACKET_CHANNEL_MSG_RECV_V3`, 0x11):
```
Byte 0: 0x11 (packet type)
Byte 1: SNR (signed byte, multiplied by 4)
Bytes 2-3: Reserved
Byte 4: Channel Index (0-7)
Byte 5: Path Length
Byte 6: Text Type
Bytes 7-10: Timestamp (32-bit little-endian)
Bytes 11+: Message Text (UTF-8)
```
**Parsing Pseudocode**:
```python
def parse_channel_message(data):
packet_type = data[0]
offset = 1
# Check for V3 format
if packet_type == 0x11: # V3
snr_byte = data[offset]
snr = ((snr_byte if snr_byte < 128 else snr_byte - 256) / 4.0)
offset += 3 # Skip SNR + reserved
channel_idx = data[offset]
path_len = data[offset + 1]
txt_type = data[offset + 2]
timestamp = int.from_bytes(data[offset+3:offset+7], 'little')
message = data[offset+7:].decode('utf-8')
return {
'channel_idx': channel_idx,
'timestamp': timestamp,
'message': message,
'snr': snr if packet_type == 0x11 else None
}
```
### Sending Messages
Use the `SEND_CHANNEL_MESSAGE` command (see [Commands](#commands)).
**Important**:
- Messages are limited to 133 characters per MeshCore specification
- Long messages should be split into chunks
- Include a chunk indicator (e.g., "[1/3] message text")
---
## Response Parsing
### Packet Types
| Value | Name | Description |
|-------|----------------------------|-------------------------------|
| 0x00 | PACKET_OK | Command succeeded |
| 0x01 | PACKET_ERROR | Command failed |
| 0x02 | PACKET_CONTACT_START | Start of contact list |
| 0x03 | PACKET_CONTACT | Contact information |
| 0x04 | PACKET_CONTACT_END | End of contact list |
| 0x05 | PACKET_SELF_INFO | Device self-information |
| 0x06 | PACKET_MSG_SENT | Message sent confirmation |
| 0x07 | PACKET_CONTACT_MSG_RECV | Contact message (standard) |
| 0x08 | PACKET_CHANNEL_MSG_RECV | Channel message (standard) |
| 0x09 | PACKET_CURRENT_TIME | Current time response |
| 0x0A | PACKET_NO_MORE_MSGS | No more messages available |
| 0x0C | PACKET_BATTERY | Battery level |
| 0x0D | PACKET_DEVICE_INFO | Device information |
| 0x10 | PACKET_CONTACT_MSG_RECV_V3 | Contact message (V3 with SNR) |
| 0x11 | PACKET_CHANNEL_MSG_RECV_V3 | Channel message (V3 with SNR) |
| 0x12 | PACKET_CHANNEL_INFO | Channel information |
| 0x80 | PACKET_ADVERTISEMENT | Advertisement packet |
| 0x82 | PACKET_ACK | Acknowledgment |
| 0x83 | PACKET_MESSAGES_WAITING | Messages waiting notification |
| 0x88 | PACKET_LOG_DATA | RF log data (can be ignored) |
### Parsing Responses
**PACKET_OK** (0x00):
```
Byte 0: 0x00
Bytes 1-4: Optional value (32-bit little-endian integer)
```
**PACKET_ERROR** (0x01):
```
Byte 0: 0x01
Byte 1: Error code (optional)
```
**PACKET_CHANNEL_INFO** (0x12):
```
Byte 0: 0x12
Byte 1: Channel Index
Bytes 2-33: Channel Name (32 bytes, null-terminated)
Bytes 34-65: Secret (32 bytes, but device typically only returns 20 bytes total)
```
**Note**: The device may not return the full 66-byte packet. Parse what is available. The secret field is typically not returned for security reasons.
**PACKET_DEVICE_INFO** (0x0D):
```
Byte 0: 0x0D
Byte 1: Firmware Version (uint8)
Bytes 2+: Variable length based on firmware version
For firmware version >= 3:
Byte 2: Max Contacts Raw (uint8, actual = value * 2)
Byte 3: Max Channels (uint8)
Bytes 4-7: BLE PIN (32-bit little-endian)
Bytes 8-19: Firmware Build (12 bytes, UTF-8, null-padded)
Bytes 20-59: Model (40 bytes, UTF-8, null-padded)
Bytes 60-79: Version (20 bytes, UTF-8, null-padded)
```
**Parsing Pseudocode**:
```python
def parse_device_info(data):
if len(data) < 2:
return None
fw_ver = data[1]
info = {'fw_ver': fw_ver}
if fw_ver >= 3 and len(data) >= 80:
info['max_contacts'] = data[2] * 2
info['max_channels'] = data[3]
info['ble_pin'] = int.from_bytes(data[4:8], 'little')
info['fw_build'] = data[8:20].decode('utf-8').rstrip('\x00').strip()
info['model'] = data[20:60].decode('utf-8').rstrip('\x00').strip()
info['ver'] = data[60:80].decode('utf-8').rstrip('\x00').strip()
return info
```
**PACKET_BATTERY** (0x0C):
```
Byte 0: 0x0C
Bytes 1-2: Battery Level (16-bit little-endian, percentage 0-100)
Optional (if data size > 3):
Bytes 3-6: Used Storage (32-bit little-endian, KB)
Bytes 7-10: Total Storage (32-bit little-endian, KB)
```
**Parsing Pseudocode**:
```python
def parse_battery(data):
if len(data) < 3:
return None
level = int.from_bytes(data[1:3], 'little')
info = {'level': level}
if len(data) > 3:
used_kb = int.from_bytes(data[3:7], 'little')
total_kb = int.from_bytes(data[7:11], 'little')
info['used_kb'] = used_kb
info['total_kb'] = total_kb
return info
```
**PACKET_SELF_INFO** (0x05):
```
Byte 0: 0x05
Byte 1: Advertisement Type
Byte 2: TX Power
Byte 3: Max TX Power
Bytes 4-35: Public Key (32 bytes, hex)
Bytes 36-39: Advertisement Latitude (32-bit little-endian, divided by 1e6)
Bytes 40-43: Advertisement Longitude (32-bit little-endian, divided by 1e6)
Byte 44: Multi ACKs
Byte 45: Advertisement Location Policy
Byte 46: Telemetry Mode (bitfield)
Byte 47: Manual Add Contacts (bool)
Bytes 48-51: Radio Frequency (32-bit little-endian, divided by 1000.0)
Bytes 52-55: Radio Bandwidth (32-bit little-endian, divided by 1000.0)
Byte 56: Radio Spreading Factor
Byte 57: Radio Coding Rate
Bytes 58+: Device Name (UTF-8, variable length, null-terminated)
```
**Parsing Pseudocode**:
```python
def parse_self_info(data):
if len(data) < 36:
return None
offset = 1
info = {
'adv_type': data[offset],
'tx_power': data[offset + 1],
'max_tx_power': data[offset + 2],
'public_key': data[offset + 3:offset + 35].hex()
}
offset += 35
lat = int.from_bytes(data[offset:offset+4], 'little') / 1e6
lon = int.from_bytes(data[offset+4:offset+8], 'little') / 1e6
info['adv_lat'] = lat
info['adv_lon'] = lon
offset += 8
info['multi_acks'] = data[offset]
info['adv_loc_policy'] = data[offset + 1]
telemetry_mode = data[offset + 2]
info['telemetry_mode_env'] = (telemetry_mode >> 4) & 0b11
info['telemetry_mode_loc'] = (telemetry_mode >> 2) & 0b11
info['telemetry_mode_base'] = telemetry_mode & 0b11
info['manual_add_contacts'] = data[offset + 3] > 0
offset += 4
freq = int.from_bytes(data[offset:offset+4], 'little') / 1000.0
bw = int.from_bytes(data[offset+4:offset+8], 'little') / 1000.0
info['radio_freq'] = freq
info['radio_bw'] = bw
info['radio_sf'] = data[offset + 8]
info['radio_cr'] = data[offset + 9]
offset += 10
if offset < len(data):
name_bytes = data[offset:]
info['name'] = name_bytes.decode('utf-8').rstrip('\x00').strip()
return info
```
**PACKET_MSG_SENT** (0x06):
```
Byte 0: 0x06
Byte 1: Message Type
Bytes 2-5: Expected ACK (4 bytes, hex)
Bytes 6-9: Suggested Timeout (32-bit little-endian, seconds)
```
**PACKET_ACK** (0x82):
```
Byte 0: 0x82
Bytes 1-6: ACK Code (6 bytes, hex)
```
### Error Codes
**PACKET_ERROR** (0x01) may include an error code in byte 1:
| Error Code | Description |
|------------|-------------|
| 0x00 | Generic error (no specific code) |
| 0x01 | Invalid command |
| 0x02 | Invalid parameter |
| 0x03 | Channel not found |
| 0x04 | Channel already exists |
| 0x05 | Channel index out of range |
| 0x06 | Secret mismatch |
| 0x07 | Message too long |
| 0x08 | Device busy |
| 0x09 | Not enough storage |
**Note**: Error codes may vary by firmware version. Always check byte 1 of `PACKET_ERROR` response.
### Partial Packet Handling
BLE notifications may arrive in chunks, especially for larger packets. Implement buffering:
**Implementation**:
```python
class PacketBuffer:
def __init__(self):
self.buffer = bytearray()
self.expected_length = None
def add_data(self, data):
self.buffer.extend(data)
# Check if we have a complete packet
if len(self.buffer) >= 1:
packet_type = self.buffer[0]
# Determine expected length based on packet type
expected = self.get_expected_length(packet_type)
if expected is not None and len(self.buffer) >= expected:
# Complete packet
packet = bytes(self.buffer[:expected])
self.buffer = self.buffer[expected:]
return packet
elif expected is None:
# Variable length packet - try to parse what we have
# Some packets have minimum length requirements
if self.can_parse_partial(packet_type):
return self.try_parse_partial()
return None # Incomplete packet
def get_expected_length(self, packet_type):
# Fixed-length packets
fixed_lengths = {
0x00: 5, # PACKET_OK (minimum)
0x01: 2, # PACKET_ERROR (minimum)
0x0A: 1, # PACKET_NO_MORE_MSGS
0x14: 3, # PACKET_BATTERY (minimum)
}
return fixed_lengths.get(packet_type)
def can_parse_partial(self, packet_type):
# Some packets can be parsed partially
return packet_type in [0x12, 0x08, 0x11, 0x07, 0x10, 0x05, 0x0D]
def try_parse_partial(self):
# Try to parse with available data
# Return packet if successfully parsed, None otherwise
# This is packet-type specific
pass
```
**Usage**:
```python
buffer = PacketBuffer()
def on_notification_received(data):
packet = buffer.add_data(data)
if packet:
parse_and_handle_packet(packet)
```
### Response Handling
1. **Command-Response Pattern**:
- Send command via TX characteristic
- Wait for response via RX characteristic (notification)
- Match response to command using sequence numbers or command type
- Handle timeout (typically 5 seconds)
- Use command queue to prevent concurrent commands
2. **Asynchronous Messages**:
- Device may send messages at any time via RX characteristic
- Handle `PACKET_MESSAGES_WAITING` (0x83) by polling `GET_MESSAGE` command
- Parse incoming messages and route to appropriate handlers
- Buffer partial packets until complete
3. **Response Matching**:
- Match responses to commands by expected packet type:
- `APP_START``PACKET_OK`
- `DEVICE_QUERY``PACKET_DEVICE_INFO`
- `GET_CHANNEL``PACKET_CHANNEL_INFO`
- `SET_CHANNEL``PACKET_OK` or `PACKET_ERROR`
- `SEND_CHANNEL_MESSAGE``PACKET_MSG_SENT`
- `GET_MESSAGE``PACKET_CHANNEL_MSG_RECV`, `PACKET_CONTACT_MSG_RECV`, or `PACKET_NO_MORE_MSGS`
- `GET_BATTERY``PACKET_BATTERY`
4. **Timeout Handling**:
- Default timeout: 5 seconds per command
- On timeout: Log error, clear current command, proceed to next in queue
- Some commands may take longer (e.g., `SET_CHANNEL` may need 1-2 seconds)
- Consider longer timeout for channel operations
5. **Error Recovery**:
- On `PACKET_ERROR`: Log error code, clear current command
- On connection loss: Clear command queue, attempt reconnection
- On invalid response: Log warning, clear current command, proceed
---
## Example Implementation Flow
### Initialization
```python
# 1. Scan for MeshCore device
device = scan_for_device("MeshCore")
# 2. Connect to BLE GATT
gatt = connect_to_device(device)
# 3. Discover services and characteristics
service = discover_service(gatt, "0000ff00-0000-1000-8000-00805f9b34fb")
rx_char = discover_characteristic(service, "0000ff01-0000-1000-8000-00805f9b34fb")
tx_char = discover_characteristic(service, "0000ff02-0000-1000-8000-00805f9b34fb")
# 4. Enable notifications on RX characteristic
enable_notifications(rx_char, on_notification_received)
# 5. Send AppStart command
send_command(tx_char, build_app_start())
wait_for_response(PACKET_OK)
```
### Creating a Private Channel
```python
# 1. Generate 16-byte secret
secret_16_bytes = generate_secret(16) # Use CSPRNG
secret_hex = secret_16_bytes.hex()
# 2. Expand secret to 32 bytes using SHA-512
import hashlib
sha512_hash = hashlib.sha512(secret_16_bytes).digest()
secret_32_bytes = sha512_hash[:32]
# 3. Build SET_CHANNEL command
channel_name = "YourChannelName"
channel_index = 1 # Use 1-7 for private channels
command = build_set_channel(channel_index, channel_name, secret_32_bytes)
# 4. Send command
send_command(tx_char, command)
response = wait_for_response(PACKET_OK)
# 5. Store secret locally (device won't return it)
store_channel_secret(channel_index, secret_hex)
```
### Sending a Message
```python
# 1. Build channel message command
channel_index = 1
message = "Hello, MeshCore!"
timestamp = int(time.time())
command = build_channel_message(channel_index, message, timestamp)
# 2. Send command
send_command(tx_char, command)
response = wait_for_response(PACKET_MSG_SENT)
```
### Receiving Messages
```python
def on_notification_received(data):
packet_type = data[0]
if packet_type == PACKET_CHANNEL_MSG_RECV or packet_type == PACKET_CHANNEL_MSG_RECV_V3:
message = parse_channel_message(data)
handle_channel_message(message)
elif packet_type == PACKET_MESSAGES_WAITING:
# Poll for messages
send_command(tx_char, build_get_message())
```
---
## Best Practices
1. **Connection Management**:
- Implement auto-reconnect with exponential backoff
- Handle disconnections gracefully
- Store last connected device address for quick reconnection
2. **Secret Management**:
- Always use cryptographically secure random number generators
- Store secrets securely (encrypted storage)
- Never log or transmit secrets in plain text
3. **Message Handling**:
- Send `CMD_SYNC_NEXT_MESSAGE` when `PUSH_CODE_MSG_WAITING` is received
- Implement message deduplication to avoid display the same message twice
4. **Channel Management**:
- Fetch all channel slots even if you encounter an empty slot
- Ideally save new channels into the first empty slot
5. **Error Handling**:
- Implement timeouts for all commands (typically 5 seconds)
- Handle `RESP_CODE_ERR` responses appropriately
---
## Troubleshooting
### Connection Issues
- **Device not found**: Ensure device is powered on and advertising
- **Connection timeout**: Check Bluetooth permissions and device proximity
- **GATT errors**: Ensure proper service/characteristic discovery
### Command Issues
- **No response**: Verify notifications are enabled, check connection state
- **Error responses**: Verify command format and check error code
- **Timeout**: Increase timeout value or try again
### Message Issues
- **Messages not received**: Poll `GET_MESSAGE` command periodically
- **Duplicate messages**: Implement message deduplication using timestamp/content as a unique id
- **Message truncation**: Send long messages as separate shorter messages

13
docs/docs.md Normal file
View File

@@ -0,0 +1,13 @@
# Local Documentation
This document explains how to build and view the MeshCore documentation locally.
## Building and viewing Docs
```
pip install mkdocs
pip install mkdocs-material
```
- `mkdocs serve` - Start the live-reloading docs server.
- `mkdocs build` - Build the documentation site.

File diff suppressed because it is too large Load Diff

15
docs/index.md Normal file
View File

@@ -0,0 +1,15 @@
# Introduction
Welcome to the MeshCore documentation.
Below are a few quick start guides.
- [Frequently Asked Questions](./faq.md)
- [CLI Commands](./cli_commands.md)
- [Companion Protocol](./companion_protocol.md)
- [Packet Format](./packet_format.md)
- [QR Codes](./qr_codes.md)
If you find a mistake in any of our documentation, or find something is missing, please feel free to open a pull request for us to review.
- [Documentation Source](https://github.com/meshcore-dev/MeshCore/tree/main/docs)

282
docs/kiss_modem_protocol.md Normal file
View File

@@ -0,0 +1,282 @@
# MeshCore KISS Modem Protocol
Standard KISS TNC firmware for MeshCore LoRa radios. Compatible with any KISS client (Direwolf, APRSdroid, YAAC, etc.) for sending and receiving raw packets. MeshCore-specific extensions (cryptography, radio configuration, telemetry) are available through the standard SetHardware (0x06) command.
## Serial Configuration
115200 baud, 8N1, no flow control.
## Frame Format
Standard KISS framing per the KA9Q/K3MC specification.
| Byte | Name | Description |
|------|------|-------------|
| `0xC0` | FEND | Frame delimiter |
| `0xDB` | FESC | Escape character |
| `0xDC` | TFEND | Escaped FEND (FESC + TFEND = 0xC0) |
| `0xDD` | TFESC | Escaped FESC (FESC + TFESC = 0xDB) |
```
┌──────┬───────────┬──────────────┬──────┐
│ FEND │ Type Byte │ Data (escaped)│ FEND │
│ 0xC0 │ 1 byte │ 0-510 bytes │ 0xC0 │
└──────┴───────────┴──────────────┴──────┘
```
### Type Byte
The type byte is split into two nibbles:
| Bits | Field | Description |
|------|-------|-------------|
| 7-4 | Port | Port number (0 for single-port TNC) |
| 3-0 | Command | Command number |
Maximum unescaped frame size: 512 bytes.
## Standard KISS Commands
### Host to TNC
| Command | Value | Data | Description |
|---------|-------|------|-------------|
| Data | `0x00` | Raw packet | Queue packet for transmission |
| TXDELAY | `0x01` | Delay (1 byte) | Transmitter keyup delay in 10ms units (default: 50 = 500ms) |
| Persistence | `0x02` | P (1 byte) | CSMA persistence parameter 0-255 (default: 63) |
| SlotTime | `0x03` | Interval (1 byte) | CSMA slot interval in 10ms units (default: 10 = 100ms) |
| TXtail | `0x04` | Delay (1 byte) | Post-TX hold time in 10ms units (default: 0) |
| FullDuplex | `0x05` | Mode (1 byte) | 0 = half duplex, nonzero = full duplex (default: 0) |
| SetHardware | `0x06` | Sub-command + data | MeshCore extensions (see below) |
| Return | `0xFF` | - | Exit KISS mode (no-op) |
### TNC to Host
| Type | Value | Data | Description |
|------|-------|------|-------------|
| Data | `0x00` | Raw packet | Received packet from radio |
Data frames carry raw packet data only, with no metadata prepended. The Data command payload is limited to 255 bytes to match the MeshCore maximum transmission unit (MAX_TRANS_UNIT); frames larger than 255 bytes are silently dropped. The KISS specification recommends at least 1024 bytes for general-purpose TNCs; this modem is intended for MeshCore packets only, whose protocol MTU is 255 bytes.
### CSMA Behavior
The TNC implements p-persistent CSMA for half-duplex operation:
1. When a packet is queued, monitor carrier detect
2. When the channel clears, generate a random value 0-255
3. If the value is less than or equal to P (Persistence), wait TXDELAY then transmit
4. Otherwise, wait SlotTime and repeat from step 1
In full-duplex mode, CSMA is bypassed and packets transmit after TXDELAY.
## SetHardware Extensions (0x06)
MeshCore-specific functionality uses the standard KISS SetHardware command. The first byte of SetHardware data is a sub-command. Standard KISS clients ignore these frames.
### Frame Format
```
┌──────┬──────┬─────────────┬──────────────┬──────┐
│ FEND │ 0x06 │ Sub-command │ Data (escaped)│ FEND │
│ 0xC0 │ │ 1 byte │ variable │ 0xC0 │
└──────┴──────┴─────────────┴──────────────┴──────┘
```
### Request Sub-commands (Host to TNC)
| Sub-command | Value | Data |
|-------------|-------|------|
| GetIdentity | `0x01` | - |
| GetRandom | `0x02` | Length (1 byte, 1-64) |
| VerifySignature | `0x03` | PubKey (32) + Signature (64) + Data |
| SignData | `0x04` | Data to sign |
| EncryptData | `0x05` | Key (32) + Plaintext |
| DecryptData | `0x06` | Key (32) + MAC (2) + Ciphertext |
| KeyExchange | `0x07` | Remote PubKey (32) |
| Hash | `0x08` | Data to hash |
| SetRadio | `0x09` | Freq (4) + BW (4) + SF (1) + CR (1) |
| SetTxPower | `0x0A` | Power dBm (1) |
| GetRadio | `0x0B` | - |
| GetTxPower | `0x0C` | - |
| GetCurrentRssi | `0x0D` | - |
| IsChannelBusy | `0x0E` | - |
| GetAirtime | `0x0F` | Packet length (1) |
| GetNoiseFloor | `0x10` | - |
| GetVersion | `0x11` | - |
| GetStats | `0x12` | - |
| GetBattery | `0x13` | - |
| GetMCUTemp | `0x14` | - |
| GetSensors | `0x15` | Permissions (1) |
| GetDeviceName | `0x16` | - |
| Ping | `0x17` | - |
| Reboot | `0x18` | - |
| SetSignalReport | `0x19` | Enable (1): 0x00=disable, nonzero=enable |
| GetSignalReport | `0x1A` | - |
### Response Sub-commands (TNC to Host)
Response codes use the high-bit convention: `response = command | 0x80`. Generic and unsolicited responses use the `0xF0`+ range.
| Sub-command | Value | Data |
|-------------|-------|------|
| Identity | `0x81` | PubKey (32) |
| Random | `0x82` | Random bytes (1-64) |
| Verify | `0x83` | Result (1): 0x00=invalid, 0x01=valid |
| Signature | `0x84` | Signature (64) |
| Encrypted | `0x85` | MAC (2) + Ciphertext |
| Decrypted | `0x86` | Plaintext |
| SharedSecret | `0x87` | Shared secret (32) |
| Hash | `0x88` | SHA-256 hash (32) |
| Radio | `0x8B` | Freq (4) + BW (4) + SF (1) + CR (1) |
| TxPower | `0x8C` | Power dBm (1) |
| CurrentRssi | `0x8D` | RSSI dBm (1, signed) |
| ChannelBusy | `0x8E` | Result (1): 0x00=clear, 0x01=busy |
| Airtime | `0x8F` | Milliseconds (4) |
| NoiseFloor | `0x90` | dBm (2, signed) |
| Version | `0x91` | Version (1) + Reserved (1) |
| Stats | `0x92` | RX (4) + TX (4) + Errors (4) |
| Battery | `0x93` | Millivolts (2) |
| MCUTemp | `0x94` | Temperature (2, signed) |
| Sensors | `0x95` | CayenneLPP payload |
| DeviceName | `0x96` | Name (variable, UTF-8) |
| Pong | `0x97` | - |
| SignalReport | `0x9A` | Status (1): 0x00=disabled, 0x01=enabled |
| OK | `0xF0` | - |
| Error | `0xF1` | Error code (1) |
| TxDone | `0xF8` | Result (1): 0x00=failed, 0x01=success |
| RxMeta | `0xF9` | SNR (1) + RSSI (1) |
### Error Codes
| Code | Value | Description |
|------|-------|-------------|
| InvalidLength | `0x01` | Request data too short |
| InvalidParam | `0x02` | Invalid parameter value |
| NoCallback | `0x03` | Feature not available |
| MacFailed | `0x04` | MAC verification failed |
| UnknownCmd | `0x05` | Unknown sub-command |
| EncryptFailed | `0x06` | Encryption failed |
### Unsolicited Events
The TNC sends these SetHardware frames without a preceding request:
**TxDone (0xF8)**: Sent after a packet has been transmitted. Contains a single byte: 0x01 for success, 0x00 for failure.
**RxMeta (0xF9)**: Sent immediately after each standard data frame (type 0x00) with metadata for the received packet. Contains SNR (1 byte, signed, value x4 for 0.25 dB precision) followed by RSSI (1 byte, signed, dBm). Enabled by default; can be toggled with SetSignalReport. Standard KISS clients ignore this frame.
## Data Formats
### Radio Parameters (SetRadio / Radio response)
All values little-endian.
| Field | Size | Description |
|-------|------|-------------|
| Frequency | 4 bytes | Hz (e.g., 869618000) |
| Bandwidth | 4 bytes | Hz (e.g., 62500) |
| SF | 1 byte | Spreading factor (5-12) |
| CR | 1 byte | Coding rate (5-8) |
### Version (Version response)
| Field | Size | Description |
|-------|------|-------------|
| Version | 1 byte | Firmware version |
| Reserved | 1 byte | Always 0 |
### Encrypted (Encrypted response)
| Field | Size | Description |
|-------|------|-------------|
| MAC | 2 bytes | HMAC-SHA256 truncated to 2 bytes |
| Ciphertext | variable | AES-128-CBC encrypted data |
### Airtime (Airtime response)
All values little-endian.
| Field | Size | Description |
|-------|------|-------------|
| Airtime | 4 bytes | uint32_t, estimated air time in milliseconds |
### Noise Floor (NoiseFloor response)
All values little-endian.
| Field | Size | Description |
|-------|------|-------------|
| Noise floor | 2 bytes | int16_t, dBm (signed) |
The modem recalibrates the noise floor every 2 seconds with an AGC reset every 30 seconds.
### Stats (Stats response)
All values little-endian.
| Field | Size | Description |
|-------|------|-------------|
| RX | 4 bytes | Packets received |
| TX | 4 bytes | Packets transmitted |
| Errors | 4 bytes | Receive errors |
### Battery (Battery response)
All values little-endian.
| Field | Size | Description |
|-------|------|-------------|
| Millivolts | 2 bytes | uint16_t, battery voltage in mV |
### MCU Temperature (MCUTemp response)
All values little-endian.
| Field | Size | Description |
|-------|------|-------------|
| Temperature | 2 bytes | int16_t, tenths of °C (e.g., 253 = 25.3°C) |
Returns `NoCallback` error if the board does not support temperature readings.
### Device Name (DeviceName response)
| Field | Size | Description |
|-------|------|-------------|
| Name | variable | UTF-8 string, no null terminator |
### Reboot
Sends an `OK` response, flushes serial, then reboots the device. The host should expect the connection to drop.
### Sensor Permissions (GetSensors)
| Bit | Value | Description |
|-----|-------|-------------|
| 0 | `0x01` | Base (battery) |
| 1 | `0x02` | Location (GPS) |
| 2 | `0x04` | Environment (temp, humidity, pressure) |
Use `0x07` for all permissions.
### Sensor Data (Sensors response)
Data returned in CayenneLPP format. See [CayenneLPP documentation](https://docs.mydevices.com/docs/lorawan/cayenne-lpp) for parsing.
## Cryptographic Algorithms
| Operation | Algorithm |
|-----------|-----------|
| Identity / Signing / Verification | Ed25519 |
| Key Exchange | X25519 (ECDH) |
| Encryption | AES-128-CBC + HMAC-SHA256 (MAC truncated to 2 bytes) |
| Hashing | SHA-256 |
## Notes
- Data payload limit (255 bytes) matches MeshCore MAX_TRANS_UNIT; no change needed for KISS “1024+ recommended” (that applies to general TNCs, not MeshCore)
- Modem generates identity on first boot (stored in flash)
- All multi-byte values are little-endian unless stated otherwise
- SNR values in RxMeta are multiplied by 4 for 0.25 dB precision
- TxDone is sent as a SetHardware event after each transmission
- Standard KISS clients receive only type 0x00 data frames and can safely ignore all SetHardware (0x06) frames
- See [packet_structure.md](./packet_structure.md) for packet format

View File

@@ -0,0 +1,213 @@
# nRF52 Power Management
## Overview
The nRF52 Power Management module provides battery protection features to prevent over-discharge, minimise likelihood of brownout and flash corruption conditions existing, and enable safe voltage-based recovery.
## Features
### Boot Voltage Protection
- Checks battery voltage immediately after boot and before mesh operations commence
- If voltage is below a configurable threshold (e.g., 3300mV), the device configures voltage wake (LPCOMP + VBUS) and enters protective shutdown (SYSTEMOFF)
- Prevents boot loops when battery is critically low
- Skipped when external power (USB VBUS) is detected
### Voltage Wake (LPCOMP + VBUS)
- Configures the nRF52's Low Power Comparator (LPCOMP) before entering SYSTEMOFF
- Enables USB VBUS detection so external power can wake the device
- Device automatically wakes when battery voltage rises above recovery threshold or when VBUS is detected
### Early Boot Register Capture
- Captures RESETREAS (reset reason) and GPREGRET2 (shutdown reason) before SystemInit() clears them
- Allows firmware to determine why it booted (cold boot, watchdog, LPCOMP wake, etc.)
- Allows firmware to determine why it last shut down (user request, low voltage, boot protection)
### Shutdown Reason Tracking
Shutdown reason codes (stored in GPREGRET2):
| Code | Name | Description |
|------|------|-------------|
| 0x00 | NONE | Normal boot / no previous shutdown |
| 0x4C | LOW_VOLTAGE | Runtime low voltage threshold reached |
| 0x55 | USER | User requested powerOff() |
| 0x42 | BOOT_PROTECT | Boot voltage protection triggered |
## Supported Boards
| Board | Implemented | LPCOMP wake | VBUS wake |
|-------|-------------|-------------|-----------|
| Seeed Studio XIAO nRF52840 (`xiao_nrf52`) | Yes | Yes | Yes |
| RAK4631 (`rak4631`) | Yes | Yes | Yes |
| Heltec T114 (`heltec_t114`) | Yes | Yes | Yes |
| Promicro nRF52840 | No | No | No |
| RAK WisMesh Tag | No | No | No |
| Heltec Mesh Solar | No | No | No |
| LilyGo T-Echo / T-Echo Lite | No | No | No |
| SenseCAP Solar | No | No | No |
| WIO Tracker L1 / L1 E-Ink | No | No | No |
| WIO WM1110 | No | No | No |
| Mesh Pocket | No | No | No |
| Nano G2 Ultra | No | No | No |
| ThinkNode M1/M3/M6 | No | No | No |
| T1000-E | No | No | No |
| Ikoka Nano/Stick/Handheld (nRF) | No | No | No |
| Keepteen LT1 | No | No | No |
| Minewsemi ME25LS01 | No | No | No |
Notes:
- "Implemented" reflects Phase 1 (boot lockout + shutdown reason capture).
- User power-off on Heltec T114 does not enable LPCOMP wake.
- VBUS detection is used to skip boot lockout on external power, and VBUS wake is configured alongside LPCOMP when supported hardware exposes VBUS to the nRF52.
## Technical Details
### Architecture
The power management functionality is integrated into the `NRF52Board` base class in `src/helpers/NRF52Board.cpp`. Board variants provide hardware-specific configuration via a `PowerMgtConfig` struct and override `initiateShutdown(uint8_t reason)` to perform board-specific power-down work and conditionally enable voltage wake (LPCOMP + VBUS).
### Early Boot Capture
A static constructor with priority 101 in `NRF52Board.cpp` captures the RESETREAS and GPREGRET2 registers before:
- SystemInit() (priority 102) - which clears RESETREAS
- Static C++ constructors (default priority 65535)
This ensures we capture the true reset reason before any initialisation code runs.
### Board Implementation
To enable power management on a board variant:
1. **Enable in platformio.ini**:
```ini
-D NRF52_POWER_MANAGEMENT
```
2. **Define configuration in variant.h**:
```c
#define PWRMGT_VOLTAGE_BOOTLOCK 3300 // Won't boot below this voltage (mV)
#define PWRMGT_LPCOMP_AIN 7 // AIN channel for voltage sensing
#define PWRMGT_LPCOMP_REFSEL 2 // REFSEL (0-6=1/8..7/8, 7=ARef, 8-15=1/16..15/16)
```
3. **Implement in board .cpp file**:
```cpp
#ifdef NRF52_POWER_MANAGEMENT
const PowerMgtConfig power_config = {
.lpcomp_ain_channel = PWRMGT_LPCOMP_AIN,
.lpcomp_refsel = PWRMGT_LPCOMP_REFSEL,
.voltage_bootlock = PWRMGT_VOLTAGE_BOOTLOCK
};
void MyBoard::initiateShutdown(uint8_t reason) {
// Board-specific shutdown preparation (e.g., disable peripherals)
bool enable_lpcomp = (reason == SHUTDOWN_REASON_LOW_VOLTAGE ||
reason == SHUTDOWN_REASON_BOOT_PROTECT);
if (enable_lpcomp) {
configureVoltageWake(power_config.lpcomp_ain_channel, power_config.lpcomp_refsel);
}
enterSystemOff(reason);
}
#endif
void MyBoard::begin() {
NRF52Board::begin(); // or NRF52BoardDCDC::begin()
// ... board setup ...
#ifdef NRF52_POWER_MANAGEMENT
checkBootVoltage(&power_config);
#endif
}
```
For user-initiated shutdowns, `powerOff()` remains board-specific. Power management only arms LPCOMP for automated shutdown reasons (boot protection/low voltage).
4. **Declare override in board .h file**:
```cpp
#ifdef NRF52_POWER_MANAGEMENT
void initiateShutdown(uint8_t reason) override;
#endif
```
### Voltage Wake Configuration
The LPCOMP (Low Power Comparator) is configured to:
- Monitor the specified AIN channel (0-7 corresponding to P0.02-P0.05, P0.28-P0.31)
- Compare against VDD fraction reference (REFSEL: 0-6=1/8..7/8, 7=ARef, 8-15=1/16..15/16)
- Detect UP events (voltage rising above threshold)
- Use 50mV hysteresis for noise immunity
- Wake the device from SYSTEMOFF when triggered
VBUS wake is enabled via the POWER peripheral USBDETECTED event whenever `configureVoltageWake()` is used. This requires USB VBUS to be routed to the nRF52 (typical on nRF52840 boards with native USB).
**LPCOMP Reference Selection (PWRMGT_LPCOMP_REFSEL)**:
| REFSEL | Fraction | VBAT @ 1M/1M divider (VDD=3.0-3.3) | VBAT @ 1.5M/1M divider (VDD=3.0-3.3) |
|--------|----------|------------------------------------|--------------------------------------|
| 0 | 1/8 | 0.75-0.82 V | 0.94-1.03 V |
| 1 | 2/8 | 1.50-1.65 V | 1.88-2.06 V |
| 2 | 3/8 | 2.25-2.47 V | 2.81-3.09 V |
| 3 | 4/8 | 3.00-3.30 V | 3.75-4.12 V |
| 4 | 5/8 | 3.75-4.12 V | 4.69-5.16 V |
| 5 | 6/8 | 4.50-4.95 V | 5.62-6.19 V |
| 6 | 7/8 | 5.25-5.77 V | 6.56-7.22 V |
| 7 | ARef | - | - |
| 8 | 1/16 | 0.38-0.41 V | 0.47-0.52 V |
| 9 | 3/16 | 1.12-1.24 V | 1.41-1.55 V |
| 10 | 5/16 | 1.88-2.06 V | 2.34-2.58 V |
| 11 | 7/16 | 2.62-2.89 V | 3.28-3.61 V |
| 12 | 9/16 | 3.38-3.71 V | 4.22-4.64 V |
| 13 | 11/16 | 4.12-4.54 V | 5.16-5.67 V |
| 14 | 13/16 | 4.88-5.36 V | 6.09-6.70 V |
| 15 | 15/16 | 5.62-6.19 V | 7.03-7.73 V |
**Important**: For boards with a voltage divider on the battery sense pin, LPCOMP measures the divided voltage. Use:
`VBAT_threshold ≈ (VDD * fraction) * divider_scale`, where `divider_scale = (Rtop + Rbottom) / Rbottom` (e.g., 2.0 for 1M/1M, 2.5 for 1.5M/1M, 3.0 for XIAO).
### SoftDevice Compatibility
The power management code checks whether SoftDevice is enabled and uses the appropriate API:
- When SD enabled: `sd_power_*` functions
- When SD disabled: Direct register access (NRF_POWER->*)
This ensures compatibility regardless of BLE stack state.
## CLI Commands
Power management status can be queried via the CLI:
| Command | Description |
|---------|-------------|
| `get pwrmgt.support` | Returns "supported" or "unsupported" |
| `get pwrmgt.source` | Returns current power source - "battery" or "external" (5V/USB power) |
| `get pwrmgt.bootreason` | Returns reset and shutdown reason strings |
| `get pwrmgt.bootmv` | Returns boot voltage in millivolts |
On boards without power management enabled, all commands except `get pwrmgt.support` return:
```
ERROR: Power management not supported
```
## Debug Output
When `MESH_DEBUG=1` is enabled, the power management module outputs:
```
DEBUG: PWRMGT: Reset = Wake from LPCOMP (0x20000); Shutdown = Low Voltage (0x4C)
DEBUG: PWRMGT: Boot voltage = 3450 mV (threshold = 3300 mV)
DEBUG: PWRMGT: LPCOMP wake configured (AIN7, ref=3/8 VDD)
```
## Phase 2 (Planned)
- Runtime voltage monitoring
- Voltage state machine (Normal -> Warning -> Critical -> Shutdown)
- Configurable thresholds
- Load shedding callbacks for power reduction
- Deep sleep integration
- Scheduled wake-up
- Extended sleep with periodic monitoring
## References
- [nRF52840 Product Specification - POWER](https://infocenter.nordicsemi.com/topic/ps_nrf52840/power.html)
- [nRF52840 Product Specification - LPCOMP](https://infocenter.nordicsemi.com/topic/ps_nrf52840/lpcomp.html)
- [SoftDevice S140 API - Power Management](https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__sdm__api.html)

120
docs/packet_format.md Normal file
View File

@@ -0,0 +1,120 @@
# Packet Format
This document describes the MeshCore packet format.
- `0xYY` indicates `YY` in hex notation.
- `0bYY` indicates `YY` in binary notation.
- Bit 0 indicates the bit furthest to the right: `0000000X`
- Bit 7 indicates the bit furthest to the left: `X0000000`
## Version 1 Packet Format
This is the protocol level packet structure used in MeshCore firmware v1.12.0
```
[header][transport_codes(optional)][path_length][path][payload]
```
- [header](#header-format) - 1 byte
- 8-bit Format: `0bVVPPPPRR` - `V=Version` - `P=PayloadType` - `R=RouteType`
- Bits 0-1 - 2-bits - [Route Type](#route-types)
- `0x00`/`0b00` - `ROUTE_TYPE_TRANSPORT_FLOOD` - Flood Routing + Transport Codes
- `0x01`/`0b01` - `ROUTE_TYPE_FLOOD` - Flood Routing
- `0x02`/`0b10` - `ROUTE_TYPE_DIRECT` - Direct Routing
- `0x03`/`0b11` - `ROUTE_TYPE_TRANSPORT_DIRECT` - Direct Routing + Transport Codes
- Bits 2-5 - 4-bits - [Payload Type](#payload-types)
- `0x00`/`0b0000` - `PAYLOAD_TYPE_REQ` - Request (destination/source hashes + MAC)
- `0x01`/`0b0001` - `PAYLOAD_TYPE_RESPONSE` - Response to `REQ` or `ANON_REQ`
- `0x02`/`0b0010` - `PAYLOAD_TYPE_TXT_MSG` - Plain text message
- `0x03`/`0b0011` - `PAYLOAD_TYPE_ACK` - Acknowledgment
- `0x04`/`0b0100` - `PAYLOAD_TYPE_ADVERT` - Node advertisement
- `0x05`/`0b0101` - `PAYLOAD_TYPE_GRP_TXT` - Group text message (unverified)
- `0x06`/`0b0110` - `PAYLOAD_TYPE_GRP_DATA` - Group datagram (unverified)
- `0x07`/`0b0111` - `PAYLOAD_TYPE_ANON_REQ` - Anonymous request
- `0x08`/`0b1000` - `PAYLOAD_TYPE_PATH` - Returned path
- `0x09`/`0b1001` - `PAYLOAD_TYPE_TRACE` - Trace a path, collecting SNR for each hop
- `0x0A`/`0b1010` - `PAYLOAD_TYPE_MULTIPART` - Packet is part of a sequence of packets
- `0x0B`/`0b1011` - `PAYLOAD_TYPE_CONTROL` - Control packet data (unencrypted)
- `0x0C`/`0b1100` - reserved
- `0x0D`/`0b1101` - reserved
- `0x0E`/`0b1110` - reserved
- `0x0F`/`0b1111` - `PAYLOAD_TYPE_RAW_CUSTOM` - Custom packet (raw bytes, custom encryption)
- Bits 6-7 - 2-bits - [Payload Version](#payload-versions)
- `0x00`/`0b00` - v1 - 1-byte src/dest hashes, 2-byte MAC
- `0x01`/`0b01` - v2 - Future version (e.g., 2-byte hashes, 4-byte MAC)
- `0x02`/`0b10` - v3 - Future version
- `0x03`/`0b11` - v4 - Future version
- `transport_codes` - 4 bytes (optional)
- Only present for `ROUTE_TYPE_TRANSPORT_FLOOD` and `ROUTE_TYPE_TRANSPORT_DIRECT`
- `transport_code_1` - 2 bytes - `uint16_t` - calculated from region scope
- `transport_code_2` - 2 bytes - `uint16_t` - reserved
- `path_length` - 1 byte - Length of the path field in bytes
- `path` - size provided by `path_length` - Path to use for Direct Routing
- Up to a maximum of 64 bytes, defined by `MAX_PATH_SIZE`
- v1.12.0 firmware and older drops packets with `path_length` [larger than 64](https://github.com/meshcore-dev/MeshCore/blob/e812632235274ffd2382adf5354168aec765d416/src/Dispatcher.cpp#L144)
- `payload` - variable length - Payload Data
- Up to a maximum 184 bytes, defined by `MAX_PACKET_PAYLOAD`
- Generally this is the remainder of the raw packet data
- The firmware parses this data based on the provided Payload Type
- v1.12.0 firmware and older drops packets with `payload` sizes [larger than 184](https://github.com/meshcore-dev/MeshCore/blob/e812632235274ffd2382adf5354168aec765d416/src/Dispatcher.cpp#L152)
### Packet Format
| Field | Size (bytes) | Description |
|-----------------|----------------------------------|----------------------------------------------------------|
| header | 1 | Contains routing type, payload type, and payload version |
| transport_codes | 4 (optional) | 2x 16-bit transport codes (if ROUTE_TYPE_TRANSPORT_*) |
| path_length | 1 | Length of the path field in bytes |
| path | up to 64 (`MAX_PATH_SIZE`) | Stores the routing path if applicable |
| payload | up to 184 (`MAX_PACKET_PAYLOAD`) | Data for the provided Payload Type |
> NOTE: see the [Payloads](./payloads.md) documentation for more information about the content of specific payload types.
### Header Format
Bit 0 means the lowest bit (1s place)
| Bits | Mask | Field | Description |
|------|--------|-----------------|----------------------------------|
| 0-1 | `0x03` | Route Type | Flood, Direct, etc |
| 2-5 | `0x3C` | Payload Type | Request, Response, ACK, etc |
| 6-7 | `0xC0` | Payload Version | Versioning of the payload format |
### Route Types
| Value | Name | Description |
|--------|-------------------------------|----------------------------------|
| `0x00` | `ROUTE_TYPE_TRANSPORT_FLOOD` | Flood Routing + Transport Codes |
| `0x01` | `ROUTE_TYPE_FLOOD` | Flood Routing |
| `0x02` | `ROUTE_TYPE_DIRECT` | Direct Routing |
| `0x03` | `ROUTE_TYPE_TRANSPORT_DIRECT` | Direct Routing + Transport Codes |
### Payload Types
| Value | Name | Description |
|--------|---------------------------|----------------------------------------------|
| `0x00` | `PAYLOAD_TYPE_REQ` | Request (destination/source hashes + MAC) |
| `0x01` | `PAYLOAD_TYPE_RESPONSE` | Response to `REQ` or `ANON_REQ` |
| `0x02` | `PAYLOAD_TYPE_TXT_MSG` | Plain text message |
| `0x03` | `PAYLOAD_TYPE_ACK` | Acknowledgment |
| `0x04` | `PAYLOAD_TYPE_ADVERT` | Node advertisement |
| `0x05` | `PAYLOAD_TYPE_GRP_TXT` | Group text message (unverified) |
| `0x06` | `PAYLOAD_TYPE_GRP_DATA` | Group datagram (unverified) |
| `0x07` | `PAYLOAD_TYPE_ANON_REQ` | Anonymous request |
| `0x08` | `PAYLOAD_TYPE_PATH` | Returned path |
| `0x09` | `PAYLOAD_TYPE_TRACE` | Trace a path, collecting SNR for each hop |
| `0x0A` | `PAYLOAD_TYPE_MULTIPART` | Packet is part of a sequence of packets |
| `0x0B` | `PAYLOAD_TYPE_CONTROL` | Control packet data (unencrypted) |
| `0x0C` | reserved | reserved |
| `0x0D` | reserved | reserved |
| `0x0E` | reserved | reserved |
| `0x0F` | `PAYLOAD_TYPE_RAW_CUSTOM` | Custom packet (raw bytes, custom encryption) |
### Payload Versions
| Value | Version | Description |
|--------|---------|--------------------------------------------------|
| `0x00` | 1 | 1-byte src/dest hashes, 2-byte MAC |
| `0x01` | 2 | Future version (e.g., 2-byte hashes, 4-byte MAC) |
| `0x02` | 3 | Future version |
| `0x03` | 4 | Future version |

273
docs/payloads.md Normal file
View File

@@ -0,0 +1,273 @@
# Payload Format
Inside each [MeshCore Packet](./packet_format.md) is a payload, identified by the payload type in the packet header. The types of payloads are:
* Node advertisement.
* Acknowledgment.
* Returned path.
* Request (destination/source hashes + MAC).
* Response to REQ or ANON_REQ.
* Plain text message.
* Anonymous request.
* Group text message (unverified).
* Group datagram (unverified).
* Multi-part packet
* Control data packet
* Custom packet (raw bytes, custom encryption).
This document defines the structure of each of these payload types.
NOTE: all 16 and 32-bit integer fields are Little Endian.
## Important concepts:
* Node hash: the first byte of the node's public key
# Node advertisement
This kind of payload notifies receivers that a node exists, and gives information about the node
| Field | Size (bytes) | Description |
|---------------|-----------------|----------------------------------------------------------|
| public key | 32 | Ed25519 public key of the node |
| timestamp | 4 | unix timestamp of advertisement |
| signature | 64 | Ed25519 signature of public key, timestamp, and app data |
| appdata | rest of payload | optional, see below |
Appdata
| Field | Size (bytes) | Description |
|---------------|-----------------|-------------------------------------------------------|
| flags | 1 | specifies which of the fields are present, see below |
| latitude | 4 (optional) | decimal latitude multiplied by 1000000, integer |
| longitude | 4 (optional) | decimal longitude multiplied by 1000000, integer |
| feature 1 | 2 (optional) | reserved for future use |
| feature 2 | 2 (optional) | reserved for future use |
| name | rest of appdata | name of the node |
Appdata Flags
| Value | Name | Description |
|--------|----------------|---------------------------------------|
| `0x01` | is chat node | advert is for a chat node |
| `0x02` | is repeater | advert is for a repeater |
| `0x03` | is room server | advert is for a room server |
| `0x04` | is sensor | advert is for a sensor server |
| `0x10` | has location | appdata contains lat/long information |
| `0x20` | has feature 1 | Reserved for future use. |
| `0x40` | has feature 2 | Reserved for future use. |
| `0x80` | has name | appdata contains a node name |
# Acknowledgement
An acknowledgement that a message was received. Note that for returned path messages, an acknowledgement can be sent in the "extra" payload (see [Returned Path](#returned-path)) instead of as a separate ackowledgement packet. CLI commands do not cause acknowledgement responses, neither discrete nor extra.
| Field | Size (bytes) | Description |
|----------|--------------|------------------------------------------------------------|
| checksum | 4 | CRC checksum of message timestamp, text, and sender pubkey |
# Returned path, request, response, and plain text message
Returned path, request, response, and plain text messages are all formatted in the same way. See the subsection for more details about the ciphertext's associated plaintext representation.
| Field | Size (bytes) | Description |
|------------------|-----------------|------------------------------------------------------|
| destination hash | 1 | first byte of destination node public key |
| source hash | 1 | first byte of source node public key |
| cipher MAC | 2 | MAC for encrypted data in next field |
| ciphertext | rest of payload | encrypted message, see subsections below for details |
## Returned path
Returned path messages provide a description of the route a packet took from the original author. Receivers will send returned path messages to the author of the original message.
| Field | Size (bytes) | Description |
|-------------|--------------|----------------------------------------------------------------------------------------------------------------------|
| path length | 1 | length of next field |
| path | see above | a list of node hashes (one byte each) |
| extra type | 1 | extra, bundled payload type, eg., acknowledgement or response. Same values as in [Packet Format](./packet_format.md) |
| extra | rest of data | extra, bundled payload content, follows same format as main content defined by this document |
## Request
| Field | Size (bytes) | Description |
|--------------|-----------------|----------------------------|
| timestamp | 4 | send time (unix timestamp) |
| request type | 1 | see below |
| request data | rest of payload | depends on request type |
Request type
| Value | Name | Description |
|--------|----------------------|---------------------------------------|
| `0x01` | get stats | get stats of repeater or room server |
| `0x02` | keepalive | (deprecated) |
| `0x03` | get telemetry data | TODO |
| `0x04` | get min,max,avg data | sensor nodes - get min, max, average for given time span |
| `0x05` | get access list | get node's approved access list |
| `0x06` | get neighbors | get repeater node's neighbors |
| `0x07` | get owner info | get repeater firmware-ver/name/owner info |
### Get stats
Gets information about the node, possibly including the following:
* Battery level (millivolts)
* Current transmit queue length
* Current free queue length
* Last RSSI value
* Number of received packets
* Number of sent packets
* Total airtime (seconds)
* Total uptime (seconds)
* Number of packets sent as flood
* Number of packets sent directly
* Number of packets received as flood
* Number of packets received directly
* Error flags
* Last SNR value
* Number of direct route duplicates
* Number of flood route duplicates
* Number posted (?)
* Number of post pushes (?)
### Get telemetry data
Request data about sensors on the node, including battery level.
### Get Telemetry
TODO
### Get Min/Max/Ave (Sensor nodes)
TODO
### Get Access List
TODO
### Get Neighors
TODO
### Get Owner Info
TODO
## Response
| Field | Size (bytes) | Description |
|---------|-----------------|-------------|
| tag | 4 | TODO |
| content | rest of payload | TODO |
## Plain text message
| Field | Size (bytes) | Description |
|--------------------|-----------------|--------------------------------------------------------------|
| timestamp | 4 | send time (unix timestamp) |
| txt_type + attempt | 1 | upper six bits are txt_type (see below), lower two bits are attempt number (0..3) |
| message | rest of payload | the message content, see next table |
txt_type
| Value | Description | Message content |
|--------|---------------------------|------------------------------------------------------------|
| `0x00` | plain text message | the plain text of the message |
| `0x01` | CLI command | the command text of the message |
| `0x02` | signed plain text message | first four bytes is sender pubkey prefix, followed by plain text message |
# Anonymous request
| Field | Size (bytes) | Description |
|------------------|-----------------|-------------------------------------------|
| destination hash | 1 | first byte of destination node public key |
| public key | 32 | sender's Ed25519 public key |
| cipher MAC | 2 | MAC for encrypted data in next field |
| ciphertext | rest of payload | encrypted message, see below for details |
## Room server login
| Field | Size (bytes) | Description |
|----------------|-----------------|-------------------------------------------------------------------------------|
| timestamp | 4 | sender time (unix timestamp) |
| sync timestamp | 4 | sender's "sync messages SINCE x" timestamp |
| password | rest of message | password for room |
## Repeater/Sensor login
| Field | Size (bytes) | Description |
|----------------|-----------------|-------------------------------------------------------------------------------|
| timestamp | 4 | sender time (unix timestamp) |
| password | rest of message | password for repeater/sensor |
## Repeater - Regions request
| Field | Size (bytes) | Description |
|----------------|-----------------|-------------------------------------------------------------------------------|
| timestamp | 4 | sender time (unix timestamp) |
| req type | 1 | 0x01 (request sub type) |
| reply path len | 1 | path len for reply |
| reply path | (variable) | reply path |
## Repeater - Owner info request
| Field | Size (bytes) | Description |
|----------------|-----------------|-------------------------------------------------------------------------------|
| timestamp | 4 | sender time (unix timestamp) |
| req type | 1 | 0x02 (request sub type) |
| reply path len | 1 | path len for reply |
| reply path | (variable) | reply path |
## Repeater - Clock and status request
| Field | Size (bytes) | Description |
|----------------|-----------------|-------------------------------------------------------------------------------|
| timestamp | 4 | sender time (unix timestamp) |
| req type | 1 | 0x03 (request sub type) |
| reply path len | 1 | path len for reply |
| reply path | (variable) | reply path |
# Group text message / datagram
| Field | Size (bytes) | Description |
|--------------|-----------------|--------------------------------------------|
| channel hash | 1 | first byte of SHA256 of channel's shared key |
| cipher MAC | 2 | MAC for encrypted data in next field |
| ciphertext | rest of payload | encrypted message, see below for details |
The plaintext contained in the ciphertext matches the format described in [plain text message](#plain-text-message). Specifically, it consists of a four byte timestamp, a flags byte, and the message. The flags byte will generally be `0x00` because it is a "plain text message". The message will be of the form `<sender name>: <message body>` (eg., `user123: I'm on my way`).
# Control data
| Field | Size (bytes) | Description |
|--------------|-----------------|--------------------------------------------|
| flags | 1 | upper 4 bits is sub_type |
| data | rest of payload | typically unencrypted data |
## DISCOVER_REQ (sub_type)
| Field | Size (bytes) | Description |
|--------------|-----------------|----------------------------------------------|
| flags | 1 | 0x8 (upper 4 bits), prefix_only (lowest bit) |
| type_filter | 1 | bit for each ADV_TYPE_* |
| tag | 4 | randomly generate by sender |
| since | 4 | (optional) epoch timestamp (0 by default) |
## DISCOVER_RESP (sub_type)
| Field | Size (bytes) | Description |
|--------------|-----------------|--------------------------------------------|
| flags | 1 | 0x9 (upper 4 bits), node_type (lower 4) |
| snr | 1 | signed, SNR*4 |
| tag | 4 | reflected back from DISCOVER_REQ |
| pubkey | 8 or 32 | node's ID (or prefix) |
# Custom packet
Custom packets have no defined format.

34
docs/qr_codes.md Normal file
View File

@@ -0,0 +1,34 @@
# QR Codes
This document provides an overview of QR Code formats that can be used for sharing MeshCore channels and contacts. The formats described below are supported by the MeshCore mobile app.
## Add Channel
**Example URL**:
```
meshcore://channel/add?name=Public&secret=8b3387e9c5cdea6ac9e5edbaa115cd72
```
**Parameters**:
- `name`: Channel name (URL-encoded if needed)
- `secret`: 16-byte secret represented as 32 hex characters
## Add Contact
**Example URL**:
```
meshcore://contact/add?name=Example+Contact&public_key=9cd8fcf22a47333b591d96a2b848b73f457b1bb1a3ea2453a885f9e5787765b1&type=1
```
**Parameters**:
- `name`: Contact name (URL-encoded if needed)
- `public_key`: 32-byte public key represented as 64 hex characters
- `type`: numeric contact type
- `1`: Companion
- `2`: Repeater
- `3`: Room Server
- `4`: Sensor

328
docs/stats_binary_frames.md Normal file
View File

@@ -0,0 +1,328 @@
# Stats Binary Frame Structures
Binary frame structures for companion radio stats commands. All multi-byte integers use little-endian byte order.
## Command Codes
| Command | Code | Description |
|---------|------|-------------|
| `CMD_GET_STATS` | 56 | Get statistics (2-byte command: code + sub-type) |
### Stats Sub-Types
The `CMD_GET_STATS` command uses a 2-byte frame structure:
- **Byte 0:** `CMD_GET_STATS` (56)
- **Byte 1:** Stats sub-type:
- `STATS_TYPE_CORE` (0) - Get core device statistics
- `STATS_TYPE_RADIO` (1) - Get radio statistics
- `STATS_TYPE_PACKETS` (2) - Get packet statistics
## Response Codes
| Response | Code | Description |
|----------|------|-------------|
| `RESP_CODE_STATS` | 24 | Statistics response (2-byte response: code + sub-type) |
### Stats Response Sub-Types
The `RESP_CODE_STATS` response uses a 2-byte header structure:
- **Byte 0:** `RESP_CODE_STATS` (24)
- **Byte 1:** Stats sub-type (matches command sub-type):
- `STATS_TYPE_CORE` (0) - Core device statistics response
- `STATS_TYPE_RADIO` (1) - Radio statistics response
- `STATS_TYPE_PACKETS` (2) - Packet statistics response
---
## RESP_CODE_STATS + STATS_TYPE_CORE (24, 0)
**Total Frame Size:** 11 bytes
| Offset | Size | Type | Field Name | Description | Range/Notes |
|--------|------|------|------------|-------------|-------------|
| 0 | 1 | uint8_t | response_code | Always `0x18` (24) | - |
| 1 | 1 | uint8_t | stats_type | Always `0x00` (STATS_TYPE_CORE) | - |
| 2 | 2 | uint16_t | battery_mv | Battery voltage in millivolts | 0 - 65,535 |
| 4 | 4 | uint32_t | uptime_secs | Device uptime in seconds | 0 - 4,294,967,295 |
| 8 | 2 | uint16_t | errors | Error flags bitmask | - |
| 10 | 1 | uint8_t | queue_len | Outbound packet queue length | 0 - 255 |
### Example Structure (C/C++)
```c
struct StatsCore {
uint8_t response_code; // 0x18
uint8_t stats_type; // 0x00 (STATS_TYPE_CORE)
uint16_t battery_mv;
uint32_t uptime_secs;
uint16_t errors;
uint8_t queue_len;
} __attribute__((packed));
```
---
## RESP_CODE_STATS + STATS_TYPE_RADIO (24, 1)
**Total Frame Size:** 14 bytes
| Offset | Size | Type | Field Name | Description | Range/Notes |
|--------|------|------|------------|-------------|-------------|
| 0 | 1 | uint8_t | response_code | Always `0x18` (24) | - |
| 1 | 1 | uint8_t | stats_type | Always `0x01` (STATS_TYPE_RADIO) | - |
| 2 | 2 | int16_t | noise_floor | Radio noise floor in dBm | -140 to +10 |
| 4 | 1 | int8_t | last_rssi | Last received signal strength in dBm | -128 to +127 |
| 5 | 1 | int8_t | last_snr | SNR scaled by 4 | Divide by 4.0 for dB |
| 6 | 4 | uint32_t | tx_air_secs | Cumulative transmit airtime in seconds | 0 - 4,294,967,295 |
| 10 | 4 | uint32_t | rx_air_secs | Cumulative receive airtime in seconds | 0 - 4,294,967,295 |
### Example Structure (C/C++)
```c
struct StatsRadio {
uint8_t response_code; // 0x18
uint8_t stats_type; // 0x01 (STATS_TYPE_RADIO)
int16_t noise_floor;
int8_t last_rssi;
int8_t last_snr; // Divide by 4.0 to get actual SNR in dB
uint32_t tx_air_secs;
uint32_t rx_air_secs;
} __attribute__((packed));
```
---
## RESP_CODE_STATS + STATS_TYPE_PACKETS (24, 2)
**Total Frame Size:** 26 bytes (legacy) or 30 bytes (includes `recv_errors`)
| Offset | Size | Type | Field Name | Description | Range/Notes |
|--------|------|------|------------|-------------|-------------|
| 0 | 1 | uint8_t | response_code | Always `0x18` (24) | - |
| 1 | 1 | uint8_t | stats_type | Always `0x02` (STATS_TYPE_PACKETS) | - |
| 2 | 4 | uint32_t | recv | Total packets received | 0 - 4,294,967,295 |
| 6 | 4 | uint32_t | sent | Total packets sent | 0 - 4,294,967,295 |
| 10 | 4 | uint32_t | flood_tx | Packets sent via flood routing | 0 - 4,294,967,295 |
| 14 | 4 | uint32_t | direct_tx | Packets sent via direct routing | 0 - 4,294,967,295 |
| 18 | 4 | uint32_t | flood_rx | Packets received via flood routing | 0 - 4,294,967,295 |
| 22 | 4 | uint32_t | direct_rx | Packets received via direct routing | 0 - 4,294,967,295 |
| 26 | 4 | uint32_t | recv_errors | Receive/CRC errors (RadioLib); present only in 30-byte frame | 0 - 4,294,967,295 |
### Notes
- Counters are cumulative from boot and may wrap.
- `recv = flood_rx + direct_rx`
- `sent = flood_tx + direct_tx`
- Clients should accept frame length ≥ 26; if length ≥ 30, parse `recv_errors` at offset 26.
### Example Structure (C/C++)
```c
struct StatsPackets {
uint8_t response_code; // 0x18
uint8_t stats_type; // 0x02 (STATS_TYPE_PACKETS)
uint32_t recv;
uint32_t sent;
uint32_t flood_tx;
uint32_t direct_tx;
uint32_t flood_rx;
uint32_t direct_rx;
uint32_t recv_errors; // present when frame size is 30
} __attribute__((packed));
```
---
## Command Usage Example (Python)
```python
# Send CMD_GET_STATS command
def send_get_stats_core(serial_interface):
"""Send command to get core stats"""
cmd = bytes([56, 0]) # CMD_GET_STATS (56) + STATS_TYPE_CORE (0)
serial_interface.write(cmd)
def send_get_stats_radio(serial_interface):
"""Send command to get radio stats"""
cmd = bytes([56, 1]) # CMD_GET_STATS (56) + STATS_TYPE_RADIO (1)
serial_interface.write(cmd)
def send_get_stats_packets(serial_interface):
"""Send command to get packet stats"""
cmd = bytes([56, 2]) # CMD_GET_STATS (56) + STATS_TYPE_PACKETS (2)
serial_interface.write(cmd)
```
---
## Response Parsing Example (Python)
```python
import struct
def parse_stats_core(frame):
"""Parse RESP_CODE_STATS + STATS_TYPE_CORE frame (11 bytes)"""
response_code, stats_type, battery_mv, uptime_secs, errors, queue_len = \
struct.unpack('<B B H I H B', frame)
assert response_code == 24 and stats_type == 0, "Invalid response type"
return {
'battery_mv': battery_mv,
'uptime_secs': uptime_secs,
'errors': errors,
'queue_len': queue_len
}
def parse_stats_radio(frame):
"""Parse RESP_CODE_STATS + STATS_TYPE_RADIO frame (14 bytes)"""
response_code, stats_type, noise_floor, last_rssi, last_snr, tx_air_secs, rx_air_secs = \
struct.unpack('<B B h b b I I', frame)
assert response_code == 24 and stats_type == 1, "Invalid response type"
return {
'noise_floor': noise_floor,
'last_rssi': last_rssi,
'last_snr': last_snr / 4.0, # Unscale SNR
'tx_air_secs': tx_air_secs,
'rx_air_secs': rx_air_secs
}
def parse_stats_packets(frame):
"""Parse RESP_CODE_STATS + STATS_TYPE_PACKETS frame (26 or 30 bytes)"""
assert len(frame) >= 26, "STATS_TYPE_PACKETS frame too short"
response_code, stats_type, recv, sent, flood_tx, direct_tx, flood_rx, direct_rx = \
struct.unpack('<B B I I I I I I', frame[:26])
assert response_code == 24 and stats_type == 2, "Invalid response type"
result = {
'recv': recv,
'sent': sent,
'flood_tx': flood_tx,
'direct_tx': direct_tx,
'flood_rx': flood_rx,
'direct_rx': direct_rx
}
if len(frame) >= 30:
(recv_errors,) = struct.unpack('<I', frame[26:30])
result['recv_errors'] = recv_errors
return result
```
---
## Command Usage Example (JavaScript/TypeScript)
```typescript
// Send CMD_GET_STATS command
const CMD_GET_STATS = 56;
const STATS_TYPE_CORE = 0;
const STATS_TYPE_RADIO = 1;
const STATS_TYPE_PACKETS = 2;
function sendGetStatsCore(serialInterface: SerialPort): void {
const cmd = new Uint8Array([CMD_GET_STATS, STATS_TYPE_CORE]);
serialInterface.write(cmd);
}
function sendGetStatsRadio(serialInterface: SerialPort): void {
const cmd = new Uint8Array([CMD_GET_STATS, STATS_TYPE_RADIO]);
serialInterface.write(cmd);
}
function sendGetStatsPackets(serialInterface: SerialPort): void {
const cmd = new Uint8Array([CMD_GET_STATS, STATS_TYPE_PACKETS]);
serialInterface.write(cmd);
}
```
---
## Response Parsing Example (JavaScript/TypeScript)
```typescript
interface StatsCore {
battery_mv: number;
uptime_secs: number;
errors: number;
queue_len: number;
}
interface StatsRadio {
noise_floor: number;
last_rssi: number;
last_snr: number;
tx_air_secs: number;
rx_air_secs: number;
}
interface StatsPackets {
recv: number;
sent: number;
flood_tx: number;
direct_tx: number;
flood_rx: number;
direct_rx: number;
recv_errors?: number; // present when frame is 30 bytes
}
function parseStatsCore(buffer: ArrayBuffer): StatsCore {
const view = new DataView(buffer);
const response_code = view.getUint8(0);
const stats_type = view.getUint8(1);
if (response_code !== 24 || stats_type !== 0) {
throw new Error('Invalid response type');
}
return {
battery_mv: view.getUint16(2, true),
uptime_secs: view.getUint32(4, true),
errors: view.getUint16(8, true),
queue_len: view.getUint8(10)
};
}
function parseStatsRadio(buffer: ArrayBuffer): StatsRadio {
const view = new DataView(buffer);
const response_code = view.getUint8(0);
const stats_type = view.getUint8(1);
if (response_code !== 24 || stats_type !== 1) {
throw new Error('Invalid response type');
}
return {
noise_floor: view.getInt16(2, true),
last_rssi: view.getInt8(4),
last_snr: view.getInt8(5) / 4.0, // Unscale SNR
tx_air_secs: view.getUint32(6, true),
rx_air_secs: view.getUint32(10, true)
};
}
function parseStatsPackets(buffer: ArrayBuffer): StatsPackets {
const view = new DataView(buffer);
if (buffer.byteLength < 26) {
throw new Error('STATS_TYPE_PACKETS frame too short');
}
const response_code = view.getUint8(0);
const stats_type = view.getUint8(1);
if (response_code !== 24 || stats_type !== 2) {
throw new Error('Invalid response type');
}
const result: StatsPackets = {
recv: view.getUint32(2, true),
sent: view.getUint32(6, true),
flood_tx: view.getUint32(10, true),
direct_tx: view.getUint32(14, true),
flood_rx: view.getUint32(18, true),
direct_rx: view.getUint32(22, true)
};
if (buffer.byteLength >= 30) {
result.recv_errors = view.getUint32(26, true);
}
return result;
}
```
---
## Field Size Considerations
- Packet counters (uint32_t): May wrap after extended high-traffic operation.
- Time fields (uint32_t): Max ~136 years.
- SNR (int8_t, scaled by 4): Range -32 to +31.75 dB, 0.25 dB precision.

96
docs/terminal_chat_cli.md Normal file
View File

@@ -0,0 +1,96 @@
# Terminal Chat CLI
Below are the commands you can enter into the Terminal Chat clients:
```
set freq {frequency}
```
Set the LoRa frequency. Example: set freq 915.8
```
set tx {tx-power-dbm}
```
Sets LoRa transmit power in dBm.
```
set name {name}
```
Sets your advertisement name.
```
set lat {latitude}
```
Sets your advertisement map latitude. (decimal degrees)
```
set lon {longitude}
```
Sets your advertisement map longitude. (decimal degrees)
```
set af {air-time-factor}
```
Sets the transmit air-time-factor.
```
time {epoch-secs}
```
Set the device clock using UNIX epoch seconds. Example: time 1738242833
```
advert
```
Sends an advertisement packet
```
clock
```
Displays current time per device's clock.
```
ver
```
Shows the device version and firmware build date.
```
card
```
Displays *your* 'business card', for other to manually _import_
```
import {card}
```
Imports the given card to your contacts.
```
list {n}
```
List all contacts by most recent. (optional {n}, is the last n by advertisement date)
```
to
```
Shows the name of current recipient contact. (for subsequent 'send' commands)
```
to {name-prefix}
```
Sets the recipient to the _first_ matching contact (in 'list') by the name prefix. (ie. you don't have to type whole name)
```
send {text}
```
Sends the text message (as DM) to current recipient.
```
reset path
```
Resets the path to current recipient, for new path discovery.
```
public {text}
```
Sends the text message to the built-in 'public' group channel

View File

@@ -0,0 +1,46 @@
#pragma once
#include <MeshCore.h>
#include <helpers/ui/DisplayDriver.h>
#include <helpers/ui/UIScreen.h>
#include <helpers/SensorManager.h>
#include <helpers/BaseSerialInterface.h>
#include <Arduino.h>
#ifdef PIN_BUZZER
#include <helpers/ui/buzzer.h>
#endif
#include "NodePrefs.h"
enum class UIEventType {
none,
contactMessage,
channelMessage,
roomMessage,
newContactMessage,
ack
};
class AbstractUITask {
protected:
mesh::MainBoard* _board;
BaseSerialInterface* _serial;
bool _connected;
AbstractUITask(mesh::MainBoard* board, BaseSerialInterface* serial) : _board(board), _serial(serial) {
_connected = false;
}
public:
void setHasConnection(bool connected) { _connected = connected; }
bool hasConnection() const { return _connected; }
uint16_t getBattMilliVolts() const { return _board->getBattMilliVolts(); }
bool isSerialEnabled() const { return _serial->isEnabled(); }
void enableSerial() { _serial->enable(); }
void disableSerial() { _serial->disable(); }
virtual void msgRead(int msgcount) = 0;
virtual void newMsg(uint8_t path_len, const char* from_name, const char* text, int msgcount) = 0;
virtual void notify(UIEventType t = UIEventType::none) = 0;
virtual void loop() = 0;
};

View File

@@ -0,0 +1,616 @@
#include <Arduino.h>
#include "DataStore.h"
#if defined(EXTRAFS) || defined(QSPIFLASH)
#define MAX_BLOBRECS 100
#else
#define MAX_BLOBRECS 20
#endif
DataStore::DataStore(FILESYSTEM& fs, mesh::RTCClock& clock) : _fs(&fs), _fsExtra(nullptr), _clock(&clock),
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
identity_store(fs, "")
#elif defined(RP2040_PLATFORM)
identity_store(fs, "/identity")
#else
identity_store(fs, "/identity")
#endif
{
}
#if defined(EXTRAFS) || defined(QSPIFLASH)
DataStore::DataStore(FILESYSTEM& fs, FILESYSTEM& fsExtra, mesh::RTCClock& clock) : _fs(&fs), _fsExtra(&fsExtra), _clock(&clock),
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
identity_store(fs, "")
#elif defined(RP2040_PLATFORM)
identity_store(fs, "/identity")
#else
identity_store(fs, "/identity")
#endif
{
}
#endif
static File openWrite(FILESYSTEM* fs, const char* filename) {
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
fs->remove(filename);
return fs->open(filename, FILE_O_WRITE);
#elif defined(RP2040_PLATFORM)
return fs->open(filename, "w");
#else
return fs->open(filename, "w", true);
#endif
}
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
static uint32_t _ContactsChannelsTotalBlocks = 0;
#endif
void DataStore::begin() {
#if defined(RP2040_PLATFORM)
identity_store.begin();
#endif
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
_ContactsChannelsTotalBlocks = _getContactsChannelsFS()->_getFS()->cfg->block_count;
checkAdvBlobFile();
#if defined(EXTRAFS) || defined(QSPIFLASH)
migrateToSecondaryFS();
#endif
#else
// init 'blob store' support
_fs->mkdir("/bl");
#endif
}
#if defined(ESP32)
#include <SPIFFS.h>
#include <nvs_flash.h>
#elif defined(RP2040_PLATFORM)
#include <LittleFS.h>
#elif defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
#if defined(QSPIFLASH)
#include <CustomLFS_QSPIFlash.h>
#elif defined(EXTRAFS)
#include <CustomLFS.h>
#else
#include <InternalFileSystem.h>
#endif
#endif
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
int _countLfsBlock(void *p, lfs_block_t block){
if (block > _ContactsChannelsTotalBlocks) {
MESH_DEBUG_PRINTLN("ERROR: Block %d exceeds filesystem bounds - CORRUPTION DETECTED!", block);
return LFS_ERR_CORRUPT; // return error to abort lfs_traverse() gracefully
}
lfs_size_t *size = (lfs_size_t*) p;
*size += 1;
return 0;
}
lfs_ssize_t _getLfsUsedBlockCount(FILESYSTEM* fs) {
lfs_size_t size = 0;
int err = lfs_traverse(fs->_getFS(), _countLfsBlock, &size);
if (err) {
MESH_DEBUG_PRINTLN("ERROR: lfs_traverse() error: %d", err);
return 0;
}
return size;
}
#endif
uint32_t DataStore::getStorageUsedKb() const {
#if defined(ESP32)
return SPIFFS.usedBytes() / 1024;
#elif defined(RP2040_PLATFORM)
FSInfo info;
info.usedBytes = 0;
_fs->info(info);
return info.usedBytes / 1024;
#elif defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
const lfs_config* config = _getContactsChannelsFS()->_getFS()->cfg;
int usedBlockCount = _getLfsUsedBlockCount(_getContactsChannelsFS());
int usedBytes = config->block_size * usedBlockCount;
return usedBytes / 1024;
#else
return 0;
#endif
}
uint32_t DataStore::getStorageTotalKb() const {
#if defined(ESP32)
return SPIFFS.totalBytes() / 1024;
#elif defined(RP2040_PLATFORM)
FSInfo info;
info.totalBytes = 0;
_fs->info(info);
return info.totalBytes / 1024;
#elif defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
const lfs_config* config = _getContactsChannelsFS()->_getFS()->cfg;
int totalBytes = config->block_size * config->block_count;
return totalBytes / 1024;
#else
return 0;
#endif
}
File DataStore::openRead(const char* filename) {
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
return _fs->open(filename, FILE_O_READ);
#elif defined(RP2040_PLATFORM)
return _fs->open(filename, "r");
#else
return _fs->open(filename, "r", false);
#endif
}
File DataStore::openRead(FILESYSTEM* fs, const char* filename) {
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
return fs->open(filename, FILE_O_READ);
#elif defined(RP2040_PLATFORM)
return fs->open(filename, "r");
#else
return fs->open(filename, "r", false);
#endif
}
bool DataStore::removeFile(const char* filename) {
return _fs->remove(filename);
}
bool DataStore::removeFile(FILESYSTEM* fs, const char* filename) {
return fs->remove(filename);
}
bool DataStore::formatFileSystem() {
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
if (_fsExtra == nullptr) {
return _fs->format();
} else {
return _fs->format() && _fsExtra->format();
}
#elif defined(RP2040_PLATFORM)
return LittleFS.format();
#elif defined(ESP32)
bool fs_success = ((fs::SPIFFSFS *)_fs)->format();
esp_err_t nvs_err = nvs_flash_erase(); // no need to reinit, will be done by reboot
return fs_success && (nvs_err == ESP_OK);
#else
#error "need to implement format()"
#endif
}
bool DataStore::loadMainIdentity(mesh::LocalIdentity &identity) {
return identity_store.load("_main", identity);
}
bool DataStore::saveMainIdentity(const mesh::LocalIdentity &identity) {
return identity_store.save("_main", identity);
}
void DataStore::loadPrefs(NodePrefs& prefs, double& node_lat, double& node_lon) {
if (_fs->exists("/new_prefs")) {
loadPrefsInt("/new_prefs", prefs, node_lat, node_lon); // new filename
} else if (_fs->exists("/node_prefs")) {
loadPrefsInt("/node_prefs", prefs, node_lat, node_lon);
savePrefs(prefs, node_lat, node_lon); // save to new filename
_fs->remove("/node_prefs"); // remove old
}
}
void DataStore::loadPrefsInt(const char *filename, NodePrefs& _prefs, double& node_lat, double& node_lon) {
File file = openRead(_fs, filename);
if (file) {
uint8_t pad[8];
file.read((uint8_t *)&_prefs.airtime_factor, sizeof(float)); // 0
file.read((uint8_t *)_prefs.node_name, sizeof(_prefs.node_name)); // 4
file.read(pad, 4); // 36
file.read((uint8_t *)&node_lat, sizeof(node_lat)); // 40
file.read((uint8_t *)&node_lon, sizeof(node_lon)); // 48
file.read((uint8_t *)&_prefs.freq, sizeof(_prefs.freq)); // 56
file.read((uint8_t *)&_prefs.sf, sizeof(_prefs.sf)); // 60
file.read((uint8_t *)&_prefs.cr, sizeof(_prefs.cr)); // 61
file.read((uint8_t *)&_prefs.client_repeat, sizeof(_prefs.client_repeat)); // 62
file.read((uint8_t *)&_prefs.manual_add_contacts, sizeof(_prefs.manual_add_contacts)); // 63
file.read((uint8_t *)&_prefs.bw, sizeof(_prefs.bw)); // 64
file.read((uint8_t *)&_prefs.tx_power_dbm, sizeof(_prefs.tx_power_dbm)); // 68
file.read((uint8_t *)&_prefs.telemetry_mode_base, sizeof(_prefs.telemetry_mode_base)); // 69
file.read((uint8_t *)&_prefs.telemetry_mode_loc, sizeof(_prefs.telemetry_mode_loc)); // 70
file.read((uint8_t *)&_prefs.telemetry_mode_env, sizeof(_prefs.telemetry_mode_env)); // 71
file.read((uint8_t *)&_prefs.rx_delay_base, sizeof(_prefs.rx_delay_base)); // 72
file.read((uint8_t *)&_prefs.advert_loc_policy, sizeof(_prefs.advert_loc_policy)); // 76
file.read((uint8_t *)&_prefs.multi_acks, sizeof(_prefs.multi_acks)); // 77
file.read((uint8_t *)&_prefs.path_hash_mode, sizeof(_prefs.path_hash_mode)); // 78
file.read(pad, 1); // 79
file.read((uint8_t *)&_prefs.ble_pin, sizeof(_prefs.ble_pin)); // 80
file.read((uint8_t *)&_prefs.buzzer_quiet, sizeof(_prefs.buzzer_quiet)); // 84
file.read((uint8_t *)&_prefs.gps_enabled, sizeof(_prefs.gps_enabled)); // 85
file.read((uint8_t *)&_prefs.gps_interval, sizeof(_prefs.gps_interval)); // 86
file.read((uint8_t *)&_prefs.autoadd_config, sizeof(_prefs.autoadd_config)); // 87
file.read((uint8_t *)&_prefs.autoadd_max_hops, sizeof(_prefs.autoadd_max_hops)); // 88
file.close();
}
}
void DataStore::savePrefs(const NodePrefs& _prefs, double node_lat, double node_lon) {
File file = openWrite(_fs, "/new_prefs");
if (file) {
uint8_t pad[8];
memset(pad, 0, sizeof(pad));
file.write((uint8_t *)&_prefs.airtime_factor, sizeof(float)); // 0
file.write((uint8_t *)_prefs.node_name, sizeof(_prefs.node_name)); // 4
file.write(pad, 4); // 36
file.write((uint8_t *)&node_lat, sizeof(node_lat)); // 40
file.write((uint8_t *)&node_lon, sizeof(node_lon)); // 48
file.write((uint8_t *)&_prefs.freq, sizeof(_prefs.freq)); // 56
file.write((uint8_t *)&_prefs.sf, sizeof(_prefs.sf)); // 60
file.write((uint8_t *)&_prefs.cr, sizeof(_prefs.cr)); // 61
file.write((uint8_t *)&_prefs.client_repeat, sizeof(_prefs.client_repeat)); // 62
file.write((uint8_t *)&_prefs.manual_add_contacts, sizeof(_prefs.manual_add_contacts)); // 63
file.write((uint8_t *)&_prefs.bw, sizeof(_prefs.bw)); // 64
file.write((uint8_t *)&_prefs.tx_power_dbm, sizeof(_prefs.tx_power_dbm)); // 68
file.write((uint8_t *)&_prefs.telemetry_mode_base, sizeof(_prefs.telemetry_mode_base)); // 69
file.write((uint8_t *)&_prefs.telemetry_mode_loc, sizeof(_prefs.telemetry_mode_loc)); // 70
file.write((uint8_t *)&_prefs.telemetry_mode_env, sizeof(_prefs.telemetry_mode_env)); // 71
file.write((uint8_t *)&_prefs.rx_delay_base, sizeof(_prefs.rx_delay_base)); // 72
file.write((uint8_t *)&_prefs.advert_loc_policy, sizeof(_prefs.advert_loc_policy)); // 76
file.write((uint8_t *)&_prefs.multi_acks, sizeof(_prefs.multi_acks)); // 77
file.write((uint8_t *)&_prefs.path_hash_mode, sizeof(_prefs.path_hash_mode)); // 78
file.write(pad, 1); // 79
file.write((uint8_t *)&_prefs.ble_pin, sizeof(_prefs.ble_pin)); // 80
file.write((uint8_t *)&_prefs.buzzer_quiet, sizeof(_prefs.buzzer_quiet)); // 84
file.write((uint8_t *)&_prefs.gps_enabled, sizeof(_prefs.gps_enabled)); // 85
file.write((uint8_t *)&_prefs.gps_interval, sizeof(_prefs.gps_interval)); // 86
file.write((uint8_t *)&_prefs.autoadd_config, sizeof(_prefs.autoadd_config)); // 87
file.write((uint8_t *)&_prefs.autoadd_max_hops, sizeof(_prefs.autoadd_max_hops)); // 88
file.close();
}
}
void DataStore::loadContacts(DataStoreHost* host) {
File file = openRead(_getContactsChannelsFS(), "/contacts3");
if (file) {
bool full = false;
while (!full) {
ContactInfo c;
uint8_t pub_key[32];
uint8_t unused;
bool success = (file.read(pub_key, 32) == 32);
success = success && (file.read((uint8_t *)&c.name, 32) == 32);
success = success && (file.read(&c.type, 1) == 1);
success = success && (file.read(&c.flags, 1) == 1);
success = success && (file.read(&unused, 1) == 1);
success = success && (file.read((uint8_t *)&c.sync_since, 4) == 4); // was 'reserved'
success = success && (file.read((uint8_t *)&c.out_path_len, 1) == 1);
success = success && (file.read((uint8_t *)&c.last_advert_timestamp, 4) == 4);
success = success && (file.read(c.out_path, 64) == 64);
success = success && (file.read((uint8_t *)&c.lastmod, 4) == 4);
success = success && (file.read((uint8_t *)&c.gps_lat, 4) == 4);
success = success && (file.read((uint8_t *)&c.gps_lon, 4) == 4);
if (!success) break; // EOF
c.id = mesh::Identity(pub_key);
if (!host->onContactLoaded(c)) full = true;
}
file.close();
}
}
void DataStore::saveContacts(DataStoreHost* host) {
File file = openWrite(_getContactsChannelsFS(), "/contacts3");
if (file) {
uint32_t idx = 0;
ContactInfo c;
uint8_t unused = 0;
while (host->getContactForSave(idx, c)) {
bool success = (file.write(c.id.pub_key, 32) == 32);
success = success && (file.write((uint8_t *)&c.name, 32) == 32);
success = success && (file.write(&c.type, 1) == 1);
success = success && (file.write(&c.flags, 1) == 1);
success = success && (file.write(&unused, 1) == 1);
success = success && (file.write((uint8_t *)&c.sync_since, 4) == 4);
success = success && (file.write((uint8_t *)&c.out_path_len, 1) == 1);
success = success && (file.write((uint8_t *)&c.last_advert_timestamp, 4) == 4);
success = success && (file.write(c.out_path, 64) == 64);
success = success && (file.write((uint8_t *)&c.lastmod, 4) == 4);
success = success && (file.write((uint8_t *)&c.gps_lat, 4) == 4);
success = success && (file.write((uint8_t *)&c.gps_lon, 4) == 4);
if (!success) break; // write failed
idx++; // advance to next contact
}
file.close();
}
}
void DataStore::loadChannels(DataStoreHost* host) {
File file = openRead(_getContactsChannelsFS(), "/channels2");
if (file) {
bool full = false;
uint8_t channel_idx = 0;
while (!full) {
ChannelDetails ch;
uint8_t unused[4];
bool success = (file.read(unused, 4) == 4);
success = success && (file.read((uint8_t *)ch.name, 32) == 32);
success = success && (file.read((uint8_t *)ch.channel.secret, 32) == 32);
if (!success) break; // EOF
if (host->onChannelLoaded(channel_idx, ch)) {
channel_idx++;
} else {
full = true;
}
}
file.close();
}
}
void DataStore::saveChannels(DataStoreHost* host) {
File file = openWrite(_getContactsChannelsFS(), "/channels2");
if (file) {
uint8_t channel_idx = 0;
ChannelDetails ch;
uint8_t unused[4];
memset(unused, 0, 4);
while (host->getChannelForSave(channel_idx, ch)) {
bool success = (file.write(unused, 4) == 4);
success = success && (file.write((uint8_t *)ch.name, 32) == 32);
success = success && (file.write((uint8_t *)ch.channel.secret, 32) == 32);
if (!success) break; // write failed
channel_idx++;
}
file.close();
}
}
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
#define MAX_ADVERT_PKT_LEN (2 + 32 + PUB_KEY_SIZE + 4 + SIGNATURE_SIZE + MAX_ADVERT_DATA_SIZE)
struct BlobRec {
uint32_t timestamp;
uint8_t key[7];
uint8_t len;
uint8_t data[MAX_ADVERT_PKT_LEN];
};
void DataStore::checkAdvBlobFile() {
if (!_getContactsChannelsFS()->exists("/adv_blobs")) {
File file = openWrite(_getContactsChannelsFS(), "/adv_blobs");
if (file) {
BlobRec zeroes;
memset(&zeroes, 0, sizeof(zeroes));
for (int i = 0; i < MAX_BLOBRECS; i++) { // pre-allocate to fixed size
file.write((uint8_t *) &zeroes, sizeof(zeroes));
}
file.close();
}
}
}
void DataStore::migrateToSecondaryFS() {
// migrate old adv_blobs, contacts3 and channels2 files to secondary FS if they don't already exist
if (!_fsExtra->exists("/adv_blobs")) {
if (_fs->exists("/adv_blobs")) {
File oldAdvBlobs = openRead(_fs, "/adv_blobs");
File newAdvBlobs = openWrite(_fsExtra, "/adv_blobs");
if (oldAdvBlobs && newAdvBlobs) {
BlobRec rec;
size_t count = 0;
// Copy 20 BlobRecs from old to new
while (count < 20 && oldAdvBlobs.read((uint8_t *)&rec, sizeof(rec)) == sizeof(rec)) {
newAdvBlobs.seek(count * sizeof(BlobRec));
newAdvBlobs.write((uint8_t *)&rec, sizeof(rec));
count++;
}
}
if (oldAdvBlobs) oldAdvBlobs.close();
if (newAdvBlobs) newAdvBlobs.close();
_fs->remove("/adv_blobs");
}
}
if (!_fsExtra->exists("/contacts3")) {
if (_fs->exists("/contacts3")) {
File oldFile = openRead(_fs, "/contacts3");
File newFile = openWrite(_fsExtra, "/contacts3");
if (oldFile && newFile) {
uint8_t buf[64];
int n;
while ((n = oldFile.read(buf, sizeof(buf))) > 0) {
newFile.write(buf, n);
}
}
if (oldFile) oldFile.close();
if (newFile) newFile.close();
_fs->remove("/contacts3");
}
}
if (!_fsExtra->exists("/channels2")) {
if (_fs->exists("/channels2")) {
File oldFile = openRead(_fs, "/channels2");
File newFile = openWrite(_fsExtra, "/channels2");
if (oldFile && newFile) {
uint8_t buf[64];
int n;
while ((n = oldFile.read(buf, sizeof(buf))) > 0) {
newFile.write(buf, n);
}
}
if (oldFile) oldFile.close();
if (newFile) newFile.close();
_fs->remove("/channels2");
}
}
// cleanup nodes which have been testing the extra fs, copy _main.id and new_prefs back to primary
if (_fsExtra->exists("/_main.id")) {
if (_fs->exists("/_main.id")) {_fs->remove("/_main.id");}
File oldFile = openRead(_fsExtra, "/_main.id");
File newFile = openWrite(_fs, "/_main.id");
if (oldFile && newFile) {
uint8_t buf[64];
int n;
while ((n = oldFile.read(buf, sizeof(buf))) > 0) {
newFile.write(buf, n);
}
}
if (oldFile) oldFile.close();
if (newFile) newFile.close();
_fsExtra->remove("/_main.id");
}
if (_fsExtra->exists("/new_prefs")) {
if (_fs->exists("/new_prefs")) {_fs->remove("/new_prefs");}
File oldFile = openRead(_fsExtra, "/new_prefs");
File newFile = openWrite(_fs, "/new_prefs");
if (oldFile && newFile) {
uint8_t buf[64];
int n;
while ((n = oldFile.read(buf, sizeof(buf))) > 0) {
newFile.write(buf, n);
}
}
if (oldFile) oldFile.close();
if (newFile) newFile.close();
_fsExtra->remove("/new_prefs");
}
// remove files from where they should not be anymore
if (_fs->exists("/adv_blobs")) {
_fs->remove("/adv_blobs");
}
if (_fs->exists("/contacts3")) {
_fs->remove("/contacts3");
}
if (_fs->exists("/channels2")) {
_fs->remove("/channels2");
}
if (_fsExtra->exists("/_main.id")) {
_fsExtra->remove("/_main.id");
}
if (_fsExtra->exists("/new_prefs")) {
_fsExtra->remove("/new_prefs");
}
}
uint8_t DataStore::getBlobByKey(const uint8_t key[], int key_len, uint8_t dest_buf[]) {
File file = openRead(_getContactsChannelsFS(), "/adv_blobs");
uint8_t len = 0; // 0 = not found
if (file) {
BlobRec tmp;
while (file.read((uint8_t *) &tmp, sizeof(tmp)) == sizeof(tmp)) {
if (memcmp(key, tmp.key, sizeof(tmp.key)) == 0) { // only match by 7 byte prefix
len = tmp.len;
memcpy(dest_buf, tmp.data, len);
break;
}
}
file.close();
}
return len;
}
bool DataStore::putBlobByKey(const uint8_t key[], int key_len, const uint8_t src_buf[], uint8_t len) {
if (len < PUB_KEY_SIZE+4+SIGNATURE_SIZE || len > MAX_ADVERT_PKT_LEN) return false;
checkAdvBlobFile();
File file = _getContactsChannelsFS()->open("/adv_blobs", FILE_O_WRITE);
if (file) {
uint32_t pos = 0, found_pos = 0;
uint32_t min_timestamp = 0xFFFFFFFF;
// search for matching key OR evict by oldest timestmap
BlobRec tmp;
file.seek(0);
while (file.read((uint8_t *) &tmp, sizeof(tmp)) == sizeof(tmp)) {
if (memcmp(key, tmp.key, sizeof(tmp.key)) == 0) { // only match by 7 byte prefix
found_pos = pos;
break;
}
if (tmp.timestamp < min_timestamp) {
min_timestamp = tmp.timestamp;
found_pos = pos;
}
pos += sizeof(tmp);
}
memcpy(tmp.key, key, sizeof(tmp.key)); // just record 7 byte prefix of key
memcpy(tmp.data, src_buf, len);
tmp.len = len;
tmp.timestamp = _clock->getCurrentTime();
file.seek(found_pos);
file.write((uint8_t *) &tmp, sizeof(tmp));
file.close();
return true;
}
return false; // error
}
bool DataStore::deleteBlobByKey(const uint8_t key[], int key_len) {
return true; // this is just a stub on NRF52/STM32 platforms
}
#else
inline void makeBlobPath(const uint8_t key[], int key_len, char* path, size_t path_size) {
char fname[18];
if (key_len > 8) key_len = 8; // just use first 8 bytes (prefix)
mesh::Utils::toHex(fname, key, key_len);
sprintf(path, "/bl/%s", fname);
}
uint8_t DataStore::getBlobByKey(const uint8_t key[], int key_len, uint8_t dest_buf[]) {
char path[64];
makeBlobPath(key, key_len, path, sizeof(path));
if (_fs->exists(path)) {
File f = openRead(_fs, path);
if (f) {
int len = f.read(dest_buf, 255); // currently MAX 255 byte blob len supported!!
f.close();
return len;
}
}
return 0; // not found
}
bool DataStore::putBlobByKey(const uint8_t key[], int key_len, const uint8_t src_buf[], uint8_t len) {
char path[64];
makeBlobPath(key, key_len, path, sizeof(path));
File f = openWrite(_fs, path);
if (f) {
int n = f.write(src_buf, len);
f.close();
if (n == len) return true; // success!
_fs->remove(path); // blob was only partially written!
}
return false; // error
}
bool DataStore::deleteBlobByKey(const uint8_t key[], int key_len) {
char path[64];
makeBlobPath(key, key_len, path, sizeof(path));
_fs->remove(path);
return true; // return true even if file did not exist
}
#endif

View File

@@ -0,0 +1,55 @@
#pragma once
#include <helpers/IdentityStore.h>
#include <helpers/ContactInfo.h>
#include <helpers/ChannelDetails.h>
#include "NodePrefs.h"
class DataStoreHost {
public:
virtual bool onContactLoaded(const ContactInfo& contact) =0;
virtual bool getContactForSave(uint32_t idx, ContactInfo& contact) =0;
virtual bool onChannelLoaded(uint8_t channel_idx, const ChannelDetails& ch) =0;
virtual bool getChannelForSave(uint8_t channel_idx, ChannelDetails& ch) =0;
};
class DataStore {
FILESYSTEM* _fs;
FILESYSTEM* _fsExtra;
mesh::RTCClock* _clock;
IdentityStore identity_store;
void loadPrefsInt(const char *filename, NodePrefs& prefs, double& node_lat, double& node_lon);
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
void checkAdvBlobFile();
#endif
public:
DataStore(FILESYSTEM& fs, mesh::RTCClock& clock);
DataStore(FILESYSTEM& fs, FILESYSTEM& fsExtra, mesh::RTCClock& clock);
void begin();
bool formatFileSystem();
FILESYSTEM* getPrimaryFS() const { return _fs; }
FILESYSTEM* getSecondaryFS() const { return _fsExtra; }
bool loadMainIdentity(mesh::LocalIdentity &identity);
bool saveMainIdentity(const mesh::LocalIdentity &identity);
void loadPrefs(NodePrefs& prefs, double& node_lat, double& node_lon);
void savePrefs(const NodePrefs& prefs, double node_lat, double node_lon);
void loadContacts(DataStoreHost* host);
void saveContacts(DataStoreHost* host);
void loadChannels(DataStoreHost* host);
void saveChannels(DataStoreHost* host);
void migrateToSecondaryFS();
uint8_t getBlobByKey(const uint8_t key[], int key_len, uint8_t dest_buf[]);
bool putBlobByKey(const uint8_t key[], int key_len, const uint8_t src_buf[], uint8_t len);
bool deleteBlobByKey(const uint8_t key[], int key_len);
File openRead(const char* filename);
File openRead(FILESYSTEM* fs, const char* filename);
bool removeFile(const char* filename);
bool removeFile(FILESYSTEM* fs, const char* filename);
uint32_t getStorageUsedKb() const;
uint32_t getStorageTotalKb() const;
private:
FILESYSTEM* _getContactsChannelsFS() const { if (_fsExtra) return _fsExtra; return _fs;};
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,238 @@
#pragma once
#include <Arduino.h>
#include <Mesh.h>
#include "AbstractUITask.h"
/*------------ Frame Protocol --------------*/
#define FIRMWARE_VER_CODE 10
#ifndef FIRMWARE_BUILD_DATE
#define FIRMWARE_BUILD_DATE "6 Mar 2026"
#endif
#ifndef FIRMWARE_VERSION
#define FIRMWARE_VERSION "v1.14.0"
#endif
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
#include <InternalFileSystem.h>
#elif defined(RP2040_PLATFORM)
#include <LittleFS.h>
#elif defined(ESP32)
#include <SPIFFS.h>
#endif
#include "DataStore.h"
#include "NodePrefs.h"
#include <RTClib.h>
#include <helpers/ArduinoHelpers.h>
#include <helpers/BaseSerialInterface.h>
#include <helpers/IdentityStore.h>
#include <helpers/SimpleMeshTables.h>
#include <helpers/StaticPoolPacketManager.h>
#include <target.h>
/* ---------------------------------- CONFIGURATION ------------------------------------- */
#ifndef LORA_FREQ
#define LORA_FREQ 915.0
#endif
#ifndef LORA_BW
#define LORA_BW 250
#endif
#ifndef LORA_SF
#define LORA_SF 10
#endif
#ifndef LORA_CR
#define LORA_CR 5
#endif
#ifndef LORA_TX_POWER
#define LORA_TX_POWER 20
#endif
#ifndef MAX_LORA_TX_POWER
#define MAX_LORA_TX_POWER LORA_TX_POWER
#endif
#ifndef MAX_CONTACTS
#define MAX_CONTACTS 100
#endif
#ifndef OFFLINE_QUEUE_SIZE
#define OFFLINE_QUEUE_SIZE 16
#endif
#ifndef BLE_NAME_PREFIX
#define BLE_NAME_PREFIX "MeshCore-"
#endif
#include <helpers/BaseChatMesh.h>
#include <helpers/TransportKeyStore.h>
/* -------------------------------------------------------------------------------------- */
#define REQ_TYPE_GET_STATUS 0x01 // same as _GET_STATS
#define REQ_TYPE_KEEP_ALIVE 0x02
#define REQ_TYPE_GET_TELEMETRY_DATA 0x03
struct AdvertPath {
uint8_t pubkey_prefix[7];
uint8_t path_len;
char name[32];
uint32_t recv_timestamp;
uint8_t path[MAX_PATH_SIZE];
};
class MyMesh : public BaseChatMesh, public DataStoreHost {
public:
MyMesh(mesh::Radio &radio, mesh::RNG &rng, mesh::RTCClock &rtc, SimpleMeshTables &tables, DataStore& store, AbstractUITask* ui=NULL);
void begin(bool has_display);
void startInterface(BaseSerialInterface &serial);
const char *getNodeName();
NodePrefs *getNodePrefs();
uint32_t getBLEPin();
void loop();
void handleCmdFrame(size_t len);
bool advert();
void enterCLIRescue();
int getRecentlyHeard(AdvertPath dest[], int max_num);
protected:
float getAirtimeBudgetFactor() const override;
int getInterferenceThreshold() const override;
int calcRxDelay(float score, uint32_t air_time) const override;
uint32_t getRetransmitDelay(const mesh::Packet *packet) override;
uint32_t getDirectRetransmitDelay(const mesh::Packet *packet) override;
uint8_t getExtraAckTransmitCount() const override;
bool filterRecvFloodPacket(mesh::Packet* packet) override;
bool allowPacketForward(const mesh::Packet* packet) override;
void sendFloodScoped(const ContactInfo& recipient, mesh::Packet* pkt, uint32_t delay_millis=0) override;
void sendFloodScoped(const mesh::GroupChannel& channel, mesh::Packet* pkt, uint32_t delay_millis=0) override;
void logRxRaw(float snr, float rssi, const uint8_t raw[], int len) override;
bool isAutoAddEnabled() const override;
bool shouldAutoAddContactType(uint8_t type) const override;
bool shouldOverwriteWhenFull() const override;
uint8_t getAutoAddMaxHops() const override;
void onContactsFull() override;
void onContactOverwrite(const uint8_t* pub_key) override;
bool onContactPathRecv(ContactInfo& from, uint8_t* in_path, uint8_t in_path_len, uint8_t* out_path, uint8_t out_path_len, uint8_t extra_type, uint8_t* extra, uint8_t extra_len) override;
void onDiscoveredContact(ContactInfo &contact, bool is_new, uint8_t path_len, const uint8_t* path) override;
void onContactPathUpdated(const ContactInfo &contact) override;
ContactInfo* processAck(const uint8_t *data) override;
void queueMessage(const ContactInfo &from, uint8_t txt_type, mesh::Packet *pkt, uint32_t sender_timestamp,
const uint8_t *extra, int extra_len, const char *text);
void onMessageRecv(const ContactInfo &from, mesh::Packet *pkt, uint32_t sender_timestamp,
const char *text) override;
void onCommandDataRecv(const ContactInfo &from, mesh::Packet *pkt, uint32_t sender_timestamp,
const char *text) override;
void onSignedMessageRecv(const ContactInfo &from, mesh::Packet *pkt, uint32_t sender_timestamp,
const uint8_t *sender_prefix, const char *text) override;
void onChannelMessageRecv(const mesh::GroupChannel &channel, mesh::Packet *pkt, uint32_t timestamp,
const char *text) override;
uint8_t onContactRequest(const ContactInfo &contact, uint32_t sender_timestamp, const uint8_t *data,
uint8_t len, uint8_t *reply) override;
void onContactResponse(const ContactInfo &contact, const uint8_t *data, uint8_t len) override;
void onControlDataRecv(mesh::Packet *packet) override;
void onRawDataRecv(mesh::Packet *packet) override;
void onTraceRecv(mesh::Packet *packet, uint32_t tag, uint32_t auth_code, uint8_t flags,
const uint8_t *path_snrs, const uint8_t *path_hashes, uint8_t path_len) override;
uint32_t calcFloodTimeoutMillisFor(uint32_t pkt_airtime_millis) const override;
uint32_t calcDirectTimeoutMillisFor(uint32_t pkt_airtime_millis, uint8_t path_len) const override;
void onSendTimeout() override;
// DataStoreHost methods
bool onContactLoaded(const ContactInfo& contact) override { return addContact(contact); }
bool getContactForSave(uint32_t idx, ContactInfo& contact) override { return getContactByIdx(idx, contact); }
bool onChannelLoaded(uint8_t channel_idx, const ChannelDetails& ch) override { return setChannel(channel_idx, ch); }
bool getChannelForSave(uint8_t channel_idx, ChannelDetails& ch) override { return getChannel(channel_idx, ch); }
void clearPendingReqs() {
pending_login = pending_status = pending_telemetry = pending_discovery = pending_req = 0;
}
public:
void savePrefs() { _store->savePrefs(_prefs, sensors.node_lat, sensors.node_lon); }
private:
void writeOKFrame();
void writeErrFrame(uint8_t err_code);
void writeDisabledFrame();
void writeContactRespFrame(uint8_t code, const ContactInfo &contact);
void updateContactFromFrame(ContactInfo &contact, uint32_t& last_mod, const uint8_t *frame, int len);
void addToOfflineQueue(const uint8_t frame[], int len);
int getFromOfflineQueue(uint8_t frame[]);
int getBlobByKey(const uint8_t key[], int key_len, uint8_t dest_buf[]) override {
return _store->getBlobByKey(key, key_len, dest_buf);
}
bool putBlobByKey(const uint8_t key[], int key_len, const uint8_t src_buf[], int len) override {
return _store->putBlobByKey(key, key_len, src_buf, len);
}
void checkCLIRescueCmd();
void checkSerialInterface();
bool isValidClientRepeatFreq(uint32_t f) const;
// helpers, short-cuts
void saveChannels() { _store->saveChannels(this); }
void saveContacts() { _store->saveContacts(this); }
DataStore* _store;
NodePrefs _prefs;
uint32_t pending_login;
uint32_t pending_status;
uint32_t pending_telemetry, pending_discovery; // pending _TELEMETRY_REQ
uint32_t pending_req; // pending _BINARY_REQ
BaseSerialInterface *_serial;
AbstractUITask* _ui;
ContactsIterator _iter;
uint32_t _iter_filter_since;
uint32_t _most_recent_lastmod;
uint32_t _active_ble_pin;
bool _iter_started;
bool _cli_rescue;
char cli_command[80];
uint8_t app_target_ver;
uint8_t *sign_data;
uint32_t sign_data_len;
unsigned long dirty_contacts_expiry;
TransportKey send_scope;
uint8_t cmd_frame[MAX_FRAME_SIZE + 1];
uint8_t out_frame[MAX_FRAME_SIZE + 1];
CayenneLPP telemetry;
struct Frame {
uint8_t len;
uint8_t buf[MAX_FRAME_SIZE];
bool isChannelMsg() const;
};
int offline_queue_len;
Frame offline_queue[OFFLINE_QUEUE_SIZE];
struct AckTableEntry {
unsigned long msg_sent;
uint32_t ack;
ContactInfo* contact;
};
#define EXPECTED_ACK_TABLE_SIZE 8
AckTableEntry expected_ack_table[EXPECTED_ACK_TABLE_SIZE]; // circular table
int next_ack_idx;
#define ADVERT_PATH_TABLE_SIZE 16
AdvertPath advert_paths[ADVERT_PATH_TABLE_SIZE]; // circular table
};
extern MyMesh the_mesh;

View File

@@ -0,0 +1,34 @@
#pragma once
#include <cstdint> // For uint8_t, uint32_t
#define TELEM_MODE_DENY 0
#define TELEM_MODE_ALLOW_FLAGS 1 // use contact.flags
#define TELEM_MODE_ALLOW_ALL 2
#define ADVERT_LOC_NONE 0
#define ADVERT_LOC_SHARE 1
struct NodePrefs { // persisted to file
float airtime_factor;
char node_name[32];
float freq;
uint8_t sf;
uint8_t cr;
uint8_t multi_acks;
uint8_t manual_add_contacts;
float bw;
int8_t tx_power_dbm;
uint8_t telemetry_mode_base;
uint8_t telemetry_mode_loc;
uint8_t telemetry_mode_env;
float rx_delay_base;
uint32_t ble_pin;
uint8_t advert_loc_policy;
uint8_t buzzer_quiet;
uint8_t gps_enabled; // GPS enabled flag (0=disabled, 1=enabled)
uint32_t gps_interval; // GPS read interval in seconds
uint8_t autoadd_config; // bitmask for auto-add contacts config
uint8_t client_repeat;
uint8_t path_hash_mode; // which path mode to use when sending
uint8_t autoadd_max_hops; // 0 = no limit, 1 = direct (0 hops), N = up to N-1 hops (max 64)
};

View File

@@ -1,25 +0,0 @@
#pragma once
#include <helpers/ui/DisplayDriver.h>
class UITask {
DisplayDriver* _display;
unsigned long _next_read, _next_refresh, _auto_off;
int _prevBtnState;
bool _connected;
uint32_t _pin_code;
const char* _node_name;
const char* _build_date;
char _origin[62];
char _msg[80];
void renderCurrScreen();
public:
UITask(DisplayDriver& display) : _display(&display) { _next_read = _next_refresh = 0; _connected = false; }
void begin(const char* node_name, const char* build_date, uint32_t pin_code);
void setHasConnection(bool connected) { _connected = connected; }
void clearMsgPreview();
void showMsgPreview(uint8_t path_len, const char* from_name, const char* text);
void loop();
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,935 @@
#include "UITask.h"
#include <helpers/TxtDataHelpers.h>
#include "../MyMesh.h"
#include "target.h"
#ifdef WIFI_SSID
#include <WiFi.h>
#endif
#ifndef AUTO_OFF_MILLIS
#define AUTO_OFF_MILLIS 15000 // 15 seconds
#endif
#define BOOT_SCREEN_MILLIS 3000 // 3 seconds
#ifdef PIN_STATUS_LED
#define LED_ON_MILLIS 20
#define LED_ON_MSG_MILLIS 200
#define LED_CYCLE_MILLIS 4000
#endif
#define LONG_PRESS_MILLIS 1200
#ifndef UI_RECENT_LIST_SIZE
#define UI_RECENT_LIST_SIZE 4
#endif
#if UI_HAS_JOYSTICK
#define PRESS_LABEL "press Enter"
#else
#define PRESS_LABEL "long press"
#endif
#include "icons.h"
class SplashScreen : public UIScreen {
UITask* _task;
unsigned long dismiss_after;
char _version_info[12];
public:
SplashScreen(UITask* task) : _task(task) {
// strip off dash and commit hash by changing dash to null terminator
// e.g: v1.2.3-abcdef -> v1.2.3
const char *ver = FIRMWARE_VERSION;
const char *dash = strchr(ver, '-');
int len = dash ? dash - ver : strlen(ver);
if (len >= sizeof(_version_info)) len = sizeof(_version_info) - 1;
memcpy(_version_info, ver, len);
_version_info[len] = 0;
dismiss_after = millis() + BOOT_SCREEN_MILLIS;
}
int render(DisplayDriver& display) override {
// meshcore logo
display.setColor(DisplayDriver::BLUE);
int logoWidth = 128;
display.drawXbm((display.width() - logoWidth) / 2, 3, meshcore_logo, logoWidth, 13);
// version info
display.setColor(DisplayDriver::LIGHT);
display.setTextSize(2);
display.drawTextCentered(display.width()/2, 22, _version_info);
display.setTextSize(1);
display.drawTextCentered(display.width()/2, 42, FIRMWARE_BUILD_DATE);
return 1000;
}
void poll() override {
if (millis() >= dismiss_after) {
_task->gotoHomeScreen();
}
}
};
class HomeScreen : public UIScreen {
enum HomePage {
FIRST,
RECENT,
RADIO,
BLUETOOTH,
ADVERT,
#if ENV_INCLUDE_GPS == 1
GPS,
#endif
#if UI_SENSORS_PAGE == 1
SENSORS,
#endif
SHUTDOWN,
Count // keep as last
};
UITask* _task;
mesh::RTCClock* _rtc;
SensorManager* _sensors;
NodePrefs* _node_prefs;
uint8_t _page;
bool _shutdown_init;
AdvertPath recent[UI_RECENT_LIST_SIZE];
void renderBatteryIndicator(DisplayDriver& display, uint16_t batteryMilliVolts) {
// Convert millivolts to percentage
#ifndef BATT_MIN_MILLIVOLTS
#define BATT_MIN_MILLIVOLTS 3000
#endif
#ifndef BATT_MAX_MILLIVOLTS
#define BATT_MAX_MILLIVOLTS 4200
#endif
const int minMilliVolts = BATT_MIN_MILLIVOLTS;
const int maxMilliVolts = BATT_MAX_MILLIVOLTS;
int batteryPercentage = ((batteryMilliVolts - minMilliVolts) * 100) / (maxMilliVolts - minMilliVolts);
if (batteryPercentage < 0) batteryPercentage = 0; // Clamp to 0%
if (batteryPercentage > 100) batteryPercentage = 100; // Clamp to 100%
// battery icon
int iconWidth = 24;
int iconHeight = 10;
int iconX = display.width() - iconWidth - 5; // Position the icon near the top-right corner
int iconY = 0;
display.setColor(DisplayDriver::GREEN);
// battery outline
display.drawRect(iconX, iconY, iconWidth, iconHeight);
// battery "cap"
display.fillRect(iconX + iconWidth, iconY + (iconHeight / 4), 3, iconHeight / 2);
// fill the battery based on the percentage
int fillWidth = (batteryPercentage * (iconWidth - 4)) / 100;
display.fillRect(iconX + 2, iconY + 2, fillWidth, iconHeight - 4);
// show muted icon if buzzer is muted
#ifdef PIN_BUZZER
if (_task->isBuzzerQuiet()) {
display.setColor(DisplayDriver::RED);
display.drawXbm(iconX - 9, iconY + 1, muted_icon, 8, 8);
}
#endif
}
CayenneLPP sensors_lpp;
int sensors_nb = 0;
bool sensors_scroll = false;
int sensors_scroll_offset = 0;
int next_sensors_refresh = 0;
void refresh_sensors() {
if (millis() > next_sensors_refresh) {
sensors_lpp.reset();
sensors_nb = 0;
sensors_lpp.addVoltage(TELEM_CHANNEL_SELF, (float)board.getBattMilliVolts() / 1000.0f);
sensors.querySensors(0xFF, sensors_lpp);
LPPReader reader (sensors_lpp.getBuffer(), sensors_lpp.getSize());
uint8_t channel, type;
while(reader.readHeader(channel, type)) {
reader.skipData(type);
sensors_nb ++;
}
sensors_scroll = sensors_nb > UI_RECENT_LIST_SIZE;
#if AUTO_OFF_MILLIS > 0
next_sensors_refresh = millis() + 5000; // refresh sensor values every 5 sec
#else
next_sensors_refresh = millis() + 60000; // refresh sensor values every 1 min
#endif
}
}
public:
HomeScreen(UITask* task, mesh::RTCClock* rtc, SensorManager* sensors, NodePrefs* node_prefs)
: _task(task), _rtc(rtc), _sensors(sensors), _node_prefs(node_prefs), _page(0),
_shutdown_init(false), sensors_lpp(200) { }
void poll() override {
if (_shutdown_init && !_task->isButtonPressed()) { // must wait for USR button to be released
_task->shutdown();
}
}
int render(DisplayDriver& display) override {
char tmp[80];
// node name
display.setTextSize(1);
display.setColor(DisplayDriver::GREEN);
char filtered_name[sizeof(_node_prefs->node_name)];
display.translateUTF8ToBlocks(filtered_name, _node_prefs->node_name, sizeof(filtered_name));
display.setCursor(0, 0);
display.print(filtered_name);
// battery voltage
renderBatteryIndicator(display, _task->getBattMilliVolts());
// curr page indicator
int y = 14;
int x = display.width() / 2 - 5 * (HomePage::Count-1);
for (uint8_t i = 0; i < HomePage::Count; i++, x += 10) {
if (i == _page) {
display.fillRect(x-1, y-1, 3, 3);
} else {
display.fillRect(x, y, 1, 1);
}
}
if (_page == HomePage::FIRST) {
display.setColor(DisplayDriver::YELLOW);
display.setTextSize(2);
sprintf(tmp, "MSG: %d", _task->getMsgCount());
display.drawTextCentered(display.width() / 2, 20, tmp);
#ifdef WIFI_SSID
IPAddress ip = WiFi.localIP();
snprintf(tmp, sizeof(tmp), "IP: %d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
display.setTextSize(1);
display.drawTextCentered(display.width() / 2, 54, tmp);
#endif
if (_task->hasConnection()) {
display.setColor(DisplayDriver::GREEN);
display.setTextSize(1);
display.drawTextCentered(display.width() / 2, 43, "< Connected >");
} else if (the_mesh.getBLEPin() != 0) { // BT pin
display.setColor(DisplayDriver::RED);
display.setTextSize(2);
sprintf(tmp, "Pin:%d", the_mesh.getBLEPin());
display.drawTextCentered(display.width() / 2, 43, tmp);
}
} else if (_page == HomePage::RECENT) {
the_mesh.getRecentlyHeard(recent, UI_RECENT_LIST_SIZE);
display.setColor(DisplayDriver::GREEN);
int y = 20;
for (int i = 0; i < UI_RECENT_LIST_SIZE; i++, y += 11) {
auto a = &recent[i];
if (a->name[0] == 0) continue; // empty slot
int secs = _rtc->getCurrentTime() - a->recv_timestamp;
if (secs < 60) {
sprintf(tmp, "%ds", secs);
} else if (secs < 60*60) {
sprintf(tmp, "%dm", secs / 60);
} else {
sprintf(tmp, "%dh", secs / (60*60));
}
int timestamp_width = display.getTextWidth(tmp);
int max_name_width = display.width() - timestamp_width - 1;
char filtered_recent_name[sizeof(a->name)];
display.translateUTF8ToBlocks(filtered_recent_name, a->name, sizeof(filtered_recent_name));
display.drawTextEllipsized(0, y, max_name_width, filtered_recent_name);
display.setCursor(display.width() - timestamp_width - 1, y);
display.print(tmp);
}
} else if (_page == HomePage::RADIO) {
display.setColor(DisplayDriver::YELLOW);
display.setTextSize(1);
// freq / sf
display.setCursor(0, 20);
sprintf(tmp, "FQ: %06.3f SF: %d", _node_prefs->freq, _node_prefs->sf);
display.print(tmp);
display.setCursor(0, 31);
sprintf(tmp, "BW: %03.2f CR: %d", _node_prefs->bw, _node_prefs->cr);
display.print(tmp);
// tx power, noise floor
display.setCursor(0, 42);
sprintf(tmp, "TX: %ddBm", _node_prefs->tx_power_dbm);
display.print(tmp);
display.setCursor(0, 53);
sprintf(tmp, "Noise floor: %d", radio_driver.getNoiseFloor());
display.print(tmp);
} else if (_page == HomePage::BLUETOOTH) {
display.setColor(DisplayDriver::GREEN);
display.drawXbm((display.width() - 32) / 2, 18,
_task->isSerialEnabled() ? bluetooth_on : bluetooth_off,
32, 32);
display.setTextSize(1);
display.drawTextCentered(display.width() / 2, 64 - 11, "toggle: " PRESS_LABEL);
} else if (_page == HomePage::ADVERT) {
display.setColor(DisplayDriver::GREEN);
display.drawXbm((display.width() - 32) / 2, 18, advert_icon, 32, 32);
display.drawTextCentered(display.width() / 2, 64 - 11, "advert: " PRESS_LABEL);
#if ENV_INCLUDE_GPS == 1
} else if (_page == HomePage::GPS) {
LocationProvider* nmea = sensors.getLocationProvider();
char buf[50];
int y = 18;
bool gps_state = _task->getGPSState();
#ifdef PIN_GPS_SWITCH
bool hw_gps_state = digitalRead(PIN_GPS_SWITCH);
if (gps_state != hw_gps_state) {
strcpy(buf, gps_state ? "gps off(hw)" : "gps off(sw)");
} else {
strcpy(buf, gps_state ? "gps on" : "gps off");
}
#else
strcpy(buf, gps_state ? "gps on" : "gps off");
#endif
display.drawTextLeftAlign(0, y, buf);
if (nmea == NULL) {
y = y + 12;
display.drawTextLeftAlign(0, y, "Can't access GPS");
} else {
strcpy(buf, nmea->isValid()?"fix":"no fix");
display.drawTextRightAlign(display.width()-1, y, buf);
y = y + 12;
display.drawTextLeftAlign(0, y, "sat");
sprintf(buf, "%d", nmea->satellitesCount());
display.drawTextRightAlign(display.width()-1, y, buf);
y = y + 12;
display.drawTextLeftAlign(0, y, "pos");
sprintf(buf, "%.4f %.4f",
nmea->getLatitude()/1000000., nmea->getLongitude()/1000000.);
display.drawTextRightAlign(display.width()-1, y, buf);
y = y + 12;
display.drawTextLeftAlign(0, y, "alt");
sprintf(buf, "%.2f", nmea->getAltitude()/1000.);
display.drawTextRightAlign(display.width()-1, y, buf);
y = y + 12;
}
#endif
#if UI_SENSORS_PAGE == 1
} else if (_page == HomePage::SENSORS) {
int y = 18;
refresh_sensors();
char buf[30];
char name[30];
LPPReader r(sensors_lpp.getBuffer(), sensors_lpp.getSize());
for (int i = 0; i < sensors_scroll_offset; i++) {
uint8_t channel, type;
r.readHeader(channel, type);
r.skipData(type);
}
for (int i = 0; i < (sensors_scroll?UI_RECENT_LIST_SIZE:sensors_nb); i++) {
uint8_t channel, type;
if (!r.readHeader(channel, type)) { // reached end, reset
r.reset();
r.readHeader(channel, type);
}
display.setCursor(0, y);
float v;
switch (type) {
case LPP_GPS: // GPS
float lat, lon, alt;
r.readGPS(lat, lon, alt);
strcpy(name, "gps"); sprintf(buf, "%.4f %.4f", lat, lon);
break;
case LPP_VOLTAGE:
r.readVoltage(v);
strcpy(name, "voltage"); sprintf(buf, "%6.2f", v);
break;
case LPP_CURRENT:
r.readCurrent(v);
strcpy(name, "current"); sprintf(buf, "%.3f", v);
break;
case LPP_TEMPERATURE:
r.readTemperature(v);
strcpy(name, "temperature"); sprintf(buf, "%.2f", v);
break;
case LPP_RELATIVE_HUMIDITY:
r.readRelativeHumidity(v);
strcpy(name, "humidity"); sprintf(buf, "%.2f", v);
break;
case LPP_BAROMETRIC_PRESSURE:
r.readPressure(v);
strcpy(name, "pressure"); sprintf(buf, "%.2f", v);
break;
case LPP_ALTITUDE:
r.readAltitude(v);
strcpy(name, "altitude"); sprintf(buf, "%.0f", v);
break;
case LPP_POWER:
r.readPower(v);
strcpy(name, "power"); sprintf(buf, "%6.2f", v);
break;
default:
r.skipData(type);
strcpy(name, "unk"); sprintf(buf, "");
}
display.setCursor(0, y);
display.print(name);
display.setCursor(
display.width()-display.getTextWidth(buf)-1, y
);
display.print(buf);
y = y + 12;
}
if (sensors_scroll) sensors_scroll_offset = (sensors_scroll_offset+1)%sensors_nb;
else sensors_scroll_offset = 0;
#endif
} else if (_page == HomePage::SHUTDOWN) {
display.setColor(DisplayDriver::GREEN);
display.setTextSize(1);
if (_shutdown_init) {
display.drawTextCentered(display.width() / 2, 34, "hibernating...");
} else {
display.drawXbm((display.width() - 32) / 2, 18, power_icon, 32, 32);
display.drawTextCentered(display.width() / 2, 64 - 11, "hibernate:" PRESS_LABEL);
}
}
return 5000; // next render after 5000 ms
}
bool handleInput(char c) override {
if (c == KEY_LEFT || c == KEY_PREV) {
_page = (_page + HomePage::Count - 1) % HomePage::Count;
return true;
}
if (c == KEY_NEXT || c == KEY_RIGHT) {
_page = (_page + 1) % HomePage::Count;
if (_page == HomePage::RECENT) {
_task->showAlert("Recent adverts", 800);
}
return true;
}
if (c == KEY_ENTER && _page == HomePage::BLUETOOTH) {
if (_task->isSerialEnabled()) { // toggle Bluetooth on/off
_task->disableSerial();
} else {
_task->enableSerial();
}
return true;
}
if (c == KEY_ENTER && _page == HomePage::ADVERT) {
_task->notify(UIEventType::ack);
if (the_mesh.advert()) {
_task->showAlert("Advert sent!", 1000);
} else {
_task->showAlert("Advert failed..", 1000);
}
return true;
}
#if ENV_INCLUDE_GPS == 1
if (c == KEY_ENTER && _page == HomePage::GPS) {
_task->toggleGPS();
return true;
}
#endif
#if UI_SENSORS_PAGE == 1
if (c == KEY_ENTER && _page == HomePage::SENSORS) {
_task->toggleGPS();
next_sensors_refresh=0;
return true;
}
#endif
if (c == KEY_ENTER && _page == HomePage::SHUTDOWN) {
_shutdown_init = true; // need to wait for button to be released
return true;
}
return false;
}
};
class MsgPreviewScreen : public UIScreen {
UITask* _task;
mesh::RTCClock* _rtc;
struct MsgEntry {
uint32_t timestamp;
char origin[62];
char msg[78];
};
#define MAX_UNREAD_MSGS 32
int num_unread;
int head = MAX_UNREAD_MSGS - 1; // index of latest unread message
MsgEntry unread[MAX_UNREAD_MSGS];
public:
MsgPreviewScreen(UITask* task, mesh::RTCClock* rtc) : _task(task), _rtc(rtc) { num_unread = 0; }
void addPreview(uint8_t path_len, const char* from_name, const char* msg) {
head = (head + 1) % MAX_UNREAD_MSGS;
if (num_unread < MAX_UNREAD_MSGS) num_unread++;
auto p = &unread[head];
p->timestamp = _rtc->getCurrentTime();
if (path_len == 0xFF) {
sprintf(p->origin, "(D) %s:", from_name);
} else {
sprintf(p->origin, "(%d) %s:", (uint32_t) path_len, from_name);
}
StrHelper::strncpy(p->msg, msg, sizeof(p->msg));
}
int render(DisplayDriver& display) override {
char tmp[16];
display.setCursor(0, 0);
display.setTextSize(1);
display.setColor(DisplayDriver::GREEN);
sprintf(tmp, "Unread: %d", num_unread);
display.print(tmp);
auto p = &unread[head];
int secs = _rtc->getCurrentTime() - p->timestamp;
if (secs < 60) {
sprintf(tmp, "%ds", secs);
} else if (secs < 60*60) {
sprintf(tmp, "%dm", secs / 60);
} else {
sprintf(tmp, "%dh", secs / (60*60));
}
display.setCursor(display.width() - display.getTextWidth(tmp) - 2, 0);
display.print(tmp);
display.drawRect(0, 11, display.width(), 1); // horiz line
display.setCursor(0, 14);
display.setColor(DisplayDriver::YELLOW);
char filtered_origin[sizeof(p->origin)];
display.translateUTF8ToBlocks(filtered_origin, p->origin, sizeof(filtered_origin));
display.print(filtered_origin);
display.setCursor(0, 25);
display.setColor(DisplayDriver::LIGHT);
char filtered_msg[sizeof(p->msg)];
display.translateUTF8ToBlocks(filtered_msg, p->msg, sizeof(filtered_msg));
display.printWordWrap(filtered_msg, display.width());
#if AUTO_OFF_MILLIS==0 // probably e-ink
return 10000; // 10 s
#else
return 1000; // next render after 1000 ms
#endif
}
bool handleInput(char c) override {
if (c == KEY_NEXT || c == KEY_RIGHT) {
head = (head + MAX_UNREAD_MSGS - 1) % MAX_UNREAD_MSGS;
num_unread--;
if (num_unread == 0) {
_task->gotoHomeScreen();
}
return true;
}
if (c == KEY_ENTER) {
num_unread = 0; // clear unread queue
_task->gotoHomeScreen();
return true;
}
return false;
}
};
void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs) {
_display = display;
_sensors = sensors;
_auto_off = millis() + AUTO_OFF_MILLIS;
#if defined(PIN_USER_BTN)
user_btn.begin();
#endif
#if defined(PIN_USER_BTN_ANA)
analog_btn.begin();
#endif
_node_prefs = node_prefs;
#if ENV_INCLUDE_GPS == 1
// Apply GPS preferences from stored prefs
if (_sensors != NULL && _node_prefs != NULL) {
_sensors->setSettingValue("gps", _node_prefs->gps_enabled ? "1" : "0");
if (_node_prefs->gps_interval > 0) {
char interval_str[12]; // Max: 24 hours = 86400 seconds (5 digits + null)
sprintf(interval_str, "%u", _node_prefs->gps_interval);
_sensors->setSettingValue("gps_interval", interval_str);
}
}
#endif
if (_display != NULL) {
_display->turnOn();
}
#ifdef PIN_BUZZER
buzzer.begin();
buzzer.quiet(_node_prefs->buzzer_quiet);
#endif
#ifdef PIN_VIBRATION
vibration.begin();
#endif
ui_started_at = millis();
_alert_expiry = 0;
splash = new SplashScreen(this);
home = new HomeScreen(this, &rtc_clock, sensors, node_prefs);
msg_preview = new MsgPreviewScreen(this, &rtc_clock);
setCurrScreen(splash);
}
void UITask::showAlert(const char* text, int duration_millis) {
strcpy(_alert, text);
_alert_expiry = millis() + duration_millis;
}
void UITask::notify(UIEventType t) {
#if defined(PIN_BUZZER)
switch(t){
case UIEventType::contactMessage:
// gemini's pick
buzzer.play("MsgRcv3:d=4,o=6,b=200:32e,32g,32b,16c7");
break;
case UIEventType::channelMessage:
buzzer.play("kerplop:d=16,o=6,b=120:32g#,32c#");
break;
case UIEventType::ack:
buzzer.play("ack:d=32,o=8,b=120:c");
break;
case UIEventType::roomMessage:
case UIEventType::newContactMessage:
case UIEventType::none:
default:
break;
}
#endif
#ifdef PIN_VIBRATION
// Trigger vibration for all UI events except none
if (t != UIEventType::none) {
vibration.trigger();
}
#endif
}
void UITask::msgRead(int msgcount) {
_msgcount = msgcount;
if (msgcount == 0) {
gotoHomeScreen();
}
}
void UITask::newMsg(uint8_t path_len, const char* from_name, const char* text, int msgcount) {
_msgcount = msgcount;
((MsgPreviewScreen *) msg_preview)->addPreview(path_len, from_name, text);
setCurrScreen(msg_preview);
if (_display != NULL) {
if (!_display->isOn() && !hasConnection()) {
_display->turnOn();
}
if (_display->isOn()) {
_auto_off = millis() + AUTO_OFF_MILLIS; // extend the auto-off timer
_next_refresh = 100; // trigger refresh
}
}
}
void UITask::userLedHandler() {
#ifdef PIN_STATUS_LED
int cur_time = millis();
if (cur_time > next_led_change) {
if (led_state == 0) {
led_state = 1;
if (_msgcount > 0) {
last_led_increment = LED_ON_MSG_MILLIS;
} else {
last_led_increment = LED_ON_MILLIS;
}
next_led_change = cur_time + last_led_increment;
} else {
led_state = 0;
next_led_change = cur_time + LED_CYCLE_MILLIS - last_led_increment;
}
digitalWrite(PIN_STATUS_LED, led_state == LED_STATE_ON);
}
#endif
}
void UITask::setCurrScreen(UIScreen* c) {
curr = c;
_next_refresh = 100;
}
/*
hardware-agnostic pre-shutdown activity should be done here
*/
void UITask::shutdown(bool restart){
#ifdef PIN_BUZZER
/* note: we have a choice here -
we can do a blocking buzzer.loop() with non-deterministic consequences
or we can set a flag and delay the shutdown for a couple of seconds
while a non-blocking buzzer.loop() plays out in UITask::loop()
*/
buzzer.shutdown();
uint32_t buzzer_timer = millis(); // fail-safe shutdown
while (buzzer.isPlaying() && (millis() - 2500) < buzzer_timer)
buzzer.loop();
#endif // PIN_BUZZER
if (restart) {
_board->reboot();
} else {
_display->turnOff();
radio_driver.powerOff();
_board->powerOff();
}
}
bool UITask::isButtonPressed() const {
#ifdef PIN_USER_BTN
return user_btn.isPressed();
#else
return false;
#endif
}
void UITask::loop() {
char c = 0;
#if UI_HAS_JOYSTICK
int ev = user_btn.check();
if (ev == BUTTON_EVENT_CLICK) {
c = checkDisplayOn(KEY_ENTER);
} else if (ev == BUTTON_EVENT_LONG_PRESS) {
c = handleLongPress(KEY_ENTER); // REVISIT: could be mapped to different key code
}
ev = joystick_left.check();
if (ev == BUTTON_EVENT_CLICK) {
c = checkDisplayOn(KEY_LEFT);
} else if (ev == BUTTON_EVENT_LONG_PRESS) {
c = handleLongPress(KEY_LEFT);
}
ev = joystick_right.check();
if (ev == BUTTON_EVENT_CLICK) {
c = checkDisplayOn(KEY_RIGHT);
} else if (ev == BUTTON_EVENT_LONG_PRESS) {
c = handleLongPress(KEY_RIGHT);
}
ev = back_btn.check();
if (ev == BUTTON_EVENT_TRIPLE_CLICK) {
c = handleTripleClick(KEY_SELECT);
}
#elif defined(PIN_USER_BTN)
int ev = user_btn.check();
if (ev == BUTTON_EVENT_CLICK) {
c = checkDisplayOn(KEY_NEXT);
} else if (ev == BUTTON_EVENT_LONG_PRESS) {
c = handleLongPress(KEY_ENTER);
} else if (ev == BUTTON_EVENT_DOUBLE_CLICK) {
c = handleDoubleClick(KEY_PREV);
} else if (ev == BUTTON_EVENT_TRIPLE_CLICK) {
c = handleTripleClick(KEY_SELECT);
}
#endif
#if defined(PIN_USER_BTN_ANA)
if (abs(millis() - _analogue_pin_read_millis) > 10) {
ev = analog_btn.check();
if (ev == BUTTON_EVENT_CLICK) {
c = checkDisplayOn(KEY_NEXT);
} else if (ev == BUTTON_EVENT_LONG_PRESS) {
c = handleLongPress(KEY_ENTER);
} else if (ev == BUTTON_EVENT_DOUBLE_CLICK) {
c = handleDoubleClick(KEY_PREV);
} else if (ev == BUTTON_EVENT_TRIPLE_CLICK) {
c = handleTripleClick(KEY_SELECT);
}
_analogue_pin_read_millis = millis();
}
#endif
#if defined(BACKLIGHT_BTN)
if (millis() > next_backlight_btn_check) {
bool touch_state = digitalRead(PIN_BUTTON2);
#if defined(DISP_BACKLIGHT)
digitalWrite(DISP_BACKLIGHT, !touch_state);
#elif defined(EXP_PIN_BACKLIGHT)
expander.digitalWrite(EXP_PIN_BACKLIGHT, !touch_state);
#endif
next_backlight_btn_check = millis() + 300;
}
#endif
if (c != 0 && curr) {
curr->handleInput(c);
_auto_off = millis() + AUTO_OFF_MILLIS; // extend auto-off timer
_next_refresh = 100; // trigger refresh
}
userLedHandler();
#ifdef PIN_BUZZER
if (buzzer.isPlaying()) buzzer.loop();
#endif
if (curr) curr->poll();
if (_display != NULL && _display->isOn()) {
if (millis() >= _next_refresh && curr) {
_display->startFrame();
int delay_millis = curr->render(*_display);
if (millis() < _alert_expiry) { // render alert popup
_display->setTextSize(1);
int y = _display->height() / 3;
int p = _display->height() / 32;
_display->setColor(DisplayDriver::DARK);
_display->fillRect(p, y, _display->width() - p*2, y);
_display->setColor(DisplayDriver::LIGHT); // draw box border
_display->drawRect(p, y, _display->width() - p*2, y);
_display->drawTextCentered(_display->width() / 2, y + p*3, _alert);
_next_refresh = _alert_expiry; // will need refresh when alert is dismissed
} else {
_next_refresh = millis() + delay_millis;
}
_display->endFrame();
}
#if AUTO_OFF_MILLIS > 0
if (millis() > _auto_off) {
_display->turnOff();
}
#endif
}
#ifdef PIN_VIBRATION
vibration.loop();
#endif
#ifdef AUTO_SHUTDOWN_MILLIVOLTS
if (millis() > next_batt_chck) {
uint16_t milliVolts = getBattMilliVolts();
if (milliVolts > 0 && milliVolts < AUTO_SHUTDOWN_MILLIVOLTS) {
// show low battery shutdown alert
// we should only do this for eink displays, which will persist after power loss
#if defined(THINKNODE_M1) || defined(LILYGO_TECHO)
if (_display != NULL) {
_display->startFrame();
_display->setTextSize(2);
_display->setColor(DisplayDriver::RED);
_display->drawTextCentered(_display->width() / 2, 20, "Low Battery.");
_display->drawTextCentered(_display->width() / 2, 40, "Shutting Down!");
_display->endFrame();
}
#endif
shutdown();
}
next_batt_chck = millis() + 8000;
}
#endif
}
char UITask::checkDisplayOn(char c) {
if (_display != NULL) {
if (!_display->isOn()) {
_display->turnOn(); // turn display on and consume event
c = 0;
}
_auto_off = millis() + AUTO_OFF_MILLIS; // extend auto-off timer
_next_refresh = 0; // trigger refresh
}
return c;
}
char UITask::handleLongPress(char c) {
if (millis() - ui_started_at < 8000) { // long press in first 8 seconds since startup -> CLI/rescue
the_mesh.enterCLIRescue();
c = 0; // consume event
}
return c;
}
char UITask::handleDoubleClick(char c) {
MESH_DEBUG_PRINTLN("UITask: double click triggered");
checkDisplayOn(c);
return c;
}
char UITask::handleTripleClick(char c) {
MESH_DEBUG_PRINTLN("UITask: triple click triggered");
checkDisplayOn(c);
toggleBuzzer();
c = 0;
return c;
}
bool UITask::getGPSState() {
if (_sensors != NULL) {
int num = _sensors->getNumSettings();
for (int i = 0; i < num; i++) {
if (strcmp(_sensors->getSettingName(i), "gps") == 0) {
return !strcmp(_sensors->getSettingValue(i), "1");
}
}
}
return false;
}
void UITask::toggleGPS() {
if (_sensors != NULL) {
// toggle GPS on/off
int num = _sensors->getNumSettings();
for (int i = 0; i < num; i++) {
if (strcmp(_sensors->getSettingName(i), "gps") == 0) {
if (strcmp(_sensors->getSettingValue(i), "1") == 0) {
_sensors->setSettingValue("gps", "0");
_node_prefs->gps_enabled = 0;
notify(UIEventType::ack);
} else {
_sensors->setSettingValue("gps", "1");
_node_prefs->gps_enabled = 1;
notify(UIEventType::ack);
}
the_mesh.savePrefs();
showAlert(_node_prefs->gps_enabled ? "GPS: Enabled" : "GPS: Disabled", 800);
_next_refresh = 0;
break;
}
}
}
}
void UITask::toggleBuzzer() {
// Toggle buzzer quiet mode
#ifdef PIN_BUZZER
if (buzzer.isQuiet()) {
buzzer.quiet(false);
notify(UIEventType::ack);
} else {
buzzer.quiet(true);
}
_node_prefs->buzzer_quiet = buzzer.isQuiet();
the_mesh.savePrefs();
showAlert(buzzer.isQuiet() ? "Buzzer: OFF" : "Buzzer: ON", 800);
_next_refresh = 0; // trigger refresh
#endif
}

View File

@@ -0,0 +1,101 @@
#pragma once
#include <MeshCore.h>
#include <helpers/ui/DisplayDriver.h>
#include <helpers/ui/UIScreen.h>
#include <helpers/SensorManager.h>
#include <helpers/BaseSerialInterface.h>
#include <Arduino.h>
#include <helpers/sensors/LPPDataHelpers.h>
#ifndef LED_STATE_ON
#define LED_STATE_ON 1
#endif
#ifdef PIN_BUZZER
#include <helpers/ui/buzzer.h>
#endif
#ifdef PIN_VIBRATION
#include <helpers/ui/GenericVibration.h>
#endif
#include "../AbstractUITask.h"
#include "../NodePrefs.h"
class UITask : public AbstractUITask {
DisplayDriver* _display;
SensorManager* _sensors;
#ifdef PIN_BUZZER
genericBuzzer buzzer;
#endif
#ifdef PIN_VIBRATION
GenericVibration vibration;
#endif
unsigned long _next_refresh, _auto_off;
NodePrefs* _node_prefs;
char _alert[80];
unsigned long _alert_expiry;
int _msgcount;
unsigned long ui_started_at, next_batt_chck;
int next_backlight_btn_check = 0;
#ifdef PIN_STATUS_LED
int led_state = 0;
int next_led_change = 0;
int last_led_increment = 0;
#endif
#ifdef PIN_USER_BTN_ANA
unsigned long _analogue_pin_read_millis = millis();
#endif
UIScreen* splash;
UIScreen* home;
UIScreen* msg_preview;
UIScreen* curr;
void userLedHandler();
// Button action handlers
char checkDisplayOn(char c);
char handleLongPress(char c);
char handleDoubleClick(char c);
char handleTripleClick(char c);
void setCurrScreen(UIScreen* c);
public:
UITask(mesh::MainBoard* board, BaseSerialInterface* serial) : AbstractUITask(board, serial), _display(NULL), _sensors(NULL) {
next_batt_chck = _next_refresh = 0;
ui_started_at = 0;
curr = NULL;
}
void begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs);
void gotoHomeScreen() { setCurrScreen(home); }
void showAlert(const char* text, int duration_millis);
int getMsgCount() const { return _msgcount; }
bool hasDisplay() const { return _display != NULL; }
bool isButtonPressed() const;
bool isBuzzerQuiet() {
#ifdef PIN_BUZZER
return buzzer.isQuiet();
#else
return true;
#endif
}
void toggleBuzzer();
bool getGPSState();
void toggleGPS();
// from AbstractUITask
void msgRead(int msgcount) override;
void newMsg(uint8_t path_len, const char* from_name, const char* text, int msgcount) override;
void notify(UIEventType t = UIEventType::none) override;
void loop() override;
void shutdown(bool restart = false);
};

View File

@@ -0,0 +1,122 @@
#pragma once
#include <stdint.h>
// 'meshcore', 128x13px
static const uint8_t meshcore_logo [] = {
0x3c, 0x01, 0xe3, 0xff, 0xc7, 0xff, 0x8f, 0x03, 0x87, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe,
0x3c, 0x03, 0xe3, 0xff, 0xc7, 0xff, 0x8e, 0x03, 0x8f, 0xfe, 0x3f, 0xfe, 0x1f, 0xff, 0x1f, 0xfe,
0x3e, 0x03, 0xc3, 0xff, 0x8f, 0xff, 0x0e, 0x07, 0x8f, 0xfe, 0x7f, 0xfe, 0x1f, 0xff, 0x1f, 0xfc,
0x3e, 0x07, 0xc7, 0x80, 0x0e, 0x00, 0x0e, 0x07, 0x9e, 0x00, 0x78, 0x0e, 0x3c, 0x0f, 0x1c, 0x00,
0x3e, 0x0f, 0xc7, 0x80, 0x1e, 0x00, 0x0e, 0x07, 0x1e, 0x00, 0x70, 0x0e, 0x38, 0x0f, 0x3c, 0x00,
0x7f, 0x0f, 0xc7, 0xfe, 0x1f, 0xfc, 0x1f, 0xff, 0x1c, 0x00, 0x70, 0x0e, 0x38, 0x0e, 0x3f, 0xf8,
0x7f, 0x1f, 0xc7, 0xfe, 0x0f, 0xff, 0x1f, 0xff, 0x1c, 0x00, 0xf0, 0x0e, 0x38, 0x0e, 0x3f, 0xf8,
0x7f, 0x3f, 0xc7, 0xfe, 0x0f, 0xff, 0x1f, 0xff, 0x1c, 0x00, 0xf0, 0x1e, 0x3f, 0xfe, 0x3f, 0xf0,
0x77, 0x3b, 0x87, 0x00, 0x00, 0x07, 0x1c, 0x0f, 0x3c, 0x00, 0xe0, 0x1c, 0x7f, 0xfc, 0x38, 0x00,
0x77, 0xfb, 0x8f, 0x00, 0x00, 0x07, 0x1c, 0x0f, 0x3c, 0x00, 0xe0, 0x1c, 0x7f, 0xf8, 0x38, 0x00,
0x73, 0xf3, 0x8f, 0xff, 0x0f, 0xff, 0x1c, 0x0e, 0x3f, 0xf8, 0xff, 0xfc, 0x70, 0x78, 0x7f, 0xf8,
0xe3, 0xe3, 0x8f, 0xff, 0x1f, 0xfe, 0x3c, 0x0e, 0x3f, 0xf8, 0xff, 0xfc, 0x70, 0x3c, 0x7f, 0xf8,
0xe3, 0xe3, 0x8f, 0xff, 0x1f, 0xfc, 0x3c, 0x0e, 0x1f, 0xf8, 0xff, 0xf8, 0x70, 0x3c, 0x7f, 0xf8,
};
static const uint8_t bluetooth_on[] = {
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x30, 0x00, 0x00,
0x00, 0x3C, 0x00, 0x00,
0x00, 0x3E, 0x00, 0x00,
0x00, 0x3F, 0x80, 0x00,
0x00, 0x3F, 0xC0, 0x00,
0x00, 0x3B, 0xE0, 0x00,
0x30, 0x38, 0xF8, 0x00,
0x3C, 0x38, 0x7C, 0x00,
0x3E, 0x38, 0x7C, 0x00,
0x1F, 0xB8, 0xF8, 0x70,
0x07, 0xF9, 0xF0, 0x78,
0x03, 0xFF, 0xC0, 0x78,
0x00, 0xFF, 0x80, 0x3C,
0x00, 0x7F, 0x07, 0x1C,
0x00, 0x7E, 0x07, 0x1C,
0x03, 0xFF, 0x82, 0x1C,
0x03, 0xFF, 0xC0, 0x78,
0x07, 0xFB, 0xE0, 0x78,
0x0F, 0xB8, 0xF8, 0x70,
0x3E, 0x38, 0x7C, 0x00,
0x3C, 0x38, 0x7C, 0x00,
0x38, 0x38, 0xF8, 0x00,
0x00, 0x39, 0xF0, 0x00,
0x00, 0x3F, 0xC0, 0x00,
0x00, 0x3F, 0x80, 0x00,
0x00, 0x3E, 0x00, 0x00,
0x00, 0x3C, 0x00, 0x00,
0x00, 0x38, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
};
static const uint8_t bluetooth_off[] = {
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0x80, 0x00,
0x00, 0x03, 0xC0, 0x00,
0x00, 0x03, 0xE0, 0x00,
0x38, 0x03, 0xF8, 0x00,
0x3C, 0x03, 0xFC, 0x00,
0x3E, 0x03, 0xBF, 0x00,
0x0F, 0x83, 0x8F, 0x80,
0x07, 0xC3, 0x87, 0xC0,
0x03, 0xF0, 0x03, 0xC0,
0x00, 0xF8, 0x0F, 0x80,
0x00, 0x7C, 0x0F, 0x00,
0x00, 0x1F, 0x0E, 0x00,
0x00, 0x0F, 0x80, 0x00,
0x00, 0x07, 0xE0, 0x00,
0x00, 0x07, 0xF0, 0x00,
0x00, 0x0F, 0xF8, 0x00,
0x00, 0x3F, 0xBE, 0x00,
0x00, 0x7F, 0x9F, 0x00,
0x00, 0xFB, 0x8F, 0xC0,
0x03, 0xE3, 0x83, 0xE0,
0x03, 0xC3, 0x87, 0xF0,
0x03, 0x83, 0x8F, 0xFC,
0x00, 0x03, 0xBF, 0x3C,
0x00, 0x03, 0xFC, 0x1C,
0x00, 0x03, 0xF8, 0x00,
0x00, 0x03, 0xE0, 0x00,
0x00, 0x03, 0xC0, 0x00,
0x00, 0x03, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
};
static const uint8_t power_icon[] = {
0x00, 0x01, 0x80, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x03, 0xC0, 0x00,
0x00, 0x33, 0xCC, 0x00, 0x00, 0xF3, 0xCF, 0x00, 0x01, 0xF3, 0xCF, 0x80,
0x03, 0xF3, 0xCF, 0xC0, 0x07, 0xF3, 0xCF, 0xE0, 0x0F, 0xE3, 0xC7, 0xF0,
0x1F, 0xC3, 0xC3, 0xF8, 0x1F, 0x83, 0xC1, 0xF8, 0x3F, 0x03, 0xC0, 0xFC,
0x3E, 0x03, 0xC0, 0x7C, 0x3E, 0x03, 0xC0, 0x7C, 0x7E, 0x01, 0x80, 0x7E,
0x7C, 0x00, 0x00, 0x3E, 0x7C, 0x00, 0x00, 0x3E, 0x7C, 0x00, 0x00, 0x3E,
0x7C, 0x00, 0x00, 0x3E, 0x7C, 0x00, 0x00, 0x3E, 0x3E, 0x00, 0x00, 0x7C,
0x3E, 0x00, 0x00, 0x7C, 0x3F, 0x00, 0x00, 0xFC, 0x1F, 0x80, 0x01, 0xF8,
0x1F, 0xC0, 0x03, 0xF8, 0x0F, 0xE0, 0x07, 0xF0, 0x0F, 0xF8, 0x1F, 0xF0,
0x07, 0xFF, 0xFF, 0xE0, 0x03, 0xFF, 0xFF, 0xC0, 0x00, 0xFF, 0xFF, 0x00,
0x00, 0x3F, 0xFC, 0x00, 0x00, 0x0F, 0xF0, 0x00,
};
static const uint8_t advert_icon[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x30,
0x1C, 0x00, 0x00, 0x38, 0x18, 0x00, 0x00, 0x18, 0x30, 0x00, 0x00, 0x0C,
0x30, 0x60, 0x06, 0x0C, 0x60, 0xE0, 0x07, 0x06, 0x61, 0xC0, 0x03, 0x86,
0xE1, 0x81, 0x81, 0x87, 0xC3, 0x07, 0xE0, 0xC3, 0xC3, 0x0F, 0xF0, 0xC3,
0xC3, 0x0F, 0xF0, 0xC3, 0xC3, 0x0F, 0xF0, 0xC3, 0xC3, 0x0F, 0xF0, 0xC3,
0xC3, 0x07, 0xE0, 0xC3, 0xC1, 0x83, 0xC1, 0x83, 0x61, 0x80, 0x01, 0x86,
0x60, 0xC0, 0x03, 0x06, 0x70, 0xE0, 0x07, 0x0E, 0x30, 0x40, 0x02, 0x0C,
0x38, 0x00, 0x00, 0x1C, 0x18, 0x00, 0x00, 0x18, 0x0C, 0x00, 0x00, 0x30,
0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static const uint8_t muted_icon[] = {
0x20, 0x6a, 0xea, 0xe4, 0xe4, 0xea, 0x6a, 0x20
};

View File

@@ -0,0 +1,131 @@
#include "Button.h"
Button::Button(uint8_t pin, bool activeState)
: _pin(pin), _activeState(activeState), _isAnalog(false), _analogThreshold(20) {
_currentState = false; // Initialize as not pressed
_lastState = _currentState;
}
Button::Button(uint8_t pin, bool activeState, bool isAnalog, uint16_t analogThreshold)
: _pin(pin), _activeState(activeState), _isAnalog(isAnalog), _analogThreshold(analogThreshold) {
_currentState = false; // Initialize as not pressed
_lastState = _currentState;
}
void Button::begin() {
_currentState = readButton();
_lastState = _currentState;
}
void Button::update() {
uint32_t now = millis();
// Read button at specified interval
if (now - _lastReadTime < BUTTON_READ_INTERVAL_MS) {
return;
}
_lastReadTime = now;
bool newState = readButton();
// Check if state has changed
if (newState != _lastState) {
_stateChangeTime = now;
}
// Debounce check
if ((now - _stateChangeTime) > BUTTON_DEBOUNCE_TIME_MS) {
if (newState != _currentState) {
_currentState = newState;
handleStateChange();
}
}
_lastState = newState;
// Handle multi-click timeout
if (_state == WAITING_FOR_MULTI_CLICK && (now - _releaseTime) > BUTTON_CLICK_TIMEOUT_MS) {
// Timeout reached, process the clicks
if (_clickCount == 1) {
triggerEvent(SHORT_PRESS);
} else if (_clickCount == 2) {
triggerEvent(DOUBLE_PRESS);
} else if (_clickCount == 3) {
triggerEvent(TRIPLE_PRESS);
} else if (_clickCount >= 4) {
triggerEvent(QUADRUPLE_PRESS);
}
_clickCount = 0;
_state = IDLE;
}
// Handle long press while button is held
if (_state == PRESSED && (now - _pressTime) > BUTTON_LONG_PRESS_TIME_MS) {
triggerEvent(LONG_PRESS);
_state = IDLE; // Prevent multiple press events
_clickCount = 0;
}
}
bool Button::readButton() {
if (_isAnalog) {
return (analogRead(_pin) < _analogThreshold);
} else {
return (digitalRead(_pin) == _activeState);
}
}
void Button::handleStateChange() {
uint32_t now = millis();
if (_currentState) {
// Button pressed
_pressTime = now;
_state = PRESSED;
triggerEvent(ANY_PRESS);
} else {
// Button released
if (_state == PRESSED) {
uint32_t pressDuration = now - _pressTime;
if (pressDuration < BUTTON_LONG_PRESS_TIME_MS) {
// Short press detected
_clickCount++;
_releaseTime = now;
_state = WAITING_FOR_MULTI_CLICK;
} else {
// Long press already handled in update()
_state = IDLE;
_clickCount = 0;
}
}
}
}
void Button::triggerEvent(EventType event) {
_lastEvent = event;
switch (event) {
case ANY_PRESS:
if (_onAnyPress) _onAnyPress();
break;
case SHORT_PRESS:
if (_onShortPress) _onShortPress();
break;
case DOUBLE_PRESS:
if (_onDoublePress) _onDoublePress();
break;
case TRIPLE_PRESS:
if (_onTriplePress) _onTriplePress();
break;
case QUADRUPLE_PRESS:
if (_onQuadruplePress) _onQuadruplePress();
break;
case LONG_PRESS:
if (_onLongPress) _onLongPress();
break;
default:
break;
}
}

View File

@@ -0,0 +1,80 @@
#pragma once
#include <Arduino.h>
#include <functional>
// Button timing configuration
#define BUTTON_DEBOUNCE_TIME_MS 50 // Debounce time in ms
#define BUTTON_CLICK_TIMEOUT_MS 500 // Max time between clicks for multi-click
#define BUTTON_LONG_PRESS_TIME_MS 3000 // Time to trigger long press (3 seconds)
#define BUTTON_READ_INTERVAL_MS 10 // How often to read the button
class Button {
public:
enum EventType {
NONE,
SHORT_PRESS,
DOUBLE_PRESS,
TRIPLE_PRESS,
QUADRUPLE_PRESS,
LONG_PRESS,
ANY_PRESS
};
using EventCallback = std::function<void()>;
Button(uint8_t pin, bool activeState = LOW);
Button(uint8_t pin, bool activeState, bool isAnalog, uint16_t analogThreshold = 20);
void begin();
void update();
// Set callbacks for different events
void onShortPress(EventCallback callback) { _onShortPress = callback; }
void onDoublePress(EventCallback callback) { _onDoublePress = callback; }
void onTriplePress(EventCallback callback) { _onTriplePress = callback; }
void onQuadruplePress(EventCallback callback) { _onQuadruplePress = callback; }
void onLongPress(EventCallback callback) { _onLongPress = callback; }
void onAnyPress(EventCallback callback) { _onAnyPress = callback; }
// State getters
bool isPressed() const { return _currentState; }
EventType getLastEvent() const { return _lastEvent; }
private:
enum State {
IDLE,
PRESSED,
RELEASED,
WAITING_FOR_MULTI_CLICK
};
uint8_t _pin;
bool _activeState;
bool _isAnalog;
uint16_t _analogThreshold;
State _state = IDLE;
bool _currentState;
bool _lastState;
uint32_t _stateChangeTime = 0;
uint32_t _pressTime = 0;
uint32_t _releaseTime = 0;
uint32_t _lastReadTime = 0;
uint8_t _clickCount = 0;
EventType _lastEvent = NONE;
// Callbacks
EventCallback _onShortPress = nullptr;
EventCallback _onDoublePress = nullptr;
EventCallback _onTriplePress = nullptr;
EventCallback _onQuadruplePress = nullptr;
EventCallback _onLongPress = nullptr;
EventCallback _onAnyPress = nullptr;
bool readButton();
void handleStateChange();
void triggerEvent(EventType event);
};

View File

@@ -0,0 +1,446 @@
#include "UITask.h"
#include <Arduino.h>
#include <helpers/TxtDataHelpers.h>
#include "../MyMesh.h"
#define AUTO_OFF_MILLIS 15000 // 15 seconds
#define BOOT_SCREEN_MILLIS 3000 // 3 seconds
#ifdef PIN_STATUS_LED
#define LED_ON_MILLIS 20
#define LED_ON_MSG_MILLIS 200
#define LED_CYCLE_MILLIS 4000
#endif
#ifndef USER_BTN_PRESSED
#define USER_BTN_PRESSED LOW
#endif
// 'meshcore', 128x13px
static const uint8_t meshcore_logo [] PROGMEM = {
0x3c, 0x01, 0xe3, 0xff, 0xc7, 0xff, 0x8f, 0x03, 0x87, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe,
0x3c, 0x03, 0xe3, 0xff, 0xc7, 0xff, 0x8e, 0x03, 0x8f, 0xfe, 0x3f, 0xfe, 0x1f, 0xff, 0x1f, 0xfe,
0x3e, 0x03, 0xc3, 0xff, 0x8f, 0xff, 0x0e, 0x07, 0x8f, 0xfe, 0x7f, 0xfe, 0x1f, 0xff, 0x1f, 0xfc,
0x3e, 0x07, 0xc7, 0x80, 0x0e, 0x00, 0x0e, 0x07, 0x9e, 0x00, 0x78, 0x0e, 0x3c, 0x0f, 0x1c, 0x00,
0x3e, 0x0f, 0xc7, 0x80, 0x1e, 0x00, 0x0e, 0x07, 0x1e, 0x00, 0x70, 0x0e, 0x38, 0x0f, 0x3c, 0x00,
0x7f, 0x0f, 0xc7, 0xfe, 0x1f, 0xfc, 0x1f, 0xff, 0x1c, 0x00, 0x70, 0x0e, 0x38, 0x0e, 0x3f, 0xf8,
0x7f, 0x1f, 0xc7, 0xfe, 0x0f, 0xff, 0x1f, 0xff, 0x1c, 0x00, 0xf0, 0x0e, 0x38, 0x0e, 0x3f, 0xf8,
0x7f, 0x3f, 0xc7, 0xfe, 0x0f, 0xff, 0x1f, 0xff, 0x1c, 0x00, 0xf0, 0x1e, 0x3f, 0xfe, 0x3f, 0xf0,
0x77, 0x3b, 0x87, 0x00, 0x00, 0x07, 0x1c, 0x0f, 0x3c, 0x00, 0xe0, 0x1c, 0x7f, 0xfc, 0x38, 0x00,
0x77, 0xfb, 0x8f, 0x00, 0x00, 0x07, 0x1c, 0x0f, 0x3c, 0x00, 0xe0, 0x1c, 0x7f, 0xf8, 0x38, 0x00,
0x73, 0xf3, 0x8f, 0xff, 0x0f, 0xff, 0x1c, 0x0e, 0x3f, 0xf8, 0xff, 0xfc, 0x70, 0x78, 0x7f, 0xf8,
0xe3, 0xe3, 0x8f, 0xff, 0x1f, 0xfe, 0x3c, 0x0e, 0x3f, 0xf8, 0xff, 0xfc, 0x70, 0x3c, 0x7f, 0xf8,
0xe3, 0xe3, 0x8f, 0xff, 0x1f, 0xfc, 0x3c, 0x0e, 0x1f, 0xf8, 0xff, 0xf8, 0x70, 0x3c, 0x7f, 0xf8,
};
void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs) {
_display = display;
_sensors = sensors;
_auto_off = millis() + AUTO_OFF_MILLIS;
clearMsgPreview();
_node_prefs = node_prefs;
if (_display != NULL) {
_display->turnOn();
}
// strip off dash and commit hash by changing dash to null terminator
// e.g: v1.2.3-abcdef -> v1.2.3
char *version = strdup(FIRMWARE_VERSION);
char *dash = strchr(version, '-');
if (dash) {
*dash = 0;
}
// v1.2.3 (1 Jan 2025)
sprintf(_version_info, "%s (%s)", version, FIRMWARE_BUILD_DATE);
#ifdef PIN_BUZZER
buzzer.begin();
buzzer.quiet(_node_prefs->buzzer_quiet);
#endif
// Initialize digital button if available
#ifdef PIN_USER_BTN
_userButton = new Button(PIN_USER_BTN, USER_BTN_PRESSED);
_userButton->begin();
// Set up digital button callbacks
_userButton->onShortPress([this]() { handleButtonShortPress(); });
_userButton->onDoublePress([this]() { handleButtonDoublePress(); });
_userButton->onTriplePress([this]() { handleButtonTriplePress(); });
_userButton->onQuadruplePress([this]() { handleButtonQuadruplePress(); });
_userButton->onLongPress([this]() { handleButtonLongPress(); });
_userButton->onAnyPress([this]() { handleButtonAnyPress(); });
#endif
// Initialize analog button if available
#ifdef PIN_USER_BTN_ANA
_userButtonAnalog = new Button(PIN_USER_BTN_ANA, USER_BTN_PRESSED, true, 20);
_userButtonAnalog->begin();
// Set up analog button callbacks
_userButtonAnalog->onShortPress([this]() { handleButtonShortPress(); });
_userButtonAnalog->onDoublePress([this]() { handleButtonDoublePress(); });
_userButtonAnalog->onTriplePress([this]() { handleButtonTriplePress(); });
_userButtonAnalog->onQuadruplePress([this]() { handleButtonQuadruplePress(); });
_userButtonAnalog->onLongPress([this]() { handleButtonLongPress(); });
_userButtonAnalog->onAnyPress([this]() { handleButtonAnyPress(); });
#endif
ui_started_at = millis();
}
void UITask::notify(UIEventType t) {
#if defined(PIN_BUZZER)
switch(t){
case UIEventType::contactMessage:
// gemini's pick
buzzer.play("MsgRcv3:d=4,o=6,b=200:32e,32g,32b,16c7");
break;
case UIEventType::channelMessage:
buzzer.play("kerplop:d=16,o=6,b=120:32g#,32c#");
break;
case UIEventType::ack:
buzzer.play("ack:d=32,o=8,b=120:c");
break;
case UIEventType::roomMessage:
case UIEventType::newContactMessage:
case UIEventType::none:
default:
break;
}
#endif
// Serial.print("DBG: Alert user -> ");
// Serial.println((int) t);
}
void UITask::msgRead(int msgcount) {
_msgcount = msgcount;
if (msgcount == 0) {
clearMsgPreview();
}
}
void UITask::clearMsgPreview() {
_origin[0] = 0;
_msg[0] = 0;
_need_refresh = true;
}
void UITask::newMsg(uint8_t path_len, const char* from_name, const char* text, int msgcount) {
_msgcount = msgcount;
if (path_len == 0xFF) {
sprintf(_origin, "(F) %s", from_name);
} else {
sprintf(_origin, "(%d) %s", (uint32_t) path_len, from_name);
}
StrHelper::strncpy(_msg, text, sizeof(_msg));
if (_display != NULL) {
if (!_display->isOn() && !hasConnection()) {
_display->turnOn();
}
if (_display->isOn()) {
_auto_off = millis() + AUTO_OFF_MILLIS; // extend the auto-off timer
_need_refresh = true;
}
}
}
void UITask::renderBatteryIndicator(uint16_t batteryMilliVolts) {
// Convert millivolts to percentage
#ifndef BATT_MIN_MILLIVOLTS
#define BATT_MIN_MILLIVOLTS 3000
#endif
#ifndef BATT_MAX_MILLIVOLTS
#define BATT_MAX_MILLIVOLTS 4200
#endif
const int minMilliVolts = BATT_MIN_MILLIVOLTS;
const int maxMilliVolts = BATT_MAX_MILLIVOLTS;
int batteryPercentage = ((batteryMilliVolts - minMilliVolts) * 100) / (maxMilliVolts - minMilliVolts);
if (batteryPercentage < 0) batteryPercentage = 0; // Clamp to 0%
if (batteryPercentage > 100) batteryPercentage = 100; // Clamp to 100%
// battery icon
int iconWidth = 24;
int iconHeight = 12;
int iconX = _display->width() - iconWidth - 5; // Position the icon near the top-right corner
int iconY = 0;
_display->setColor(DisplayDriver::GREEN);
// battery outline
_display->drawRect(iconX, iconY, iconWidth, iconHeight);
// battery "cap"
_display->fillRect(iconX + iconWidth, iconY + (iconHeight / 4), 3, iconHeight / 2);
// fill the battery based on the percentage
int fillWidth = (batteryPercentage * (iconWidth - 4)) / 100;
_display->fillRect(iconX + 2, iconY + 2, fillWidth, iconHeight - 4);
}
void UITask::renderCurrScreen() {
if (_display == NULL) return; // assert() ??
char tmp[80];
if (_alert[0]) {
_display->setTextSize(1.4);
uint16_t textWidth = _display->getTextWidth(_alert);
_display->setCursor((_display->width() - textWidth) / 2, 22);
_display->setColor(DisplayDriver::GREEN);
_display->print(_alert);
_alert[0] = 0;
_need_refresh = true;
return;
} else if (_origin[0] && _msg[0]) { // message preview
// render message preview
_display->setCursor(0, 0);
_display->setTextSize(1);
_display->setColor(DisplayDriver::GREEN);
_display->print(_node_prefs->node_name);
_display->setCursor(0, 12);
_display->setColor(DisplayDriver::YELLOW);
_display->print(_origin);
_display->setCursor(0, 24);
_display->setColor(DisplayDriver::LIGHT);
_display->print(_msg);
_display->setCursor(_display->width() - 28, 9);
_display->setTextSize(2);
_display->setColor(DisplayDriver::ORANGE);
sprintf(tmp, "%d", _msgcount);
_display->print(tmp);
_display->setColor(DisplayDriver::YELLOW); // last color will be kept on T114
} else if ((millis() - ui_started_at) < BOOT_SCREEN_MILLIS) { // boot screen
// meshcore logo
_display->setColor(DisplayDriver::BLUE);
int logoWidth = 128;
_display->drawXbm((_display->width() - logoWidth) / 2, 3, meshcore_logo, logoWidth, 13);
// version info
_display->setColor(DisplayDriver::LIGHT);
_display->setTextSize(1);
uint16_t textWidth = _display->getTextWidth(_version_info);
_display->setCursor((_display->width() - textWidth) / 2, 22);
_display->print(_version_info);
} else { // home screen
// node name
_display->setCursor(0, 0);
_display->setTextSize(1);
_display->setColor(DisplayDriver::GREEN);
_display->print(_node_prefs->node_name);
// battery voltage
renderBatteryIndicator(_board->getBattMilliVolts());
// freq / sf
_display->setCursor(0, 20);
_display->setColor(DisplayDriver::YELLOW);
sprintf(tmp, "FREQ: %06.3f SF%d", _node_prefs->freq, _node_prefs->sf);
_display->print(tmp);
// bw / cr
_display->setCursor(0, 30);
sprintf(tmp, "BW: %03.2f CR: %d", _node_prefs->bw, _node_prefs->cr);
_display->print(tmp);
// BT pin
if (!_connected && the_mesh.getBLEPin() != 0) {
_display->setColor(DisplayDriver::RED);
_display->setTextSize(2);
_display->setCursor(0, 43);
sprintf(tmp, "Pin:%d", the_mesh.getBLEPin());
_display->print(tmp);
_display->setColor(DisplayDriver::GREEN);
} else {
_display->setColor(DisplayDriver::LIGHT);
}
}
_need_refresh = false;
}
void UITask::userLedHandler() {
#ifdef PIN_STATUS_LED
static int state = 0;
static int next_change = 0;
static int last_increment = 0;
int cur_time = millis();
if (cur_time > next_change) {
if (state == 0) {
state = 1;
if (_msgcount > 0) {
last_increment = LED_ON_MSG_MILLIS;
} else {
last_increment = LED_ON_MILLIS;
}
next_change = cur_time + last_increment;
} else {
state = 0;
next_change = cur_time + LED_CYCLE_MILLIS - last_increment;
}
digitalWrite(PIN_STATUS_LED, state == LED_STATE_ON);
}
#endif
}
/*
hardware-agnostic pre-shutdown activity should be done here
*/
void UITask::shutdown(bool restart){
#ifdef PIN_BUZZER
/* note: we have a choice here -
we can do a blocking buzzer.loop() with non-deterministic consequences
or we can set a flag and delay the shutdown for a couple of seconds
while a non-blocking buzzer.loop() plays out in UITask::loop()
*/
buzzer.shutdown();
uint32_t buzzer_timer = millis(); // fail-safe shutdown
while (buzzer.isPlaying() && (millis() - 2500) < buzzer_timer)
buzzer.loop();
#endif // PIN_BUZZER
if (restart) {
_board->reboot();
} else {
radio_driver.powerOff();
_board->powerOff();
}
}
void UITask::loop() {
#ifdef PIN_USER_BTN
if (_userButton) {
_userButton->update();
}
#endif
#ifdef PIN_USER_BTN_ANA
if (_userButtonAnalog) {
_userButtonAnalog->update();
}
#endif
userLedHandler();
#ifdef PIN_BUZZER
if (buzzer.isPlaying()) buzzer.loop();
#endif
if (_display != NULL && _display->isOn()) {
static bool _firstBoot = true;
if(_firstBoot && (millis() - ui_started_at) >= BOOT_SCREEN_MILLIS) {
_need_refresh = true;
_firstBoot = false;
}
if (millis() >= _next_refresh && _need_refresh) {
_display->startFrame();
renderCurrScreen();
_display->endFrame();
_next_refresh = millis() + 1000; // refresh every second
}
if (millis() > _auto_off) {
_display->turnOff();
}
}
}
void UITask::handleButtonAnyPress() {
MESH_DEBUG_PRINTLN("UITask: any press triggered");
// called on any button press before other events, to wake up the display quickly
// do not refresh the display here, as it may block the button handler
if (_display != NULL) {
_displayWasOn = _display->isOn(); // Track display state before any action
if (!_displayWasOn) {
_display->turnOn();
}
_auto_off = millis() + AUTO_OFF_MILLIS; // extend auto-off timer
}
}
void UITask::handleButtonShortPress() {
MESH_DEBUG_PRINTLN("UITask: short press triggered");
if (_display != NULL) {
// Only clear message preview if display was already on before button press
if (_displayWasOn) {
// If display was on and showing message preview, clear it
if (_origin[0] && _msg[0]) {
clearMsgPreview();
} else {
// Otherwise, refresh the display
_need_refresh = true;
}
} else {
_need_refresh = true; // display just turned on, so we need to refresh
}
// Note: Display turn-on and auto-off timer extension are handled by handleButtonAnyPress
}
}
void UITask::handleButtonDoublePress() {
MESH_DEBUG_PRINTLN("UITask: double press triggered, sending advert");
// ADVERT
#ifdef PIN_BUZZER
notify(UIEventType::ack);
#endif
if (the_mesh.advert()) {
MESH_DEBUG_PRINTLN("Advert sent!");
sprintf(_alert, "Advert sent!");
} else {
MESH_DEBUG_PRINTLN("Advert failed!");
sprintf(_alert, "Advert failed..");
}
_need_refresh = true;
}
void UITask::handleButtonTriplePress() {
MESH_DEBUG_PRINTLN("UITask: triple press triggered");
// Toggle buzzer quiet mode
#ifdef PIN_BUZZER
if (buzzer.isQuiet()) {
buzzer.quiet(false);
notify(UIEventType::ack);
sprintf(_alert, "Buzzer: ON");
} else {
buzzer.quiet(true);
sprintf(_alert, "Buzzer: OFF");
}
_node_prefs->buzzer_quiet = buzzer.isQuiet();
the_mesh.savePrefs();
_need_refresh = true;
#endif
}
void UITask::handleButtonQuadruplePress() {
MESH_DEBUG_PRINTLN("UITask: quad press triggered");
if (_sensors != NULL) {
// toggle GPS onn/off
int num = _sensors->getNumSettings();
for (int i = 0; i < num; i++) {
if (strcmp(_sensors->getSettingName(i), "gps") == 0) {
if (strcmp(_sensors->getSettingValue(i), "1") == 0) {
_sensors->setSettingValue("gps", "0");
notify(UIEventType::ack);
sprintf(_alert, "GPS: Disabled");
} else {
_sensors->setSettingValue("gps", "1");
notify(UIEventType::ack);
sprintf(_alert, "GPS: Enabled");
}
break;
}
}
}
_need_refresh = true;
}
void UITask::handleButtonLongPress() {
MESH_DEBUG_PRINTLN("UITask: long press triggered");
if (millis() - ui_started_at < 8000) { // long press in first 8 seconds since startup -> CLI/rescue
the_mesh.enterCLIRescue();
} else {
shutdown();
}
}

View File

@@ -0,0 +1,73 @@
#pragma once
#include <MeshCore.h>
#include <helpers/ui/DisplayDriver.h>
#include <helpers/SensorManager.h>
#include <stddef.h>
#ifdef PIN_BUZZER
#include <helpers/ui/buzzer.h>
#endif
#include "../AbstractUITask.h"
#include "../NodePrefs.h"
#include "Button.h"
class UITask : public AbstractUITask {
DisplayDriver* _display;
SensorManager* _sensors;
#ifdef PIN_BUZZER
genericBuzzer buzzer;
#endif
unsigned long _next_refresh, _auto_off;
NodePrefs* _node_prefs;
char _version_info[32];
char _origin[62];
char _msg[80];
char _alert[80];
int _msgcount;
bool _need_refresh = true;
bool _displayWasOn = false; // Track display state before button press
unsigned long ui_started_at;
// Button handlers
#ifdef PIN_USER_BTN
Button* _userButton = nullptr;
#endif
#ifdef PIN_USER_BTN_ANA
Button* _userButtonAnalog = nullptr;
#endif
void renderCurrScreen();
void userLedHandler();
void renderBatteryIndicator(uint16_t batteryMilliVolts);
// Button action handlers
void handleButtonAnyPress();
void handleButtonShortPress();
void handleButtonDoublePress();
void handleButtonTriplePress();
void handleButtonQuadruplePress();
void handleButtonLongPress();
public:
UITask(mesh::MainBoard* board, BaseSerialInterface* serial) : AbstractUITask(board, serial), _display(NULL), _sensors(NULL) {
_next_refresh = 0;
ui_started_at = 0;
}
void begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs);
bool hasDisplay() const { return _display != NULL; }
void clearMsgPreview();
// from AbstractUITask
void msgRead(int msgcount) override;
void newMsg(uint8_t path_len, const char* from_name, const char* text, int msgcount) override;
void notify(UIEventType t = UIEventType::none) override;
void loop() override;
void shutdown(bool restart = false);
};

View File

@@ -0,0 +1,581 @@
#include "KissModem.h"
#include <CayenneLPP.h>
KissModem::KissModem(Stream& serial, mesh::LocalIdentity& identity, mesh::RNG& rng,
mesh::Radio& radio, mesh::MainBoard& board, SensorManager& sensors)
: _serial(serial), _identity(identity), _rng(rng), _radio(radio), _board(board), _sensors(sensors) {
_rx_len = 0;
_rx_escaped = false;
_rx_active = false;
_has_pending_tx = false;
_pending_tx_len = 0;
_txdelay = KISS_DEFAULT_TXDELAY;
_persistence = KISS_DEFAULT_PERSISTENCE;
_slottime = KISS_DEFAULT_SLOTTIME;
_txtail = 0;
_fullduplex = 0;
_tx_state = TX_IDLE;
_tx_timer = 0;
_setRadioCallback = nullptr;
_setTxPowerCallback = nullptr;
_getCurrentRssiCallback = nullptr;
_getStatsCallback = nullptr;
_config = {0, 0, 0, 0, 0};
_signal_report_enabled = true;
}
void KissModem::begin() {
_rx_len = 0;
_rx_escaped = false;
_rx_active = false;
_has_pending_tx = false;
_tx_state = TX_IDLE;
}
void KissModem::writeByte(uint8_t b) {
if (b == KISS_FEND) {
_serial.write(KISS_FESC);
_serial.write(KISS_TFEND);
} else if (b == KISS_FESC) {
_serial.write(KISS_FESC);
_serial.write(KISS_TFESC);
} else {
_serial.write(b);
}
}
void KissModem::writeFrame(uint8_t type, const uint8_t* data, uint16_t len) {
_serial.write(KISS_FEND);
writeByte(type);
for (uint16_t i = 0; i < len; i++) {
writeByte(data[i]);
}
_serial.write(KISS_FEND);
}
void KissModem::writeHardwareFrame(uint8_t sub_cmd, const uint8_t* data, uint16_t len) {
_serial.write(KISS_FEND);
writeByte(KISS_CMD_SETHARDWARE);
writeByte(sub_cmd);
for (uint16_t i = 0; i < len; i++) {
writeByte(data[i]);
}
_serial.write(KISS_FEND);
}
void KissModem::writeHardwareError(uint8_t error_code) {
writeHardwareFrame(HW_RESP_ERROR, &error_code, 1);
}
void KissModem::loop() {
while (_serial.available()) {
uint8_t b = _serial.read();
if (b == KISS_FEND) {
if (_rx_active && _rx_len > 0) {
processFrame();
}
_rx_len = 0;
_rx_escaped = false;
_rx_active = true;
continue;
}
if (!_rx_active) continue;
if (b == KISS_FESC) {
_rx_escaped = true;
continue;
}
if (_rx_escaped) {
_rx_escaped = false;
if (b == KISS_TFEND) b = KISS_FEND;
else if (b == KISS_TFESC) b = KISS_FESC;
else continue;
}
if (_rx_len < KISS_MAX_FRAME_SIZE) {
_rx_buf[_rx_len++] = b;
} else {
/* Buffer full with no FEND; reset so we don't stay stuck ignoring input. */
_rx_len = 0;
_rx_escaped = false;
_rx_active = false;
}
}
processTx();
}
void KissModem::processFrame() {
if (_rx_len < 1) return;
uint8_t type_byte = _rx_buf[0];
if (type_byte == KISS_CMD_RETURN) return;
uint8_t port = (type_byte >> 4) & 0x0F;
uint8_t cmd = type_byte & 0x0F;
if (port != 0) return;
const uint8_t* data = &_rx_buf[1];
uint16_t data_len = _rx_len - 1;
switch (cmd) {
case KISS_CMD_DATA:
if (data_len > 0 && data_len <= KISS_MAX_PACKET_SIZE && !_has_pending_tx) {
memcpy(_pending_tx, data, data_len);
_pending_tx_len = data_len;
_has_pending_tx = true;
}
break;
case KISS_CMD_TXDELAY:
if (data_len >= 1) _txdelay = data[0];
break;
case KISS_CMD_PERSISTENCE:
if (data_len >= 1) _persistence = data[0];
break;
case KISS_CMD_SLOTTIME:
if (data_len >= 1) _slottime = data[0];
break;
case KISS_CMD_TXTAIL:
if (data_len >= 1) _txtail = data[0];
break;
case KISS_CMD_FULLDUPLEX:
if (data_len >= 1) _fullduplex = data[0];
break;
case KISS_CMD_SETHARDWARE:
if (data_len >= 1) {
handleHardwareCommand(data[0], data + 1, data_len - 1);
}
break;
default:
break;
}
}
void KissModem::handleHardwareCommand(uint8_t sub_cmd, const uint8_t* data, uint16_t len) {
switch (sub_cmd) {
case HW_CMD_GET_IDENTITY:
handleGetIdentity();
break;
case HW_CMD_GET_RANDOM:
handleGetRandom(data, len);
break;
case HW_CMD_VERIFY_SIGNATURE:
handleVerifySignature(data, len);
break;
case HW_CMD_SIGN_DATA:
handleSignData(data, len);
break;
case HW_CMD_ENCRYPT_DATA:
handleEncryptData(data, len);
break;
case HW_CMD_DECRYPT_DATA:
handleDecryptData(data, len);
break;
case HW_CMD_KEY_EXCHANGE:
handleKeyExchange(data, len);
break;
case HW_CMD_HASH:
handleHash(data, len);
break;
case HW_CMD_SET_RADIO:
handleSetRadio(data, len);
break;
case HW_CMD_SET_TX_POWER:
handleSetTxPower(data, len);
break;
case HW_CMD_GET_RADIO:
handleGetRadio();
break;
case HW_CMD_GET_TX_POWER:
handleGetTxPower();
break;
case HW_CMD_GET_VERSION:
handleGetVersion();
break;
case HW_CMD_GET_CURRENT_RSSI:
handleGetCurrentRssi();
break;
case HW_CMD_IS_CHANNEL_BUSY:
handleIsChannelBusy();
break;
case HW_CMD_GET_AIRTIME:
handleGetAirtime(data, len);
break;
case HW_CMD_GET_NOISE_FLOOR:
handleGetNoiseFloor();
break;
case HW_CMD_GET_STATS:
handleGetStats();
break;
case HW_CMD_GET_BATTERY:
handleGetBattery();
break;
case HW_CMD_PING:
handlePing();
break;
case HW_CMD_GET_SENSORS:
handleGetSensors(data, len);
break;
case HW_CMD_GET_MCU_TEMP:
handleGetMCUTemp();
break;
case HW_CMD_REBOOT:
handleReboot();
break;
case HW_CMD_GET_DEVICE_NAME:
handleGetDeviceName();
break;
case HW_CMD_SET_SIGNAL_REPORT:
handleSetSignalReport(data, len);
break;
case HW_CMD_GET_SIGNAL_REPORT:
handleGetSignalReport();
break;
default:
writeHardwareError(HW_ERR_UNKNOWN_CMD);
break;
}
}
void KissModem::processTx() {
switch (_tx_state) {
case TX_IDLE:
if (_has_pending_tx) {
if (_fullduplex) {
_tx_timer = millis();
_tx_state = TX_DELAY;
} else {
_tx_state = TX_WAIT_CLEAR;
}
}
break;
case TX_WAIT_CLEAR:
if (!_radio.isReceiving()) {
uint8_t rand_val;
_rng.random(&rand_val, 1);
if (rand_val <= _persistence) {
_tx_timer = millis();
_tx_state = TX_DELAY;
} else {
_tx_timer = millis();
_tx_state = TX_SLOT_WAIT;
}
}
break;
case TX_SLOT_WAIT:
if (millis() - _tx_timer >= (uint32_t)_slottime * 10) {
_tx_state = TX_WAIT_CLEAR;
}
break;
case TX_DELAY:
if (millis() - _tx_timer >= (uint32_t)_txdelay * 10) {
_radio.startSendRaw(_pending_tx, _pending_tx_len);
_tx_state = TX_SENDING;
}
break;
case TX_SENDING:
if (_radio.isSendComplete()) {
_radio.onSendFinished();
uint8_t result = 0x01;
writeHardwareFrame(HW_RESP_TX_DONE, &result, 1);
_has_pending_tx = false;
_tx_state = TX_IDLE;
}
break;
}
}
void KissModem::onPacketReceived(int8_t snr, int8_t rssi, const uint8_t* packet, uint16_t len) {
writeFrame(KISS_CMD_DATA, packet, len);
if (_signal_report_enabled) {
uint8_t meta[2] = { (uint8_t)snr, (uint8_t)rssi };
writeHardwareFrame(HW_RESP_RX_META, meta, 2);
}
}
void KissModem::handleGetIdentity() {
writeHardwareFrame(HW_RESP(HW_CMD_GET_IDENTITY), _identity.pub_key, PUB_KEY_SIZE);
}
void KissModem::handleGetRandom(const uint8_t* data, uint16_t len) {
if (len < 1) {
writeHardwareError(HW_ERR_INVALID_LENGTH);
return;
}
uint8_t requested = data[0];
if (requested < 1 || requested > 64) {
writeHardwareError(HW_ERR_INVALID_PARAM);
return;
}
uint8_t buf[64];
_rng.random(buf, requested);
writeHardwareFrame(HW_RESP(HW_CMD_GET_RANDOM), buf, requested);
}
void KissModem::handleVerifySignature(const uint8_t* data, uint16_t len) {
if (len < PUB_KEY_SIZE + SIGNATURE_SIZE + 1) {
writeHardwareError(HW_ERR_INVALID_LENGTH);
return;
}
mesh::Identity signer(data);
const uint8_t* signature = data + PUB_KEY_SIZE;
const uint8_t* msg = data + PUB_KEY_SIZE + SIGNATURE_SIZE;
uint16_t msg_len = len - PUB_KEY_SIZE - SIGNATURE_SIZE;
uint8_t result = signer.verify(signature, msg, msg_len) ? 0x01 : 0x00;
writeHardwareFrame(HW_RESP(HW_CMD_VERIFY_SIGNATURE), &result, 1);
}
void KissModem::handleSignData(const uint8_t* data, uint16_t len) {
if (len < 1) {
writeHardwareError(HW_ERR_INVALID_LENGTH);
return;
}
uint8_t signature[SIGNATURE_SIZE];
_identity.sign(signature, data, len);
writeHardwareFrame(HW_RESP(HW_CMD_SIGN_DATA), signature, SIGNATURE_SIZE);
}
void KissModem::handleEncryptData(const uint8_t* data, uint16_t len) {
if (len < PUB_KEY_SIZE + 1) {
writeHardwareError(HW_ERR_INVALID_LENGTH);
return;
}
const uint8_t* key = data;
const uint8_t* plaintext = data + PUB_KEY_SIZE;
uint16_t plaintext_len = len - PUB_KEY_SIZE;
uint8_t buf[KISS_MAX_FRAME_SIZE];
int encrypted_len = mesh::Utils::encryptThenMAC(key, buf, plaintext, plaintext_len);
if (encrypted_len > 0) {
writeHardwareFrame(HW_RESP(HW_CMD_ENCRYPT_DATA), buf, encrypted_len);
} else {
writeHardwareError(HW_ERR_ENCRYPT_FAILED);
}
}
void KissModem::handleDecryptData(const uint8_t* data, uint16_t len) {
if (len < PUB_KEY_SIZE + CIPHER_MAC_SIZE + 1) {
writeHardwareError(HW_ERR_INVALID_LENGTH);
return;
}
const uint8_t* key = data;
const uint8_t* ciphertext = data + PUB_KEY_SIZE;
uint16_t ciphertext_len = len - PUB_KEY_SIZE;
uint8_t buf[KISS_MAX_FRAME_SIZE];
int decrypted_len = mesh::Utils::MACThenDecrypt(key, buf, ciphertext, ciphertext_len);
if (decrypted_len > 0) {
writeHardwareFrame(HW_RESP(HW_CMD_DECRYPT_DATA), buf, decrypted_len);
} else {
writeHardwareError(HW_ERR_MAC_FAILED);
}
}
void KissModem::handleKeyExchange(const uint8_t* data, uint16_t len) {
if (len < PUB_KEY_SIZE) {
writeHardwareError(HW_ERR_INVALID_LENGTH);
return;
}
uint8_t shared_secret[PUB_KEY_SIZE];
_identity.calcSharedSecret(shared_secret, data);
writeHardwareFrame(HW_RESP(HW_CMD_KEY_EXCHANGE), shared_secret, PUB_KEY_SIZE);
}
void KissModem::handleHash(const uint8_t* data, uint16_t len) {
if (len < 1) {
writeHardwareError(HW_ERR_INVALID_LENGTH);
return;
}
uint8_t hash[32];
mesh::Utils::sha256(hash, 32, data, len);
writeHardwareFrame(HW_RESP(HW_CMD_HASH), hash, 32);
}
void KissModem::handleSetRadio(const uint8_t* data, uint16_t len) {
if (len < 10) {
writeHardwareError(HW_ERR_INVALID_LENGTH);
return;
}
if (!_setRadioCallback) {
writeHardwareError(HW_ERR_NO_CALLBACK);
return;
}
memcpy(&_config.freq_hz, data, 4);
memcpy(&_config.bw_hz, data + 4, 4);
_config.sf = data[8];
_config.cr = data[9];
_setRadioCallback(_config.freq_hz / 1000000.0f, _config.bw_hz / 1000.0f, _config.sf, _config.cr);
writeHardwareFrame(HW_RESP_OK, nullptr, 0);
}
void KissModem::handleSetTxPower(const uint8_t* data, uint16_t len) {
if (len < 1) {
writeHardwareError(HW_ERR_INVALID_LENGTH);
return;
}
if (!_setTxPowerCallback) {
writeHardwareError(HW_ERR_NO_CALLBACK);
return;
}
_config.tx_power = data[0];
_setTxPowerCallback(data[0]);
writeHardwareFrame(HW_RESP_OK, nullptr, 0);
}
void KissModem::handleGetRadio() {
uint8_t buf[10];
memcpy(buf, &_config.freq_hz, 4);
memcpy(buf + 4, &_config.bw_hz, 4);
buf[8] = _config.sf;
buf[9] = _config.cr;
writeHardwareFrame(HW_RESP(HW_CMD_GET_RADIO), buf, 10);
}
void KissModem::handleGetTxPower() {
writeHardwareFrame(HW_RESP(HW_CMD_GET_TX_POWER), &_config.tx_power, 1);
}
void KissModem::handleGetVersion() {
uint8_t buf[2];
buf[0] = KISS_FIRMWARE_VERSION;
buf[1] = 0;
writeHardwareFrame(HW_RESP(HW_CMD_GET_VERSION), buf, 2);
}
void KissModem::handleGetCurrentRssi() {
if (!_getCurrentRssiCallback) {
writeHardwareError(HW_ERR_NO_CALLBACK);
return;
}
float rssi = _getCurrentRssiCallback();
int8_t rssi_byte = (int8_t)rssi;
writeHardwareFrame(HW_RESP(HW_CMD_GET_CURRENT_RSSI), (uint8_t*)&rssi_byte, 1);
}
void KissModem::handleIsChannelBusy() {
uint8_t busy = _radio.isReceiving() ? 0x01 : 0x00;
writeHardwareFrame(HW_RESP(HW_CMD_IS_CHANNEL_BUSY), &busy, 1);
}
void KissModem::handleGetAirtime(const uint8_t* data, uint16_t len) {
if (len < 1) {
writeHardwareError(HW_ERR_INVALID_LENGTH);
return;
}
uint8_t packet_len = data[0];
uint32_t airtime = _radio.getEstAirtimeFor(packet_len);
writeHardwareFrame(HW_RESP(HW_CMD_GET_AIRTIME), (uint8_t*)&airtime, 4);
}
void KissModem::handleGetNoiseFloor() {
int16_t noise_floor = _radio.getNoiseFloor();
writeHardwareFrame(HW_RESP(HW_CMD_GET_NOISE_FLOOR), (uint8_t*)&noise_floor, 2);
}
void KissModem::handleGetStats() {
if (!_getStatsCallback) {
writeHardwareError(HW_ERR_NO_CALLBACK);
return;
}
uint32_t rx, tx, errors;
_getStatsCallback(&rx, &tx, &errors);
uint8_t buf[12];
memcpy(buf, &rx, 4);
memcpy(buf + 4, &tx, 4);
memcpy(buf + 8, &errors, 4);
writeHardwareFrame(HW_RESP(HW_CMD_GET_STATS), buf, 12);
}
void KissModem::handleGetBattery() {
uint16_t mv = _board.getBattMilliVolts();
writeHardwareFrame(HW_RESP(HW_CMD_GET_BATTERY), (uint8_t*)&mv, 2);
}
void KissModem::handlePing() {
writeHardwareFrame(HW_RESP(HW_CMD_PING), nullptr, 0);
}
void KissModem::handleGetSensors(const uint8_t* data, uint16_t len) {
if (len < 1) {
writeHardwareError(HW_ERR_INVALID_LENGTH);
return;
}
uint8_t permissions = data[0];
CayenneLPP telemetry(255);
if (_sensors.querySensors(permissions, telemetry)) {
writeHardwareFrame(HW_RESP(HW_CMD_GET_SENSORS), telemetry.getBuffer(), telemetry.getSize());
} else {
writeHardwareFrame(HW_RESP(HW_CMD_GET_SENSORS), nullptr, 0);
}
}
void KissModem::handleGetMCUTemp() {
float temp = _board.getMCUTemperature();
if (isnan(temp)) {
writeHardwareError(HW_ERR_NO_CALLBACK);
return;
}
int16_t temp_tenths = (int16_t)(temp * 10.0f);
writeHardwareFrame(HW_RESP(HW_CMD_GET_MCU_TEMP), (uint8_t*)&temp_tenths, 2);
}
void KissModem::handleReboot() {
writeHardwareFrame(HW_RESP_OK, nullptr, 0);
_serial.flush();
delay(50);
_board.reboot();
}
void KissModem::handleGetDeviceName() {
const char* name = _board.getManufacturerName();
writeHardwareFrame(HW_RESP(HW_CMD_GET_DEVICE_NAME), (const uint8_t*)name, strlen(name));
}
void KissModem::handleSetSignalReport(const uint8_t* data, uint16_t len) {
if (len < 1) {
writeHardwareError(HW_ERR_INVALID_LENGTH);
return;
}
_signal_report_enabled = (data[0] != 0x00);
uint8_t val = _signal_report_enabled ? 0x01 : 0x00;
writeHardwareFrame(HW_RESP(HW_CMD_GET_SIGNAL_REPORT), &val, 1);
}
void KissModem::handleGetSignalReport() {
uint8_t val = _signal_report_enabled ? 0x01 : 0x00;
writeHardwareFrame(HW_RESP(HW_CMD_GET_SIGNAL_REPORT), &val, 1);
}

View File

@@ -0,0 +1,183 @@
#pragma once
#include <Arduino.h>
#include <Identity.h>
#include <Utils.h>
#include <Mesh.h>
#include <helpers/SensorManager.h>
#define KISS_FEND 0xC0
#define KISS_FESC 0xDB
#define KISS_TFEND 0xDC
#define KISS_TFESC 0xDD
#define KISS_MAX_FRAME_SIZE 512
#define KISS_MAX_PACKET_SIZE 255
#define KISS_CMD_DATA 0x00
#define KISS_CMD_TXDELAY 0x01
#define KISS_CMD_PERSISTENCE 0x02
#define KISS_CMD_SLOTTIME 0x03
#define KISS_CMD_TXTAIL 0x04
#define KISS_CMD_FULLDUPLEX 0x05
#define KISS_CMD_SETHARDWARE 0x06
#define KISS_CMD_RETURN 0xFF
#define KISS_DEFAULT_TXDELAY 50
#define KISS_DEFAULT_PERSISTENCE 63
#define KISS_DEFAULT_SLOTTIME 10
#define HW_CMD_GET_IDENTITY 0x01
#define HW_CMD_GET_RANDOM 0x02
#define HW_CMD_VERIFY_SIGNATURE 0x03
#define HW_CMD_SIGN_DATA 0x04
#define HW_CMD_ENCRYPT_DATA 0x05
#define HW_CMD_DECRYPT_DATA 0x06
#define HW_CMD_KEY_EXCHANGE 0x07
#define HW_CMD_HASH 0x08
#define HW_CMD_SET_RADIO 0x09
#define HW_CMD_SET_TX_POWER 0x0A
#define HW_CMD_GET_RADIO 0x0B
#define HW_CMD_GET_TX_POWER 0x0C
#define HW_CMD_GET_CURRENT_RSSI 0x0D
#define HW_CMD_IS_CHANNEL_BUSY 0x0E
#define HW_CMD_GET_AIRTIME 0x0F
#define HW_CMD_GET_NOISE_FLOOR 0x10
#define HW_CMD_GET_VERSION 0x11
#define HW_CMD_GET_STATS 0x12
#define HW_CMD_GET_BATTERY 0x13
#define HW_CMD_GET_MCU_TEMP 0x14
#define HW_CMD_GET_SENSORS 0x15
#define HW_CMD_GET_DEVICE_NAME 0x16
#define HW_CMD_PING 0x17
#define HW_CMD_REBOOT 0x18
#define HW_CMD_SET_SIGNAL_REPORT 0x19
#define HW_CMD_GET_SIGNAL_REPORT 0x1A
/* Response code = command code | 0x80. Generic / unsolicited use 0xF0+. */
#define HW_RESP(cmd) ((cmd) | 0x80)
/* Generic responses (shared by multiple commands) */
#define HW_RESP_OK 0xF0
#define HW_RESP_ERROR 0xF1
/* Unsolicited notifications (no corresponding request) */
#define HW_RESP_TX_DONE 0xF8
#define HW_RESP_RX_META 0xF9
#define HW_ERR_INVALID_LENGTH 0x01
#define HW_ERR_INVALID_PARAM 0x02
#define HW_ERR_NO_CALLBACK 0x03
#define HW_ERR_MAC_FAILED 0x04
#define HW_ERR_UNKNOWN_CMD 0x05
#define HW_ERR_ENCRYPT_FAILED 0x06
#define KISS_FIRMWARE_VERSION 1
typedef void (*SetRadioCallback)(float freq, float bw, uint8_t sf, uint8_t cr);
typedef void (*SetTxPowerCallback)(uint8_t power);
typedef float (*GetCurrentRssiCallback)();
typedef void (*GetStatsCallback)(uint32_t* rx, uint32_t* tx, uint32_t* errors);
struct RadioConfig {
uint32_t freq_hz;
uint32_t bw_hz;
uint8_t sf;
uint8_t cr;
uint8_t tx_power;
};
enum TxState {
TX_IDLE,
TX_WAIT_CLEAR,
TX_SLOT_WAIT,
TX_DELAY,
TX_SENDING
};
class KissModem {
Stream& _serial;
mesh::LocalIdentity& _identity;
mesh::RNG& _rng;
mesh::Radio& _radio;
mesh::MainBoard& _board;
SensorManager& _sensors;
uint8_t _rx_buf[KISS_MAX_FRAME_SIZE];
uint16_t _rx_len;
bool _rx_escaped;
bool _rx_active;
uint8_t _pending_tx[KISS_MAX_PACKET_SIZE];
uint16_t _pending_tx_len;
bool _has_pending_tx;
uint8_t _txdelay;
uint8_t _persistence;
uint8_t _slottime;
uint8_t _txtail;
uint8_t _fullduplex;
TxState _tx_state;
uint32_t _tx_timer;
SetRadioCallback _setRadioCallback;
SetTxPowerCallback _setTxPowerCallback;
GetCurrentRssiCallback _getCurrentRssiCallback;
GetStatsCallback _getStatsCallback;
RadioConfig _config;
bool _signal_report_enabled;
void writeByte(uint8_t b);
void writeFrame(uint8_t type, const uint8_t* data, uint16_t len);
void writeHardwareFrame(uint8_t sub_cmd, const uint8_t* data, uint16_t len);
void writeHardwareError(uint8_t error_code);
void processFrame();
void handleHardwareCommand(uint8_t sub_cmd, const uint8_t* data, uint16_t len);
void processTx();
void handleGetIdentity();
void handleGetRandom(const uint8_t* data, uint16_t len);
void handleVerifySignature(const uint8_t* data, uint16_t len);
void handleSignData(const uint8_t* data, uint16_t len);
void handleEncryptData(const uint8_t* data, uint16_t len);
void handleDecryptData(const uint8_t* data, uint16_t len);
void handleKeyExchange(const uint8_t* data, uint16_t len);
void handleHash(const uint8_t* data, uint16_t len);
void handleSetRadio(const uint8_t* data, uint16_t len);
void handleSetTxPower(const uint8_t* data, uint16_t len);
void handleGetRadio();
void handleGetTxPower();
void handleGetVersion();
void handleGetCurrentRssi();
void handleIsChannelBusy();
void handleGetAirtime(const uint8_t* data, uint16_t len);
void handleGetNoiseFloor();
void handleGetStats();
void handleGetBattery();
void handlePing();
void handleGetSensors(const uint8_t* data, uint16_t len);
void handleGetMCUTemp();
void handleReboot();
void handleGetDeviceName();
void handleSetSignalReport(const uint8_t* data, uint16_t len);
void handleGetSignalReport();
public:
KissModem(Stream& serial, mesh::LocalIdentity& identity, mesh::RNG& rng,
mesh::Radio& radio, mesh::MainBoard& board, SensorManager& sensors);
void begin();
void loop();
void setRadioCallback(SetRadioCallback cb) { _setRadioCallback = cb; }
void setTxPowerCallback(SetTxPowerCallback cb) { _setTxPowerCallback = cb; }
void setGetCurrentRssiCallback(GetCurrentRssiCallback cb) { _getCurrentRssiCallback = cb; }
void setGetStatsCallback(GetStatsCallback cb) { _getStatsCallback = cb; }
void onPacketReceived(int8_t snr, int8_t rssi, const uint8_t* packet, uint16_t len);
bool isTxBusy() const { return _tx_state != TX_IDLE; }
/** True only when radio is actually transmitting; use to skip recvRaw in main loop. */
bool isActuallyTransmitting() const { return _tx_state == TX_SENDING; }
};

Some files were not shown because too many files have changed in this diff Show More