test
This commit is contained in:
parent
f2c55132c3
commit
ad6ce61e45
31
src/main.cpp
31
src/main.cpp
|
@ -53,7 +53,6 @@ unsigned long endTime;
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#include <PubSubClient.h>
|
#include <PubSubClient.h>
|
||||||
#define mqtt_port 61883
|
|
||||||
WiFiClient espClient;
|
WiFiClient espClient;
|
||||||
PubSubClient client(espClient);
|
PubSubClient client(espClient);
|
||||||
|
|
||||||
|
@ -95,10 +94,11 @@ uint16_t myCOLORS[8]={myRED,myGREEN,myBLUE,myWHITE,myYELLOW,myCYAN,myMAGENTA,myB
|
||||||
// Wifi
|
// Wifi
|
||||||
char ssid[] = "St.-Peters-Gasse"; // your network SSID (name)
|
char ssid[] = "St.-Peters-Gasse"; // your network SSID (name)
|
||||||
char pass[] = "1952994784599317"; // your network password
|
char pass[] = "1952994784599317"; // your network password
|
||||||
IPAddress ip( 192, 168, 127, 247);
|
IPAddress ip;
|
||||||
IPAddress gateway( 192, 168, 127, 1 );
|
IPAddress gateway;
|
||||||
IPAddress subnet( 255, 255, 255, 0 );
|
IPAddress subnet;
|
||||||
IPAddress dns(192, 168, 127, 1); // DNS-Server
|
IPAddress dns; // DNS-Server
|
||||||
|
IPAddress sdecondarDNS;
|
||||||
String hostname = "GROSSZEICHENDISPLAY2";
|
String hostname = "GROSSZEICHENDISPLAY2";
|
||||||
int status = WL_IDLE_STATUS;
|
int status = WL_IDLE_STATUS;
|
||||||
const char* NTP_SERVER = "de.pool.ntp.org";
|
const char* NTP_SERVER = "de.pool.ntp.org";
|
||||||
|
@ -133,8 +133,8 @@ const char* const PROGMEM DAY_NAMES[] = {"Sonntag", "Montag", "Dienstag", "Mittw
|
||||||
const char* const PROGMEM DAY_SHORT[] = {"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"};
|
const char* const PROGMEM DAY_SHORT[] = {"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"};
|
||||||
|
|
||||||
//MQTT
|
//MQTT
|
||||||
//define mqtt_port 1883
|
//define mqtt_port mqtt_port
|
||||||
const char* mqtt_server = "hjkmqtt.dedyn.io";
|
//const char* mqtt_server = mqtt_server;
|
||||||
char topic_0[50];
|
char topic_0[50];
|
||||||
char msg[20];
|
char msg[20];
|
||||||
char clientName[30];
|
char clientName[30];
|
||||||
|
@ -660,6 +660,23 @@ static void setup_wifi() {
|
||||||
|
|
||||||
delay(10);
|
delay(10);
|
||||||
// We start by connecting to a WiFi network
|
// We start by connecting to a WiFi network
|
||||||
|
if (!ip.fromString(MyIP)) { // try to parse into the IPAddress
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
if (!secondarDNS.fromString(SECONDARDNS)) { // try to parse into the IPAddress
|
||||||
|
Serial.println("UnParsable GATEWAY");
|
||||||
|
}
|
||||||
|
//WiFi.config( ip, dns, gateway, subnet );
|
||||||
|
if (!WiFi.config(ip, gateway, subnet, dns, secondarDNS))
|
||||||
|
{
|
||||||
|
Serial.println("STA Failed to configure");
|
||||||
|
}
|
||||||
Serial.println();
|
Serial.println();
|
||||||
Serial.print("Connecting to ");
|
Serial.print("Connecting to ");
|
||||||
Serial.print(ssid);
|
Serial.print(ssid);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user