I have bought this board.
I have success with understanding of DIP switches. But, I am failing to integrate Blynk with this board:
I am not able to understand at all which code I have to upload to Mega, or the ESP8266, what example to choose for which Module, and which Board to choose - the WeMos Pro R1 or the Arduino Mega 2560.
Its been like this for the past 24 hours and seriously, I am not able to understand what I shall do.
Please help me out with this one. I know I am asking for a lot but your help is sincerely appreciated.
UPDATE; I have some success
I got the ESP connected to Blynk, an extra DIP was turned on.
The code was
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
This example runs directly on ESP8266 chip.
Note: This requires ESP8266 support package:
https://github.com/esp8266/Arduino
Please be sure to select the right ESP8266 module
in the Tools -> Board menu!
Change WiFi ssid, pass, and Blynk auth token to run :)
Feel free to apply it to any other example. It's simple!
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "AuthToken";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "NetworkSSID";
char pass[] = "Password";
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
}
void loop()
{
Blynk.run();
}
Now, I want to ask how do I connect the ESP8266 to the onboard Atmega2650. I want to take data from soil sensors from Atmega2650 and use the data to make a few conditions that I have figured out.,
I just want to know what do I write on code so that mega connects with ESP and I am able to send notifications on mobile phone.
FINAL UPDATE: I have figured out the DIP Switches and the Code.
See in the Thread to see the Code.
This is the configuration for DIP Switches
I think youâll find that youâre supposed to be running the default factory âATâ firmware on the ESP and a regular Arduino + ESP simple shield sketch on the Arduino.
If you search the forum youâll find some info on similar boards, and how to re-flash the ESP with AT firmware.
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
WARNING!
It's very tricky to get it working. Please read this article:
http://help.blynk.cc/hardware-and-libraries/arduino/esp8266-with-at-firmware
Youâll need:
- Blynk App (download from AppStore or Google Play)
- Arduino Mega 2560 board
- Decide how to connect to Blynk
(USB, Ethernet, Wi-Fi, Bluetooth, ...)
There is a bunch of great example sketches included to show you how to get
started. Think of them as LEGO bricks and combine them as you wish.
For example, take the Ethernet Shield sketch and combine it with the
Servo example, or choose a USB sketch and add a code from SendData
example.
*************************************************************/
/* Uploads on SWITCHES ON - 3,4
WORKS ON SWITCHES ON : 1, 2*/
//it works
#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "AuthToken";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "NetworkName";
char pass[] = "Password";
// 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 115200
ESP8266 wifi(&EspSerial);
void setup()
{
// Debug console
Serial.begin(9600);
// 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.com", 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!
}
This code is for communicating between ESP8266 (ESP-01) and Atmega2650
Well, each child has wishes different from each other and I have got mine! What do you want? anyways, Happy Christmas to each of my friend on Blynk Community and you PETE!!!
Hi @cmilian it really depends what youâre wanting to achieve, and to a degree what youâve done so far.
If you want the onboard ESP8266 to act as a WiFi modem for the Arduino Mega part of the board then this is done as shown in the table, and documented in the codeâŚ
Upload code to Arduino : SWITCHES ON - 3, 4
Operation mode : SWITCHES ON : 1, 2
However, if you have previously set switches 5, 6 & 7 to the ON position and uploaded a sketch to the onboard ESP8266 then this wonât work, a you will have overwritten the factory âATâ firmware. To resolve that youâll need to get hold of a copy of the factors firmware for the ESP8266 and upload it.
When you have switches 1 & 2 in the ON position and the other switches set to OFF then the ESP8266 is connected to hardware COM port 3 on the Arduino and your Arduino sketch needs to reflect this.
I think I was able to get it done, I am stuck now on the [1609] ESP is not responding.= error.
Here is my code:
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
WARNING!
It's very tricky to get it working. Please read this article:
http://help.blynk.cc/hardware-and-libraries/arduino/esp8266-with-at-firmware
Youâll need:
- Blynk App (download from AppStore or Google Play)
- Arduino Mega 2560 board
- Decide how to connect to Blynk
(USB, Ethernet, Wi-Fi, Bluetooth, ...)
There is a bunch of great example sketches included to show you how to get
started. Think of them as LEGO bricks and combine them as you wish.
For example, take the Ethernet Shield sketch and combine it with the
Servo example, or choose a USB sketch and add a code from SendData
example.
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "removed on pourpose";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Sebi";
char pass[] = "Crifdgfdg";
// 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 9600
ESP8266 wifi(&EspSerial);
void setup()
{
// Debug console
Serial.begin(9600);
// 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.com", 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!
}
That is not correct.
I use 1,2,3,4 on rest off to program the 2560.
If you want to program the esp then 5,6,7 on and all others off.
You can leave 1,2,3,4 on and rest off to run and program. no need to change them to run or program the mega 2560 section.
What I do is leave 1,2,3,4 on and rest off to run and program mega. To program the esp part after the initial esp is initially programmed I set up the esp accept OTA so no need to ever change the dip switched againâŚ
I am facing a similar issue. Can you explain the solution that you found?
I cannot decide which board to choose in the Blynk application. I am also unable to integrate ESP module with the AtMega 2560. I want to use the analog pins of Mega to read sensor data over WiFi.
Please help me with the same.
I have the same board.
As I said earlier in this topic, Iâve never used one of these boards and never will, so donât have any first hand experience.
The key issue as far as the sketch is concerned is selecting the correct serial port, but thatâs discussed above.
As far as the board is concerned, you need to get the switch settings correct, and NEVER upload a sketch to the ESP8266 part of the board if you want to use the BlynkSimpleShieldEsp8266.h library, where the code runs on the Mega and the ESP acts as a WiFi modem.