Compare commits

..

No commits in common. "8994baad3c6f4b7e85a7fead368a9822dae4a3a7" and "126879fc0da83d0402d86bead8f69efa1483cc57" have entirely different histories.

2 changed files with 12 additions and 26 deletions

View File

@ -24,12 +24,12 @@ lib_deps =
build_flags = ${env.build_flags} build_flags = ${env.build_flags}
-DDEBUG=0 -DDEBUG=0
-DNOADS=0 -DNOADS=0
-DNAME=\"BLE-Praesenz\" -DNAME=\"BLE_GATE\"
-DSTASSID=\"MagentaWLAN-RGDO\" -DSTASSID=\"MagentaWLAN-RGDO\"
-DSTAPSK=\"93329248424922704583\" -DSTAPSK=\"93329248424922704583\"
-DGATEWAY=\"192.168.127.1\" -DGATEWAY=\"192.168.127.1\"
-DDNS=\"192.168.127.1\" -DDNS=\"192.168.127.1\"
-DKMYIP=\"192.168.127.241\" -DKMYIP=\"192.168.127.42\"
-Dmqtt_server=\"192.168.127.193\" -Dmqtt_server=\"192.168.127.193\"
-Dmqtt_port=1883 -Dmqtt_port=1883

View File

@ -22,28 +22,26 @@ PubSubClient client(espClient);
#define mqtt_port 1883 #define mqtt_port 1883
//cf:d7:ab:1f:24:2c //cf:d7:ab:1f:24:2c
String Adresse = "96:33:bb:bf:ff:ab"; // Bluetooth Adresse die zu Anwesenheitserkennung überwacht wird ET585 //String Adresse = "96:33:bb:bf:ff:ab"; // Bluetooth Adresse die zu Anwesenheitserkennung überwacht wird ET585
//String Adresse = "cf:d7:ab:1f:24:2c"; // Bluetooth Adresse die zu Anwesenheitserkennung überwacht wird Holy-IOT String Adresse = "cf:d7:ab:1f:24:2c"; // Bluetooth Adresse die zu Anwesenheitserkennung überwacht wird Holy-IOT
const int RelaisPin = LED_BUILTIN; // Pin an dem Relais hängt const int RelaisPin = LED_BUILTIN; // Pin an dem Relais hängt
int Verzoegerung = 30; // Auschaltverzögerung wenn das Signal von BLE ibeacon fehlt int Verzoegerung = 15; // Auschaltverzögerung wenn das Signal von BLE ibeacon fehlt
int VerzoegerungZaeler = 0; int VerzoegerungZaeler = 0;
//long int ZZ = 0; //long int ZZ = 0;
Ticker Tic; Ticker Tic;
static BLEAddress *pServerAddress; static BLEAddress *pServerAddress;
BLEScan* pBLEScan ; BLEScan* pBLEScan ;
int scanTime = 5; //In seconds int scanTime = 10; //In seconds
long int Feldstaerke; long int Feldstaerke;
// WiFI // WiFI
IPAddress ip; IPAddress ip( 192, 168, 127, 241 ); // 10 bis 29 für feste IP
IPAddress gateway; IPAddress gateway( 192, 168, 127, 1 );
IPAddress subnet(255,255,255,0); IPAddress subnet( 255, 255, 255, 0 );
IPAddress dns; IPAddress dns(192, 168, 127, 1); // DNS-Server
IPAddress secondaryDNS(8, 8, 8, 8);
String hostname = NAME; String hostname = NAME;
const char *MyIP = KMYIP;
char msg[20]; char msg[20];
char clientName[30]; char clientName[30];
char topic[50]; char topic[50];
@ -98,20 +96,8 @@ static void setup_wifi() {
WiFi.persistent( false ); WiFi.persistent( false );
WiFi.setHostname(hostname.c_str()); //define hostname WiFi.setHostname(hostname.c_str()); //define hostname
WiFi.mode( WIFI_STA ); WiFi.mode( WIFI_STA );
if (!ip.fromString(MyIP)) { // try to parse into the IPAddress WiFi.config( ip, gateway, subnet, dns, dns );
Serial.println("UnParsable IP");
}
if (!dns.fromString(DNS)) { // try to parse into the IPAddress
Serial.println("UnParsable DNS");
}
if (!gateway.fromString(GATEWAY)) { // try to parse into the IPAddress
Serial.println("UnParsable GATEWAY");
}
//WiFi.config( ip, dns, gateway, subnet );
if (!WiFi.config(ip, gateway, subnet, dns, secondaryDNS))
{
Serial.println("STA Failed to configure");
}
WiFi.begin (STASSID, STAPSK); WiFi.begin (STASSID, STAPSK);
while (WiFi.status() != WL_CONNECTED) { while (WiFi.status() != WL_CONNECTED) {