add wifi library and code diagnostic

This commit is contained in:
Siwat Sirichai 2019-08-21 20:17:09 +07:00
parent 4968c752e5
commit 82c50d3fd9
1 changed files with 23 additions and 14 deletions

View File

@ -1,3 +1,25 @@
#include <BearSSLHelpers.h>
#include <CertStoreBearSSL.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiAP.h>
#include <ESP8266WiFiGeneric.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266WiFiScan.h>
#include <ESP8266WiFiSTA.h>
#include <ESP8266WiFiType.h>
#include <WiFiClient.h>
#include <WiFiClientSecure.h>
#include <WiFiClientSecureAxTLS.h>
#include <WiFiClientSecureBearSSL.h>
#include <WiFiServer.h>
#include <WiFiServerSecure.h>
#include <WiFiServerSecureAxTLS.h>
#include <WiFiServerSecureBearSSL.h>
#include <WiFiUdp.h>
#include <ESP8266WiFiMesh.h>
#include <NetworkInfo.h>
#include <TransmissionResult.h>
#include <TypeConversionFunctions.h>
#include "settings.h"
#include <ESP8266MQTTMesh.h>
#include <FS.h>
@ -5,22 +27,12 @@
// |----------------------------------|
// | SIWAT INC |
// |----------------------------------|
#define FIRMWARE_ID 0x1337
#define FIRMWARE_VER "0.1"
wifi_conn networks[] = {WIFI_CONN("ssid 1", "Password", NULL, 0),WIFI_CONN("ssid 2", "Another Password", NULL, 0),NULL,};
String ID = String(ESP.getChipId());
unsigned long previousMillis = 0;
const long interval = 5000;
int cnt = 0;
ESP8266MQTTMesh mesh = ESP8266MQTTMesh::Builder(networks, mqtt_server, mqtt_port).setMqttAuth(mqtt_user, mqtt_password).setVersion(FIRMWARE_VER, FIRMWARE_ID).setMeshPassword(mesh_password).build();
ESP8266MQTTMesh mesh = ESP8266MQTTMesh::Builder(networks, mqtt_server, mqtt_port).setMqttAuth(mqtt_user, mqtt_password).setVersion(FIRMWARE_VER, FIRMWARE_ID).setMeshPassword(mesh_password).setMeshSSID(mesh_ssid).build();
void callback(const char *topic, const char *msg);
void setup() {
Serial.begin(115200);
delay(1000);
@ -38,9 +50,6 @@ void loop() {
cnt++;
}
}
void callback(const char *topic, const char *msg) {
Serial.print(topic);
Serial.print(msg);