diff --git a/platformio.ini b/platformio.ini index a5afc2e..1c5c3bd 100644 --- a/platformio.ini +++ b/platformio.ini @@ -28,7 +28,7 @@ [platformio] default_envs = - Comment this line and uncomment one board-id below: + ; Comment this line and uncomment one board-id below: ; LoRa development boards with integrated LoRa support: @@ -42,7 +42,7 @@ default_envs = ; heltec_wireless_stick ; Heltec Wireless Stick ; lopy4 ; Pycom Lopy4 ; lora32u4II ; BSFrance LoRa32u4 II v1.0, v1.1, v1.2, v1.3 - ; ttgo_lora32_v1 ; TTGO LoRa32 v1.3 + ttgo_lora32_v1 ; TTGO LoRa32 v1.3 ; ttgo_lora32_v2 ; TTGO LoRa32 v2.0 ; ttgo_lora32_v21 ; TTGO LoRa32 v2.1.6 ; ttgo_t_beam ; TTGO T-Beam v0.5, v0.6, v0.7 @@ -407,7 +407,7 @@ build_flags = -D MONITOR_SPEED=${common.monitor_speed} -D LMIC_PRINTF_TO=Serial -D USE_SERIAL - ; -D USE_LED ; NO ONBOARD USER LED + -D USE_LED ; NO ONBOARD USER LED -D USE_DISPLAY diff --git a/src/LMIC-node.cpp b/src/LMIC-node.cpp index b60d3a0..1e81024 100644 --- a/src/LMIC-node.cpp +++ b/src/LMIC-node.cpp @@ -475,7 +475,8 @@ void initLmic(bit_t adrEnabled = 1, s1_t abpTxPower = DefaultABPTxPower) { // ostime_t timestamp = os_getTime(); - +Serial.print("abpDataRate: "); +Serial.println(abpDataRate); // Initialize LMIC runtime environment os_init(); // Reset MAC state @@ -691,7 +692,7 @@ lmic_tx_error_t scheduleUplink(uint8_t fPort, uint8_t* data, uint8_t dataLength, // ▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀▀▀ ▀▀▀ ▀▀ ▀▀▀ ▀▀ ▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ -static volatile uint16_t counter_ = 0; +static volatile uint16_t counter_ = 7757; uint16_t getCounterValue() { @@ -703,7 +704,7 @@ uint16_t getCounterValue() void resetCounter() { // Reset counter to 0 - counter_ = 0; + counter_ = 7757; } @@ -769,7 +770,7 @@ void processWork(ostime_t doWorkJobTimeStamp) payloadBuffer[0] = counterValue >> 8; payloadBuffer[1] = counterValue & 0xFF; uint8_t payloadLength = 2; - +LMIC_setDrTxpow(DR_SF12,14); scheduleUplink(fPort, payloadBuffer, payloadLength); } } @@ -839,7 +840,7 @@ void setup() abort(); } - initLmic(); + initLmic(1,DR_SF12, DefaultABPTxPower); // █ █ █▀▀ █▀▀ █▀▄ █▀▀ █▀█ █▀▄ █▀▀ █▀▄ █▀▀ █▀▀ ▀█▀ █▀█ // █ █ ▀▀█ █▀▀ █▀▄ █ █ █ █ █ █▀▀ █▀▄ █▀▀ █ █ █ █ █ diff --git a/src/boards/bsf_ttgo_lora32_v1.h b/src/boards/bsf_ttgo_lora32_v1.h index 51378de..f027a96 100644 --- a/src/boards/bsf_ttgo_lora32_v1.h +++ b/src/boards/bsf_ttgo_lora32_v1.h @@ -33,13 +33,13 @@ * * Leds GPIO * ---- ---- - * LED - Incorrectly defined in BSP as LED_BUILTIN (2). + * LED 2 Incorrectly defined in BSP as LED_BUILTIN (2). * * I2C/Display GPIO * --- ---- * SDA <――――――――――> 4 Not SDA! (OLED_SDA) * SCL <――――――――――> 15 Not SCL! (OLED_SCL) - * RST OLED_RST is defined in BSP but not connected to GPIO. + * RST <――――――――――> 16 OLED_RST is defined in BSP but not connected to GPIO. * * SPI/LoRa GPIO * --- ---- @@ -112,13 +112,13 @@ const lmic_pinmap lmic_pins = { #endif #ifdef USE_LED - #error Invalid option: USE_LED. This board has no onboard user LED. - // EasyLed led(, EasyLed::ActiveLevel::Low); + // #error Invalid option: USE_LED. This board has no onboard user LED. + EasyLed led(2, EasyLed::ActiveLevel::High); #endif #ifdef USE_DISPLAY // Create U8x8 instance for SSD1306 OLED display (no reset) using hardware I2C. - U8X8_SSD1306_128X64_NONAME_HW_I2C display(/*rst*/ U8X8_PIN_NONE, /*scl*/ 15, /*sda*/ 4); + U8X8_SSD1306_128X64_NONAME_HW_I2C display(/*rst*/ 16, /*scl*/ 15, /*sda*/ 4); #endif