So the title says most of it…
I am trying to use a emga 2560 with a ESP 8266 shield, I have verified all my hardware using other methods but when trying to compile this code(See below) for the mega I get an error(See below)
I have a full project running on the node but now want to move to a mega that has an 8266 attached. Can anyone help me with this error?
Code:
// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID "TMPLL4N5_5kx"
#define BLYNK_DEVICE_NAME "Quickstart Device"
#define BLYNK_AUTH_TOKEN "l2blSC4Nlw2KKSZJKDnD7NDNK-JfGGTX"
// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
char auth[] = BLYNK_AUTH_TOKEN;
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Merle";
char pass[] = "ccn9257m";
// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial1
// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 38400
ESP8266 wifi(&EspSerial);
void setup()
{
// Debug console
Serial.begin(115200);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, wifi, ssid, pass, "blynk.cloud", 80);
//Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);
}
void loop()
{
Blynk.run();
// You can inject your own code or combine it with other sketches.
// Check other examples on how to communicate with Blynk. Remember
// to avoid delay() function!
}
Error:
In file included from C:\Users\Joshua Serrao\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkApi.h:36:0,
from C:\Users\Joshua Serrao\Documents\Arduino\libraries\Blynk\src/BlynkApiArduino.h:14,
from C:\Users\Joshua Serrao\Documents\Arduino\libraries\Blynk_Esp8266AT_WM\src/BlynkSimpleShieldEsp8266.h:85,
from C:\Users\Joshua Serrao\Desktop\Plain_mega___8266\Plain_mega___8266.ino:32:
C:\Users\Joshua Serrao\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkParam.h: In member function 'long long int BlynkParam::iterator::asLongLong() const':
C:\Users\Joshua Serrao\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkParam.h:48:50: error: 'atoll' was not declared in this scope
long long asLongLong() const { return atoll(ptr); }
^~~~~
C:\Users\Joshua Serrao\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkParam.h:48:50: note: suggested alternative: 'atol'
long long asLongLong() const { return atoll(ptr); }
^~~~~
atol
C:\Users\Joshua Serrao\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkParam.h: In member function 'long long int BlynkParam::asLongLong() const':
C:\Users\Joshua Serrao\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkParam.h:89:46: error: 'atoll' was not declared in this scope
long long asLongLong() const { return atoll(buff); }
^~~~~
C:\Users\Joshua Serrao\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkParam.h:89:46: note: suggested alternative: 'atol'
long long asLongLong() const { return atoll(buff); }
^~~~~
atol
Multiple libraries were found for "BlynkApiArduino.h"
Used: C:\Users\Joshua Serrao\Documents\Arduino\libraries\Blynk
Not used: C:\Program Files (x86)\Arduino\libraries\Blynk
Multiple libraries were found for "BlynkSimpleShieldEsp8266.h"
Used: C:\Users\Joshua Serrao\Documents\Arduino\libraries\Blynk_Esp8266AT_WM
Not used: C:\Program Files (x86)\Arduino\libraries\Blynk
Not used: C:\Users\Joshua Serrao\Documents\Arduino\libraries\Blynk
exit status 1
Error compiling for board Arduino Mega or Mega 2560.
I have the latest versions of all libraries installed so that should rule out one issue hopefully?