Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTGO_v1.0 board Changes #39

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

[platformio]
default_envs =
<platformio.ini board selector guard> Comment this line and uncomment one board-id below:
;<platformio.ini board selector guard> Comment this line and uncomment one board-id below:

; LoRa development boards with integrated LoRa support:

Expand All @@ -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
Expand Down Expand Up @@ -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


Expand Down
11 changes: 6 additions & 5 deletions src/LMIC-node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
{
Expand All @@ -703,7 +704,7 @@ uint16_t getCounterValue()
void resetCounter()
{
// Reset counter to 0
counter_ = 0;
counter_ = 7757;
}


Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -839,7 +840,7 @@ void setup()
abort();
}

initLmic();
initLmic(1,DR_SF12, DefaultABPTxPower);

// █ █ █▀▀ █▀▀ █▀▄ █▀▀ █▀█ █▀▄ █▀▀ █▀▄ █▀▀ █▀▀ ▀█▀ █▀█
// █ █ ▀▀█ █▀▀ █▀▄ █ █ █ █ █ █▀▀ █▀▄ █▀▀ █ █ █ █ █
Expand Down
10 changes: 5 additions & 5 deletions src/boards/bsf_ttgo_lora32_v1.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
* --- ----
Expand Down Expand Up @@ -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(<external LED GPIO>, 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


Expand Down