Skip to content

Commit 2536fa6

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into dev
2 parents 951d2df + 3ef2aa6 commit 2536fa6

File tree

82 files changed

+5209
-2053
lines changed

Some content is hidden

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

82 files changed

+5209
-2053
lines changed

boards/nrf52840_s140_v6_extrafs.ld

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* Linker script to configure memory regions. */
2+
3+
SEARCH_DIR(.)
4+
GROUP(-lgcc -lc -lnosys)
5+
6+
MEMORY
7+
{
8+
FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xD4000 - 0x26000
9+
10+
/* SRAM required by Softdevice depend on
11+
* - Attribute Table Size (Number of Services and Characteristics)
12+
* - Vendor UUID count
13+
* - Max ATT MTU
14+
* - Concurrent connection peripheral + central + secure links
15+
* - Event Len, HVN queue, Write CMD queue
16+
*/
17+
RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000
18+
}
19+
20+
SECTIONS
21+
{
22+
. = ALIGN(4);
23+
.svc_data :
24+
{
25+
PROVIDE(__start_svc_data = .);
26+
KEEP(*(.svc_data))
27+
PROVIDE(__stop_svc_data = .);
28+
} > RAM
29+
30+
.fs_data :
31+
{
32+
PROVIDE(__start_fs_data = .);
33+
KEEP(*(.fs_data))
34+
PROVIDE(__stop_fs_data = .);
35+
} > RAM
36+
} INSERT AFTER .data;
37+
38+
INCLUDE "nrf52_common.ld"

boards/nrf52840_s140_v7_extrafs.ld

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* Linker script to configure memory regions. */
2+
3+
SEARCH_DIR(.)
4+
GROUP(-lgcc -lc -lnosys)
5+
6+
MEMORY
7+
{
8+
FLASH (rx) : ORIGIN = 0x27000, LENGTH = 0xD4000 - 0x27000
9+
10+
/* SRAM required by Softdevice depend on
11+
* - Attribute Table Size (Number of Services and Characteristics)
12+
* - Vendor UUID count
13+
* - Max ATT MTU
14+
* - Concurrent connection peripheral + central + secure links
15+
* - Event Len, HVN queue, Write CMD queue
16+
*/
17+
RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000
18+
}
19+
20+
SECTIONS
21+
{
22+
. = ALIGN(4);
23+
.svc_data :
24+
{
25+
PROVIDE(__start_svc_data = .);
26+
KEEP(*(.svc_data))
27+
PROVIDE(__stop_svc_data = .);
28+
} > RAM
29+
30+
.fs_data :
31+
{
32+
PROVIDE(__start_fs_data = .);
33+
KEEP(*(.fs_data))
34+
PROVIDE(__stop_fs_data = .);
35+
} > RAM
36+
} INSERT AFTER .data;
37+
38+
INCLUDE "nrf52_common.ld"

docs/faq.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ author: https://github.com/LitBomb<!-- omit from toc -->
6363
- [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)
6464
- [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)
6565
- [6.3. Q: How to connect to a repeater via BLE (Bluetooth)?](#63-q-how-to-connect-to-a-repeater-via-ble-bluetooth)
66-
- [6.4. 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)
67-
- [6.5. 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)
68-
- [6.6. 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)
69-
- [6.7. Q: WebFlasher fails on Linux with failed to open](#67-q-webflasher-fails-on-linux-with-failed-to-open)
66+
- [6.4. Q: My companion isn't showing up over Bluetooth?](#64-q-my-companion-isnt-showing-up-over-bluetooth)
67+
- [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)
68+
- [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)
69+
- [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)
70+
- [6.8. Q: WebFlasher fails on Linux with failed to open](#67-q-webflasher-fails-on-linux-with-failed-to-open)
7071
- [7. Other Questions:](#7-other-questions)
7172
- [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)
7273
- [7.2 Q: How to update ESP32-based devices over the air?](#72-q-how-to-update-esp32-based-devices-over-the-air)
@@ -563,15 +564,19 @@ You can get the epoch time on <https://www.epochconverter.com/> and use it to se
563564
### 6.3. Q: How to connect to a repeater via BLE (Bluetooth)?
564565
**A:** You can't connect to a device running repeater firmware via Bluetooth. Devices running the BLE companion firmware you can connect to it via Bluetooth using the android app
565566

566-
### 6.4. Q: I can't connect via Bluetooth, what is the Bluetooth pairing code?
567+
### 6.4. Q: My companion isn't showing up over Bluetooth?
568+
569+
**A:** make sure that you flashed the Bluetooth companion firmware and not the USB-only companion firmware.
570+
571+
### 6.5. Q: I can't connect via Bluetooth, what is the Bluetooth pairing code?
567572

568573
**A:** the default Bluetooth pairing code is `123456`
569574

570-
### 6.5. Q: My Heltec V3 keeps disconnecting from my smartphone. It can't hold a solid Bluetooth connection.
575+
### 6.6. Q: My Heltec V3 keeps disconnecting from my smartphone. It can't hold a solid Bluetooth connection.
571576

572577
**A:** Heltec V3 has a very small coil antenna on its PCB for Wi-Fi and Bluetooth connectivity. It has a very short range, only a few feet. It is possible to remove the coil antenna and replace it with a 31mm wire. The BT range is much improved with the modification.
573578

574-
### 6.6. Q: My RAK/T1000-E/xiao_nRF52 device seems to be corrupted, how do I wipe it clean to start fresh?
579+
### 6.7. Q: My RAK/T1000-E/xiao_nRF52 device seems to be corrupted, how do I wipe it clean to start fresh?
575580

576581
**A:**
577582
1. Connect USB-C cable to your device, per your device's instruction, get it to flash mode:
@@ -591,8 +596,7 @@ You can get the epoch time on <https://www.epochconverter.com/> and use it to se
591596

592597
Separately, starting in firmware version 1.7.0, there is a CLI Rescue mode. If your device has a user button (e.g. some RAK, T114), you can activate the rescue mode by hold down the user button of the device within 8 seconds of boot. Then you can use the 'Console' on flasher.meshcore.co.uk
593598

594-
595-
### 6.7. Q: WebFlasher fails on Linux with failed to open
599+
### 6.8. Q: WebFlasher fails on Linux with failed to open
596600

597601
**A:** If the usb port doesn't have the right ownership for this task, the process fails with the following error:
598602
`NetworkError: Failed to execute 'open' on 'SerialPort': Failed to open serial port.`

examples/companion_radio/ui-new/UITask.cpp

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ class HomeScreen : public UIScreen {
7575
RADIO,
7676
BLUETOOTH,
7777
ADVERT,
78+
#if UI_SENSORS_PAGE == 1
79+
SENSORS,
80+
#endif
7881
SHUTDOWN,
7982
Count // keep as last
8083
};
@@ -113,9 +116,37 @@ class HomeScreen : public UIScreen {
113116
display.fillRect(iconX + 2, iconY + 2, fillWidth, iconHeight - 4);
114117
}
115118

119+
CayenneLPP sensors_lpp;
120+
int sensors_nb = 0;
121+
bool sensors_scroll = false;
122+
int sensors_scroll_offset = 0;
123+
int next_sensors_refresh = 0;
124+
125+
void refresh_sensors() {
126+
if (millis() > next_sensors_refresh) {
127+
sensors_lpp.reset();
128+
sensors_nb = 0;
129+
sensors_lpp.addVoltage(TELEM_CHANNEL_SELF, (float)board.getBattMilliVolts() / 1000.0f);
130+
sensors.querySensors(0xFF, sensors_lpp);
131+
LPPReader reader (sensors_lpp.getBuffer(), sensors_lpp.getSize());
132+
uint8_t channel, type;
133+
while(reader.readHeader(channel, type)) {
134+
reader.skipData(type);
135+
sensors_nb ++;
136+
}
137+
sensors_scroll = sensors_nb > UI_RECENT_LIST_SIZE;
138+
#if AUTO_OFF_MILLIS > 0
139+
next_sensors_refresh = millis() + 5000; // refresh sensor values every 5 sec
140+
#else
141+
next_sensors_refresh = millis() + 60000; // refresh sensor values every 1 min
142+
#endif
143+
}
144+
}
145+
116146
public:
117147
HomeScreen(UITask* task, mesh::RTCClock* rtc, SensorManager* sensors, NodePrefs* node_prefs)
118-
: _task(task), _rtc(rtc), _sensors(sensors), _node_prefs(node_prefs), _page(0), _shutdown_init(false) { }
148+
: _task(task), _rtc(rtc), _sensors(sensors), _node_prefs(node_prefs), _page(0),
149+
_shutdown_init(false), sensors_lpp(200) { }
119150

120151
void poll() override {
121152
if (_shutdown_init && !_task->isButtonPressed()) { // must wait for USR button to be released
@@ -211,6 +242,78 @@ class HomeScreen : public UIScreen {
211242
display.setColor(DisplayDriver::GREEN);
212243
display.drawXbm((display.width() - 32) / 2, 18, advert_icon, 32, 32);
213244
display.drawTextCentered(display.width() / 2, 64 - 11, "advert: " PRESS_LABEL);
245+
#if UI_SENSORS_PAGE == 1
246+
} else if (_page == HomePage::SENSORS) {
247+
int y = 18;
248+
refresh_sensors();
249+
char buf[30];
250+
char name[30];
251+
LPPReader r(sensors_lpp.getBuffer(), sensors_lpp.getSize());
252+
253+
for (int i = 0; i < sensors_scroll_offset; i++) {
254+
uint8_t channel, type;
255+
r.readHeader(channel, type);
256+
r.skipData(type);
257+
}
258+
259+
for (int i = 0; i < (sensors_scroll?UI_RECENT_LIST_SIZE:sensors_nb); i++) {
260+
uint8_t channel, type;
261+
if (!r.readHeader(channel, type)) { // reached end, reset
262+
r.reset();
263+
r.readHeader(channel, type);
264+
}
265+
266+
display.setCursor(0, y);
267+
float v;
268+
switch (type) {
269+
case LPP_GPS: // GPS
270+
float lat, lon, alt;
271+
r.readGPS(lat, lon, alt);
272+
strcpy(name, "gps"); sprintf(buf, "%.4f %.4f", lat, lon);
273+
break;
274+
case LPP_VOLTAGE:
275+
r.readVoltage(v);
276+
strcpy(name, "voltage"); sprintf(buf, "%6.2f", v);
277+
break;
278+
case LPP_CURRENT:
279+
r.readCurrent(v);
280+
strcpy(name, "current"); sprintf(buf, "%.3f", v);
281+
break;
282+
case LPP_TEMPERATURE:
283+
r.readTemperature(v);
284+
strcpy(name, "temperature"); sprintf(buf, "%.2f", v);
285+
break;
286+
case LPP_RELATIVE_HUMIDITY:
287+
r.readRelativeHumidity(v);
288+
strcpy(name, "humidity"); sprintf(buf, "%.2f", v);
289+
break;
290+
case LPP_BAROMETRIC_PRESSURE:
291+
r.readPressure(v);
292+
strcpy(name, "pressure"); sprintf(buf, "%.2f", v);
293+
break;
294+
case LPP_ALTITUDE:
295+
r.readAltitude(v);
296+
strcpy(name, "altitude"); sprintf(buf, "%.0f", v);
297+
break;
298+
case LPP_POWER:
299+
r.readPower(v);
300+
strcpy(name, "power"); sprintf(buf, "%6.2f", v);
301+
break;
302+
default:
303+
r.skipData(type);
304+
strcpy(name, "unk"); sprintf(buf, "");
305+
}
306+
display.setCursor(0, y);
307+
display.print(name);
308+
display.setCursor(
309+
display.width()-display.getTextWidth(buf)-1, y
310+
);
311+
display.print(buf);
312+
y = y + 12;
313+
}
314+
if (sensors_scroll) sensors_scroll_offset = (sensors_scroll_offset+1)%sensors_nb;
315+
else sensors_scroll_offset = 0;
316+
#endif
214317
} else if (_page == HomePage::SHUTDOWN) {
215318
display.setColor(DisplayDriver::GREEN);
216319
display.setTextSize(1);
@@ -255,6 +358,13 @@ class HomeScreen : public UIScreen {
255358
}
256359
return true;
257360
}
361+
#if UI_SENSORS_PAGE == 1
362+
if (c == KEY_ENTER && _page == HomePage::SENSORS) {
363+
_task->toggleGPS();
364+
next_sensors_refresh=0;
365+
return true;
366+
}
367+
#endif
258368
if (c == KEY_ENTER && _page == HomePage::SHUTDOWN) {
259369
_shutdown_init = true; // need to wait for button to be released
260370
return true;

examples/companion_radio/ui-new/UITask.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <helpers/SensorManager.h>
77
#include <helpers/BaseSerialInterface.h>
88
#include <Arduino.h>
9+
#include <helpers/sensors/LPPDataHelpers.h>
910

1011
#ifdef PIN_BUZZER
1112
#include <helpers/ui/buzzer.h>

0 commit comments

Comments
 (0)