ESP32 support added

* ESP32 adjustments, compiles and runs
* Changed gitignore to ignore debug log files
This commit is contained in:
tastendruecker123 2022-08-19 17:35:10 +02:00 committed by GitHub
parent 9ca1792480
commit 0ad53d56d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 153 additions and 50 deletions

View file

@ -6,7 +6,16 @@
#ifndef __MQTT_H__
#define __MQTT_H__
#include <ESP8266WiFi.h>
#ifdef ESP8266
#include <ESP8266WiFi.h>
#elif defined(ESP32)
#include <WiFi.h>
#endif
#if defined(ESP32) && defined(F)
#undef F
#define F(sl) (sl)
#endif
#include <PubSubClient.h>
#include "defines.h"
@ -70,7 +79,11 @@ class mqtt {
void reconnect(void) {
DPRINTLN(DBG_DEBUG, F("mqtt.h:reconnect"));
DPRINTLN(DBG_DEBUG, F("MQTT mClient->_state ") + String(mClient->state()) );
DPRINTLN(DBG_DEBUG, F("WIFI mEspClient.status ") + String(mEspClient.status()) );
#ifdef ESP8266
DPRINTLN(DBG_DEBUG, F("WIFI mEspClient.status ") + String(mEspClient.status()) );
#endif
boolean resub = false;
if(!mClient->connected()) {
if(strlen(mDevName) > 0) {