Skip to content

Commit 7bec45b

Browse files
author
Scott Powell
committed
Merge branch 'dev' into double-acks
2 parents f792011 + 58f4db1 commit 7bec45b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2683
-176
lines changed

boards/minewsemi_me25ls01.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "nrf52840_s140_v7.ld"
5+
},
6+
"core": "nRF5",
7+
"cpu": "cortex-m4",
8+
"extra_flags": "-DARDUINO_WIO_WM1110 -DNRF52840_XXAA",
9+
"f_cpu": "64000000L",
10+
"hwids": [
11+
["0x239A", "0x8029"],
12+
["0x239A", "0x0029"],
13+
["0x239A", "0x002A"],
14+
["0x239A", "0x802A"]
15+
],
16+
"usb_product": "me25ls01-BOOT",
17+
"mcu": "nrf52840",
18+
"variant": "minewsemi_me25ls01",
19+
"bsp": {
20+
"name": "adafruit"
21+
},
22+
"softdevice": {
23+
"sd_flags": "-DS140",
24+
"sd_name": "s140",
25+
"sd_version": "7.3.0",
26+
"sd_fwid": "0x0123"
27+
},
28+
"bootloader": {
29+
"settings_addr": "0xFF000"
30+
}
31+
},
32+
"connectivity": ["bluetooth"],
33+
"debug": {
34+
"jlink_device": "nRF52840_xxAA",
35+
"svd_path": "nrf52840.svd",
36+
"openocd_target": "nrf52.cfg"
37+
},
38+
"frameworks": ["arduino"],
39+
"name": "Minewsemi ME25LS01",
40+
"upload": {
41+
"maximum_ram_size": 248832,
42+
"maximum_size": 815104,
43+
"speed": 115200,
44+
"protocol": "nrfutil",
45+
"protocols": [
46+
"jlink",
47+
"nrfjprog",
48+
"nrfutil",
49+
"stlink",
50+
"cmsis-dap",
51+
"blackmagic"
52+
],
53+
"use_1200bps_touch": true,
54+
"require_upload_port": true,
55+
"wait_for_upload_port": true
56+
},
57+
"url": "https://en.minewsemi.com/lora-module/lr1110-nrf52840-me25LS01",
58+
"vendor": "MINEWSEMI"
59+
}

boards/seeed_sensecap_solar.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "nrf52840_s140_v7.ld"
5+
},
6+
"core": "nRF5",
7+
"cpu": "cortex-m4",
8+
"extra_flags": "-DARDUINO_Seeed_XIAO_nRF52840 -DNRF52840_XXAA -DSEEED_XIAO_NRF52840 ",
9+
"f_cpu": "64000000L",
10+
"hwids": [
11+
[ "0x2886", "0x0059" ]
12+
],
13+
"mcu": "nrf52840",
14+
"variant": "Seeed_XIAO_nRF52840",
15+
"softdevice": {
16+
"sd_flags": "-DS140",
17+
"sd_name": "s140",
18+
"sd_version": "7.3.0",
19+
"sd_fwid": "0x0123"
20+
},
21+
"bsp": {
22+
"name": "adafruit"
23+
},
24+
"bootloader": {
25+
"settings_addr": "0xFF000"
26+
},
27+
"usb_product": "XIAO nRF52840"
28+
},
29+
"connectivity": [
30+
"bluetooth"
31+
],
32+
"debug": {
33+
"jlink_device": "nRF52840_xxAA",
34+
"openocd_target": "nrf52.cfg",
35+
"svd_path": "nrf52840.svd"
36+
},
37+
"frameworks": [
38+
"arduino"
39+
],
40+
"name": "Seeed Studio XIAO nRF52840",
41+
"upload": {
42+
"maximum_ram_size": 248832,
43+
"maximum_size": 815104,
44+
"protocol": "nrfutil",
45+
"speed": 115200,
46+
"protocols": [
47+
"jlink",
48+
"nrfjprog",
49+
"nrfutil",
50+
"cmsis-dap",
51+
"sam-ba",
52+
"blackmagic"
53+
],
54+
"use_1200bps_touch": true,
55+
"require_upload_port": true,
56+
"wait_for_upload_port": true
57+
},
58+
"url": "https://wiki.seeedstudio.com/meshtastic_solar_node/",
59+
"vendor": "Seeed Studio"
60+
}

examples/companion_radio/MyMesh.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,17 @@ void MyMesh::queueMessage(const ContactInfo &from, uint8_t txt_type, mesh::Packe
319319
uint8_t frame[1];
320320
frame[0] = PUSH_CODE_MSG_WAITING; // send push 'tickle'
321321
_serial->writeFrame(frame, 1);
322-
} else {
323-
#ifdef DISPLAY_CLASS
324-
ui_task.soundBuzzer(UIEventType::contactMessage);
325-
#endif
326322
}
323+
327324
#ifdef DISPLAY_CLASS
328-
ui_task.newMsg(path_len, from.name, text, offline_queue_len);
325+
// we only want to show text messages on display, not cli data
326+
bool should_display = txt_type == TXT_TYPE_PLAIN || txt_type == TXT_TYPE_SIGNED_PLAIN;
327+
if (should_display) {
328+
ui_task.newMsg(path_len, from.name, text, offline_queue_len);
329+
if (!_serial->isConnected()) {
330+
ui_task.soundBuzzer(UIEventType::contactMessage);
331+
}
332+
}
329333
#endif
330334
}
331335

@@ -613,10 +617,10 @@ void MyMesh::begin(bool has_display) {
613617
_prefs.cr = constrain(_prefs.cr, 5, 8);
614618
_prefs.tx_power_dbm = constrain(_prefs.tx_power_dbm, 1, MAX_LORA_TX_POWER);
615619

616-
#ifdef BLE_PIN_CODE
620+
#ifdef BLE_PIN_CODE // 123456 by default
617621
if (_prefs.ble_pin == 0) {
618622
#ifdef DISPLAY_CLASS
619-
if (has_display) {
623+
if (has_display && BLE_PIN_CODE == 123456) {
620624
StdRNG rng;
621625
_active_ble_pin = rng.nextInt(100000, 999999); // random pin each session
622626
} else {

examples/companion_radio/MyMesh.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
#define FIRMWARE_VER_CODE 6
1111

1212
#ifndef FIRMWARE_BUILD_DATE
13-
#define FIRMWARE_BUILD_DATE "29 Jun 2025"
13+
#define FIRMWARE_BUILD_DATE "2 Jul 2025"
1414
#endif
1515

1616
#ifndef FIRMWARE_VERSION
17-
#define FIRMWARE_VERSION "v1.7.1"
17+
#define FIRMWARE_VERSION "v1.7.2"
1818
#endif
1919

2020
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)

examples/simple_repeater/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
/* ------------------------------ Config -------------------------------- */
2323

2424
#ifndef FIRMWARE_BUILD_DATE
25-
#define FIRMWARE_BUILD_DATE "29 Jun 2025"
25+
#define FIRMWARE_BUILD_DATE "2 Jul 2025"
2626
#endif
2727

2828
#ifndef FIRMWARE_VERSION
29-
#define FIRMWARE_VERSION "v1.7.1"
29+
#define FIRMWARE_VERSION "v1.7.2"
3030
#endif
3131

3232
#ifndef LORA_FREQ

examples/simple_room_server/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
/* ------------------------------ Config -------------------------------- */
2323

2424
#ifndef FIRMWARE_BUILD_DATE
25-
#define FIRMWARE_BUILD_DATE "29 Jun 2025"
25+
#define FIRMWARE_BUILD_DATE "2 Jul 2025"
2626
#endif
2727

2828
#ifndef FIRMWARE_VERSION
29-
#define FIRMWARE_VERSION "v1.7.1"
29+
#define FIRMWARE_VERSION "v1.7.2"
3030
#endif
3131

3232
#ifndef LORA_FREQ

platformio.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ build_flags = -w -DNDEBUG -DRADIOLIB_STATIC_ONLY=1 -DRADIOLIB_GODMODE=1
2929
-D LORA_SF=11
3030
-D ENABLE_PRIVATE_KEY_IMPORT=1 ; NOTE: comment these out for more secure firmware
3131
-D ENABLE_PRIVATE_KEY_EXPORT=1
32+
-D RADIOLIB_EXCLUDE_CC1101=1
33+
-D RADIOLIB_EXCLUDE_RF69=1
34+
-D RADIOLIB_EXCLUDE_SX1231=1
35+
-D RADIOLIB_EXCLUDE_SI443X=1
36+
-D RADIOLIB_EXCLUDE_RFM2X=1
37+
-D RADIOLIB_EXCLUDE_SX128X=1
38+
-D RADIOLIB_EXCLUDE_AFSK=1
39+
-D RADIOLIB_EXCLUDE_AX25=1
40+
-D RADIOLIB_EXCLUDE_HELLSCHREIBER=1
41+
-D RADIOLIB_EXCLUDE_MORSE=1
42+
-D RADIOLIB_EXCLUDE_APRS=1
43+
-D RADIOLIB_EXCLUDE_BELL=1
44+
-D RADIOLIB_EXCLUDE_RTTY=1
45+
-D RADIOLIB_EXCLUDE_SSTV=1
3246
build_src_filter =
3347
+<*.cpp>
3448
+<helpers/*.cpp>

src/Mesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ DispatcherAction Mesh::onRecvPacket(Packet* pkt) {
136136
int k = 0;
137137
uint8_t path_len = data[k++];
138138
uint8_t* path = &data[k]; k += path_len;
139-
uint8_t extra_type = data[k++];
139+
uint8_t extra_type = data[k++] & 0x0F; // upper 4 bits reserved for future use
140140
uint8_t* extra = &data[k];
141141
uint8_t extra_len = len - k; // remainder of packet (may be padded with zeroes!)
142142
if (onPeerPathRecv(pkt, j, secret, path, path_len, extra_type, extra, extra_len)) {

src/helpers/CustomLR1110.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,59 @@ class CustomLR1110 : public LR1110 {
99
public:
1010
CustomLR1110(Module *mod) : LR1110(mod) { }
1111

12+
RadioLibTime_t getTimeOnAir(size_t len) override {
13+
// calculate number of symbols
14+
float N_symbol = 0;
15+
if(this->codingRate <= RADIOLIB_LR11X0_LORA_CR_4_8_SHORT) {
16+
// legacy coding rate - nice and simple
17+
// get SF coefficients
18+
float coeff1 = 0;
19+
int16_t coeff2 = 0;
20+
int16_t coeff3 = 0;
21+
if(this->spreadingFactor < 7) {
22+
// SF5, SF6
23+
coeff1 = 6.25;
24+
coeff2 = 4*this->spreadingFactor;
25+
coeff3 = 4*this->spreadingFactor;
26+
} else if(this->spreadingFactor < 11) {
27+
// SF7. SF8, SF9, SF10
28+
coeff1 = 4.25;
29+
coeff2 = 4*this->spreadingFactor + 8;
30+
coeff3 = 4*this->spreadingFactor;
31+
} else {
32+
// SF11, SF12
33+
coeff1 = 4.25;
34+
coeff2 = 4*this->spreadingFactor + 8;
35+
coeff3 = 4*(this->spreadingFactor - 2);
36+
}
37+
38+
// get CRC length
39+
int16_t N_bitCRC = 16;
40+
if(this->crcTypeLoRa == RADIOLIB_LR11X0_LORA_CRC_DISABLED) {
41+
N_bitCRC = 0;
42+
}
43+
44+
// get header length
45+
int16_t N_symbolHeader = 20;
46+
if(this->headerType == RADIOLIB_LR11X0_LORA_HEADER_IMPLICIT) {
47+
N_symbolHeader = 0;
48+
}
49+
50+
// calculate number of LoRa preamble symbols - NO! Lora preamble is already in symbols
51+
// uint32_t N_symbolPreamble = (this->preambleLengthLoRa & 0x0F) * (uint32_t(1) << ((this->preambleLengthLoRa & 0xF0) >> 4));
52+
53+
// calculate the number of symbols - nope
54+
// N_symbol = (float)N_symbolPreamble + coeff1 + 8.0f + ceilf((float)RADIOLIB_MAX((int16_t)(8 * len + N_bitCRC - coeff2 + N_symbolHeader), (int16_t)0) / (float)coeff3) * (float)(this->codingRate + 4);
55+
// calculate the number of symbols - using only preamblelora because it's already in symbols
56+
N_symbol = (float)preambleLengthLoRa + coeff1 + 8.0f + ceilf((float)RADIOLIB_MAX((int16_t)(8 * len + N_bitCRC - coeff2 + N_symbolHeader), (int16_t)0) / (float)coeff3) * (float)(this->codingRate + 4);
57+
} else {
58+
// long interleaving - not needed for this modem
59+
}
60+
61+
// get time-on-air in us
62+
return(((uint32_t(1) << this->spreadingFactor) / this->bandwidthKhz) * N_symbol * 1000.0f);
63+
}
64+
1265
bool isReceiving() {
1366
uint16_t irq = getIrqStatus();
1467
bool detected = ((irq & LR1110_IRQ_HEADER_VALID) || (irq & LR1110_IRQ_HAS_PREAMBLE));

src/helpers/CustomLR1110Wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CustomLR1110Wrapper : public RadioLibWrapper {
1717

1818
void onSendFinished() override {
1919
RadioLibWrapper::onSendFinished();
20-
_radio->setPreambleLength(8); // overcomes weird issues with small and big pkts
20+
_radio->setPreambleLength(16); // overcomes weird issues with small and big pkts
2121
}
2222

2323
float getLastRSSI() const override { return ((CustomLR1110 *)_radio)->getRSSI(); }

0 commit comments

Comments
 (0)