Merge pull request #703 from mc-hamster/master

#701, #697 - Bug fix and update to debug output.
1.2-legacy
Jm Casler 2021-02-20 00:53:07 -08:00 zatwierdzone przez GitHub
commit f41d79d586
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
5 zmienionych plików z 21 dodań i 12 usunięć

Wyświetl plik

@ -29,6 +29,12 @@ UC 4) support for a mesh to have multiple routers that have the store & forward
UC 5) Support for "long term" delayed messages and "short term" delayed messages. Handle the cases slightly different to improve user expierence. A short term delayed message would be a message that was resent becaue a node was not heard from for <5 minutes. A long term delayed message is a message that has not been delivered in >5 minutes. UC 5) Support for "long term" delayed messages and "short term" delayed messages. Handle the cases slightly different to improve user expierence. A short term delayed message would be a message that was resent becaue a node was not heard from for <5 minutes. A long term delayed message is a message that has not been delivered in >5 minutes.
UC 6) Eventually we could add a "want_store_and_forward" bit to MeshPacket and that could be nicer than whitelists in this plugin. Initially we'd only set that bit in text messages (and any other plugin messages that can cope with this). This change would be backward wire compatible so can add easily later.
UC 7) Currently the way we allocate messages in the device code is super inefficient. It always allocates the worst case message size. Really we should dynamically allocate just the # of bytes we need. This would allow many more MeshPackets to be kept in RAM.
UC 8) We'll want a "delayed" bit in MeshPacket. This will indicate that the message was not received in real time.
# Things to consider # Things to consider
Not all these cases will be initially implemented. It's just a running stream of thoughts to be considered. Not all these cases will be initially implemented. It's just a running stream of thoughts to be considered.

Wyświetl plik

@ -78,9 +78,9 @@ size_t RedirectablePrint::logDebug(const char *format, ...)
int min = (hms % SEC_PER_HOUR) / SEC_PER_MIN; int min = (hms % SEC_PER_HOUR) / SEC_PER_MIN;
int sec = (hms % SEC_PER_HOUR) % SEC_PER_MIN; // or hms % SEC_PER_MIN int sec = (hms % SEC_PER_HOUR) % SEC_PER_MIN; // or hms % SEC_PER_MIN
r += printf("%02d:%02d:%02d ", hour, min, sec); r += printf("%02d:%02d:%02d %u ", hour, min, sec, millis() / 1000);
} else } else
r += printf("??:??:?? "); r += printf("??:??:?? %u ", millis() / 1000);
auto thread = concurrency::OSThread::currentThread; auto thread = concurrency::OSThread::currentThread;
if(thread) { if(thread) {

Wyświetl plik

@ -354,9 +354,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost #define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
#define LED_PIN 25 // If defined we will blink this LED #define LED_PIN 25 // If defined we will blink this LED
#define BUTTON_PIN \ #define BUTTON_PIN 12 // If defined, this will be used for user button presses,
12 // If defined, this will be used for user button presses, if your board doesn't have a physical switch, you can wire one
// between this pin and ground
#define BUTTON_NEED_PULLUP #define BUTTON_NEED_PULLUP
#define USE_RF95 #define USE_RF95
@ -375,15 +374,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define GPS_RESET_N 10 #define GPS_RESET_N 10
#define GPS_EXTINT 23 // On MAX-M8 module pin name is EXTINT. On L70 module pin name is STANDBY. #define GPS_EXTINT 23 // On MAX-M8 module pin name is EXTINT. On L70 module pin name is STANDBY.
#define BATTERY_PIN 39 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define BATTERY_PIN 39 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define BATTERY_EN_PIN 14 // Voltage voltage divider enable pin connected to mosfet #define BATTERY_EN_PIN 14 // Voltage voltage divider enable pin connected to mosfet
#define I2C_SDA 4 // I2C pins for this board #define I2C_SDA 4 // I2C pins for this board
#define I2C_SCL 2 #define I2C_SCL 2
#define LED_PIN 12 // If defined we will blink this LED #define LED_PIN 12 // If defined we will blink this LED
//#define BUTTON_PIN 36 // If defined, this will be used for user button presses (ToDo problem on that line on debug screen --> Long press start!) //#define BUTTON_PIN 36 // If defined, this will be used for user button presses (ToDo problem on that line on debug screen -->
//#define BUTTON_NEED_PULLUP //GPIOs 34 to 39 are GPIs – input only pins. These pins dont have internal pull-ups or pull-down resistors. //Long press start!) #define BUTTON_NEED_PULLUP //GPIOs 34 to 39 are GPIs – input only pins. These pins dont have internal
//pull-ups or pull-down resistors.
#define USE_RF95 #define USE_RF95
#define LORA_DIO0 38 // a No connect on the SX1262 module #define LORA_DIO0 38 // a No connect on the SX1262 module

Wyświetl plik

@ -305,12 +305,15 @@ void setup()
#ifdef BUTTON_PIN #ifdef BUTTON_PIN
#ifndef NO_ESP32 #ifndef NO_ESP32
// If BUTTON_PIN is held down during the startup process,
// force the device to go into a SoftAP mode.
bool forceSoftAP = 0; bool forceSoftAP = 0;
// If the button is connected to GPIO 12, don't enable the ability to use
// meshtasticAdmin on the device.
pinMode(BUTTON_PIN, INPUT); pinMode(BUTTON_PIN, INPUT);
#ifdef BUTTON_NEED_PULLUP #ifdef BUTTON_NEED_PULLUP
gpio_pullup_en((gpio_num_t)BUTTON_PIN); gpio_pullup_en((gpio_num_t)BUTTON_PIN);
delay(10);
#endif #endif
// BUTTON_PIN is pulled high by a 12k resistor. // BUTTON_PIN is pulled high by a 12k resistor.

Wyświetl plik

@ -37,7 +37,7 @@ int32_t RangeTestPlugin::runOnce()
//radioConfig.preferences.range_test_plugin_enabled = 1; //radioConfig.preferences.range_test_plugin_enabled = 1;
//radioConfig.preferences.range_test_plugin_sender = 45; //radioConfig.preferences.range_test_plugin_sender = 45;
// radioConfig.preferences.range_test_plugin_save = 1; //radioConfig.preferences.range_test_plugin_save = 1;
// Fixed position is useful when testing indoors. // Fixed position is useful when testing indoors.
// radioConfig.preferences.fixed_position = 1; // radioConfig.preferences.fixed_position = 1;