I’ve been with Blynk from the kickstarter stage and it look great. Also I’ve been looking through the site for a solution but haven’t been able to find a solution to my problem.
I’ve flashed the firmware of the ESP-01 to one that is compatible with the Arduino and it looks like it makes it part of the way to connecting. (I have attached the output from 2 different firmware’s I have tried one early one one newer, I’ve flashed almost all the firmware’s i could find to see if anything will work)
I keep getting the following errors.
[14635] Failed to enable MUX
[15646] Failed to set STA mode
I’ve done a search and i didn’t come across these errors is anyone able to tell me whats going on.
---- Additional information
Serial Type from Arduino to ESP-01: Software
Firmware type Flashed: BOOT MODE, Flash size 8Mbit: 512KB+512KB
[591] Connecting to pkgspt
[13612] AT vession:0.25.0/0(Jun 5 2005 16:27:16(
SDK version:1.1.1
Ai,
[14635] Failed to enable MUX
[15646] Failed to set STA mode
@dwadia I didn’t know that there was an SDK dating back to 2005! I wouldn’t bother with that one.
Are you able to successfully send AT commands to the ESP?
I’m not a fan of that device but the following commands might help:
AT+CWMODE=3 // sets the ESP01 to have both AP and Station mode
AT+CIPMUX=1 // sets the ESP01 to have up to 4 simultaneous connections
I connected to the esp-01 via serial and was able to connect. to my wifi network.
This being the case i’m still getting the following error message on the arduino project serial output
[14648] Failed to set STA mode
This being the case this may be something on the Blynk or arduino libraries for the TA commands to the ESP-01
(I’m just using the BlynkBlynk arduino code example from the blynk example builder )
Any ideas whats going on?
-------Serial log
ready
AT+CWMODE=3
OK
AT+CIPMUX=1
OK
AT+GMR
AT version:1.1.0.0(May 11 2016 18:09:56)
SDK version:1.5.4(baaeaebb)
compile time:May 20 2016 15:06:44
OK
AT+CWLAP
+CWLAP:(3,"ssid info)
+CWLAP:(4,ssid info)
+CWLAP:(4,ssid info)
+CWLAP:(3,ssid info)
OK
AT+CWJAP=“SSID”,“PWD”
WIFI CONNECTED
WIFI GOT IP
ESP is powered through a 3.3v Regulator(2 x 220uF filters caps in parallel on the 3.3v power line) connected to a 5V power supply that is used for the Aurduio. %v power supply is from a battery pack that has a step down and power cleaning voltage regulator.
I’m also thinking that i may try setting up the wireless on raspberry Pi 3 as an adhoc network and connect directly to the Raspberry Pi that is running the Blynk server.
----Arduino code
/* 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[] = "XXXXXXX";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "XXXXX";
char pass[] = "XXXXX";
// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial
// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(6, 5); // 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);
Blynk.begin(auth, wifi, ssid, pass,"192.168.001.190");
}
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!
}
I set up the ad-hock connection between the PI(blynk server) and the hardware and there was no change to the disconnection / re-connection error.
Ran the full project of battery power and still didn’t change the problem.
As you can see in the loop is only have the Blynk.run() command so i don’t know whats going on.
Should be no power problem the 5v step down is rated at 3Amps & the 3.3v regulator is rated at 800mA (i’m thinking this should be more than enough to run the WiFi peek power consumption is 300mA as per the data sheet).
Unfortunately no luck, I also changed the ip address to connect to my ad-hock wifi but this didn’t work either.
---- Server Log
2017-02-05 23:18:10.317 INFO - HTTPS Admin UI server listening at 7444 port.
2017-02-05 23:18:10.318 INFO - Web Sockets server listening at 8082 port.
2017-02-05 23:18:10.320 INFO - Web SSL Sockets server listening at 8081 port.
2017-02-05 23:18:10.321 INFO - Mqtt hardware server listening at 8440 port.
2017-02-05 23:26:57.412 INFO - XXXXXX hardware joined.
2017-02-05 23:27:12.330 INFO - XXXXXX hardware joined.
2017-02-05 23:27:37.434 INFO - XXXXXX hardware joined.
2017-02-05 23:28:02.533 INFO - XXXXXX hardware joined.
2017-02-05 23:28:12.595 INFO - XXXXXX hardware joined.
2017-02-05 23:28:22.650 INFO - XXXXXX hardware joined.
2017-02-05 23:28:32.736 INFO - XXXXXX hardware joined.
#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[] = "93d8d2f084bd4637aaf15c8854772339";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "XXXXX";
char pass[] = "XXXXXXXX";
// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial
// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(6, 5); // 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,"10.0.0.5");
}
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!
}
The esp is set to 115200 in the firmware i’ll drop the baud rate tonight and see what happens. I can also try a few other AP solutions and see what happens.
Thanks for all the help. I’ll keep you update as to what happens.
@dwadia the standard shield sketch shows a rate of 115200 but if you study the sketch including the notes then you will work out that this is just for Hardware Serial (Mega, Leonardo etc).
ESP’s come preconfigured to various baud rates and it’s quite common for them to be 115200 but you can’t use this as a shield for Nano’s and Uno’s. Blynk’s AT page gives details of how you make the change.
Ok It looks like it reliably works when you set the baud rate to 19200 for the esp.
The steps i did to get everything work are ass follows.
1.) Flash AT Firmware to esp-01 (Flash Profile i used marked as : Flash size 16Mbit: 512KB+512KB)
2.) Start serial interface on relevant com port at 115200, 8,1,N,N
3.) issue AT command “AT+CWMODE=3” (in putty yo have to press enter then CTRL+J"
4.) Issue AT command “AT+CIPMUX=1”
5.) restart ESP-01
6.) change baud rate with either command “AT+UART_DEF=19200,8,1,0,0” or “AT+IPR=19200”, Only one of them will work.
7.)Make sure that Arduino has the correct baud rate for the ESP-01.
Also to help others out in the future i’ve created the following repository with the firmware, programming tool, instructions, and settings to get the ESP-01 working. Firmware ESP-01 ESP8266 AI-Cloud Black