commit
9758afe4fc
@ -11,6 +11,12 @@ HAS_DISPLAY u8x8(MY_OLED_RST, MY_OLED_SCL, MY_OLED_SDA);
|
||||
const char lora_datarate[] = {"1211100908077BFSNA"};
|
||||
#elif defined(CFG_us915)
|
||||
const char lora_datarate[] = {"100908078CNA121110090807"};
|
||||
#elif defined(CFG_as923)
|
||||
const char lora_datarate[] = {"1211100908077BFSNA"};
|
||||
#elif defined(CFG_au921)
|
||||
const char lora_datarate[] = {"1211100908078CNA1211109C8C7C"};
|
||||
#elif defined(CFG_in866)
|
||||
const char lora_datarate[] = {"121110090807FSNA"};
|
||||
#endif
|
||||
|
||||
uint8_t volatile DisplayState = 0;
|
||||
|
@ -112,7 +112,7 @@ void get_hard_deveui(uint8_t *pdeveui) {
|
||||
uint8_t i2c_ret;
|
||||
|
||||
// Init this just in case, no more to 100KHz
|
||||
Wire.begin(SDA, SCL, 100000);
|
||||
Wire.begin(MY_OLED_SDA, MY_OLED_SCL, 100000);
|
||||
Wire.beginTransmission(MCP_24AA02E64_I2C_ADDRESS);
|
||||
Wire.write(MCP_24AA02E64_MAC_ADDRESS);
|
||||
i2c_ret = Wire.endTransmission();
|
||||
@ -249,6 +249,7 @@ void onEvent(ev_t ev) {
|
||||
break;
|
||||
|
||||
case EV_TXSTART:
|
||||
if (!(LMIC.opmode & OP_JOINING))
|
||||
strcpy_P(buff, PSTR("TX START"));
|
||||
break;
|
||||
|
||||
|
14
src/main.cpp
14
src/main.cpp
@ -166,7 +166,21 @@ void setup() {
|
||||
ESP_LOGI(TAG, "Starting LMIC...");
|
||||
os_init(); // initialize lmic run-time environment on core 1
|
||||
LMIC_reset(); // initialize lmic MAC
|
||||
LMIC_setLinkCheckMode(0);
|
||||
LMIC_setClockError(MAX_CLOCK_ERROR * CLOCK_ERROR_PROCENTAGE / 100);
|
||||
|
||||
#ifdef CFG_US915
|
||||
// Set the data rate to Spreading Factor 7. This is the fastest supported
|
||||
// rate for 125 kHz channels, and it minimizes air time and battery power. Set
|
||||
// the transmission power to 14 dBi (25 mW).
|
||||
LMIC_setDrTxpow(DR_SF7, 14);
|
||||
// in the US, with TTN, it saves join time if we start on subband 1 (channels
|
||||
// 8-15). This will get overridden after the join by parameters from the
|
||||
// network. If working with other networks or in other regions, this will need
|
||||
// to be changed.
|
||||
LMIC_selectSubBand(1);
|
||||
#endif
|
||||
|
||||
LMIC_startJoining(); // start joining
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user