Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Unsupported firmware 3.0.4 #204

Open
makarna35 opened this issue Oct 8, 2020 · 17 comments
Open

Warning: Unsupported firmware 3.0.4 #204

makarna35 opened this issue Oct 8, 2020 · 17 comments

Comments

@makarna35
Copy link

I get this warning message:

[WiFiEsp] Warning: Unsupported firmware 3.0.4

Library work but show this Warning on Serial monitor

My ESP-01 module AT version:
AT+GMR
AT version:1.7.4.0(May 11 2020 19:13:04)
SDK version:3.0.4(9532ceb)
compile time:May 27 2020 10:12:17
Bin version(Wroom 02):1.7.4
OK

@JAndrassy
Copy link

use my WiFiEspAT library

@makarna35
Copy link
Author

use my WiFiEspAT library

Your library compitable with mathworks/thingspeak-arduino ?

@JAndrassy
Copy link

use my WiFiEspAT library

Your library compitable with mathworks/thingspeak-arduino ?

It is an Arduino WiFi library like the WiFiEsp, but it doesn't support SSL with AT 1.7.4, only with 2.1.0+.
https://github.com/jandrassy/WiFiEspAT/blob/master/README.md

@Legsmaniac
Copy link

@JAndrassy Does your library support DNS?
I like to set Statip IP and whilst you can do this with WiFiEsp with Config.begin(IPAddress, ssid) that's all it does allow.
It doesn't allow setting gateway, netmask or DNS, it's the DNS that is important for me.

I'm already guessing the answer is no, impossible because the AT Command Set doesn't support it. Am I right?

@JAndrassy
Copy link

@JAndrassy Does your library support DNS?
I like to set Statip IP and whilst you can do this with WiFiEsp with Config.begin(IPAddress, ssid) that's all it does allow.
It doesn't allow setting gateway, netmask or DNS, it's the DNS that is important for me.

I'm already guessing the answer is no, impossible because the AT Command Set doesn't support it. Am I right?

https://github.com/jandrassy/WiFiEspAT/blob/master/src/WiFi.h#L71

@Legsmaniac
Copy link

Thanks for the reply.
Just tried your fork, however it throws up error when compiling.
Error compiling for board Arduino Mega or Mega 2560.
The original WiFiEsp compiles fine.

@JAndrassy
Copy link

JAndrassy commented Mar 16, 2021

Thanks for the reply.
Just tried your fork, however it throws up error when compiling.
Error compiling for board Arduino Mega or Mega 2560.
The original WiFiEsp compiles fine.

and what do you compile? and what compilation error?

@Legsmaniac
Copy link

This is my original code as it stands at the moment, it's part of a larger project.
Naturally, I changed the line #include "WiFiEsp.h" for #include "WiFiEspAT.h" and also tried #include <WiFiEspAT.h> but it doesn't like it when compiling for Mega2560.

#include <Arduino.h>
#include "WiFiEsp.h"
#include "WiFiEspUdp.h"
#include <NTPClient.h>
#include <Wire.h>
#include <ds3231.h>

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

// Define NTP Client to get time
WiFiEspUDP ntpUDP;
NTPClient timeClient(ntpUDP);

// First Boot variable
int firstBoot = 1;

// Create time variables
int currentHour;
int currentMinute;
int currentSecond;
int currentDate;
int currentMonth;
int currentYear;

String currentDay;

int xmasHour;
int xmasMinute;
int xmasSecond;

int monthDays;
int daysMonth[12] = {358, 327, 299, 268, 238, 207, 177, 146, 115, 85, 54, 24};

char buffer [16];
struct ts tm;
String message;

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

//  IPAddress local_ip(192,168,1,198);
//  IPAddress dns_server(192,168,1,254);
//  IPAddress gateway(192,168,1,254);
//  IPAddress subnet(255,255,255,0);


//  WiFiEsp.config(local_ip, dns_server, gateway, subnet);

  // You're connected now
  Serial.println("You're connected to the network");

  timeClient.begin();
  timeClient.setTimeOffset(0);

  Wire.begin();
  DS3231_init(DS3231_CONTROL_INTCN);

}  //End Setup

void loop()    {

  // Call time routine
  tikTok();

  // Call time update check
  timeUpdate();

  // Call Countdown routine
  countDown();

  delay(1000);

} // End Loop

void timeUpdate()  {

  // Resync RTC with NTP 0200hrs daily or on first boot up
  if (tm.hour == 2 && tm.min == 0 && tm.sec == 0 ||  firstBoot == 1)  {
    Serial.println("Resyncing.....");
    //  Get time
    while (!timeClient.update());
    unsigned long epochTime = timeClient.getEpochTime();
    currentHour = timeClient.getHours();
    currentMinute = timeClient.getMinutes();
    currentSecond = timeClient.getSeconds();
    currentDay = timeClient.getFormattedDate();
    currentDate = (currentDay.substring(8, 10)).toInt();
    currentMonth = (currentDay.substring(5, 7)).toInt();
    currentYear = (currentDay.substring(0, 4)).toInt();

    //  Check if Summer Time
    unsigned long startBST = (1551398400 + ((currentYear - 2019) * 31536000)) + ((((31 - (((5 * currentYear) / 4) + 4) % 7) - 1) * 86400) + 3600) + (int((currentYear / 4) - 504) * 86400);
    unsigned long endBST = (1569888000 + ((currentYear - 2019) * 31536000)) + ((((31 - (((5 * currentYear / 4)) + 1) % 7) - 1) * 86400) + 3600) + (int((currentYear / 4) - 504) * 86400);
    //  If Summer Time, add 1 hour
    if (epochTime >= startBST && epochTime <= endBST)  {
      timeClient.setTimeOffset(3600);
    }
    //  Not Summer Time
    else {
      timeClient.setTimeOffset(0);

      //  Set H:M:S from web server
      tm.hour = currentHour;
      tm.min = currentMinute;
      tm.sec = currentSecond;
      tm.mday = currentDate;
      tm.mon = currentMonth;
      tm.year = currentYear;
      DS3231_set(tm);

      //  Void First Boot
      firstBoot = 0;
      Serial.println("NTP Time Update set.");
    }
  }
}  // End timeUpdate

void tikTok() {

  //  Refresh time from RTC
  DS3231_get(&tm);
  currentHour = tm.hour;
  currentMinute = tm.min;
  currentSecond = tm.sec;
  currentDate = tm.mday;
  currentMonth = tm.mon;
  currentYear = tm.year;

  sprintf (buffer, "Time: %02u:%02u:%02u\n", currentHour, currentMinute, currentSecond);
  Serial.print (buffer);
  sprintf (buffer, "Date: %02u-%02u-%04u\n", currentDate, currentMonth, currentYear);
  Serial.print (buffer);

}  // End TikTok

void countDown()  {

  DS3231_get(&tm);
  xmasHour = 23 - tm.hour;
  xmasMinute = 59 - tm.min;
  xmasSecond = 59 - tm.sec;

  sprintf (buffer, "Time to Xmas: %02u:%02u:%02u\n", xmasHour, xmasMinute, xmasSecond);
  Serial.print (buffer);

  monthDays = daysMonth[currentMonth - 1] - currentDate;
  if (currentMonth <= 2 && currentYear % 4 == 0)  {
    monthDays ++;
  }
  if (monthDays <= -1)  {
    monthDays = 390 - currentDate;
    if ((currentYear + 1) % 4 == 0)   {
      monthDays ++;
    }
  }
  monthDays ++; // Add one for Sleeps rather than days
  switch (monthDays)  {
    case 0:
      message = "It's Christmas Day!\n";
      break;
    case 1:
      message = "Christmas Eve! Only 1 more sleep!\n";
      break;
    default:
      message = "Only " + String(monthDays) + " more sleeps to Christmas!\n";
  }
  Serial.println(message);
}  // End countDown

@JAndrassy
Copy link

JAndrassy commented Mar 16, 2021

install WiFiEspAT from Library Manager and try the examples

@Legsmaniac
Copy link

It's already installed but good point, I'll try one of the examples..............

@Legsmaniac
Copy link

Right, test passed.
Investigating further, it looks like it may well be the #include "WiFiEspUdp.h" that is the problem as this is calling for WiFiEsp-Master. Yet if I rename it #include "WiFiEspATUdp.h", it throws a wobbly.
Thoughts?

@Legsmaniac
Copy link

I could try re-writing my project and use Time.lib instead I guess.

@JAndrassy
Copy link

JAndrassy commented Mar 17, 2021

Right, test passed.
Investigating further, it looks like it may well be the #include "WiFiEspUdp.h" that is the problem as this is calling for WiFiEsp-Master. Yet if I rename it #include "WiFiEspATUdp.h", it throws a wobbly.
Thoughts?

UDP is included with #include <WiFiEspAT.h>
WiFiEspAT.h is a wrapper to identify the library. all the other files don't have EspAT in name.

Note: WiFiEspAT is not a fork of this library. It is original code with a very different and more robust concept of 'driver'

@Legsmaniac
Copy link

UDP is included with #include <WiFiEspAT.h>

Hmmmmmm. Why then won't it compile for me? As mentioned above, I have WiFiEspUdp.h yet it gives me this error when I attempt to compile......

XmasClock:3:10: fatal error: WiFiEspUdp.h: No such file or directory
 #include <WiFiEspUdp.h>
          ^~~~~~~~~~~~~~
compilation terminated.
exit status 1
WiFiEspUdp.h: No such file or directory

I have tried both "WiFiEspUdp.h" and <WiFiEspUdp.h> and both fail.

@JAndrassy
Copy link

please read again my previous comment

@Legsmaniac
Copy link

please read again my previous comment

I did.
You said "UDP is included with #include <WiFiEspAT.h>".
So from that I take that to mean UDP should still work,
However you also say "Note: WiFiEspAT is not a fork of this library."
Do I assume from this that WiFiEspUdp therefore doesn't work and it's some other command?
If I then try commenting it out, the following doesn't work .....

WiFiEspUDP ntpUDP;
NTPClient timeClient(ntpUDP);

So what are the required commands I now need to use instead please? I can find no documentation on it.

@JAndrassy
Copy link

JAndrassy commented Mar 17, 2021

I can find no documentation on it.

really? there are examples in IDE Examples menu. there is documentation link in Library Manager. so usual places.

the common Arduino UDP example UdpSendReceiveString has a version for WiFiEspAT, which has only

#include <WiFiEspAT.h>

at the top. there is no WiFisomethingUdp.h.
if you look in the folder with the library or list the files on GitHub, or if you look into the .h files you will immediately see that the Udp include is named WiFiUdp.h, but it is included in WiFi.h which is included in WiFiEspAT.h so you don't have to include it in the sketch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants