|
|
@ -26,7 +26,7 @@ |
|
|
|
#include <sys/time.h> |
|
|
|
#include "apps/sntp/sntp.h" |
|
|
|
|
|
|
|
//#include <LoRa.h>
|
|
|
|
#include <LoRa.h> |
|
|
|
|
|
|
|
#include "driver/rtc_io.h" |
|
|
|
|
|
|
@ -107,6 +107,18 @@ void setup() { |
|
|
|
statusTopic = "esp32-node/stat/" + iot.hostname + "/status"; |
|
|
|
sensorTopic = "esp32-node/stat/" + iot.hostname + "/sensor"; |
|
|
|
|
|
|
|
// LoRa
|
|
|
|
SPI.begin(SX1276_SCK, SX1276_MISO, SX1276_MOSI, SX1276_CS); |
|
|
|
LoRa.setPins(SX1276_CS, SX1276_RST, SX1276_IRQ); |
|
|
|
if (!LoRa.begin(SX1276_BAND)) { |
|
|
|
Serial.println("LoRa init failed"); |
|
|
|
} else { |
|
|
|
//LoRa.onReceive(onLoRaReceive);
|
|
|
|
//LoRa.receive();
|
|
|
|
// LoRa.idle();
|
|
|
|
LoRa.sleep(); |
|
|
|
} |
|
|
|
|
|
|
|
/*
|
|
|
|
//Use the web object to add elements to the interface
|
|
|
|
iot.web.addInterfaceElement("color", "input", "", "#configform", "LampColor"); |
|
|
|