Go Down

Topic: Connecting and working with Mega +WiFi R3 ATmega2560+ESP8266 (32Mb memory) (Read 8947 times) previous topic - next topic

garry_brook

Hi cyberpks.

Can you please provide more detail about how you uploaded the new esp firmware.

Cheers
Garry

odam2k

Hi everyone, looks like a LOT of confusion with this board, and VERY LITTLE good info online as far as I have found.

I managed to get it working, I can upload sketches to the Mega with switches 3 and 4 on, and upload sketches to the ESP with 5, 6, and 7 on...   

With 1, 2, 3, and 4 on, I can upload sketches to the Mega, and the Mega and ESP can talk over serial (Mega-Serial3, ESP-Serial)

So I've got a WebServer running on the ESP, as well as loaded a MySQL connector library so it can read/write data to a remote MySQL Server.

The Mega will connect using SoftwareSerial with 3 other Pro-Mini's, each with 8 sensors (limit of analog pins) and send results via Serial3 to the ESP which will parse the data, and do inserts into the database. 
The WebServer can then read this data and display it...

I'm concerned that all this DIP Switch switching is going to kill the tiny little switch!

There is also the MODE button, which existing instructions say you must push to program the ESP.  Well, I can program the ESP with the proper DIP Switch settings, and don't need the MODE button. In fact, if I have the DIP Switches in another configuration, the MODE button doesn't do anything....  I'm hoping it's a shortcut so you don't need to keep changing the DIP switches all the time during development...

Some actual instruction here would help, do you just press it and release at any time? press and hold during upload? Press and hold at bootup? Tried em all, nothing....

I've only had this for a couple days,. and I like it, and will be ordering more, but I sure hate the thought of it becoming useless over a mangled dip switch....

Juraj

I'm concerned that all this DIP Switch switching is going to kill the tiny little switch!
You can use OTA upload to esp8266
or
Topic: Arduino + ESP8266 with EspProxy (develop without rewiring) (read all posts in the topic)
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

odam2k

I couldn't get IDE OTA to work, the network port isn't showing up, so rather than mess with that, I'm using web browser update for now, and that solves my problem with the dip switches, thanks!

I still don't know what the mode button is supposed to be used for, but everything seems to be working.

arkarash

Hi,
I have one of these modules and I can load the sketchs without problems in both the ESP and the Mega changing the DIP's. The problem comes because my ESP only uses it as an AP so that the Mega receives data. The AP is reflected in the WiFi search but when you connect to the AP it disappears and you have to turn off the power so that it goes back out because no reset succeeds.

Thinking that it was the module that was defective I bought a second module and it does exactly the same. The fact is that the same sketch I put in my Nodemcu and works perfectly.

Juraj

Hi,
I have one of these modules and I can load the sketchs without problems in both the ESP and the Mega changing the DIP's. The problem comes because my ESP only uses it as an AP so that the Mega receives data. The AP is reflected in the WiFi search but when you connect to the AP it disappears and you have to turn off the power so that it goes back out because no reset succeeds.

Thinking that it was the module that was defective I bought a second module and it does exactly the same. The fact is that the same sketch I put in my Nodemcu and works perfectly.
powering of the esp8266 has not enough amps
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

arkarash

powering of the esp8266 has not enough amps
I thought it was a good solution and I put a 12V 3A power supply through the jack input and still do the same, can you feed the esp8266 directly on this board without going through the converter?

Juraj

sorry. the powering on Mega+WiFi is ok. it will be a problem with the esp8266 sketch. better start a new thread and show the code
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

arkarash

sorry. the powering on Mega+WiFi is ok. it will be a problem with the esp8266 sketch. better start a new thread and show the code
I have tried with the example WifiAcessPoint and it is the same. I'm trying to change the firmware to WiFiLink to test

Juraj

one recommendation. clear the flash with esptool and the upload the sketch again
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

Aldo71

Hello, I would like to ask you a help, because I'm not undestanding very well...

Now I use an Arduino uno board with an ESP8266 board mount on its adataptor, the sketch of my project loaded into the Arduino uno works fine using the "WiFiEsp.h" library and the "SoftwareSerial.h" for the communication between the Arduino and the ESP8266.
I haven't load or flash anything into my ESP8266, I had just connect it to the pin of the virtual serial and power supply of course.

I would like to move my project to this board, doesn't it works as the same? My sketch just adapted for a Atmega2560 isn't enought to work properly with this board? Do I need to load something into the ESP8266 unit or does it need some setting? This is what I am not undestanding...

Thank you very much if somebody would like to help me !

arkarash

I suppose you are using esp8266 in AT commands mode and transparent serial communication. If so, you have nothing to do if you change to mega. We are talking about a plate that combines the two in one. not separately.

Juraj

Hello, I would like to ask you a help, because I'm not undestanding very well...

Now I use an Arduino uno board with an ESP8266 board mount on its adataptor, the sketch of my project loaded into the Arduino uno works fine using the "WiFiEsp.h" library and the "SoftwareSerial.h" for the communication between the Arduino and the ESP8266.
I haven't load or flash anything into my ESP8266, I had just connect it to the pin of the virtual serial and power supply of course.

I would like to move my project to this board, doesn't it works as the same? My sketch just adapted for a Atmega2560 isn't enought to work properly with this board? Do I need to load something into the ESP8266 unit or does it need some setting? This is what I am not undestanding...

The Atmega 2560 MCU has more Serial ports. The DIP switches on the Mega+WiFi board alows to connect esp8266 to Serial3 of 2560. So you only replace SoftwareSerial instance with Serial3 for the WiFiEsp library.
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

Aldo71

Thanks a lot for replying !

@arkarash No, I'm not using the AT commands in my sketch but the "WiFiEsp.h" library, this is the code I use now with Arduino uno:

#include "WiFiEsp.h"
#include "SoftwareSerial.h"
SoftwareSerial Serial1(A1,A0); // RX, TX

char ssid[] = "SSID";         // your network SSID (name)
char pass[] ="PASSWORD";        // your network password
WiFiEspServer server(80);        //port

void setup()
{
  Serial1.begin (115200);
  Serial.begin(9600);
 
  WiFi.init(&Serial1);    
  Serial.print("Attempting to start AP ");
  Serial.println(ssid);  
  IPAddress localIp(192,168,1,4);
  WiFi.configAP(localIp);  
  status = WiFi.beginAP(ssid, 10, pass, ENC_TYPE_WPA2_PSK); // start access point
  Serial.println("Access point started");
  server.begin();  // start the web server on port
  Serial.println("Server started");

 }
WiFiEspClient client = server.available();

  if (client) {                                            

   while (client.connected()) {       // loop while the client's connected
     
     if (client.available()) {            // if there's bytes to read from the client,

       ......// receive data from a wi-fi client device
     }
   }
 }

I would like to move to ATmega2560 and if possible I want use the board we are talking about which combines atmega+ESP.

@Juraj Modify my sketch to replace SoftwareSerial with Serial3 is not a problem.
What I was not sure is if this board is ready to use WiFiEsp library or it needs an ESP8266 filmware upgrade


Juraj

@Juraj Modify my sketch to replace SoftwareSerial with Serial3 is not a problem.
What I was not sure is if this board is ready to use WiFiEsp library or it needs an ESP8266 filmware upgrade
I don't have the board. I somehow become an expert on connecting esp8266 to Arduinos and helped on forum whith this board based on reference and schematics. As I can remember from forum discussions the esp8266 on boar has AT firmware. And if not, the it is easy to flash it.
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

Go Up