diff --git a/.github/workflows/pr-build-check.yml b/.github/workflows/pr-build-check.yml index cebf0cfe5..fd0311665 100644 --- a/.github/workflows/pr-build-check.yml +++ b/.github/workflows/pr-build-check.yml @@ -40,6 +40,11 @@ jobs: - PicoW_repeater # STM32 - wio-e5-mini_repeater + - LilyGo_T3_STM32_repeater + - LilyGo_T3_STM32_companion_radio_usb + - LilyGo_T3_STM32_repeater_ina219 + - LilyGo_T3_STM32_companion_radio_usb_ina219 + - nucleo_wl55jc_repeater # ESP32-C6 - LilyGo_Tlora_C6_repeater_ # LR1110 (nRF52) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b998610ec..da30c3ae3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,6 +18,15 @@ Thanks for considering contributing to this project! ### 3. Submitting Code Changes (Pull Requests) +The project receives far more code than it is able to process. +To increase the likelihood of your PR being accepted, please consider +the following: + +- **Keep it small.** Changes of about 10 lines or fewer were merged 64% of the time; changes over 1000 lines, 10%. +- **Keep the description short.** A few sentences on what changed and why is enough. Longer descriptions were merged less often. +- **Build a track record with small fixes first.** First-time contributors were merged 31% of the time, rising to 74% after 10 merged PRs. +- **Open the PR when it is ready for review, not as a draft.** + #### Small fixes (typos, comments, examples, small bug fixes) → Just open a pull request — no prior issue needed @@ -52,6 +61,15 @@ Please follow the existing C++ style (per the .clang-format) (But consistency with existing code is more important than strict rules) +## LLM Agent Specific Advice + +- **Have a human read and understand every line before opening the PR.** Check every claim in the description against the code. +- **Search open PRs first** so you don't duplicate one that's already waiting. +- **Pick a subsystem maintainers are actively merging in.** If several PRs for the same board or feature have sat for weeks with no response, a new one will likely sit too. +- **Prefer low-risk changes.** Build fixes and documentation fixes merge most often (about 61% and 64%). Changes to protocol or behavior, and crash or overflow fixes, get much more scrutiny. +- **Make a minimal diff in the existing style.** Don't reformat, rename, or "tidy" code next to your change. +- **Don't use a templated description.** Lots of headings and boilerplate on a small change reads as generated. Just say what changed, why, and what hardware you tested on. + ## Thank You! > [!NOTE] diff --git a/README.md b/README.md index 6cc45d7f4..a8f72e0f6 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ 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. +- For the LilyGO T3 STM32, see the [board build and flashing guide](./variants/lilygo_t3_stm32/README.md). - 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 Wi-Fi. - [KISS Modem](./examples/kiss_modem) - Serial KISS protocol bridge for host applications. ([protocol docs](./docs/kiss_modem_protocol.md)) diff --git a/boards/dfrobot_lorawan_esp32s3.json b/boards/dfrobot_lorawan_esp32s3.json new file mode 100644 index 000000000..62e6cfed3 --- /dev/null +++ b/boards/dfrobot_lorawan_esp32s3.json @@ -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": "esp32s3" + }, + "connectivity": ["wifi", "bluetooth", "lora"], + "debug": { + "default_tool": "esp-builtin", + "onboard_tools": ["esp-builtin"], + "openocd_target": "esp32s3.cfg" + }, + "frameworks": ["arduino", "espidf"], + "name": "DFRobot LoRaWAN ESP32-S3 (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.dfrobot.com", + "vendor": "DFRobot" +} diff --git a/boards/heltec-rc52.json b/boards/heltec-rc52.json new file mode 100644 index 000000000..404aac19f --- /dev/null +++ b/boards/heltec-rc52.json @@ -0,0 +1,61 @@ +{ + "build": { + "arduino": { + "ldscript": "nrf52840_s140_v6.ld" + }, + "core": "nRF5", + "cpu": "cortex-m4", + "extra_flags": "-DNRF52840_XXAA", + "f_cpu": "64000000L", + "hwids": [ + ["0x239A", "0x8071"], + ["0x239A", "0x0071"], + ["0x239A", "0x8072"] + ], + "usb_product": "HT-n5262", + "mcu": "nrf52840", + "variant": "heltec_rc52", + "bsp": { + "name": "adafruit" + }, + "softdevice": { + "sd_flags": "-DS140", + "sd_name": "s140", + "sd_version": "6.1.1", + "sd_fwid": "0x00B6" + }, + "bootloader": { + "settings_addr": "0xFF000" + } + }, + "connectivity": [ + "bluetooth", + "lora" + ], + "debug": { + "jlink_device": "nRF52840_xxAA", + "svd_path": "nrf52840.svd", + "openocd_target": "nrf52.cfg" + }, + "frameworks": [ + "arduino" + ], + "name": "Heltec RC52", + "upload": { + "maximum_ram_size": 237568, + "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" +} diff --git a/boards/heltec_meshpocket_v2.json b/boards/heltec_meshpocket_v2.json new file mode 100644 index 000000000..169d1ef79 --- /dev/null +++ b/boards/heltec_meshpocket_v2.json @@ -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"], + ["0x1915", "0x1667"] + ], + "usb_product": "pocket-v2", + "mcu": "nrf52840", + "variant": "heltec_meshpocket_v2", + "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 Mesh Pocket V2 (Adafruit BSP)", + "upload": { + "maximum_ram_size": 237568, + "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" +} diff --git a/boards/lilygo_t3_stm32.json b/boards/lilygo_t3_stm32.json new file mode 100644 index 000000000..3f3234022 --- /dev/null +++ b/boards/lilygo_t3_stm32.json @@ -0,0 +1,32 @@ +{ + "build": { + "arduino": { + "variant_h": "variant_generic.h" + }, + "core": "stm32", + "cpu": "cortex-m4", + "extra_flags": "-DSTM32WL -DSTM32WLxx -DSTM32WL55xx", + "f_cpu": "48000000L", + "framework_extra_flags": { + "arduino": "-DUSE_CM4_STARTUP_FILE -DARDUINO_GENERIC_WL55CCUX" + }, + "mcu": "stm32wl55ccu6", + "product_line": "STM32WL55xx", + "variant": "STM32WLxx/WL54CCU_WL55CCU_WLE4C(8-B-C)U_WLE5C(8-B-C)U" + }, + "debug": { + "jlink_device": "STM32WL55CC", + "openocd_target": "stm32wlx", + "svd_path": "STM32WL5x_CM4.svd" + }, + "frameworks": ["arduino"], + "name": "LilyGO T3 STM32 V1.0 (STM32WL55CCU6)", + "upload": { + "maximum_ram_size": 65536, + "maximum_size": 262144, + "protocol": "serial", + "protocols": ["serial", "stlink", "jlink"] + }, + "url": "https://github.com/Xinyuan-LilyGO/T3-STM32", + "vendor": "LilyGO" +} diff --git a/docs/cli_commands.md b/docs/cli_commands.md index 9fde4d436..a9d047d42 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -6,6 +6,7 @@ This document provides an overview of CLI commands that can be sent to MeshCore - [Operational](#operational) - [Neighbors](#neighbors-repeater-only) +- [Posts](#posts-room-server-only) - [Statistics](#statistics) - [Logging](#logging) - [Information](#info) @@ -129,6 +130,19 @@ This document provides an overview of CLI commands that can be sent to MeshCore --- +## Posts (Room Server Only) + +### Post a message as the room server +**Usage:** +- `room.post ` + +**Parameters:** +- `message`: The text of the post + +**Note:** The post is stored and pushed to logged-in clients like a client's post, with the room server as its author. + +--- + ## Statistics ### Clear Stats @@ -142,6 +156,18 @@ This document provides an overview of CLI commands that can be sent to MeshCore **Serial Only:** Yes +**Note:** Output format: `{"battery_mv":,"uptime_secs":,"errors":,"queue_len":}` + +**Note:** `errors` is a bitmask shown as "Debug flags" in the app's repeater status. + +| Value | Flag | Meaning | +|-------|------|---------| +| 1 | `ERR_EVENT_FULL` | A packet failed to send because the memory pool was full. | +| 2 | `ERR_EVENT_CAD_TIMEOUT` | After waiting 4 seconds for a gap, a packet was transmitted into a busy network. | +| 4 | `ERR_EVENT_STARTRX_TIMEOUT` | The radio was out of receive mode for more than 8 seconds. | + +Flags stay set until the node reboots or `clear stats` is run. + --- ### Radio Stats - Noise floor, Last RSSI/SNR, Airtime, Receive errors @@ -215,6 +241,10 @@ This document provides an overview of CLI commands that can be sent to MeshCore **Note:** Requires reboot to apply +**Notes:** These settings control the setup of the radio parameters. +Refer to the node's manual for the correct settings to use. +**Setting a value too high or too low may violate the laws in your country.** + --- #### View or change this node's transmit power @@ -229,7 +259,9 @@ This document provides an overview of CLI commands that can be sent to MeshCore **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.** +**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.** --- @@ -244,6 +276,10 @@ This document provides an overview of CLI commands that can be sent to MeshCore - `cr`: Coding rate (5-8) - `timeout_mins`: Duration in minutes (must be > 0) +**Notes:** These settings control the setup of the radio parameters. +Refer to the node's manual for the correct settings to use. +**Setting a value too high or too low may violate the laws in your country.** + **Note:** This is not saved to preferences and will clear on reboot --- @@ -400,6 +436,23 @@ This document provides an overview of CLI commands that can be sent to MeshCore --- +#### View or change this node's read-only password +**Usage:** +- `get ro.password` +- `set ro.password ` +- `set ro.password` (clears it) + +**Parameters:** +- `password`: Read-only password, must differ from the admin and guest passwords + +**Default:** `` (read-only logins disabled) + +**Note:** Repeater and Sensor only. Logins with this password get the read-only role (full telemetry, subscriptions) but are not saved to the ACL, so changing it revokes access after the next reboot. On a sensor, location is withheld from these logins. + +**Note:** On a sensor, a blank guest password disables guest logins. + +--- + #### View or change this node's owner info **Usage:** - `get owner.info` @@ -575,6 +628,9 @@ This document provides an overview of CLI commands that can be sent to MeshCore > **Note:** Added in firmware v1.15.0 +**Notes:** Refer to the node's manual for the correct settings to use. +**Setting a value too high may violate the laws in your country.** + --- #### View or change the airtime factor (duty cycle limit) @@ -999,9 +1055,16 @@ region save --- ### GPS (When GPS support is compiled in) -#### View or change GPS state +#### View GPS state **Usage:** - `gps` + +**Note:** Reports the requested state, receiver activity, last-fix status (last fix gives number of sats and how long ago was the fix), and mode. In periodic mode, `waiting` means the receiver is off between acquisitions; the last fix remains available. `off(hw)` means a hardware GPS switch is off. + +--- + +#### Change GPS state +**Usage:** - `gps ` **Parameters:** @@ -1009,9 +1072,44 @@ region save **Default:** `off` -**Note:** Output format: -- `off` when the GPS hardware is disabled -- `on, {active|deactivated}, {fix|no fix}, {sat count} sats` when the GPS hardware is enabled +--- + +#### View or change the GPS acquisition period +**Usage:** +- `gps period` +- `gps period ` + +**Parameters:** +- `value`: `0` for continuous tracking, or a period. The value can be postfixed with `s`, `m`, `h` or `d` to specify the unit (seconds by default). + +**Note:** A periodic acquisition stops after receiving a valid fix, then resumes after the configured period. Without a fix it stops after 5 minutes (`GPS_PERIODIC_ACQUISITION_TIMEOUT_MS`), or, until the first fix since boot, after the first fix timeout (see `gps firstfix`). + +--- + +#### View or change the first fix timeout +**Usage:** +- `gps firstfix` +- `gps firstfix ` + +**Parameters:** +- `value`: `0` for no limit, or a duration up to `1d`. The value can be postfixed with `s`, `m`, `h` or `d` to specify the unit (seconds by default). + +**Default:** `1h` (`GPS_FIRST_FIX_TIMEOUT_MS`) + +**Note:** In periodic mode, limits an acquisition until the first valid fix since boot. A cold start can take much longer than the usual 5 minutes with a weak sky view; after the limit the GPS sleeps for the period and tries again. Saved with the other GPS settings. + +--- + +#### View the last GPS fix +**Usage:** +- `gps fix` + +**Output:** +- `> Fix (n sat): , `: the GPS currently has a fix. +- `> Last fix ago (n sat)[, acq