Skip to content

Commit a16393e

Browse files
authored
Merge branch 'ripplebiz:dev' into dev
2 parents 9844296 + f77a694 commit a16393e

File tree

7 files changed

+46
-11
lines changed

7 files changed

+46
-11
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,18 @@ MeshCore provides the ability to create wireless mesh networks, similar to Mesht
2525

2626
## 🚀 How to Get Started
2727

28-
Flash the Firmware: Download the pre-built firmware binary for Heltec V3 and flash it using Adafruit ESPTool.
29-
Install [PlatformIO](https://docs.platformio.org) in Visual Studio Code (optional for developers who want to modify the firmware).
28+
Andy Kirby has published a very useful [intro video](https://www.youtube.com/watch?v=t1qne8uJBAc) which explains the steps for beginners.
29+
30+
For developers, install [PlatformIO](https://docs.platformio.org) in Visual Studio Code.
3031
Download & Open the MeshCore repository.
31-
Select a Sample Application: Choose from chat, ping, repeater, or admin test tools.
32+
Select a Sample Application: Choose from chat, repeater, other example app.
3233
Monitor & Communicate using the Serial Monitor (e.g., Serial USB Terminal on Android).
3334

3435
📁 Included Example Applications
3536
* 📡 Terminal Chat: Secure text communication between devices.
3637
* 📡 Simple Repeater: Extends network coverage by relaying messages.
3738
* 📡 Companion Radio: For use with an external chat app, over BLE or USB.
3839
* 📡 Room Server: A simple BBS server for shared Posts.
39-
* 📡 Ping Client, Ping Server & Client: Basic client/server example.
40-
* 📡 Test Admin: Monitors and manages repeaters remotely.
4140

4241
## 🛠 Hardware Compatibility
4342

@@ -49,6 +48,9 @@ MeshCore is designed for use with:
4948
* LilyGo T3S3
5049
* Heltec T114
5150
* Station G2
51+
* Sensecap T1000e
52+
* Heltec V2
53+
* LilyGo TLora32 v1.6
5254

5355
## 📜 License
5456
MeshCore is open-source software released under the MIT License. You are free to use, modify, and distribute it for personal and commercial projects.

docs/faq.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Anyone is able to build anything they like on top of MeshCore without paying any
2626
Phone Client Applications: https://meshcore.co.uk/apps.html
2727
MeshCore Fimrware Github: https://github.com/ripplebiz/MeshCore
2828

29+
NOTE: Andy Kirby has a very useful [intro video](https://www.youtube.com/watch?v=t1qne8uJBAc) for beginners.
2930

3031
You need LoRa hardware devices to run MeshCore firmware as clients or server (repeater and room server).
3132

examples/companion_radio/main.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ static uint32_t _atoi(const char* sp) {
184184
#define PUSH_CODE_LOGIN_SUCCESS 0x85
185185
#define PUSH_CODE_LOGIN_FAIL 0x86
186186
#define PUSH_CODE_STATUS_RESPONSE 0x87
187+
#define PUSH_CODE_LOG_RX_DATA 0x88
187188

188189
/* -------------------------------------------------------------------------------------- */
189190

@@ -435,6 +436,18 @@ class MyMesh : public BaseChatMesh {
435436
return (int) ((pow(_prefs.rx_delay_base, 0.85f - score) - 1.0) * air_time);
436437
}
437438

439+
void logRxRaw(float snr, float rssi, const uint8_t raw[], int len) override {
440+
if (_serial->isConnected()) {
441+
int i = 0;
442+
out_frame[i++] = PUSH_CODE_LOG_RX_DATA;
443+
out_frame[i++] = (int8_t)(snr * 4);
444+
out_frame[i++] = (int8_t)(rssi);
445+
memcpy(&out_frame[i], raw, len); i += len;
446+
447+
_serial->writeFrame(out_frame, i);
448+
}
449+
}
450+
438451
void onDiscoveredContact(ContactInfo& contact, bool is_new) override {
439452
if (_serial->isConnected()) {
440453
out_frame[0] = PUSH_CODE_ADVERT;

platformio.ini

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -422,16 +422,22 @@ build_flags =
422422
-D P_LORA_MOSI=27 ; SPI MOSI
423423
-D P_LORA_TX_LED=2 ; LED pin for TX indication
424424
-D PIN_VBAT_READ=35 ; Battery voltage reading (analog pin)
425+
-D PIN_USER_BTN=0
425426
-D RADIO_CLASS=CustomSX1276
426427
-D ARDUINO_LOOP_STACK_SIZE=16384
428+
-D DISPLAY_CLASS=SSD1306Display
427429
-D WRAPPER_CLASS=CustomSX1276Wrapper
428430
-D LORA_TX_POWER=20
431+
lib_deps =
432+
${esp32_base.lib_deps}
433+
adafruit/Adafruit SSD1306 @ ^2.5.13
429434

430435
; === LILYGO T-LoRa V2.1-1.6 with SX1276 environments ===
431436
[env:LilyGo_TLora_V2_1_1_6_Repeater]
432437
extends = LilyGo_TLora_V2_1_1_6
433438
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
434-
+<../examples/simple_repeater/main.cpp>
439+
+<helpers/ui/*.cpp>
440+
+<../examples/simple_repeater>
435441
build_flags =
436442
${LilyGo_TLora_V2_1_1_6.build_flags}
437443
-D ADVERT_NAME="\"TLora-V2.1-1.6 Repeater\""
@@ -451,7 +457,8 @@ build_flags =
451457
; -D MESH_PACKET_LOGGING=1
452458
; -D MESH_DEBUG=1
453459
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
454-
+<../examples/simple_secure_chat/main.cpp>
460+
+<helpers/ui/*.cpp>
461+
+<../examples/simple_repeater>
455462
lib_deps =
456463
${LilyGo_TLora_V2_1_1_6.lib_deps}
457464
densaugeo/base64 @ ~1.4.0
@@ -467,7 +474,8 @@ build_flags =
467474
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
468475
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
469476
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
470-
+<../examples/companion_radio/main.cpp>
477+
+<helpers/ui/*.cpp>
478+
+<../examples/companion_radio>
471479
lib_deps =
472480
${LilyGo_TLora_V2_1_1_6.lib_deps}
473481
densaugeo/base64 @ ~1.4.0
@@ -486,15 +494,17 @@ build_flags =
486494
; -D MESH_DEBUG=1
487495
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
488496
+<helpers/esp32/*.cpp>
489-
+<../examples/companion_radio/main.cpp>
497+
+<helpers/ui/*.cpp>
498+
+<../examples/companion_radio>
490499
lib_deps =
491500
${LilyGo_TLora_V2_1_1_6.lib_deps}
492501
densaugeo/base64 @ ~1.4.0
493502

494503
[env:LilyGo_TLora_V2_1_1_6_room_server]
495504
extends = LilyGo_TLora_V2_1_1_6
496505
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
497-
+<../examples/simple_room_server/main.cpp>
506+
+<helpers/ui/*.cpp>
507+
+<../examples/simple_room_server>
498508
build_flags =
499509
${LilyGo_TLora_V2_1_1_6.build_flags}
500510
-D ADVERT_NAME="\"TLora-V2.1-1.6 Room\""

src/Dispatcher.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ void Dispatcher::checkRecv() {
7878
float score;
7979
uint32_t air_time;
8080
{
81-
uint8_t raw[MAX_TRANS_UNIT];
81+
uint8_t raw[MAX_TRANS_UNIT+1];
8282
int len = _radio->recvRaw(raw, MAX_TRANS_UNIT);
8383
if (len > 0) {
84+
logRxRaw(_radio->getLastSNR(), _radio->getLastRSSI(), raw, len);
85+
8486
pkt = _mgr->allocNew();
8587
if (pkt == NULL) {
8688
MESH_DEBUG_PRINTLN("%s Dispatcher::checkRecv(): WARNING: received data, no unused packets available!", getLogDateTime());

src/Dispatcher.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ class Dispatcher {
117117

118118
virtual DispatcherAction onRecvPacket(Packet* pkt) = 0;
119119

120+
virtual void logRxRaw(float snr, float rssi, const uint8_t raw[], int len) { } // custom hook
121+
120122
virtual void logRx(Packet* packet, int len, float score) { } // hooks for custom logging
121123
virtual void logTx(Packet* packet, int len) { }
122124
virtual void logTxFail(Packet* packet, int len) { }

src/helpers/nrf52/T1000eBoard.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ class T1000eBoard : public mesh::MainBoard {
3131

3232
uint16_t getBattMilliVolts() override {
3333
#ifdef BATTERY_PIN
34+
analogReference(AR_INTERNAL_3_0);
3435
analogReadResolution(12);
3536
float volts = (analogRead(BATTERY_PIN) * ADC_MULTIPLIER * AREF_VOLTAGE) / 4096;
37+
38+
analogReference(AR_DEFAULT); // put back to default
39+
analogReadResolution(10);
40+
3641
return volts * 1000;
3742
#else
3843
return 0;

0 commit comments

Comments
 (0)