|
@ -26,7 +26,7 @@ |
|
|
#include <sys/time.h> |
|
|
#include <sys/time.h> |
|
|
#include "apps/sntp/sntp.h" |
|
|
#include "apps/sntp/sntp.h" |
|
|
|
|
|
|
|
|
//#include <LoRa.h>
|
|
|
#include <LoRa.h> |
|
|
|
|
|
|
|
|
#include "driver/rtc_io.h" |
|
|
#include "driver/rtc_io.h" |
|
|
|
|
|
|
|
@ -107,6 +107,18 @@ void setup() { |
|
|
statusTopic = "esp32-node/stat/" + iot.hostname + "/status"; |
|
|
statusTopic = "esp32-node/stat/" + iot.hostname + "/status"; |
|
|
sensorTopic = "esp32-node/stat/" + iot.hostname + "/sensor"; |
|
|
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
|
|
|
//Use the web object to add elements to the interface
|
|
|
iot.web.addInterfaceElement("color", "input", "", "#configform", "LampColor"); |
|
|
iot.web.addInterfaceElement("color", "input", "", "#configform", "LampColor"); |
|
|