diff --git a/README.md b/README.md index 97890ce8..0103da77 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,11 @@ MeshCore provides the ability to create wireless mesh networks, similar to Mesht ## 🚀 How to Get Started -Flash the Firmware: Download the pre-built firmware binary for Heltec V3 and flash it using Adafruit ESPTool. -Install [PlatformIO](https://docs.platformio.org) in Visual Studio Code (optional for developers who want to modify the firmware). +Andy Kirby has published a very useful [intro video](https://www.youtube.com/watch?v=t1qne8uJBAc) which explains the steps for beginners. + +For developers, install [PlatformIO](https://docs.platformio.org) in Visual Studio Code. Download & Open the MeshCore repository. -Select a Sample Application: Choose from chat, ping, repeater, or admin test tools. +Select a Sample Application: Choose from chat, repeater, other example app. Monitor & Communicate using the Serial Monitor (e.g., Serial USB Terminal on Android). 📁 Included Example Applications @@ -36,8 +37,6 @@ Monitor & Communicate using the Serial Monitor (e.g., Serial USB Terminal on And * 📡 Simple Repeater: Extends network coverage by relaying messages. * 📡 Companion Radio: For use with an external chat app, over BLE or USB. * 📡 Room Server: A simple BBS server for shared Posts. -* 📡 Ping Client, Ping Server & Client: Basic client/server example. -* 📡 Test Admin: Monitors and manages repeaters remotely. ## 🛠 Hardware Compatibility @@ -49,6 +48,9 @@ MeshCore is designed for use with: * LilyGo T3S3 * Heltec T114 * Station G2 +* Sensecap T1000e +* Heltec V2 +* LilyGo TLora32 v1.6 ## 📜 License MeshCore is open-source software released under the MIT License. You are free to use, modify, and distribute it for personal and commercial projects. diff --git a/docs/faq.md b/docs/faq.md index a7169a0e..eb5fdf29 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -26,6 +26,7 @@ Anyone is able to build anything they like on top of MeshCore without paying any Phone Client Applications: https://meshcore.co.uk/apps.html MeshCore Fimrware Github: https://github.com/ripplebiz/MeshCore + NOTE: Andy Kirby has a very useful [intro video](https://www.youtube.com/watch?v=t1qne8uJBAc) for beginners. You need LoRa hardware devices to run MeshCore firmware as clients or server (repeater and room server). diff --git a/examples/companion_radio/main.cpp b/examples/companion_radio/main.cpp index ea5efc5e..10eca8c9 100644 --- a/examples/companion_radio/main.cpp +++ b/examples/companion_radio/main.cpp @@ -184,6 +184,7 @@ static uint32_t _atoi(const char* sp) { #define PUSH_CODE_LOGIN_SUCCESS 0x85 #define PUSH_CODE_LOGIN_FAIL 0x86 #define PUSH_CODE_STATUS_RESPONSE 0x87 +#define PUSH_CODE_LOG_RX_DATA 0x88 /* -------------------------------------------------------------------------------------- */ @@ -435,6 +436,18 @@ protected: return (int) ((pow(_prefs.rx_delay_base, 0.85f - score) - 1.0) * air_time); } + void logRxRaw(float snr, float rssi, const uint8_t raw[], int len) override { + if (_serial->isConnected()) { + int i = 0; + out_frame[i++] = PUSH_CODE_LOG_RX_DATA; + out_frame[i++] = (int8_t)(snr * 4); + out_frame[i++] = (int8_t)(rssi); + memcpy(&out_frame[i], raw, len); i += len; + + _serial->writeFrame(out_frame, i); + } + } + void onDiscoveredContact(ContactInfo& contact, bool is_new) override { if (_serial->isConnected()) { out_frame[0] = PUSH_CODE_ADVERT; diff --git a/platformio.ini b/platformio.ini index 081bd9f9..20e2802b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -422,16 +422,22 @@ build_flags = -D P_LORA_MOSI=27 ; SPI MOSI -D P_LORA_TX_LED=2 ; LED pin for TX indication -D PIN_VBAT_READ=35 ; Battery voltage reading (analog pin) + -D PIN_USER_BTN=0 -D RADIO_CLASS=CustomSX1276 -D ARDUINO_LOOP_STACK_SIZE=16384 + -D DISPLAY_CLASS=SSD1306Display -D WRAPPER_CLASS=CustomSX1276Wrapper -D LORA_TX_POWER=20 +lib_deps = + ${esp32_base.lib_deps} + adafruit/Adafruit SSD1306 @ ^2.5.13 ; === LILYGO T-LoRa V2.1-1.6 with SX1276 environments === [env:LilyGo_TLora_V2_1_1_6_Repeater] extends = LilyGo_TLora_V2_1_1_6 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - +<../examples/simple_repeater/main.cpp> + + + +<../examples/simple_repeater> build_flags = ${LilyGo_TLora_V2_1_1_6.build_flags} -D ADVERT_NAME="\"TLora-V2.1-1.6 Repeater\"" @@ -451,7 +457,8 @@ build_flags = ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> + + + +<../examples/simple_repeater> lib_deps = ${LilyGo_TLora_V2_1_1_6.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -467,7 +474,8 @@ build_flags = ; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 ; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - +<../examples/companion_radio/main.cpp> + + + +<../examples/companion_radio> lib_deps = ${LilyGo_TLora_V2_1_1_6.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -486,7 +494,8 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} + - +<../examples/companion_radio/main.cpp> + + + +<../examples/companion_radio> lib_deps = ${LilyGo_TLora_V2_1_1_6.lib_deps} densaugeo/base64 @ ~1.4.0 @@ -494,7 +503,8 @@ lib_deps = [env:LilyGo_TLora_V2_1_1_6_room_server] extends = LilyGo_TLora_V2_1_1_6 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - +<../examples/simple_room_server/main.cpp> + + + +<../examples/simple_room_server> build_flags = ${LilyGo_TLora_V2_1_1_6.build_flags} -D ADVERT_NAME="\"TLora-V2.1-1.6 Room\"" diff --git a/src/Dispatcher.cpp b/src/Dispatcher.cpp index b9da0e65..e4943254 100644 --- a/src/Dispatcher.cpp +++ b/src/Dispatcher.cpp @@ -78,9 +78,11 @@ void Dispatcher::checkRecv() { float score; uint32_t air_time; { - uint8_t raw[MAX_TRANS_UNIT]; + uint8_t raw[MAX_TRANS_UNIT+1]; int len = _radio->recvRaw(raw, MAX_TRANS_UNIT); if (len > 0) { + logRxRaw(_radio->getLastSNR(), _radio->getLastRSSI(), raw, len); + pkt = _mgr->allocNew(); if (pkt == NULL) { MESH_DEBUG_PRINTLN("%s Dispatcher::checkRecv(): WARNING: received data, no unused packets available!", getLogDateTime()); diff --git a/src/Dispatcher.h b/src/Dispatcher.h index 7d75c219..0b00f1a9 100644 --- a/src/Dispatcher.h +++ b/src/Dispatcher.h @@ -117,6 +117,8 @@ protected: virtual DispatcherAction onRecvPacket(Packet* pkt) = 0; + virtual void logRxRaw(float snr, float rssi, const uint8_t raw[], int len) { } // custom hook + virtual void logRx(Packet* packet, int len, float score) { } // hooks for custom logging virtual void logTx(Packet* packet, int len) { } virtual void logTxFail(Packet* packet, int len) { } diff --git a/src/helpers/nrf52/T1000eBoard.h b/src/helpers/nrf52/T1000eBoard.h index 14272edb..3c0f30b4 100644 --- a/src/helpers/nrf52/T1000eBoard.h +++ b/src/helpers/nrf52/T1000eBoard.h @@ -31,8 +31,13 @@ public: uint16_t getBattMilliVolts() override { #ifdef BATTERY_PIN + analogReference(AR_INTERNAL_3_0); analogReadResolution(12); float volts = (analogRead(BATTERY_PIN) * ADC_MULTIPLIER * AREF_VOLTAGE) / 4096; + + analogReference(AR_DEFAULT); // put back to default + analogReadResolution(10); + return volts * 1000; #else return 0;