ESP8266 Mega - can't upload

Good morning!
I have this:

It’s a Mega with the ESP-8266EX chip.
I’ve tried uploading to 8266-esp1 and esp12.
There are only a few unbranded 8266 options in the list.

How can I upload to this thing?
I have big plans for it. It’s going to collect sensor data from multiple RF24s and publish a WebServer page.

Seems to me that you have a RobotDyn Mega + WiFi board. The referenced page shows you how to configure the DIP switches to upload to each board. There’s just one CH340G chip which can be switched to being connected to the Mega2560 or ESP8266. There’s also a setting where the two chips are connected with each other. For PlatformIO, the configurations should be pretty standard. Either two projects with one target board each, as in

platform = atmelavr
board = megaatmega2560
framework = arduino
platform = espressif8266
; just a generic ESP8266 with 4MByte of flash.
; esp12e should be okay, just like nodemcuv2...
board = esp12e
framework = arduino

or setup one project with both environments and two source folders (which can be selected by src_filter).

So this is an actual Mega, but it also has the 8266 chip?
And I can use them together???

Now I need to figure out what I’d use that for… You’d try esp12e as the board?

Thank you!

Indeed, a two-chip board, just as the linked documentation and schematics show. The ESP can talk to the Mega through its Serial3 port, and in reverse. These docs are also crucial because they show how to get the ESP into bootloader mode for uploading.

1 Like

I had a file with only the WiFi library, so it worked fine.

I set the switches to 8266 only.

Can’t get a MAC address.

I think I’m ready to ask what this means.
The lesson I want is “What does ‘src_filter’ do?”

There’s a big hole in my understanding of the .ini file which fluent knowledge of a programming language would certainly help fill. That’s one ‘word’. Why? What is the derivation of this word?

Set up one project with both the ESP and Arduino environments.
Each has its own project folder?

Why would one do that? Would you toggle between them?

Is there stuff that these characters strung into a processor in the ESP environment can do that the same characters can’t get from an Arduino processor?

I mean, the ESP obviously has incomparably higher specs, but C++ into a machine should always cause the same events, regardless of platform, no? Assuming capacities are comparable. Atmel can’t do BLE, and ESP has two processors, and one isn’t open source. So they’re different animals altogether.

Can you give me an example of a scenario where you’d write these two programs and how they coexist?

You have a board with two MCUs on it… an ESP8266, and an ATMega2560.

Those two MCUs to not use the same code.

So you need to write the code for each, compile the code for each, and upload the code for each.

You can either:

  1. Create two projects - one configured for the ATMega2560 with code to suit, and one configured for the ESP8266 with code to suit it; or
  2. Create a single project, with two source code directories, which has both environments configured, and you use the src_filter directive to ensure the correct source code is used for each environment.

If you are only using the ESP8266 chip on the board, you don’t need to do anything with the ATMega2560. But why would you get a board with both MCUs on board if you don’t intend to use both?

You might have the ATMega2560 connecting to multiple sensors, or multiple outputs, and be using the ESP8266 to provide WiFi control. Or the ATMega2560 might be monitoring multiple things, and uses the ESP8266 to upload that to a online dashboard. The possibilities are endless.

I linked the documentation for you in the first post – you have to do a special switch configuration and reset method to get the ESP8266 into bootloader mode, otherwise it will not accept a firmware. Tripple check that that procedure is correct.

PIO is telling me it’s uploading successfully.

I don’t think anything has worked yet.

I get serial gibberish when I push the reset button.

There’s no serial in the script. I’m trying to get a 2812 RGB ring to light up.

I’ve seen somewhere that you’re supposed to push the Mode button to upload.

I want to use the analog ports.
I’m guessing they’re best handled by the 2560 chip, and that chip can handle a long program.

But this unit’s ultimate destination is a web server fed by some RF Nanos and some ESPNow WeMos.

I can use the 8,252 Mega pins to run relays, etc.
I’ll learn how to use the second mpu soon. Gotta get back online.

The problem goes deeper than 8266.
Nothing has worked. I’m trying to run a known I2C scan, but it keeps running the previous script.

PIO is lying about successfully flashing the WeMos, or the 8266 Mega, as it were. I’m getting exasperated by this RGB LED that won’t light, and the program probably isn’t being uploaded.

BME 280 has nothing to do with this file.
I restarted twice to get this to stop.

I got the I2C scanner to upload to the 8266 Mega.
Looks like you have to switch dip 7 to OFF to go from upload to connect mode.