Go Down

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

arkarash

any guide to flash the esp of this plate? It will be my first time and it gives me a little something. I want to leave it as a nodemcu which is what I usually use

Juraj

any guide to flash the esp of this plate? It will be my first time and it gives me a little something. I want to leave it as a nodemcu which is what I usually use
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"

arkarash

I use nodemcu with Arduino IDE not with LUA. I like that the Esp8266 does not make transparent transmissions if not that analyze the data and those of the breakdown to the Mega to download it because it controls an LCD and several other sensors. Is it possible to use Esp8266 from the combination plate in this way?

Juraj

I use nodemcu with Arduino IDE not with LUA. I like that the Esp8266 does not make transparent transmissions if not that analyze the data and those of the breakdown to the Mega to download it because it controls an LCD and several other sensors. Is it possible to use Esp8266 from the combination plate in this way?
I answered in comment #27

mikenetcom

Please help. I can not connect to wifi my RobotDyn Arduino mega+Wifi. I tried to upload sketch from arduino IDE WiFiWEBServer and other many skatches which work with my ESP-12e without problem. I can see text in serial monitor "Connecting to (My SSID)"...... but can not connect to wifi. May be someone knows why? P.S. I tried to upload firmware from nodeMCU Firmware Programmer. But the same problem

Juraj

try to erase the flash of the esp8266 with esptool. it will erase old RF settings of SDK version used with preinstalled AT firmware. and then upload your sketch from IDE

hossain tipu monaem


Juraj


banaylor

I have WeMos Mega2650 with onboard ESP8266.  I can upload a sketch on the Mega, and it works.  I can upload a sketch on the ESP8266 (scan networks, join, print IP) and it works.  I think I have figured out all of the DIP switches and RX/TX switch settings. I cannot get the Mega <> ESP communicating.

I want to use the Mega to control a number of weather sensors, and then do a HTTPS GET request, over wifi network, to upload weather data to target site.  What code should go where?

Please correct me if wrong, or is there a better way?

ESP8266 should contain sketch to join wifi network, and open Serial3 port
DIP switches: CH340 connect to Mega2560 COM3 connect to ESP8266;  ON for 1 to 4; OFF for 5 to 7;  RXD3/TXD3 on.
Serial 1 is connected to MEGA (i assume)
Serial 3 is connected to ESP (i assume)
MEGA should contain sketch to read weather sensors, and issue HTTPS GET over Serial3

Does anyone have an example sketch for mega and esp to do simple HTTPS GET/POST ?

Juraj

I have WeMos Mega2650 with onboard ESP8266.  I can upload a sketch on the Mega, and it works.  I can upload a sketch on the ESP8266 (scan networks, join, print IP) and it works.  I think I have figured out all of the DIP switches and RX/TX switch settings. I cannot get the Mega <> ESP communicating.

I want to use the Mega to control a number of weather sensors, and then do a HTTPS GET request, over wifi network, to upload weather data to target site.  What code should go where?

Please correct me if wrong, or is there a better way?

ESP8266 should contain sketch to join wifi network, and open Serial3 port
DIP switches: CH340 connect to Mega2560 COM3 connect to ESP8266;  ON for 1 to 4; OFF for 5 to 7;  RXD3/TXD3 on.
Serial 1 is connected to MEGA (i assume)
Serial 3 is connected to ESP (i assume)
MEGA should contain sketch to read weather sensors, and issue HTTPS GET over Serial3

Does anyone have an example sketch for mega and esp to do simple HTTPS GET/POST ?
the Serial3 dip switched connect Serial of esp8266 with Serial3 of Mega.


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() {
}

Juraj

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

bialabs

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 https://www.espressif.com/en/support/download/at)

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.

Juraj

can you help me to flash ESP8266 IDF AT Bin V2.0?
(link https://www.espressif.com/en/support/download/at)

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

bialabs

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

Go Up