Hi! how can i connect this mega wifi to my wifi? i aleady follow all the tutorial but no reponse to esp, and i see a tutorial like you need to flash the esp ( link: https://www.youtube.com/watch?v=E250CVUWNB0)
and i flash the esp ([12348 off] [567 on] [rxd0 & txd0] AiThinker_ESP8266_DIO_8M_8M_20160615_V1.5.4) but still same problem
and the ESP8266WIFI.h i have always problem with that thing
error
#include <queue.h>
next when i add and the error #include <wl_definitions.h>
after that error again when i add #include <Iwip/dns.h>
error again #include
using this Mega/ESP8266 is not simple - having to switch the DIL switches ON/OFF between loading and running code is awkward - also not sure how long the DIL switch will last
also having to program two microcontrollers with the overhead of interprocessor communication increases the task complexity by an order of magnitude
unless you have a specific reason to use a Mega I would recommend you get a ESP8266 or ESP32 dev module
first i flash the ESP (DIP Switch 12348 off and 567 on then set RXD0&TXD0), Using ESPFlashDownloadTools_v3.4.4 then download the firmware AiThinker_ESP8266_DIO_32M_32M_20160615_V1.5.4
#include "WiFiEsp.h"
// Emulate Serial1 on pins 6/7 if not present
#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial3(6, 7); // RX, TX
#endif
void setup() {
// initialize serial for debugging
Serial.begin(115200);
// initialize serial for ESP module
Serial3.begin(115200);
// initialize ESP module
WiFi.init(&Serial3);
// check for the presence of the shield
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue
while (true);
}
// Print WiFi MAC address
printMacAddress();
}
void loop()
{
// scan for existing networks
Serial.println();
Serial.println("Scanning available networks...");
listNetworks();
delay(10000);
}
void printMacAddress()
{
// get your MAC address
byte mac[6];
WiFi.macAddress(mac);
// print MAC address
char buf[20];
sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X", mac[5], mac[4], mac[3], mac[2], mac[1], mac[0]);
Serial.print("MAC address: ");
Serial.println(buf);
}
void listNetworks()
{
// scan for nearby networks
int numSsid = WiFi.scanNetworks();
if (numSsid == -1) {
Serial.println("Couldn't get a wifi connection");
while (true);
}
// print the list of networks seen
Serial.print("Number of available networks:");
Serial.println(numSsid);
// print the network number and name for each network found
for (int thisNet = 0; thisNet < numSsid; thisNet++) {
Serial.print(thisNet);
Serial.print(") ");
Serial.print(WiFi.SSID(thisNet));
Serial.print("\tSignal: ");
Serial.print(WiFi.RSSI(thisNet));
Serial.print(" dBm");
Serial.print("\tEncryption: ");
printEncryptionType(WiFi.encryptionType(thisNet));
}
}
void printEncryptionType(int thisType) {
// read the encryption type and print out the name
switch (thisType) {
case ENC_TYPE_WEP:
Serial.print("WEP");
break;
case ENC_TYPE_WPA_PSK:
Serial.print("WPA_PSK");
break;
case ENC_TYPE_WPA2_PSK:
Serial.print("WPA2_PSK");
break;
case ENC_TYPE_WPA_WPA2_PSK:
Serial.print("WPA_WPA2_PSK");
break;
case ENC_TYPE_NONE:
Serial.print("None");
break;
}
Serial.println();
}
make use at the Serial monitor the baud set at 15200
and then it will scan a network around
If you connect to wifi with a pass, asap use wpa cause the wp2 or 3 will failed unless you use a ESP8266WIFI.h lib it supports wpa2 for security purposes