Connecting and working with Mega +WiFi R3 ATmega2560+ESP8266 (32Mb memory)

"the Serial3 dip switched connect Serial of esp8266 with Serial3 of Mega." Not sure I understand. Individually these code examples work, but not together.

Trying to run this code on the Mega;;
// Basic serial communication with ESP8266
// Uses serial monitor for communication with ESP8266
//
// When a command is entered in to the serial monitor on the computer
// the Arduino will relay it to the ESP8266
//

#include <SoftwareSerial.h>
SoftwareSerial ESPserial(2, 3); // RX | TX

void setup()
{
Serial.begin(115200); // communication with the host computer
//while (!Serial) { ; }

// Start the software serial for communication with the ESP8266
ESPserial.begin(115200);

Serial.println("");
Serial.println("Remember to to set Both NL & CR in the serial monitor.");
Serial.println("Ready");
Serial.println("");
}

void loop()
{
// listen for communication from the ESP8266 and then write it to the serial monitor
if ( ESPserial.available() ) { Serial.write( ESPserial.read() ); }

// listen for user input and send it to the ESP8266
if ( Serial.available() ) { ESPserial.write( Serial.read() ); }
}

and trying to run something like this on the ESP8266;;

/*
HTTP over TLS (HTTPS) example sketch

This example demonstrates how to use
WiFiClientSecure class to access HTTPS API.
We fetch and display the status of
esp8266/Arduino project continuous integration
build.

Limitations:
only RSA certificates
no support of Perfect Forward Secrecy (PFS)
TLSv1.2 is supported since version 2.4.0-rc1

Created by Ivan Grokhotkov, 2015.
This example is in public domain.
*/

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>

#ifndef STASSID
#define STASSID "ZZZZZZZ"
#define STAPSK "XXXXXXX"
#endif

const char* ssid = STASSID;
const char* password = STAPSK;

const char* host = "api.github.com";
const int httpsPort = 443;

// Use web browser to view and copy
// SHA1 fingerprint of the certificate
const char fingerprint[] PROGMEM = "5F F1 60 31 09 04 3E F2 90 D2 B0 8A 50 38 04 E8 37 9F BC 76";

void setup() {
Serial.begin(115200);
Serial.println();
Serial.print("connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());

// Use WiFiClientSecure class to create TLS connection
WiFiClientSecure client;
Serial.print("connecting to ");
Serial.println(host);

Serial.printf("Using fingerprint '%s'\n", fingerprint);
client.setFingerprint(fingerprint);

if (!client.connect(host, httpsPort)) {
Serial.println("connection failed");
return;
}

String url = "/repos/esp8266/Arduino/commits/master/status";
Serial.print("requesting URL: ");
Serial.println(url);

client.print(String("GET ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"User-Agent: BuildFailureDetectorESP8266\r\n" +
"Connection: close\r\n\r\n");

Serial.println("request sent");
while (client.connected()) {
String line = client.readStringUntil('\n');
if (line == "\r") {
Serial.println("headers received");
break;
}
}
String line = client.readStringUntil('\n');
if (line.startsWith("{"state":"success"")) {
Serial.println("esp8266/Arduino CI successfull!");
} else {
Serial.println("esp8266/Arduino CI has failed");
}
Serial.println("reply was:");
Serial.println("==========");
Serial.println(line);
Serial.println("==========");
Serial.println("closing connection");
}

void loop() {
}

SoftwareSerial in Mega? use Serial3. it is wired to esp8266. use 1,2,3,4 ON

Juraj:
NodeMcu? that is LUA scripting. different firmware then AT firmware

to flash AT firmware, download it from Espressif site. in README are the addresss. use esptool to flash it. or on Windows you can use Espressif's "flash download tool"

can you help me to flash ESP8266 IDF AT Bin V2.0?
(link ESP-AT | Espressif Systems)

i am able to flash ESP8266 NonOS AT Bin V1.7.1 (following the readme) but i want to test IDF to see if it work better with HTTPS. Flashing isntructions for IDF are not clear for me.

bialabs:
can you help me to flash ESP8266 IDF AT Bin V2.0?
(link ESP-AT | Espressif Systems)

i am able to flash ESP8266 NonOS AT Bin V1.7.1 (following the readme) but i want to test IDF to see if it work better with HTTPS. Flashing isntructions for IDF are not clear for me.

IDF is a development framework and toolchain to write application for the esp. once you have your application build, you flash it the same way like the AT firmware. only to address 0x1000 you flash binary of your own application

Juraj:
IDF is a development framework and toolchain to write application for the esp. once you have your application build, you flash it the same way like the AT firmware. only to address 0x1000 you flash binary of your own application

so i cannot flash the IDF AT Firmware and send AT commands from Arduino Mega?

in the attache PDF i read "To run the ESP8266 AT, you can download the binary in ESP8266-IDF-AT/factory to address 0x0.". I have tried to flash factory_WROOM-02.bin at adress 0x0 (flash mode dio

  • freq 40m - flash size 16Mb ) but is not booting

sorry AT 2.0 is new. I didn't see until now

Juraj:
sorry AT 2.0 is new. I didn't see until now

I tested the esp8266 AT 2.0 firmware, which is esp32 AT firmware compiled on esp8266 RTOS SDK IDF framework.

It communicates over pins 13 RX and 15 TX so it can be used only with modules with this pins accessible. On esp8266 dev boards, you can't communicate with this AT firmware from PC over the on board USB chip, because that is traditionally wired to io 0 and 3.

and the commands set is older then in 1.x esp8266 AT firmware (non-OS SDK 2 and 3)

I didn't test SSL

banaylor:
"the Serial3 dip switched connect Serial of esp8266 with Serial3 of Mega." Not sure I understand. Individually these code examples work, but not together.

Trying to run this code on the Mega;;
// Basic serial communication with ESP8266
// Uses serial monitor for communication with ESP8266
//
// When a command is entered in to the serial monitor on the computer
// the Arduino will relay it to the ESP8266
//

#include <SoftwareSerial.h>
SoftwareSerial ESPserial(2, 3); // RX | TX

void setup()
{
Serial.begin(115200); // communication with the host computer
//while (!Serial) { ; }

// Start the software serial for communication with the ESP8266
ESPserial.begin(115200);

Serial.println("");
Serial.println("Remember to to set Both NL & CR in the serial monitor.");
Serial.println("Ready");
Serial.println("");
}

void loop()
{
// listen for communication from the ESP8266 and then write it to the serial monitor
if ( ESPserial.available() ) { Serial.write( ESPserial.read() ); }

// listen for user input and send it to the ESP8266
if ( Serial.available() ) { ESPserial.write( Serial.read() ); }
}

and trying to run something like this on the ESP8266;;

/*
HTTP over TLS (HTTPS) example sketch

This example demonstrates how to use
WiFiClientSecure class to access HTTPS API.
We fetch and display the status of
esp8266/Arduino project continuous integration
build.

Limitations:
only RSA certificates
no support of Perfect Forward Secrecy (PFS)
TLSv1.2 is supported since version 2.4.0-rc1

Created by Ivan Grokhotkov, 2015.
This example is in public domain.
*/

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>

#ifndef STASSID
#define STASSID "ZZZZZZZ"
#define STAPSK "XXXXXXX"
#endif

const char* ssid = STASSID;
const char* password = STAPSK;

const char* host = "api.github.com";
const int httpsPort = 443;

// Use web browser to view and copy
// SHA1 fingerprint of the certificate
const char fingerprint[] PROGMEM = "5F F1 60 31 09 04 3E F2 90 D2 B0 8A 50 38 04 E8 37 9F BC 76";

void setup() {
Serial.begin(115200);
Serial.println();
Serial.print("connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());

// Use WiFiClientSecure class to create TLS connection
WiFiClientSecure client;
Serial.print("connecting to ");
Serial.println(host);

Serial.printf("Using fingerprint '%s'\n", fingerprint);
client.setFingerprint(fingerprint);

if (!client.connect(host, httpsPort)) {
Serial.println("connection failed");
return;
}

String url = "/repos/esp8266/Arduino/commits/master/status";
Serial.print("requesting URL: ");
Serial.println(url);

client.print(String("GET ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"User-Agent: BuildFailureDetectorESP8266\r\n" +
"Connection: close\r\n\r\n");

Serial.println("request sent");
while (client.connected()) {
String line = client.readStringUntil('\n');
if (line == "\r") {
Serial.println("headers received");
break;
}
}
String line = client.readStringUntil('\n');
if (line.startsWith("{"state":"success"")) {
Serial.println("esp8266/Arduino CI successfull!");
} else {
Serial.println("esp8266/Arduino CI has failed");
}
Serial.println("reply was:");
Serial.println("==========");
Serial.println(line);
Serial.println("==========");
Serial.println("closing connection");
}

void loop() {
}

Did you got it?. I'm trying to understand how it works. I've changed "ESPSerial" to Serial3, because as Juraj said, it's yet wired.

HI, I have problems with the same MODULE.
I'm not able to integrate it with the ESP01 module which is inside.
AT command does not receive OK

  1. The MEGA 2560 works fine alone.
  2. I already FLASHED the ESP01
  3. every 5 seconds via serial3 MEGA receive this:

ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 1856, room 16
tail 0
chksum 0x63
load 0x3ffe8000, len 776, room 8
tail 0
chksum 0x02
load 0x3ffe8310, len 552, room 8
tail 0
chksum 0x79
csum 0x79

2nd boot version : 1.5
SPI Speed : 40MHz
SPI Mode : DIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000

Any IDEA or suggestion to fix the problem?
Thanks
p.

paolinor70:
HI, I have problems with the same MODULE.
I'm not able to integrate it with the ESP01 module which is inside.
AT command does not receive OK

  1. The MEGA 2560 works fine alone.
  2. I already FLASHED the ESP01
  3. every 5 seconds via serial3 MEGA receive this:

ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 1856, room 16
tail 0
chksum 0x63
load 0x3ffe8000, len 776, room 8
tail 0
chksum 0x02
load 0x3ffe8310, len 552, room 8
tail 0
chksum 0x79
csum 0x79

2nd boot version : 1.5
SPI Speed : 40MHz
SPI Mode : DIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000

Any IDEA or suggestion to fix the problem?
Thanks
p.

if you flashed something, it replaced the AT firmware a causes a watchdog reset

If you're reading this thread because you can't get your MEGA or UNO with on-board ESP8266 WiFi (robotdyn, wemos, unbranded) to send data to the web (ie Thingspeak) using a WiFi connection, consider sending AT commands to the OEM ESP8266 firmware from an Arduino sketch, which avoids figuring out how to transfer bytes between an Arduino sketch on the MEGA / UNO and an ESP8266 sketch on the ESP8266.

Perhaps the pros consider AT commands to be a complicated / inefficient / knuckle-dragging approach, but if, like me, you just want your data to flow with minimal effort learning to code, you might benefit from the many hours I spent figuring out what might seem obvious to the pros...though simple successful example code for the MEGA/UNO w/ESP8266 boards is noticeably absent from all the web posts I looked at... Based on the many postings I reviewed, people (like me) asking how to get these MEGA/UNO w/ESP8266 boards working didn't seem to know enough about this subject to interpret informed responses, while the informed respondents don't realize their responses assume a certain level of understanding that someone like me doesn't have.

Anyway, here's the basic concept / process I eventually used for the MEGA w/ESP8266:

  1. Flash ESP8266 chip with appropriate Espressif firmware (or don't erase the firmware in the first place...I spent several hours with the esp flash tool figuring out correct reflash settings)
  2. Using key elements (commented in attached MEGA sketch) upload an Arduino sketch to the Mega with DIP positions: ON:3,4; OFF:1,2,5,6,7,8; RX/TX switch: any position
  3. Use the 'special solution' switch configuration: DIPs: ON:1,2,3,4; OFF:5,6,7,8; RX/TX switch set to RX3/TX3
  4. The 'special solution' connects the MEGA's serial3 port to the ESP8266 at the same time the serial port connects to the serial monitor
  5. Open serial monitor and your Thingspeak channel to see what's happening. You should see AT commands and values in the serial monitor, and about every 30 seconds a new value should appear on Thingspeak.

After figuring this out with the MEGA w/ESP8266, here's the basic concept / process I used for the UNO:

  1. Flash ESP8266 chip with appropriate Espressif firmware (or don't erase the firmware in the first place...I spent several hours with esp tool figuring out correct reflash settings)
  2. Using key elements (commented in attached UNO sketch) upload an Arduino sketch to the UNO with DIP positions: ON:3,4; OFF:1,2,5,6,7,8
  3. To connect the UNO serial output directly to the ESP8266, use the switch configuration: DIPs: ON:1,2; OFF:3,4,5,6,7,8.
  4. Serial monitor will not work (since serial is being used for data transfer between UNO MCU and ESP8266), but you can open your Thingspeak channel to see if anything is showing up.

If nothing shows up on Thingspeak, use serial monitor to connect directly to the ESP8266 (DIP: ON:5,6; OFF:1,2,3,4,7,8) and send AT commands directly to the ESP8266; copy AT command strings by using serial monitor while running the MEGA sketch, copying the AT command strings to MS Word or notepad.

Hope it works for you!

MEGAwWiFi_logger_webpost_example.ino (8.78 KB)

UNOwWiFi_logger_webpost_example.ino.ino (7.66 KB)

Thank's for your help, It clear a lot of thing in my mind.
I try few sample and get them to work and do a get on most web site.
Ex:
arduino.cc using port 80
www.google.com usin 443 and connectSSL

but on some web site I get Connection failed

I suspect it because of the encription some are RSA (2048 Bits) is this the reason of the failed.

Hy, and respect for everyone.

I am stuck at the very first steps with this board, which is the aformentioned mega2560+esp8266.

Here is what I've found:

http://www.sysengineering.ru/notes/kontroller-arduino-mega-s-esp8266

The firmwares I've tried:
ESP8266_AT_Bin_V1.4
ESP8266_AT_Bin_V1.5.1
ESP8266_AT_Bin_V1.6.2
ESP8266_AT_Bin_V1.7
ESP8266_NonOS_AT_Bin_V1.7.2
esp_iot_sdk_v1.5.0

This last one made me wonder, if I flash AT firmware on esp8266, do I have to have a correct answer on serial monitor, when I type AT? All I achieved is a decent "ERROR" message, in some cases a neverending loop, or simply nothing.
What makes it even more interesting, is that in case I have an answer, I have it on different baud levels. I mean when pressing reset on the board I get this:

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 1396, room 16
tail 4
chksum 0x89
load 0x3ffe8000, len 776, room 4
tail 4
chksum 0xe8
load 0x3ffe8308, len 540, room 4
tail 8
chksum 0xc0
csum 0xc0

2nd boot version : 1.4(b1)
SPI Speed : 80MHz
SPI Mode : DIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000

⸮⸮11⸮

This is at 74880 baud.
Switching to 115200 it has a meaning, but not pleasing my eyes:
AT+GMR

ERROR

The idea is to flash the AT firmware on it, and control a sk6812 led strip. With a simple webserver I could change the light effect, and a few more switches, probably a colour wheel, and two slider, and I have all I need.

So, I am asking you, if anyone achieved success with this board, please give me a photo of the flash tool with all the settings. If there is no way achieving that, I am very much open to every idea which helps me achieving my goal, which is controlling that light strip on a local network.

Thank You very much!

wannabeamphunter:
Switching to 115200 it has a meaning, but not pleasing my eyes:
AT+GMR

ERROR

set line ending in Serial Monitor to "Both NL & CR"

Oh my god!

I owe You a beer Sir!

I try then to clear it up, for everybody, because this is a gamechanger.

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 816, room 16
tail 0
chksum 0x8d
load 0x3ffe8000, len 788, room 8
tail 12
chksum 0xcf
ho 0 tail 12 room 4
load 0x3ffe8314, len 288, room 12
tail 4
chksum 0xcf
csum 0xcf

2nd boot version : 1.2
SPI Speed : 80MHz
SPI Mode : DIO
SPI Flash Size : 32Mbit
jump to run user1

rf cal sector: 1019
freq trace enable 1
rf[112] : 03
rf[113] : 00
rf[114] : 01

SDK ver: 2.2.1(6ab97e9) compiled @ Jun 7 2018 13:59:14
phy ver: 1136_0, pp ver: 10.2

⸮NOAT

OK
AT+GMR
AT version:1.6.2.0(Apr 13 2018 11:10:59)
SDK version:2.2.1(6ab97e9)
compile time:Jun 7 2018 19:34:26
Bin version(Wroom 02):1.6.2
OK

So I am here after a not so pleasing cca 60 hours of error, and trial.
I am happy with the result so far, it means that I will make a step forward, and if I am lucky enough, I do not have to continue experimenting with it. I am not saying that this is the only way, but the first when it seems to work.

So first of all

ESP8266 Download tool 3.6.8
I've downloaded the ESP8266_NONOS_SDK-2.2.1 , and took what it has from the "bin" folder. This is a better choice for me than the AT versions, because it has a readme :-), but at this point I am pretty sure that those versions would work too.)

The settings to achieve it are the following:
ESP8266_NONOS_SDK-2.2.1\bin\boot_v1.2.bin 0x00000
ESP8266_NONOS_SDK-2.2.1\bin\at\512+512\user1.1024.new.2.bin 0x1000
ESP8266_NONOS_SDK-2.2.1\bin\blank.bin 0xfe000
ESP8266_NONOS_SDK-2.2.1\bin\blank.bin 0x37e000
ESP8266_NONOS_SDK-2.2.1\bin\esp_init_data_default_v08.bin 0x3fc000

CrystalFreq: 26M
SPI speed 80MHz
SPI Mode DIO
Flash size 32Mbit (with 512+512 you choose this, 1024+1024 requires 32Mbit-C1)

The detected info is the following:
flash vendor:
EFh : WB
flash devID:
4016h
QUAD;32Mbit
crystal:
26 Mhz

When flashing 5-6-7 ON, others off, when communicating 5-6 ON, others off.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!set line ending in Serial Monitor to "Both NL & CR"!!!!!!!!!!!!!!!!!!!!!!!!!!!!
otherwise you'll see only errors.

If it starts looping, choose another boot version.
The other failures I've seen were due to the wrong addresses, and if I ever feel the need to do it again, I will continue this thread finding and posting the possible combinations, but for now, that is all.
Right now I am happy :slight_smile:
Thank You Juraj!

Hi there

Thanks @wannabeamphunter; finally I updated to latest version. Still I was not able to use WiFiEsp.
I suspected RXD/TXD switch and connected RX of ESP8266 to TX3 of Mega and vice versa with Dupont cable.. It started to work.. It continued to work after keeping only TX of ESP8266 to RX3 of Mega. Turned out to be that the selector switch was not working properly... I will try with cleaning oil later.

I have spent many late evenings on this. :o

Cheers!

Over the last few days I have started experimenting with the board that contains both the Mega 2560 MPU and the ESP8266 MPU. I wanted to learn how to program both MPU's, and to get them talking to each other via serial communications so that I could use the Mega 2560 for its large I/O capability and use the ESP8266 for its WiFi and MQTT capability.

In doing so, I did a lot of online searching, and this thread was one of several that gave me a few tips that led to my eventual success. I also did a lot of trial and error. Once I got it working, I sat down and wrote myself some notes on how I did it so that sometime in the future I need to do this again, I can reproduce a working setup.

I'm posting my notes here in case they may be of help to others online. I hope they are helpful.


These are my notes from today, which is the first time I have successfully written and tested 2 sketches for the Mega 2560 with onboard ESP8266 board that communicate with each other via serial ports.

I named the sketch that runs on the Mega 2560 Sandbox.Mega2560.Mega. The Board setting in the IDE is "Arduino Mega or Mega 2560".

I named the sketch that runs on the onboard ESP8266 Sandbox.Mega2560.ESP8266. The Board setting in the IDE is "Generic ESP8266 Module"

I was never able to get the two boards talking via the (only) serial port on the ESP8266 and serial port # 3 (Serial3) on the Mega 2560 without using two Dupont jumper wires to tie the RXD and the TXD on the ESP8266 board to the RXD3 and TXD3 on the Mega 2560 board. I am under the impression that one of the DIP switch settings will do this connection for you, but I was never able to get that working. So I'm just using the jumper wires.

Note also that if the two Dupont jumper wires are plugged in, you will NOT be able to download the sketch to the ESP8266. So while programming the ESP8266, be sure and disconnect those two jumper wires.

Note also that this physical board only has a single USB connection. You have to set the DIP switches in different settings depending on how you want to use that single USB connection. I found that I had to use 4 different settings:

  1. One setting to download the sketch from the IDE to the ESP8266 MPU.
  2. One setting to use the Serial Monitor to view the output from the sketch running on the ESP8266 MPU.
  3. One setting to download the sketch from the IDE to the Mega 2560 MPU.
  4. One setting to use the Serial Monitor to view the output from the sketch running on the Mega 2560 MPU.

Each of these two MPU's have advantages and disadvantages. A big advantage of the Mega 2560 is that it has a LOT of digital and analog I/O pins. But it does not have WiFi capability. The main advantage of the ESP8266 is that it has WiFi capability. Since I cannot have the single USB port on the PCB connected to both MPU's at the same time, I decided to do the following: While testing the two sketches, I use the USB cable with the Serial monitor of the Mega 2560 board. And I transmit diagnostic messages from the ESP8266 board over WiFi using MQTT.

So there are a lot of DIP switch settings, IDE settings, and jumper wires that have to be set in different states to get all this working. I'm going to attempt to describe each of these as "states" in the paragraphs below:

State 1 - Used when programming and downloading the ESP8266 sketch.

  1. Set the onboard DIP switches to: 1=OFF,2=OFF,3=OFF,4=OFF,5=ON,6=ON,7=ON
  2. Disconnect the RXD/TXD to RXD3/TXD3 jumper wires (breaks download otherwise).
  3. Set the Arduino IDE Board setting to "Generic ESP8266 Module"

State 2 - Used to test the ESP8266 sketch by viewing its Serial Monitor output.

  1. Set the onboard DIP switches to: 1=OFF,2=OFF,3=OFF,4=OFF,5=ON,6=ON,7=OFF
  2. RXD/TXD to RXD3/TXD3 jumper wires can be connected or disconnected.
  3. Start the Serial Monitor in the Arduino IDE to view the output from the ESP8266.

State 3 - Used when programming and downloading the Mega 2560 sketch.

  1. Set the onboard DIP switches to: 1=OFF,2=OFF,3=ON,4=ON,5=OFF,6=OFF,7=OFF
  2. Set the Arduino IDE Board setting to "Arduino Mega or Mega 2560"
  3. RXD/TXD to RXD3/TXD3 jumper wires can be connected or disconnected.

State 4 - Used when testing the Mega 2560 sketch (or both sketches running together) by viewing the Serial Monitor output from the Mega 2560 MPU.

  1. Set the onboard DIP switches to: 1=OFF,2=OFF,3=ON,4=ON,5=OFF,6=OFF,7=OFF (same as for State 3)
  2. Connect the RXD/TXD to RXD3/TXD3
  3. Start the Serial Monitor in the Arduino IDE to view the output from the Mega 2560.
  4. Ensure target MQTT broker service is running (so ESP8266 can connect)
  5. Start a MQTT client and subscribe to the MQTT topic that the ESP8266 sketch broadcasts to, so that the diagnostic messages transmitted by the ESP8266 sketch can be seen.

again I recommend, put a firmware in the esp8266, set the board to ATmega on USB and esp8266 on ATmega Serial3 and stop switching the switches. they will fall apart if you switch them too much. or if you want to have a sketch in esp8266, use OTA upload to esp8266.

Hi. I have this board and need the USB<>Mega<>ESP8266 mode where "Serial" acts as it normally would from the USB to the Mega (for example to use the serial monitor to enter commands), and "Serial3" would connect to the ESP8266. I have 2 questions.

  1. Can I use the "special mode" above to program the Mega without interfering with the ESP8266? Or do you HAVE to change the switches to upload sketch mode to Mega and then back to special mode every time I want to change the sketch in the Mega? I could be modifying the sketch a lot, especially when developing and debugging.

  2. No one mentions the little tx/rx switch. I assume that sets the port for how the Mega and ESP8266 talk to each other. Do I always leave it set to 3? Or do I have to switch that back and forth too?

fdecker:
Hi. I have this board and need the USB<>Mega<>ESP8266 mode where "Serial" acts as it normally would from the USB to the Mega (for example to use the serial monitor to enter commands), and "Serial3" would connect to the ESP8266. I have 2 questions.

  1. Can I use the "special mode" above to program the Mega without interfering with the ESP8266? Or do you HAVE to change the switches to upload sketch mode to Mega and then back to special mode every time I want to change the sketch in the Mega? I could be modifying the sketch a lot, especially when developing and debugging.

  2. No one mentions the little tx/rx switch. I assume that sets the port for how the Mega and ESP8266 talk to each other. Do I always leave it set to 3? Or do I have to switch that back and forth too?

  1. Mega is uploaded over Serial. there is no interference with esp8266 on Serial3.

  2. let it at 3

don't switch the switches too many times. upload a firmware to esp8266 and use it with a corresponding library. or if you want to have your own sketch in esp8266, upload it OTA with esp8266 ArduinoOTA library