public builds: Czech mesh defaults (meshcore.cz wiki)
pub-release / release (push) Successful in 20m57s
pub-release / release (push) Successful in 20m57s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f7887324e5
commit
88ef08c6d5
6 files changed
+80
-1
No files matched your search
@@ -5,6 +5,10 @@
|
|||||||
# password ("password") -- change both on the node after flashing. Nothing
|
# password ("password") -- change both on the node after flashing. Nothing
|
||||||
# here carries a site's identity or real secrets.
|
# here carries a site's identity or real secrets.
|
||||||
#
|
#
|
||||||
|
# Defaults follow the Czech mesh (meshcore.cz wiki: nastaveni_site_meshcore_cz,
|
||||||
|
# instalace_repeateru, regiony), PUB_FLAGS below. They apply to a node with
|
||||||
|
# no saved settings (fresh, or after an erase); a reflash keeps what is set.
|
||||||
|
#
|
||||||
# Runs on every push to main -- the export pushes there only after an
|
# Runs on every push to main -- the export pushes there only after an
|
||||||
# upstream merge (private repo, tth-upstream-sync) -- and by hand.
|
# upstream merge (private repo, tth-upstream-sync) -- and by hand.
|
||||||
# Release tag tth-<sha8>, titled with the stamped version (v1.18.0-tth<sha>);
|
# Release tag tth-<sha8>, titled with the stamped version (v1.18.0-tth<sha>);
|
||||||
@@ -34,6 +38,13 @@ concurrency:
|
|||||||
env:
|
env:
|
||||||
GITEA: https://git.rfa.cz
|
GITEA: https://git.rfa.cz
|
||||||
KEEP: 5
|
KEEP: 5
|
||||||
|
# 869.432/62.5/SF7/CR5; repeater + room server: zero-hop advert off, flood
|
||||||
|
# advert 25 h, af 9 (= 10 % duty cycle); repeater: regions cz,cs next to *.
|
||||||
|
# Path hash 2 B is this fork's default anyway. TX power stays the board's.
|
||||||
|
PUB_FLAGS: >-
|
||||||
|
-D LORA_FREQ=869.432 -D LORA_BW=62.5 -D LORA_SF=7 -D LORA_CR=5
|
||||||
|
-D ADVERT_INTERVAL_DEFAULT=0 -D FLOOD_ADVERT_INTERVAL_DEFAULT=25
|
||||||
|
-D AIRTIME_FACTOR_DEFAULT=9.0 -D DEFAULT_REGIONS=\"cz,cs\"
|
||||||
ENVS: >-
|
ENVS: >-
|
||||||
Xiao_nrf52_repeater Xiao_nrf52_companion_radio_ble Xiao_nrf52_room_server Xiao_nrf52_sensor
|
Xiao_nrf52_repeater Xiao_nrf52_companion_radio_ble Xiao_nrf52_room_server Xiao_nrf52_sensor
|
||||||
SenseCap_Solar_repeater SenseCap_Solar_companion_radio_ble
|
SenseCap_Solar_repeater SenseCap_Solar_companion_radio_ble
|
||||||
@@ -90,6 +101,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
sha=$(git rev-parse --short=8 HEAD)
|
sha=$(git rev-parse --short=8 HEAD)
|
||||||
|
# PlatformIO appends these after each env's flags: last -D wins
|
||||||
|
export PLATFORMIO_BUILD_FLAGS="$PUB_FLAGS"
|
||||||
dist="$GITHUB_WORKSPACE/dist"
|
dist="$GITHUB_WORKSPACE/dist"
|
||||||
mkdir -p "$dist"
|
mkdir -p "$dist"
|
||||||
version=""
|
version=""
|
||||||
@@ -126,7 +139,9 @@ jobs:
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
api="$GITEA/api/v1/repos/$GITHUB_REPOSITORY"
|
api="$GITEA/api/v1/repos/$GITHUB_REPOSITORY"
|
||||||
auth="header = \"Authorization: token $TOKEN\""
|
auth="header = \"Authorization: token $TOKEN\""
|
||||||
note='BLE PIN 123456 and admin password "password" are placeholders: change them after flashing.'
|
note='BLE PIN 123456 and admin password "password" are placeholders: change them after flashing.
|
||||||
|
Czech mesh defaults (meshcore.cz): 869.432 MHz / 62.5 kHz / SF7 / CR5; repeater: zero-hop advert off,
|
||||||
|
flood advert 25 h, af 9 (10 % duty cycle), regions cz + cs. Apply to a fresh or erased node only.'
|
||||||
body=$(printf '%s\n\ncommit %s, run %s\n\n%s\nWhat this fork changes against upstream: see README.md.\n' \
|
body=$(printf '%s\n\ncommit %s, run %s\n\n%s\nWhat this fork changes against upstream: see README.md.\n' \
|
||||||
"$VERSION" "$SHA" "$GITHUB_RUN_NUMBER" "$note")
|
"$VERSION" "$SHA" "$GITHUB_RUN_NUMBER" "$note")
|
||||||
jq -n --arg t "$TAG" --arg c "$SHA" --arg n "$VERSION" --arg b "$body" \
|
jq -n --arg t "$TAG" --arg c "$SHA" --arg n "$VERSION" --arg b "$body" \
|
||||||
|
|||||||
@@ -70,6 +70,23 @@ twice a day; everything below is on top of that. Our code is marked
|
|||||||
* Companion: `gps duty` persists, key export / PIN gated on an unauthenticated
|
* Companion: `gps duty` persists, key export / PIN gated on an unauthenticated
|
||||||
USB link, bounded build-date copy. KISS modem: off-by-one in the name clamp.
|
USB link, bounded build-date copy. KISS modem: off-by-one in the name clamp.
|
||||||
|
|
||||||
|
### Public builds: Czech mesh defaults
|
||||||
|
|
||||||
|
Releases built from this repository (`pub-release`) come preset for the
|
||||||
|
Czech mesh, following the [meshcore.cz](https://meshcore.cz/) wiki, so a
|
||||||
|
freshly flashed node does not need the usual round of settings:
|
||||||
|
|
||||||
|
* radio 869.432 MHz / 62.5 kHz / SF7 / CR5 (all builds);
|
||||||
|
* repeater and room server: zero-hop advert off, flood advert every 25 h,
|
||||||
|
`af 9` (10 % duty cycle);
|
||||||
|
* repeater: regions `cz` and `cs` next to `*` -- add your own `cz-<kraj>`
|
||||||
|
with `region put cz-xxx cz` + `region save`;
|
||||||
|
* 2-byte path hashes (this fork's default).
|
||||||
|
|
||||||
|
They apply only to a node with no saved settings (new, or after an erase):
|
||||||
|
a reflash keeps whatever the node already has, and regions you removed and
|
||||||
|
saved stay removed. Set a name, an admin password and the BLE PIN yourself.
|
||||||
|
|
||||||
### Build
|
### Build
|
||||||
|
|
||||||
* Version stamping in every nRF52 env (`v1.18.0-tth<sha>`, `+` = dirty tree),
|
* Version stamping in every nRF52 env (`v1.18.0-tth<sha>`, `+` = dirty tree),
|
||||||
|
|||||||
@@ -1344,6 +1344,9 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc
|
|||||||
|
|
||||||
// defaults
|
// defaults
|
||||||
_prefs.airtime_factor = 1.0;
|
_prefs.airtime_factor = 1.0;
|
||||||
|
#ifdef AIRTIME_FACTOR_DEFAULT // CUSTOM (TeTeHacko): e.g. 9 = 10 % duty cycle (meshcore.cz)
|
||||||
|
_prefs.airtime_factor = AIRTIME_FACTOR_DEFAULT;
|
||||||
|
#endif
|
||||||
_prefs.rx_delay_base = 0.0f; // turn off by default, was 10.0;
|
_prefs.rx_delay_base = 0.0f; // turn off by default, was 10.0;
|
||||||
_prefs.tx_delay_factor = 0.5f; // was 0.25f
|
_prefs.tx_delay_factor = 0.5f; // was 0.25f
|
||||||
_prefs.direct_tx_delay_factor = 0.3f; // was 0.2
|
_prefs.direct_tx_delay_factor = 0.3f; // was 0.2
|
||||||
@@ -1463,7 +1466,18 @@ void MyMesh::begin(FILESYSTEM *fs) {
|
|||||||
next_fair_sender_low_refill = futureMillis(fairAdvertRefillMs());
|
next_fair_sender_low_refill = futureMillis(fairAdvertRefillMs());
|
||||||
next_fair_group_refill = futureMillis(fairGroupRefillMs());
|
next_fair_group_refill = futureMillis(fairGroupRefillMs());
|
||||||
// TODO: key_store.begin();
|
// TODO: key_store.begin();
|
||||||
|
#ifdef DEFAULT_REGIONS
|
||||||
|
// CUSTOM (TeTeHacko): a node that never saved regions gets DEFAULT_REGIONS
|
||||||
|
// (e.g. "cz,cs", meshcore.cz/regiony) -- as if `region put` each + `region
|
||||||
|
// save`. Once /regions2 exists the operator's list wins, removals included.
|
||||||
|
bool regions_saved = _fs->exists("/regions2");
|
||||||
|
#endif
|
||||||
region_map.load(_fs);
|
region_map.load(_fs);
|
||||||
|
#ifdef DEFAULT_REGIONS
|
||||||
|
if (!regions_saved && region_map.putDefaults(DEFAULT_REGIONS) > 0) {
|
||||||
|
region_map.save(_fs);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// establish default-scope
|
// establish default-scope
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -646,6 +646,9 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc
|
|||||||
|
|
||||||
// defaults
|
// defaults
|
||||||
_prefs.airtime_factor = 1.0;
|
_prefs.airtime_factor = 1.0;
|
||||||
|
#ifdef AIRTIME_FACTOR_DEFAULT // CUSTOM (TeTeHacko): e.g. 9 = 10 % duty cycle (meshcore.cz)
|
||||||
|
_prefs.airtime_factor = AIRTIME_FACTOR_DEFAULT;
|
||||||
|
#endif
|
||||||
_prefs.rx_delay_base = 0.0f; // off by default, was 10.0
|
_prefs.rx_delay_base = 0.0f; // off by default, was 10.0
|
||||||
_prefs.tx_delay_factor = 0.5f; // was 0.25f;
|
_prefs.tx_delay_factor = 0.5f; // was 0.25f;
|
||||||
_prefs.direct_tx_delay_factor = 0.2f; // was zero
|
_prefs.direct_tx_delay_factor = 0.2f; // was zero
|
||||||
@@ -661,6 +664,12 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc
|
|||||||
_prefs.disable_fwd = 1;
|
_prefs.disable_fwd = 1;
|
||||||
_prefs.advert_interval = 1; // default to 2 minutes for NEW installs
|
_prefs.advert_interval = 1; // default to 2 minutes for NEW installs
|
||||||
_prefs.flood_advert_interval = 47; // 47 hours
|
_prefs.flood_advert_interval = 47; // 47 hours
|
||||||
|
#ifdef ADVERT_INTERVAL_DEFAULT // CUSTOM (TeTeHacko): same knobs as simple_repeater
|
||||||
|
_prefs.advert_interval = ADVERT_INTERVAL_DEFAULT;
|
||||||
|
#endif
|
||||||
|
#ifdef FLOOD_ADVERT_INTERVAL_DEFAULT
|
||||||
|
_prefs.flood_advert_interval = FLOOD_ADVERT_INTERVAL_DEFAULT;
|
||||||
|
#endif
|
||||||
_prefs.flood_max = 64;
|
_prefs.flood_max = 64;
|
||||||
_prefs.flood_max_unscoped = 64;
|
_prefs.flood_max_unscoped = 64;
|
||||||
_prefs.flood_max_advert = 8;
|
_prefs.flood_max_advert = 8;
|
||||||
|
|||||||
@@ -280,6 +280,27 @@ bool RegionMap::removeRegion(const RegionEntry& region) {
|
|||||||
return true; // success
|
return true; // success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int RegionMap::putDefaults(const char* csv) {
|
||||||
|
int n = 0;
|
||||||
|
char name[sizeof(regions[0].name)];
|
||||||
|
while (csv && *csv) {
|
||||||
|
int len = 0;
|
||||||
|
while (csv[len] && csv[len] != ',') len++;
|
||||||
|
if (len > 0 && len < (int)sizeof(name)) {
|
||||||
|
memcpy(name, csv, len);
|
||||||
|
name[len] = 0;
|
||||||
|
auto r = putRegion(name, wildcard.id);
|
||||||
|
if (r) {
|
||||||
|
r->flags = 0; // flood allowed, same as `region put`
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
csv += len;
|
||||||
|
if (*csv == ',') csv++;
|
||||||
|
}
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
bool RegionMap::clear() {
|
bool RegionMap::clear() {
|
||||||
num_regions = 0;
|
num_regions = 0;
|
||||||
return true; // success
|
return true; // success
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ public:
|
|||||||
void setDefaultRegion(const RegionEntry* def);
|
void setDefaultRegion(const RegionEntry* def);
|
||||||
bool removeRegion(const RegionEntry& region);
|
bool removeRegion(const RegionEntry& region);
|
||||||
bool clear();
|
bool clear();
|
||||||
|
// CUSTOM (TeTeHacko): `region put <name>` for each name of a comma-separated
|
||||||
|
// list (flood allowed, parent = wildcard). Returns how many it put.
|
||||||
|
int putDefaults(const char* csv);
|
||||||
void resetFrom(const RegionMap& src) { num_regions = 0; next_id = src.next_id; }
|
void resetFrom(const RegionMap& src) { num_regions = 0; next_id = src.next_id; }
|
||||||
int getCount() const { return num_regions; }
|
int getCount() const { return num_regions; }
|
||||||
const RegionEntry* getByIdx(int i) const { return ®ions[i]; }
|
const RegionEntry* getByIdx(int i) const { return ®ions[i]; }
|
||||||
|
|||||||
Reference in new issue
Block a user