Compare commits
40 Commits
main-evo
...
meshcore-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4ee93aceb | ||
|
|
46a9164622 | ||
|
|
ca5a8ecb16 | ||
|
|
7682f1085c | ||
|
|
c9d6927d26 | ||
|
|
0b947f9d1b | ||
|
|
1798e44f01 | ||
|
|
4fd7aa6ce8 | ||
|
|
94d44eb47c | ||
|
|
f8f9cddb47 | ||
|
|
6b52fb3230 | ||
|
|
a93527a474 | ||
|
|
9b08a9bd93 | ||
|
|
27c92d2fe9 | ||
|
|
e563529cc5 | ||
|
|
09a20d72e7 | ||
|
|
2228214ded | ||
|
|
2bcc9c10d2 | ||
|
|
14f00fe688 | ||
|
|
ce3b6e67f9 | ||
|
|
922e378be5 | ||
|
|
3a497a4b99 | ||
|
|
5871c69f6f | ||
|
|
802de27e03 | ||
|
|
1f5659dd26 | ||
|
|
cae37d8892 | ||
|
|
6d3219329f | ||
|
|
9405e8bee3 | ||
|
|
8b68b5a689 | ||
|
|
b2dcb06197 | ||
|
|
da5dbcd274 | ||
|
|
3e3fa5b443 | ||
|
|
f5f5886327 | ||
|
|
6ee0b85195 | ||
|
|
86225cd24a | ||
|
|
f594f2c7e6 | ||
|
|
3dc04deabf | ||
|
|
c8a6bcf57f | ||
|
|
4e886bfa90 | ||
|
|
816d4e2fa3 |
15
README.md
15
README.md
@@ -97,10 +97,10 @@ Here are some general principals you should try to adhere to:
|
||||
|
||||
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
|
||||
- [ ] Repeater + Room Server: add ACL's (like Sensor Node has)
|
||||
- [ ] Standardise Bridge mode for repeaters
|
||||
- [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
|
||||
- [ ] Core + Repeater: enhanced zero-hop neighbour discovery
|
||||
- [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
|
||||
@@ -113,12 +113,3 @@ There are a number of fairly major features in the pipeline, with no particular
|
||||
- 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.
|
||||
|
||||
## 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)
|
||||
|
||||
|
||||
163
docs/faq.md
163
docs/faq.md
@@ -26,6 +26,10 @@ author: https://github.com/LitBomb<!-- omit from toc -->
|
||||
- [3.2. Q: Do I need to set the location for a repeater?](#32-q-do-i-need-to-set-the-location-for-a-repeater)
|
||||
- [3.3. Q: What is the password to administer a repeater or a room server?](#33-q-what-is-the-password-to-administer-a-repeater-or-a-room-server)
|
||||
- [3.4. Q: What is the password to join a room server?](#34-q-what-is-the-password-to-join-a-room-server)
|
||||
- [3.5. Q: Can I retrieve a repeater's private key or set a repeater's private key?](#35-q-can-i-retrieve-a-repeaters-private-key-or-set-a-repeaters-private-key)
|
||||
- [3.6. Q: The first byte of my repeater's public key collides with an exisitng repeater on the mesh. How do I get a new private key with a matching public key that has its first byte of my choosing?](#36-q-the-first-byte-of-my-repeaters-public-key-collides-with-an-exisitng-repeater-on-the-mesh--how-do-i-get-a-new-private-key-with-a-matching-public-key-that-has-its-first-byte-of-my-choosing)
|
||||
- [3.7. Q: My repeater maybe suffering from deafness due to high power interference near my mesh's frequency, it is not hearing other in-range MeshCore radios. what can I do?](#37-q-my-repeater-maybe-suffering-from-deafness-due-to-high-power-interference-near-my-meshs-frequency-it-is-not-hearing-other-in-range-meshcore-radios--what-can-i-do)
|
||||
- [3.8 Q: How do I make my repeater an observer on the mesh](#38-q-how-do-i-make-my-repeater-an-observer-on-the-mesh)
|
||||
- [4. T-Deck Related](#4-t-deck-related)
|
||||
- [4.1. Q: Is there a user guide for T-Deck, T-Pager, T-Watch, or T-Display Pro?](#41-q-is-there-a-user-guide-for-t-deck-t-pager-t-watch-or-t-display-pro)
|
||||
- [4.2. Q: What are the steps to get a T-Deck into DFU (Device Firmware Update) mode?](#42-q-what-are-the-steps-to-get-a-t-deck-into-dfu-device-firmware-update-mode)
|
||||
@@ -61,22 +65,31 @@ author: https://github.com/LitBomb<!-- omit from toc -->
|
||||
- [5.14.3. Python MeshCore](#5143-python-meshcore)
|
||||
- [5.14.4. meshcore-cli](#5144-meshcore-cli)
|
||||
- [5.14.5. meshcore.js](#5145-meshcorejs)
|
||||
- [5.14.6. pyMC\_core](#5146-pymc_core)
|
||||
- [5.14.7. MeshCore Packet Decoder](#5147-meshcore-packet-decoder)
|
||||
- [5.14.8. meshcore-pi](#5148-meshcore-pi)
|
||||
- [5.14.9. pyMC\_Repeater](#5149-pymc_repeater)
|
||||
- [5.15. Q: Are there client applications for Windows or Mac?](#515-q-are-there-client-applications-for-windows-or-mac)
|
||||
- [5.16. Q: Are there any resources that compare MeshCore to other LoRa systems?](#516-q-are-there-any-resources-that-compare-meshcore-to-other-lora-systems)
|
||||
- [6. Troubleshooting](#6-troubleshooting)
|
||||
- [6.1. Q: My client says another client or a repeater or a room server was last seen many, many days ago.](#61-q-my-client-says-another-client-or-a-repeater-or-a-room-server-was-last-seen-many-many-days-ago)
|
||||
- [6.2. Q: A repeater or a client or a room server I expect to see on my discover list (on T-Deck) or contact list (on a smart device client) are not listed.](#62-q-a-repeater-or-a-client-or-a-room-server-i-expect-to-see-on-my-discover-list-on-t-deck-or-contact-list-on-a-smart-device-client-are-not-listed)
|
||||
- [6.3. Q: How to connect to a repeater via BLE (Bluetooth)?](#63-q-how-to-connect-to-a-repeater-via-ble-bluetooth)
|
||||
- [6.4. Q: My companion isn't showing up over Bluetooth?](#64-q-my-companion-isnt-showing-up-over-bluetooth)
|
||||
- [6.5. Q: I can't connect via Bluetooth, what is the Bluetooth pairing code?](#64-q-i-cant-connect-via-bluetooth-what-is-the-bluetooth-pairing-code)
|
||||
- [6.6. Q: My Heltec V3 keeps disconnecting from my smartphone. It can't hold a solid Bluetooth connection.](#65-q-my-heltec-v3-keeps-disconnecting-from-my-smartphone--it-cant-hold-a-solid-bluetooth-connection)
|
||||
- [6.7. Q: My RAK/T1000-E/xiao\_nRF52 device seems to be corrupted, how do I wipe it clean to start fresh?](#66-q-my-rakt1000-exiao_nrf52-device-seems-to-be-corrupted-how-do-i-wipe-it-clean-to-start-fresh)
|
||||
- [6.8. Q: WebFlasher fails on Linux with failed to open](#67-q-webflasher-fails-on-linux-with-failed-to-open)
|
||||
- [6.5. Q: I can't connect via Bluetooth, what is the Bluetooth pairing code?](#65-q-i-cant-connect-via-bluetooth-what-is-the-bluetooth-pairing-code)
|
||||
- [6.6. Q: My Heltec V3 keeps disconnecting from my smartphone. It can't hold a solid Bluetooth connection.](#66-q-my-heltec-v3-keeps-disconnecting-from-my-smartphone--it-cant-hold-a-solid-bluetooth-connection)
|
||||
- [6.7. Q: My RAK/T1000-E/xiao\_nRF52 device seems to be corrupted, how do I wipe it clean to start fresh?](#67-q-my-rakt1000-exiao_nrf52-device-seems-to-be-corrupted-how-do-i-wipe-it-clean-to-start-fresh)
|
||||
- [6.8. Q: WebFlasher fails on Linux with failed to open](#68-q-webflasher-fails-on-linux-with-failed-to-open)
|
||||
- [7. Other Questions:](#7-other-questions)
|
||||
- [7.1. Q: How to update nRF (RAK, T114, Seed XIAO) repeater and room server firmware over the air using the new simpler DFU app?](#71-q-how-to-update-nrf-rak-t114-seed-xiao-repeater-and-room-server-firmware-over-the-air-using-the-new-simpler-dfu-app)
|
||||
- [7.1.1 Q: Can I update Seeed Studio Wio Tracker L1 Pro using OTA?](#711-q-can-i-update-seeed-studio-wio-tracker-l1-pro-using-ota)
|
||||
- [7.2. Q: How to update ESP32-based devices over the air?](#72-q-how-to-update-esp32-based-devices-over-the-air)
|
||||
- [7.3. Q: Is there a way to lower the chance of a failed OTA device firmware update (DFU)?](#73-q-is-there-a-way-to-lower-the-chance-of-a-failed-ota-device-firmware-update-dfu)
|
||||
- [7.4. Q: are the MeshCore logo and font available?](#74-q-are-the-meshcore-logo-and-font-available)
|
||||
- [7.5. Q: What is the format of a contact or channel QR code?](#75-q-what-is-the-format-of-a-contact-or-channel-qr-code)
|
||||
- [7.6. Q: How do I connect to the companion via WIFI, e.g. using a heltec v3?](#76-q-how-do-i-connect-to-the-comnpanion-via-wifi-eg-using-a-heltec-v3)
|
||||
- [7.6. Q: How do I connect to the companion via WIFI, e.g. using a heltec v3?](#76-q-how-do-i-connect-to-the-companion-via-wifi-eg-using-a-heltec-v3)
|
||||
- [7.7. Q: I have a Station G2, or a Heltec V4, or an Ikoka Stick, or a radio with a EByte E22-900M30S or a E22-900M33S module, what should their transmit power be set to?](#77-q-i-have-a-station-g2-or-a-heltec-v4-or-an-ikoka-stick-or-a-radio-with-a-ebyte-e22-900m30s-or-a-e22-900m33s-module-what-should-their-transmit-power-be-set-to)
|
||||
- [| | High Output | 22 dBm | 28 dBm | |](#--high-output--22-dbm--28-dbm--)
|
||||
|
||||
## 1. Introduction
|
||||
|
||||
@@ -180,22 +193,17 @@ The T-Deck firmware is free to download and most features are available without
|
||||
|
||||
|
||||
### 2.3. Q: What frequencies are supported by MeshCore?
|
||||
**A:** It supports the 868MHz range in the UK/EU and the 915MHz range in New Zealand, Australia, and the USA. Countries and regions in these two frequency ranges are also supported. The firmware and client allow users to set their preferred frequency.
|
||||
- Australia and New Zealand are on **915.8MHz**
|
||||
- UK and EU are on **869.525MHz**
|
||||
- Canada and USA are on **910.525MHz**
|
||||
- For other regions and countries, please check your local LoRa frequency
|
||||
**A:** It supports the 868MHz range in the UK/EU and the 915MHz range in New Zealand, Australia, and the USA. Countries and regions in these two frequency ranges are also supported.
|
||||
|
||||
In UK and EU, 867.5MHz is not allowed to use 250kHz bandwidth and it only allows 2.5% duty cycle for clients. 869.525Mhz allows an airtime of 10%, 250KHz bandwidth, and a higher EIRP, therefore MeshCore nodes can send more often and with more power. That is why this frequency is chosen for UK and EU. This is also why Meshtastic also uses this frequency.
|
||||
Use the smartphone client or the repeater setup feature on there web flasher to set your radios' RF settings by choosing the preset for your regions.
|
||||
|
||||
[Source](https://discord.com/channels/826570251612323860/1330643963501351004/1356540643853209641)
|
||||
Recently, as of October 2025, many regions have moved to the "narrow" setting, aka using BW62.5 and a lower SF number (instead of the original SF11). For example, USA/Canada (Recommended) preset is 910.525MHz, SF7, BW62.5, CR5.
|
||||
|
||||
After extensive testing, many regions have switched or about to switch over to BW62.5 and SF7, 8, or 9. Narrower bandwidth setting and lower SF setting allow MeshCore's radio signals to fit between interference in the ISM band, provide for a lower noise floor, better SNR, and faster transmissions.
|
||||
|
||||
If you have consensus from your community in your region to update your region's preset recommendation, please post your update request on the [#meshcore-app](https://discord.com/channels/1343693475589263471/1391681655911088241) channel on the [MeshCore Discord server ](https://discord.gg/cYtQNYCCRK) to let Liam Cottle know.
|
||||
|
||||
the rest of the radio settings are the same for all frequencies:
|
||||
- Spread Factor (SF): 11
|
||||
- Coding Rate (CR): 5
|
||||
- Bandwidth (BW): 250.00
|
||||
|
||||
(Originally MeshCore started with SF 10. recently (as of late April 2025) the community has advocated SF 11 also a viable option for longer range but a little slower transmission. Currently there are MeshCore meshes with SF 10 and SF 11. Liam Cottle's smartphone app's presets now recommend SF 10 for Australia and SF 11 for all other regions and countries. EU and UK has SF 10 and SF 11 presets. Work with your local meshers on deciding with SF number is best for your use cases. In the future, there may be bridge nodes that can bridge SF 10 and SF 11 (or even different frequencies) traffic.)
|
||||
|
||||
### 2.4. Q: What is an "advert" in MeshCore?
|
||||
**A:**
|
||||
@@ -243,7 +251,7 @@ Repeater or room server can be administered with one of the options below:
|
||||
|
||||
|
||||
### 3.2. Q: Do I need to set the location for a repeater?
|
||||
**A:** With location set for a repeater, it can show up on a MeshCore map in the future. Set location with the following commands:
|
||||
**A:** While not required, with location set for a repeater it will show up on the MeshCore map in the future. Set location with the following command:
|
||||
|
||||
`set lat <GPS Lat> set long <GPS Lon>`
|
||||
|
||||
@@ -260,6 +268,34 @@ You can get the latitude and longitude from Google Maps by right-clicking the lo
|
||||
|
||||
`set guest.password {guest-password}`
|
||||
|
||||
### 3.5. Q: Can I retrieve a repeater's private key or set a repeater's private key?
|
||||
|
||||
**A:** You can issue these commands to get or set a repeater's private key using a USB serial connection.
|
||||
|
||||
`get prv.key` to print a repeater's private key on the serial console
|
||||
`set prv.key <hex>` to set a repeater's private key on the serial console
|
||||
|
||||
Reboot the repeater after `set prv.key <hex>` command for the new private key to take effect.
|
||||
|
||||
### 3.6. Q: The first byte of my repeater's public key collides with an exisitng repeater on the mesh. How do I get a new private key with a matching public key that has its first byte of my choosing?
|
||||
|
||||
**A:** You can generate a new private key and specific the first byte of its public key here: https://gessaman.com/mc-keygen/
|
||||
|
||||
|
||||
### 3.7. Q: My repeater maybe suffering from deafness due to high power interference near my mesh's frequency, it is not hearing other in-range MeshCore radios. what can I do?
|
||||
|
||||
**A:** This may be due to the SX1262 radio's auto gain control feature. You can use this command to preiodically reset its AGC.
|
||||
|
||||
`set agc.reset.interval <number>`
|
||||
|
||||
The `<number>` unit is in seconds and is incremented by 4. `set agc.reset.interval 4` works well to cure deafness.
|
||||
|
||||
This is a very low cost operation. AGC reset is done by simply setting `state = STATE_IDLE;` in function `RadioLibWrapper::resetAGC()` in `RadioLibWrappers.cpp`
|
||||
|
||||
|
||||
### 3.8 Q: How do I make my repeater an observer on the mesh
|
||||
|
||||
**A:** The observer instruction is available here: https://analyzer.letsme.sh/observer/onboard
|
||||
|
||||
---
|
||||
|
||||
@@ -297,7 +333,9 @@ GPS on T-Deck is always enabled. You can skip the "GPS clock sync" and the T-De
|
||||
**A:**
|
||||
T-Deck uses the same key the smartphone apps use but in base64
|
||||
`izOH6cXN6mrJ5e26oRXNcg==`
|
||||
The third character is the capital letter 'O', not zero `0`
|
||||
|
||||
There is no `=` key on the T-Deck's hardware keyboard. You can use the on-screen software keyboard to enter `=`. Tap the text box to enable the on-screen software keyboard.
|
||||
The third character is the capital letter `O` (Oh), not zero `0`
|
||||
|
||||
The smartphone app key is in hex:
|
||||
` 8b3387e9c5cdea6ac9e5edbaa115cd72`
|
||||
@@ -376,7 +414,23 @@ https://github.com/meshcore-dev/MeshCore/blob/main/src/Packet.h#L19
|
||||
|
||||
**SF is spreading factor** - how much should the communication spread in time
|
||||
|
||||
**CR is coding rate** - https://www.thethingsnetwork.org/docs/lorawan/fec-and-code-rate/
|
||||
**CR is coding rate** - from: https://www.thethingsnetwork.org/docs/lorawan/fec-and-code-rate/
|
||||
|
||||
TL;DR: default CR to 5 for good stable links. If it is not a solid link and is intermittent, change to CR to 7 or 8.
|
||||
|
||||
Forward Error Correction is a process of adding redundant bits to the data to be transmitted. During the transmission, data may get corrupted by interference (changes from 0 to 1 / 1 to 0). These error correction bits are used at the receivers for restoring corrupted bits.
|
||||
|
||||
The Code Rate of a forward error correction expresses the proportion of bits in a data stream that actually carry useful information.
|
||||
|
||||
There are 4 code rates used in LoRaWAN:
|
||||
|
||||
4/5
|
||||
4/6
|
||||
5/7
|
||||
4/8
|
||||
|
||||
For example, if the code rate is 5/7, for every 5 bits of useful information, the coder generates a total of 7 bits of data, of which 2 bits are redundant.
|
||||
|
||||
Making the bandwidth 2x wider (from BW125 to BW250) allows you to send 2x more bytes in the same time. Making the spreading factor 1 step lower (from SF10 to SF9) allows you to send 2x more bytes in the same time.
|
||||
|
||||
Lowering the spreading factor makes it more difficult for the gateway to receive a transmission, as it will be more sensitive to noise. You could compare this to two people taking in a noisy place (a bar for example). If you’re far from each other, you have to talk slow (SF10), but if you’re close, you can talk faster (SF7)
|
||||
@@ -558,7 +612,8 @@ From here, reference repeater and room server command line commands on MeshCore
|
||||
**A:** Yes. See the following:
|
||||
|
||||
#### 5.14.1. meshcoremqtt
|
||||
A Python script to send meshore debug and packet capture data to MQTT for analysis
|
||||
A Python script to send meshcore debug and packet capture data to MQTT for analysis. Cisien's version is a fork of Andrew-a-g's and is being used to to collect data for https://map.w0z.is/messages and https://analyzer.letsme.sh/
|
||||
https://github.com/Cisien/meshcoretomqtt
|
||||
https://github.com/Andrew-a-g/meshcoretomqtt
|
||||
|
||||
#### 5.14.2. MeshCore for Home Assistant
|
||||
@@ -577,6 +632,40 @@ CLI interface to MeshCore companion radio over BLE, TCP, or serial. Uses Python
|
||||
A JavaScript library for interacting with a MeshCore device running the companion radio firmware
|
||||
https://github.com/liamcottle/meshcore.js
|
||||
|
||||
#### 5.14.6. pyMC_core
|
||||
pyMC_Core is a Python port of MeshCore, designed for Raspberry Pi and similar hardware, it talks to LoRa modules over SPI.
|
||||
https://github.com/rightup/pyMC_core
|
||||
|
||||
#### 5.14.7. MeshCore Packet Decoder
|
||||
A TypeScript library for decoding MeshCore mesh networking packets with full cryptographic support. Uses WebAssembly (WASM) for Ed25519 key derivation through the orlp/ed25519 library. It powers the [MeshCore Packet Analyzer](https://analyzer.letsme.sh/packets).
|
||||
https://github.com/michaelhart/meshcore-decoder
|
||||
|
||||
#### 5.14.8. meshcore-pi
|
||||
meshcore-pi is another Python port of MeshCore, designed for Raspberry Pi and similar hardware, it talks to LoRa modules over SPI or GPIO.
|
||||
https://github.com/brianwiddas/meshcore-pi
|
||||
|
||||
#### 5.14.9. pyMC_Repeater
|
||||
pyMC_Repeater is a repeater daemon in Python built on top of the [`pymc_core`](#5146-pymc_core) library.
|
||||
https://github.com/rightup/pyMC_Repeater
|
||||
|
||||
|
||||
### 5.15. Q: Are there client applications for Windows or Mac?
|
||||
**A:** Yes, the same iOS and Android client is also available for Windows and Intel Mac (sorry, not available for ARM-based Mac yet). You can find them together with the Android APK here:
|
||||
https://files.liamcottle.net/MeshCore
|
||||
|
||||
Both the Windows and Intel Mac versions of the client app are fully unlocked and are free to use.
|
||||
|
||||
### 5.16. Q: Are there any resources that compare MeshCore to other LoRa systems?
|
||||
|
||||
**A:** Here is a list of MeshCore comparison resources:
|
||||
The Comms Channel on YouTube:
|
||||
https://www.youtube.com/watch?v=guDoKGs02Us
|
||||
MeshCore Advantages by MCarper:
|
||||
https://github.com/mikecarper/meshfirmware/blob/main/MeshCoreAdvantages.md
|
||||
Meshcore vs Meshtastic by austinmesh.org
|
||||
https://www.austinmesh.org/learn/meshcore-vs-meshtastic/
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 6. Troubleshooting
|
||||
@@ -653,6 +742,12 @@ Allow the browser user on it:
|
||||
13. If it fails, try turning off and on Bluetooth on your phone. If that doesn't work, try rebooting your phone.
|
||||
14. Wait for the update to complete. It can take a few minutes.
|
||||
|
||||
#### 7.1.1 Q: Can I update Seeed Studio Wio Tracker L1 Pro using OTA?
|
||||
**A:** You can flash this safer bootloader to the Wio Tracker L1 Pro
|
||||
https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX
|
||||
|
||||
After this bootloader is flashed onto the device, you can trigger over the air update using bluetooth by holding the button next to the D-Pad and then click the reset button. The follow the same OTA update instructions above. You can skip pass the `start ota` instruction and start the update using the DFU app.
|
||||
|
||||
|
||||
### 7.2. Q: How to update ESP32-based devices over the air?
|
||||
|
||||
@@ -673,10 +768,14 @@ Allow the browser user on it:
|
||||
Refer to https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX for the latest information.
|
||||
|
||||
Currently, the following boards are supported:
|
||||
- Nologo ProMicro
|
||||
- Heltec Automation Mesh Node T114 / HT-nRF5262
|
||||
- Nologo ProMicro NRF52840 (aka SuperMini NRF52840)
|
||||
- Seeed Studio SenseCAP Card Tracker T1000-E
|
||||
- Seeed Studio Wio Tracker L1
|
||||
- Seeed Studio XIAO nRF52840 BLE
|
||||
- Seeed Studio XIAO nRF52840 BLE SENSE
|
||||
- RAK 4631
|
||||
- RAK 4631 (See note)
|
||||
- RAK WisMesh Tag (new 28/11/2025)
|
||||
|
||||
### 7.4. Q: are the MeshCore logo and font available?
|
||||
|
||||
@@ -703,4 +802,22 @@ where `&type` is:
|
||||
WiFi firmware requires you to compile it yourself, as you need to set the wifi ssid and password.
|
||||
Edit WIFI_SSID and WIFI_PWD in `./variants/heltec_v3/platformio.ini` and then flash it to your device.
|
||||
|
||||
### 7.7. Q: I have a Station G2, or a Heltec V4, or an Ikoka Stick, or a radio with a EByte E22-900M30S or a E22-900M33S module, what should their transmit power be set to?
|
||||
**A:**
|
||||
For companion radios, you can set these radios' transmit power in the smartphone app. For repeater and room server radios, you can set their transmit power using the command line command `set tx`. You can get their current value using command line comand `get tx`
|
||||
|
||||
|
||||
> ### ⚠️ **WARNING: Set these values at your own risk. Incorrect power settings can permanently damage your radio hardware.**
|
||||
|
||||
| Device / Model | Region / Description | In-App Setting (dBm) | Target Radio Output | Notes |
|
||||
| :--- | :--- | :--- | :--- | :--- |
|
||||
| **Station G2** <br> [Reference](https://wiki.uniteng.com/en/meshtastic/station-g2) | US915 Max Output | 19 dBm | 36.5 dBm (4.46W) | |
|
||||
| | US915 Recommended Max | 16 dBm | 35 dBm (3.16W) | 1dB compression point |
|
||||
| | EU868 Recommended Max | 15 dBm | 34.5 dBm (2.82W) | 1dB compression point |
|
||||
| | US915 1W Output | 10 dBm | 1W | |
|
||||
| | EU868 1W Output | 9 dBm | 1W | |
|
||||
| **Ikoka Stick E22-900M30S** | 1W Model | 19 dBm | 1W | **DO NOT EXCEED** (Risk of burn out) |
|
||||
| **Ikoka Stick E22-900M33S** | 2W Model | 9 dBm | 2W | **DO NOT EXCEED** (Risk of burn out) |
|
||||
| **Heltec V4** | Standard Output | 10 dBm | 22 dBm | |
|
||||
| | High Output | 22 dBm | 28 dBm | |
|
||||
---
|
||||
|
||||
@@ -390,6 +390,14 @@ bool MyMesh::allowPacketForward(const mesh::Packet *packet) {
|
||||
MESH_DEBUG_PRINTLN("allowPacketForward: unknown transport code, or wildcard not allowed for FLOOD packet");
|
||||
return false;
|
||||
}
|
||||
// Limit flood advert paket forwarding using a probabilistic reduction defined by P(h) = 0.308^(hops-1)
|
||||
// https://github.com/meshcore-dev/MeshCore/issues/1223
|
||||
double_t roll_dice = (double)rand() / RAND_MAX;
|
||||
double_t forw_prob = pow(_prefs.flood_advert_base, packet->path_len - 1);
|
||||
if (packet->getPayloadType() == PAYLOAD_TYPE_ADVERT && packet->isRouteFlood() && roll_dice > forw_prob)
|
||||
return false;
|
||||
|
||||
// all other packets
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -711,6 +719,12 @@ bool MyMesh::onPeerPathRecv(mesh::Packet *packet, int sender_idx, const uint8_t
|
||||
#define CTL_TYPE_NODE_DISCOVER_RESP 0x90
|
||||
|
||||
void MyMesh::onControlDataRecv(mesh::Packet* packet) {
|
||||
if (!packet->payload) {
|
||||
MESH_DEBUG_PRINTLN("onControlDataRecv: packet->payload is null");
|
||||
return;
|
||||
}
|
||||
|
||||
#if !defined(STEALTH_MODE)
|
||||
uint8_t type = packet->payload[0] & 0xF0; // just test upper 4 bits
|
||||
if (type == CTL_TYPE_NODE_DISCOVER_REQ && packet->payload_len >= 6
|
||||
&& !_prefs.disable_fwd && discover_limiter.allow(rtc_clock.getCurrentTime())
|
||||
@@ -739,6 +753,7 @@ void MyMesh::onControlDataRecv(mesh::Packet* packet) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondClock &ms, mesh::RNG &rng,
|
||||
@@ -781,8 +796,9 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc
|
||||
_prefs.bw = LORA_BW;
|
||||
_prefs.cr = LORA_CR;
|
||||
_prefs.tx_power_dbm = LORA_TX_POWER;
|
||||
_prefs.advert_interval = 1; // default to 2 minutes for NEW installs
|
||||
_prefs.flood_advert_interval = 12; // 12 hours
|
||||
_prefs.advert_interval = DEF_LOCAL_ADVERT_INTERVAL;
|
||||
_prefs.flood_advert_interval = DEF_FLOOD_ADVERT_INTERVAL;
|
||||
_prefs.flood_advert_base = 0.308f;
|
||||
_prefs.flood_max = 64;
|
||||
_prefs.interference_threshold = 0; // disabled
|
||||
|
||||
@@ -854,10 +870,14 @@ bool MyMesh::formatFileSystem() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void MyMesh::sendSelfAdvertisement(int delay_millis) {
|
||||
void MyMesh::sendSelfAdvertisement(int delay_millis, bool flood) {
|
||||
mesh::Packet *pkt = createSelfAdvert();
|
||||
if (pkt) {
|
||||
sendFlood(pkt, delay_millis);
|
||||
if (flood) {
|
||||
sendFlood(pkt, delay_millis);
|
||||
} else {
|
||||
sendZeroHop(pkt, delay_millis);
|
||||
}
|
||||
} else {
|
||||
MESH_DEBUG_PRINTLN("ERROR: unable to create advertisement packet!");
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
|
||||
void applyTempRadioParams(float freq, float bw, uint8_t sf, uint8_t cr, int timeout_mins) override;
|
||||
bool formatFileSystem() override;
|
||||
void sendSelfAdvertisement(int delay_millis) override;
|
||||
void sendSelfAdvertisement(int delay_millis, bool flood = true) override;
|
||||
void updateAdvertTimer() override;
|
||||
void updateFloodAdvertTimer() override;
|
||||
|
||||
|
||||
@@ -87,8 +87,10 @@ void setup() {
|
||||
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION);
|
||||
#endif
|
||||
|
||||
// send out initial Advertisement to the mesh
|
||||
the_mesh.sendSelfAdvertisement(16000);
|
||||
#if !defined(STEALTH_MODE) && !defined(NO_BOOT_ADVERT)
|
||||
// send out initial Zero Hop Advertisement to the mesh
|
||||
the_mesh.sendSelfAdvertisement(16000, false);
|
||||
#endif
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@@ -275,6 +275,15 @@ uint32_t MyMesh::getDirectRetransmitDelay(const mesh::Packet *packet) {
|
||||
bool MyMesh::allowPacketForward(const mesh::Packet *packet) {
|
||||
if (_prefs.disable_fwd) return false;
|
||||
if (packet->isRouteFlood() && packet->path_len >= _prefs.flood_max) return false;
|
||||
|
||||
// Limit flood advert paket forwarding using a probabilistic reduction defined by P(h) = 0.308^(hops-1)
|
||||
// https://github.com/meshcore-dev/MeshCore/issues/1223
|
||||
double_t roll_dice = (double)rand() / RAND_MAX;
|
||||
double_t forw_prob = pow(_prefs.flood_advert_base, packet->path_len - 1);
|
||||
if (packet->getPayloadType() == PAYLOAD_TYPE_ADVERT && packet->isRouteFlood() && roll_dice > forw_prob)
|
||||
return false;
|
||||
|
||||
// all other packets
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -611,8 +620,9 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc
|
||||
_prefs.cr = LORA_CR;
|
||||
_prefs.tx_power_dbm = LORA_TX_POWER;
|
||||
_prefs.disable_fwd = 1;
|
||||
_prefs.advert_interval = 1; // default to 2 minutes for NEW installs
|
||||
_prefs.flood_advert_interval = 12; // 12 hours
|
||||
_prefs.advert_interval = DEF_LOCAL_ADVERT_INTERVAL;
|
||||
_prefs.flood_advert_interval = DEF_FLOOD_ADVERT_INTERVAL;
|
||||
_prefs.flood_advert_base = 0.308f;
|
||||
_prefs.flood_max = 64;
|
||||
_prefs.interference_threshold = 0; // disabled
|
||||
#ifdef ROOM_PASSWORD
|
||||
@@ -675,10 +685,14 @@ bool MyMesh::formatFileSystem() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void MyMesh::sendSelfAdvertisement(int delay_millis) {
|
||||
void MyMesh::sendSelfAdvertisement(int delay_millis, bool flood) {
|
||||
mesh::Packet *pkt = createSelfAdvert();
|
||||
if (pkt) {
|
||||
sendFlood(pkt, delay_millis);
|
||||
if (flood) {
|
||||
sendFlood(pkt, delay_millis);
|
||||
} else {
|
||||
sendZeroHop(pkt, delay_millis);
|
||||
}
|
||||
} else {
|
||||
MESH_DEBUG_PRINTLN("ERROR: unable to create advertisement packet!");
|
||||
}
|
||||
@@ -815,7 +829,7 @@ void MyMesh::loop() {
|
||||
if (c->extra.room.pending_ack && millisHasNowPassed(c->extra.room.ack_timeout)) {
|
||||
c->extra.room.push_failures++;
|
||||
c->extra.room.pending_ack = 0; // reset (TODO: keep prev expected_ack's in a list, incase they arrive LATER, after we retry)
|
||||
MESH_DEBUG_PRINTLN("pending ACK timed out: push_failures: %d", (uint32_t)c->push_failures);
|
||||
MESH_DEBUG_PRINTLN("pending ACK timed out: push_failures: %d", (uint32_t)c->extra.room.push_failures);
|
||||
}
|
||||
}
|
||||
// check next Round-Robin client, and sync next new post
|
||||
|
||||
@@ -177,7 +177,7 @@ public:
|
||||
|
||||
void applyTempRadioParams(float freq, float bw, uint8_t sf, uint8_t cr, int timeout_mins) override;
|
||||
bool formatFileSystem() override;
|
||||
void sendSelfAdvertisement(int delay_millis) override;
|
||||
void sendSelfAdvertisement(int delay_millis, bool flood = true) override;
|
||||
void updateAdvertTimer() override;
|
||||
void updateFloodAdvertTimer() override;
|
||||
|
||||
|
||||
@@ -76,8 +76,10 @@ void setup() {
|
||||
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION);
|
||||
#endif
|
||||
|
||||
// send out initial Advertisement to the mesh
|
||||
the_mesh.sendSelfAdvertisement(16000);
|
||||
#if !defined(STEALTH_MODE) && !defined(NO_BOOT_ADVERT)
|
||||
// send out initial Zero Hop Advertisement to the mesh
|
||||
the_mesh.sendSelfAdvertisement(16000, false);
|
||||
#endif
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@@ -718,7 +718,7 @@ SensorMesh::SensorMesh(mesh::MainBoard& board, mesh::Radio& radio, mesh::Millise
|
||||
_prefs.bw = LORA_BW;
|
||||
_prefs.cr = LORA_CR;
|
||||
_prefs.tx_power_dbm = LORA_TX_POWER;
|
||||
_prefs.advert_interval = 1; // default to 2 minutes for NEW installs
|
||||
_prefs.advert_interval = DEF_LOCAL_ADVERT_INTERVAL;
|
||||
_prefs.flood_advert_interval = 0; // disabled
|
||||
_prefs.disable_fwd = true;
|
||||
_prefs.flood_max = 64;
|
||||
@@ -788,10 +788,14 @@ void SensorMesh::applyTempRadioParams(float freq, float bw, uint8_t sf, uint8_t
|
||||
revert_radio_at = futureMillis(2000 + timeout_mins*60*1000); // schedule when to revert radio params
|
||||
}
|
||||
|
||||
void SensorMesh::sendSelfAdvertisement(int delay_millis) {
|
||||
void SensorMesh::sendSelfAdvertisement(int delay_millis, bool flood) {
|
||||
mesh::Packet* pkt = createSelfAdvert();
|
||||
if (pkt) {
|
||||
sendFlood(pkt, delay_millis);
|
||||
if (flood) {
|
||||
sendFlood(pkt, delay_millis);
|
||||
} else {
|
||||
sendZeroHop(pkt, delay_millis);
|
||||
}
|
||||
} else {
|
||||
MESH_DEBUG_PRINTLN("ERROR: unable to create advertisement packet!");
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
NodePrefs* getNodePrefs() { return &_prefs; }
|
||||
void savePrefs() override { _cli.savePrefs(_fs); }
|
||||
bool formatFileSystem() override;
|
||||
void sendSelfAdvertisement(int delay_millis) override;
|
||||
void sendSelfAdvertisement(int delay_millis, bool flood = true) override;
|
||||
void updateAdvertTimer() override;
|
||||
void updateFloodAdvertTimer() override;
|
||||
void setLoggingOn(bool enable) override { }
|
||||
|
||||
@@ -110,8 +110,10 @@ void setup() {
|
||||
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION);
|
||||
#endif
|
||||
|
||||
// send out initial Advertisement to the mesh
|
||||
the_mesh.sendSelfAdvertisement(16000);
|
||||
#if !defined(STEALTH_MODE) && !defined(NO_BOOT_ADVERT)
|
||||
// send out initial Zero Hop Advertisement to the mesh
|
||||
the_mesh.sendSelfAdvertisement(16000, false);
|
||||
#endif
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@@ -23,12 +23,16 @@ lib_deps =
|
||||
adafruit/RTClib @ ^2.1.3
|
||||
melopero/Melopero RV3028 @ ^1.1.0
|
||||
electroniccats/CayenneLPP @ 1.6.1
|
||||
build_flags = -w -DNDEBUG -DRADIOLIB_STATIC_ONLY=1 -DRADIOLIB_GODMODE=1
|
||||
build_flags = -w -DNDEBUG
|
||||
-D LORA_FREQ=869.525
|
||||
-D LORA_BW=250
|
||||
-D LORA_SF=11
|
||||
;
|
||||
-D ENABLE_PRIVATE_KEY_IMPORT=1 ; NOTE: comment these out for more secure firmware
|
||||
-D ENABLE_PRIVATE_KEY_EXPORT=1
|
||||
;
|
||||
-D RADIOLIB_STATIC_ONLY=1
|
||||
-D RADIOLIB_GODMODE=1
|
||||
-D RADIOLIB_EXCLUDE_CC1101=1
|
||||
-D RADIOLIB_EXCLUDE_RF69=1
|
||||
-D RADIOLIB_EXCLUDE_SX1231=1
|
||||
@@ -43,6 +47,15 @@ build_flags = -w -DNDEBUG -DRADIOLIB_STATIC_ONLY=1 -DRADIOLIB_GODMODE=1
|
||||
-D RADIOLIB_EXCLUDE_BELL=1
|
||||
-D RADIOLIB_EXCLUDE_RTTY=1
|
||||
-D RADIOLIB_EXCLUDE_SSTV=1
|
||||
;
|
||||
-D MIN_LOCAL_ADVERT_INTERVAL=60
|
||||
-D MAX_LOCAL_ADVERT_INTERVAL=10000
|
||||
-D DEF_LOCAL_ADVERT_INTERVAL=1 ; default to 2 minutes for NEW installs
|
||||
-D MIN_FLOOD_ADVERT_INTERVAL=48
|
||||
-D MAX_FLOOD_ADVERT_INTERVAL=10000
|
||||
-D DEF_FLOOD_ADVERT_INTERVAL=48 ; default to 12 hours for NEW installs
|
||||
; -D NO_BOOT_ADVERT=1 ; disable boot advertisement
|
||||
; -D STEALTH_MODE=1 ; disable all advertisements and DISCOVER_REQ
|
||||
build_src_filter =
|
||||
+<*.cpp>
|
||||
+<helpers/*.cpp>
|
||||
|
||||
@@ -81,7 +81,9 @@ void CommonCLI::loadPrefsInt(FILESYSTEM* fs, const char* filename) {
|
||||
file.read((uint8_t *)&_prefs->discovery_mod_timestamp, sizeof(_prefs->discovery_mod_timestamp)); // 162
|
||||
file.read((uint8_t *)&_prefs->adc_multiplier, sizeof(_prefs->adc_multiplier)); // 166
|
||||
file.read((uint8_t *)_prefs->owner_info, sizeof(_prefs->owner_info)); // 170
|
||||
// 290
|
||||
file.read((uint8_t *)&_prefs->flood_advert_base, sizeof(_prefs->flood_advert_base)); // 290
|
||||
|
||||
// 294
|
||||
|
||||
// sanitise bad pref values
|
||||
_prefs->rx_delay_base = constrain(_prefs->rx_delay_base, 0, 20.0f);
|
||||
@@ -108,6 +110,8 @@ void CommonCLI::loadPrefsInt(FILESYSTEM* fs, const char* filename) {
|
||||
_prefs->gps_enabled = constrain(_prefs->gps_enabled, 0, 1);
|
||||
_prefs->advert_loc_policy = constrain(_prefs->advert_loc_policy, 0, 2);
|
||||
|
||||
_prefs->flood_advert_base = constrain(_prefs->flood_advert_base, 0, 1);
|
||||
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
@@ -165,14 +169,14 @@ void CommonCLI::savePrefs(FILESYSTEM* fs) {
|
||||
file.write((uint8_t *)&_prefs->discovery_mod_timestamp, sizeof(_prefs->discovery_mod_timestamp)); // 162
|
||||
file.write((uint8_t *)&_prefs->adc_multiplier, sizeof(_prefs->adc_multiplier)); // 166
|
||||
file.write((uint8_t *)_prefs->owner_info, sizeof(_prefs->owner_info)); // 170
|
||||
// 290
|
||||
file.write((uint8_t *)&_prefs->flood_advert_base, sizeof(_prefs->flood_advert_base)); // 290
|
||||
|
||||
// 294
|
||||
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
|
||||
#define MIN_LOCAL_ADVERT_INTERVAL 60
|
||||
|
||||
void CommonCLI::savePrefs() {
|
||||
if (_prefs->advert_interval * 2 < MIN_LOCAL_ADVERT_INTERVAL) {
|
||||
_prefs->advert_interval = 0; // turn it off, now that device has been manually configured
|
||||
@@ -197,6 +201,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
|
||||
if (memcmp(command, "reboot", 6) == 0) {
|
||||
_board->reboot(); // doesn't return
|
||||
} else if (memcmp(command, "advert", 6) == 0) {
|
||||
// Keep "advert" as flood for backward compatibility
|
||||
_callbacks->sendSelfAdvertisement(1500); // longer delay, give CLI response time to be sent first
|
||||
strcpy(reply, "OK - Advert sent");
|
||||
} else if (memcmp(command, "clock sync", 10) == 0) {
|
||||
@@ -217,7 +222,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
|
||||
uint32_t now = getRTCClock()->getCurrentTime();
|
||||
DateTime dt = DateTime(now);
|
||||
sprintf(reply, "%02d:%02d - %d/%d/%d UTC", dt.hour(), dt.minute(), dt.day(), dt.month(), dt.year());
|
||||
} else if (memcmp(command, "time ", 5) == 0) { // set time (to epoch seconds)
|
||||
} else if (memcmp(command, "time ", 5) == 0) { // set time (to epoch seconds)
|
||||
uint32_t secs = _atoi(&command[5]);
|
||||
uint32_t curr = getRTCClock()->getCurrentTime();
|
||||
if (secs > curr) {
|
||||
@@ -364,6 +369,8 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
|
||||
} else {
|
||||
sprintf(reply, "> %.3f", adc_mult);
|
||||
}
|
||||
} else if (memcmp(config, "flood.advert.base", 17) == 0) {
|
||||
sprintf(reply, "> %s", StrHelper::ftoa(_prefs->flood_advert_base));
|
||||
} else {
|
||||
sprintf(reply, "??: %s", config);
|
||||
}
|
||||
@@ -394,8 +401,9 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
|
||||
strcpy(reply, "OK");
|
||||
} else if (memcmp(config, "flood.advert.interval ", 22) == 0) {
|
||||
int hours = _atoi(&config[22]);
|
||||
if ((hours > 0 && hours < 3) || (hours > 48)) {
|
||||
strcpy(reply, "Error: interval range is 3-48 hours");
|
||||
if ((hours > 0 && hours < MIN_FLOOD_ADVERT_INTERVAL) || (hours > MAX_FLOOD_ADVERT_INTERVAL)) {
|
||||
sprintf(reply, "Error: interval range is %d-%d hours", MIN_FLOOD_ADVERT_INTERVAL,
|
||||
MAX_FLOOD_ADVERT_INTERVAL);
|
||||
} else {
|
||||
_prefs->flood_advert_interval = (uint8_t)(hours);
|
||||
_callbacks->updateFloodAdvertTimer();
|
||||
@@ -404,8 +412,9 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
|
||||
}
|
||||
} else if (memcmp(config, "advert.interval ", 16) == 0) {
|
||||
int mins = _atoi(&config[16]);
|
||||
if ((mins > 0 && mins < MIN_LOCAL_ADVERT_INTERVAL) || (mins > 240)) {
|
||||
sprintf(reply, "Error: interval range is %d-240 minutes", MIN_LOCAL_ADVERT_INTERVAL);
|
||||
if ((mins > 0 && mins < MIN_LOCAL_ADVERT_INTERVAL) || (mins > MAX_LOCAL_ADVERT_INTERVAL)) {
|
||||
sprintf(reply, "Error: interval range is %d-%d minutes",MIN_LOCAL_ADVERT_INTERVAL,
|
||||
MAX_LOCAL_ADVERT_INTERVAL);
|
||||
} else {
|
||||
_prefs->advert_interval = (uint8_t)(mins / 2);
|
||||
_callbacks->updateAdvertTimer();
|
||||
@@ -583,6 +592,15 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
|
||||
_prefs->adc_multiplier = 0.0f;
|
||||
strcpy(reply, "Error: unsupported by this board");
|
||||
};
|
||||
} else if (memcmp(config, "flood.advert.base ", 18) == 0) {
|
||||
float f = atof(&config[18]);
|
||||
if((f > 0) || (f<1)) {
|
||||
_prefs->flood_advert_base = f;
|
||||
savePrefs();
|
||||
strcpy(reply, "OK");
|
||||
} else {
|
||||
strcpy(reply, "Error: base must be between 0 and 1");
|
||||
}
|
||||
} else {
|
||||
sprintf(reply, "unknown config: %s", config);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ struct NodePrefs { // persisted to file
|
||||
uint8_t flood_max;
|
||||
uint8_t interference_threshold;
|
||||
uint8_t agc_reset_interval; // secs / 4
|
||||
float flood_advert_base;
|
||||
// Bridge settings
|
||||
uint8_t bridge_enabled; // boolean
|
||||
uint16_t bridge_delay; // milliseconds (default 500 ms)
|
||||
@@ -60,7 +61,7 @@ public:
|
||||
virtual const char* getBuildDate() = 0;
|
||||
virtual const char* getRole() = 0;
|
||||
virtual bool formatFileSystem() = 0;
|
||||
virtual void sendSelfAdvertisement(int delay_millis) = 0;
|
||||
virtual void sendSelfAdvertisement(int delay_millis, bool flood = true) = 0;
|
||||
virtual void updateAdvertTimer() = 0;
|
||||
virtual void updateFloodAdvertTimer() = 0;
|
||||
virtual void setLoggingOn(bool enable) = 0;
|
||||
|
||||
56
tools/maint/README.md
Normal file
56
tools/maint/README.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# Maintenance Tools
|
||||
|
||||
This directory contains automation for managing our **Friendly Fork**. It allows us to integrate community-submitted Pull Requests from the upstream repository into our local development branches.
|
||||
|
||||
## Why this exists
|
||||
|
||||
In firmware development, critical bug fixes or hardware support often exist in the upstream "Pull Request" queue long before they are officially merged. This tool allows us to build an integrated firmware version that includes those necessary patches while remaining syncable with the official source.
|
||||
|
||||
## Usage
|
||||
|
||||
### 1. Prerequisites
|
||||
|
||||
You must have the original repository added as a remote named `upstream`:
|
||||
|
||||
```bash
|
||||
git remote add upstream https://github.com/meshcore-dev/MeshCore.git
|
||||
```
|
||||
|
||||
### 2. Basic Commands
|
||||
|
||||
**Apply specific patches:**
|
||||
To pull in PR #1338 and PR #1400 from the upstream project:
|
||||
|
||||
```bash
|
||||
./tools/maint/apply_patches.sh 1338 1400
|
||||
|
||||
```
|
||||
|
||||
**Start over (Reset):**
|
||||
To wipe the integrated branch and reset it to match the official upstream `main` branch exactly:
|
||||
|
||||
```bash
|
||||
./tools/maint/apply_patches.sh --reset
|
||||
|
||||
```
|
||||
|
||||
## Traceability
|
||||
|
||||
Every time this script runs, it updates `patch_manifest.log`. This file tracks:
|
||||
|
||||
* The date of the integration.
|
||||
* The base commit SHA we started from.
|
||||
* The specific commit SHA of every PR applied.
|
||||
|
||||
**This log is essential for debugging firmware regressions.** If the hardware fails, check the manifest to identify which experimental patch might be the cause.
|
||||
|
||||
---
|
||||
|
||||
### A Note on Merge Conflicts
|
||||
|
||||
If a PR cannot be applied automatically, the script will abort the merge. You will need to:
|
||||
|
||||
1. Manually merge the PR.
|
||||
2. Resolve the conflicts in your editor.
|
||||
3. Commit the result.
|
||||
4. Manually update the `patch_manifest.log`.
|
||||
65
tools/maint/apply_patches.sh
Executable file
65
tools/maint/apply_patches.sh
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Configuration
|
||||
UPSTREAM_REMOTE="upstream"
|
||||
BASE_BRANCH="main" # Change to 'master' if that's what upstream uses
|
||||
TARGET_BRANCH="main-integrated"
|
||||
MANIFEST_FILE="tools/maint/patch_manifest.log"
|
||||
|
||||
# Function to reset the branch
|
||||
reset_to_upstream() {
|
||||
echo "Warning: This will wipe all local changes on $TARGET_BRANCH."
|
||||
read -p "Are you sure you want to reset to $UPSTREAM_REMOTE/$BASE_BRANCH? (y/n) " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
git fetch "$UPSTREAM_REMOTE"
|
||||
git checkout -B "$TARGET_BRANCH" "$UPSTREAM_REMOTE/$BASE_BRANCH"
|
||||
echo "--- Reset to Upstream: $(date) ---" > "$MANIFEST_FILE"
|
||||
echo "Base Commit: $(git rev-parse HEAD)" >> "$MANIFEST_FILE"
|
||||
echo "Reset successful. Branch is now clean."
|
||||
else
|
||||
echo "Reset aborted."
|
||||
fi
|
||||
}
|
||||
|
||||
# Check for reset flag
|
||||
if [[ "$1" == "--reset" ]]; then
|
||||
reset_to_upstream
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Standard PR application logic
|
||||
PR_IDS=("$@")
|
||||
if [ ${#PR_IDS[@]} -eq 0 ]; then
|
||||
echo "Usage:"
|
||||
echo " Apply PRs: $0 <PR_ID1> <PR_ID2> ..."
|
||||
echo " Reset: $0 --reset"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure target branch exists and is checked out
|
||||
git checkout -B "$TARGET_BRANCH"
|
||||
|
||||
echo "--- Patch Session: $(date) ---" >> "$MANIFEST_FILE"
|
||||
|
||||
for PR in "${PR_IDS[@]}"; do
|
||||
echo "--------------------------------------"
|
||||
echo "Fetching PR #$PR..."
|
||||
|
||||
if git fetch "$UPSTREAM_REMOTE" "pull/$PR/head:PR_TEMP_FETCH"; then
|
||||
if git merge PR_TEMP_FETCH --no-edit -m "Integrate upstream PR #$PR"; then
|
||||
echo "Successfully integrated PR #$PR"
|
||||
echo "PR #$PR SHA: $(git rev-parse PR_TEMP_FETCH)" >> "$MANIFEST_FILE"
|
||||
else
|
||||
echo "Conflict in PR #$PR. Aborting merge."
|
||||
git merge --abort
|
||||
exit 1
|
||||
fi
|
||||
git branch -D PR_TEMP_FETCH
|
||||
else
|
||||
echo "Error: PR #$PR not found."
|
||||
fi
|
||||
done
|
||||
|
||||
echo "--------------------------------------"
|
||||
echo "Done. See $MANIFEST_FILE for details."
|
||||
Reference in New Issue
Block a user