Wemos Mega R3 +Wifi

Hello,
I have a Wemos mega wifi R3 + ESP ... which can be mega separately
separately esp
Then there is a function of programming both of the two modes at once, all of them being controlled via Serial ...
My question is how do I get Serial and Serial3 data with myself?
...
On board mega + nrf24 where I download another 3x nrf24 and data from them via pipe function ..
On Serial3 Mam Esp Wifi,

I need to get the data from Serial and send via mysqlconketor to the help server insert into mysql database ...
Do you have a try, especially with the exchange between Serial and Serial3?
thank you for every advice
Roman

Wemos? not Robotdyn Mega + WiFI

you can do with it everything you can do with a Mega and ESP-01.

yes it is it, sorry :slight_smile:
and some advice or a simple example of how to transfer data?

roman_rja:
yes it is it, sorry :slight_smile:
and some advice or a simple example of how to transfer data?

basic Serial communication. like with Serial Monitor. one mcu prints other parses. see Serial Input Basic

or use some firmware in esp8266 to make it a network adapter like the Ethernet or WiFi shield.
AT firmware with WiFiEsp library or WiFi Link firmware with WiFi Link library

or put firmata into Atmega and write sketch for esp8266 with FirmataMaster library accessing the capabilities of Atmega

Juraj:
basic Serial communication. like with Serial Monitor. one mcu prints other parses. see Serial Input Basic

AT firmware with WiFiEsp library ??

I did not find any link on AT firmware anywhere on the site (just this: here , but the firmware is not there :slight_smile: or bad looking ??
Thank you

Juraj:
AT firmware with WiFiEsp library or WiFi Link firmware with WiFi Link library

  1. AT firmware with WiFiEsp library

or

  1. WiFi Link firmware with WiFi Link library

I recommend 2)

I tried everything

  • upload the MEGA code
  • Upload a code to ESP
  • Upload a code to MEGA-ESP
    when I run Wemos in MEGA-ESP mode, it shows me ESP data, but I would need DATA from MEGA mode to send to ESP mode.

I generally imagined
how from the Mega mode where Nrf24 is and collects DATA as DATA PRET in ESP mode, all the rest is me clearly. If DATA in Meg sends over Serial and I will clean DATA over Serial and / or Serial3 ... I do not know

We talked over PMs that you have it working with Ethernet shield and you want only replace the networking to WiFi. I recommended WiFi Link over Serial3 as a direct replacement of Ethernet library. Is it not working?

it does not work or I am doing a bug somewhere, for connecting to Wifi via web panel, esp will not connect with wifi, it reports a problem, but if I connect via sketches I will connect without problems ...
I think have with firmware....
what firmware version is best?

roman_rja:
it does not work or I am doing a bug somewhere, for connecting to Wifi via web panel, esp will not connect with wifi, it reports a problem, but if I connect via sketches I will connect without problems ...
I think have with firmware....
what firmware version is best?

hi roman, did you manage to make work Wifi Link with wemos?

@bialabs, did you try? something doesn't work?

Juraj:
@bialabs, did you try? something doesn't work?

yes i successfully flashed arduino-firmware-wifilink. I see the esp8266 wifi created. But i can't see correctly the http://192.168.240.1/ web panel. Seems that connects to the panel but is slow..the browser continues loading..sometimes the panel shows but partially.
Second thing, with this library is possible to create a Webserver in AP mode? I can't see in examples. Many thanks

bialabs:
yes i successfully flashed arduino-firmware-wifilink. I see the esp8266 wifi created. But i can't see correctly the http://192.168.240.1/ web panel. Seems that connects to the panel but is slow..the browser continues loading..sometimes the panel shows but partially.
Second thing, with this library is possible to create a Webserver in AP mode? I can't see in examples. Many thanks

did you clear the esp8266 flash with esptool before uploading WiFi Link? did you choose lwip 1.4 Higher bandwidth?

no WiFi Link library doesn't have access to AP mode, but if the firmware is in AP mode the sketch uses it

Juraj:
did you clear the esp8266 flash with esptool before uploading WiFi Link? did you choose lwip 1.4 Higher bandwidth?

no WiFi Link library doesn't have access to AP mode, but if the firmware is in AP mode the sketch uses it

i'll try to clear flash with espotool. Many thanks!

Juraj:

  1. AT firmware with WiFiEsp library

or

  1. WiFi Link firmware with WiFi Link library

I recommend 2)

i am currently using the WifiEsp library and is working quite good, but i have a problem when i connect to a mobile hotspot wifi instead a wifi adsl router

when i do
client.connectSSL(server, 443)
it fails more often (unable to connect...)
and if the connect succeds, sometimes i have timeouts and problems with a GET request

seems related with the quality of mobile signal. Some days i have less failures, some days not

in your opinion, how can i improve this behaviour?
better wifi chip? (now is esp01)
improve libray?
improve my code?

i am using the latest AT firmware from espressif

bialabs:
i am currently using the WifiEsp library and is working quite good, but i have a problem when i connect to a mobile hotspot wifi instead a wifi adsl router

when i do
client.connectSSL(server, 443)
it fails more often (unable to connect...)
and if the connect succeds, sometimes i have timeouts and problems with a GET request

seems related with the quality of mobile signal. Some days i have less failures, some days not

in your opinion, how can i improve this behaviour?
better wifi chip? (now is esp01)
improve libray?
improve my code?

i am using the latest AT firmware from espressif

I made a new WiFiEspAT library for AT 1.7, but it doesn't support SSL because the AT firmware doesn't support so called passive mode for SSL yet. So sorry I have no advice for you. The old WiFiEsp library has timeout problems.

Juraj:
I made a new WiFiEspAT library for AT 1.7, but it doesn't support SSL because the AT firmware doesn't support so called passive mode for SSL yet. So sorry I have no advice for you. The old WiFiEsp library has timeout problems.

Ok. I read about your library
I'll try and see if goes better

Any advice/links on how to safely send post parameters without SSL?
Thank you

Juraj:
I made a new WiFiEspAT library for AT 1.7, but it doesn't support SSL because the AT firmware doesn't support so called passive mode for SSL yet. So sorry I have no advice for you. The old WiFiEsp library has timeout problems.

hello, i tried your library and it's better than the wifiesp library if i run the "webclient" sketch

but i'm trying to make it work the wifiesp's WebClientRepeating with no luck (i need to make multiple http connection)

this is my sketch

#include "WiFiEspAT.h"

char ssid[] = "Wifi";            // your network SSID (name)
char pass[] = "pass";        // your network password
int status = WL_IDLE_STATUS;     // the Wifi radio's status

char server[] = "arduino.cc";

unsigned long lastConnectionTime = 0;         // last time you connected to the server, in milliseconds
const unsigned long postingInterval = 10000L; // delay between updates, in milliseconds

// Initialize the Ethernet client object
WiFiClient client;

void setup()
{
  // initialize serial for debugging
  Serial.begin(115200);
  // initialize serial for ESP module
  Serial3.begin(9600);
  // 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);
  }

  // attempt to connect to WiFi network
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network
    status = WiFi.begin(ssid, pass);
  }

  Serial.println("You're connected to the network");
  
  printWifiStatus();
}

void loop()
{
  // if there's incoming data from the net connection send it out the serial port
  // this is for debugging purposes only
  while (client.available()) {
    char c = client.read();
    Serial.write(c);
  }

  // if 10 seconds have passed since your last connection,
  // then connect again and send data
  if (millis() - lastConnectionTime > postingInterval) {
    httpRequest();
  }
}

// this method makes a HTTP connection to the server
void httpRequest()
{
  Serial.println();
    
  // close any connection before send a new request
  // this will free the socket on the WiFi shield
  client.stop();

  // if there's a successful connection
  if (client.connect(server, 80)) {
    Serial.println("Connecting...");
    
    // send the HTTP PUT request
    client.println(F("GET /asciilogo.txt HTTP/1.1"));
    client.println(F("Host: arduino.cc"));
    client.println("Connection: close");
    client.println();

    // note the time that the connection was made
    lastConnectionTime = millis();
  }
  else {
    // if you couldn't make a connection
    Serial.println("Connection failed");
  }
}


void printWifiStatus()
{
  // print the SSID of the network you're attached to
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength
  long rssi = WiFi.RSSI();
  Serial.print("Signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}

the connection works on the first attempt (on serial console i get the asciilogo) but on the second attempt i get infinite empty characters on console

wat is the correct approach to make multiple connection with your library?
i am on Espressif's AT firmware 1.7.1

it was a bug and I found one more. it is fixed in GitHub repo https://github.com/jandrassy/WiFiEspAT
thank you

you can use higher baud rate for Serial3. it works at 500000 baud too

Juraj:
it was a bug and I found one more. it is fixed in GitHub repo GitHub - JAndrassy/WiFiEspAT: Arduino networking library. Standard Arduino WiFi networking API over ESP8266 or ESP32 AT commands.
thank you

you can use higher baud rate for Serial3. it works at 500000 baud too

thank you! it's working now! :slight_smile:

Sometimes client.connect fails (i get "Connection failed"), but on next loop starts working again

i will try also higher bauds