no message
This commit is contained in:
parent
25f2375760
commit
94731c011c
|
@ -32,7 +32,6 @@ using namespace ace_button;
|
||||||
long tslr = 0;
|
long tslr = 0;
|
||||||
WiFiClient espClient;
|
WiFiClient espClient;
|
||||||
boolean allowbuttonint=true;
|
boolean allowbuttonint=true;
|
||||||
AceButton gpio(0);
|
|
||||||
PubSubClient client("siwatsystem.com", 1883, espClient);
|
PubSubClient client("siwatsystem.com", 1883, espClient);
|
||||||
PubSubClientTools mqtt(client);
|
PubSubClientTools mqtt(client);
|
||||||
ThreadController threadControl = ThreadController();
|
ThreadController threadControl = ThreadController();
|
||||||
|
@ -50,7 +49,6 @@ int devconmenu=0;
|
||||||
volatile boolean awakenByInterrupt = false;
|
volatile boolean awakenByInterrupt = false;
|
||||||
LiquidCrystal_I2C lcd(0x3F, 16, 2);
|
LiquidCrystal_I2C lcd(0x3F, 16, 2);
|
||||||
int menu;
|
int menu;
|
||||||
void handleGPIO(AceButton*, uint8_t, uint8_t);
|
|
||||||
void writelcd(String line1, String line2){
|
void writelcd(String line1, String line2){
|
||||||
if(!devcon){
|
if(!devcon){
|
||||||
lcd.clear();
|
lcd.clear();
|
||||||
|
@ -103,11 +101,6 @@ void setup() {
|
||||||
delay(1000);
|
delay(1000);
|
||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
WiFi.disconnect(true);
|
WiFi.disconnect(true);
|
||||||
esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)eap_usernam, strlen(eap_username));
|
|
||||||
esp_wifi_sta_wpa2_ent_set_username((uint8_t *)eap_username, strlen(eap_username));
|
|
||||||
esp_wifi_sta_wpa2_ent_set_password((uint8_t *)eap_password, strlen(eap_password));
|
|
||||||
esp_wpa2_config_t config = WPA2_CONFIG_INIT_DEFAULT();
|
|
||||||
esp_wifi_sta_wpa2_ent_enable(&config);
|
|
||||||
WiFi.begin(ssid);
|
WiFi.begin(ssid);
|
||||||
int connectionattempt = 0;
|
int connectionattempt = 0;
|
||||||
while (WiFi.status() != WL_CONNECTED && online)
|
while (WiFi.status() != WL_CONNECTED && online)
|
||||||
|
@ -175,19 +168,14 @@ void setup() {
|
||||||
void loop() {
|
void loop() {
|
||||||
if(online)client.loop();
|
if(online)client.loop();
|
||||||
if(!devcon)threadControl.run();
|
if(!devcon)threadControl.run();
|
||||||
if(allowbuttonint)gpio0.check();
|
|
||||||
}
|
}
|
||||||
void drawcon(){
|
void drawcon(){
|
||||||
if(devconmenu==1){
|
if(devconmenu==1){
|
||||||
writelcd("connectionchck.c","Check Connection");
|
writelcd("connectionchck.c","Check Connection");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void handleGPIO(AceButton* , uint8_t eventType,
|
void startdevcon(){
|
||||||
uint8_t ) {
|
allowbuttonint=false;
|
||||||
switch (eventType) {
|
|
||||||
case AceButton::kEventPressed:
|
|
||||||
if(devcon=false){
|
|
||||||
allowbuttonint=false;
|
|
||||||
devcon=true; //no going back, Delete Waterish OS and Install Siwat INC(R) DEVCON OS
|
devcon=true; //no going back, Delete Waterish OS and Install Siwat INC(R) DEVCON OS
|
||||||
writelcd(" SIWAT INC(R) ","DEVCON OS V3.2.4");
|
writelcd(" SIWAT INC(R) ","DEVCON OS V3.2.4");
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
@ -204,11 +192,4 @@ void handleGPIO(AceButton* , uint8_t eventType,
|
||||||
allowbuttonint=true;
|
allowbuttonint=true;
|
||||||
devconmenu=1;
|
devconmenu=1;
|
||||||
drawcon();
|
drawcon();
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AceButton::kEventReleased:
|
|
||||||
//debounce
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue