Need help with ESP-01s and Arduino Nano

Are you 100% sure that your Wi-Fi SSID and password are correct in your code?
Remember that both SSID and password are case sensitive.

Pete.

Verify your SSID and password, if it’s ok you can :

1-Try to reset your ESP : AT+RESTORE,
2-After fix speed : AT+UART_DEF=9600,8,1,0,0
3-You can fix ESP in station mode : AT+CWMODE_DEF=1
4-And try to fix IP, GATEWAY and MASK : AT+CIPSTA_DEF=“192.168.6.100”,“192.168.6.1”,“255.255.255.0”

you can find list of AT commands here :

Gunner -> those different numbers were different after each reset,i copy/pastethem as they apeared.

Aklain - Thank you, your post is very constructive and helpful…

but i done following:
I set ESP to client mode and disable it’s DHCP
AT+CWDHCP=1,1 - disabled

and i get this:

[19] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.4.10 on Arduino Nano

[605] Connecting to MyNetwork
[3816] AT version:1.2.0.0(Jul  1 2016 20:04:45)
SDK version:1.5.4.1(39cb9a32)
Ai-Thinker Technology Co. Ltd.
Dec  2 2016 14:21:16
OK
[9120] +CIFSR:STAIP,"192.168.1.81"
+CIFSR:STAMAC,"dc:4f:22:0a:0b:23"
[9127] Connected to WiFi

:slight_smile: but when i start blynk on my mobile phone i get message “Device is ofline”

And Yes Auth Token is right one and correct.

Any further ideas?

Verify your token.

When your use AT+CIPSTA_DEF you need to enter an IP, GATEWAY and MASK. Verify with “AT+CIPSTA_DEF?” there are all ok. Disable DHCP is not useful when you set an address with AT+CIPSTA_DEF.

This configuration will store in Flash user parameter area.
This configuration interacts with DHCP related AT commands (AT+CWDHCP related):
•If enable static IP, DHCP will be disabled;
•If enable DHCP, static IP will be disabled;
•This will depend on the last configuration.

Any solutions?

I did not realize that i must set all manually.

I set fixed IP,Gateway and Mask with:

AT+CIPSTA_DEF=“192.168.1.100”,“MyGateway”,“255.255.255.0”

and i get this:

[19]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
///_, /////_
/__/ v0.4.10 on Arduino Nano

[605] Connecting to MyNetwork
[3815] AT version:1.2.0.0(Jul 1 2016 20:04:45)
SDK version:1.5.4.1(39cb9a32)
Ai-Thinker Technology Co. Ltd.
Dec 2 2016 14:21:16
OK
[4915] Failed to enable MUX
[8111] +CIFSR:STAIP,“192.168.1.100”
+CIFSR:STAMAC,“dc:4f:22:0a:0b:23”
[8119] Connected to WiFi
[18550] Ready (ping: 38ms).

And example with turning led on/of works…nice

But what this mean “[4915] Failed to enable MUX” ?
Is there any waythat IP,Gateway and Mask can be obtained automatically?

For example i make some project but my “Default Gateway” is not the same every time,
or i want to connect my project to another WiFi network(assuming same nameand password) with another Gateway…

Generally the gateway of your local network should not move. Often this is the IP address used to access the administration of your router, which often acts as a DHCP server. In your case certainly 192.168.1.1 or 192.168.1.254

The error “Failed to enable MUX” can happen at the start.

is there any way (method) to check if connection to wifi is succesfuly established from code?

You can enable debug by use :

#define BLYNK_DEBUG // Optional, this enables lots of prints
#define BLYNK_PRINT Serial

Verify all this points :

Troubleshooting
Connection

If you experience connection problems, follow these steps:

    Check that your hardware, wires, cables and power supply are good quality, not harmed or damaged, etc.
    Use high power USB cables and USB ports.
    Check your wiring using the examples (TCP/HTTP Client or similar) provided with your shield and hardware.
        Once you understand how to manage connection, it’s much easier to use Blynk.
    Try running command telnet blynk-cloud.com 8442 from your PC, connected to the same network as your hardware. You should see something like: Connected to blynk-cloud.com..
    Try running Blynk default examples for your platform without modifications to see if it is working.
        Double-check that you have selected the right example for your connection type and hardware model.
        Our examples come with comments and explanations. Read them carefully.
        Check that your Auth Token is valid (copied from the App and doesn’t contain spaces, etc.)
        If it doesn’t work, try looking into serial debug prints.
    Done! Add your modifications and functionality. Enjoy Blynk!

Note: when you have multiple devices connected to your network, they should all have different MAC and IP addresses. For example, when using 2 Arduino UNO with Ethernet shields, flashing default example to both of them will cause connection problems. You should use manual ethernet configuration example.
WiFi network connection

If you encounter WiFi connection problems, please check these pitfalls:

    You’re trying to connect to “WPA & WPA2 Enterprise” network (often used in offices), and your shield does not support this security method
    Your WiFi network has a login page that requests entering an access token (often used in restaurants)
    Your WiFi network security disallows connecting alien devices completely (MAC filtering, etc)
    There is a firewall running. Default port for hardware connections is 8442. Make sure it’s open.

Can you paste your code here and give your GATEWAY. I think is a problem with your network.

Aklain you did not understand it works i sad this in earlier post.

I asked only if is it possible to check if connection to wifi is succesfuly established from code…

Sorry, I understand that you still have problems.

You can use “Blynk.connected()” like exemple :

if (Blynk.connected()) {
  //do what you want 
}
else {
  //do what you want 
}

You can find all you want in the Blynk documentation :

http://docs.blynk.cc/

No, you do not need to be sorry, you have been very helpfull.

Yes “[4915] Failed to enable MUX” is still there but it works even with that…i am not sure if this is serius problem.

And i still wondering Is there any way that IP,Gateway and Mask can be obtained automatically.

Yes the default is for an ESP to get all the details automatically even when used as a shield for an Arduino Nano.

Costas - and why mine is not capable to do that?

OR how to make it to do it automaticaly?

At home i use actually 4 esp-01 and my DHCP don’t work very well with us (give IP when he want). I think there are problem with some router.

I see that lots of examples are using ESP8266WiFi.h library but i am missing one, i can’t compile.

So what library is that? Who wrote it,where i canfind it? in Arduino library manager the list is long with diferent ESP8266 libraries, which is the right one?

In reference to Blynk Libraries (seeing how this is a Blynk forum :stuck_out_tongue_winking_eye: ) It depends on what hardware you use, and in what configuration…

http://help.blynk.cc/how-to-connect-different-hardware-with-blynk/arduino/esp8266-standalone

http://help.blynk.cc/how-to-connect-different-hardware-with-blynk/arduino/esp8266-with-at-firmware

I like to pick and chose my hardware and connection type in the Sketch Builder and see that Blynk Libraries are used in the examples.

U did not explain too much…

For example i will try to be more specific, on this link:

How to compile example!??
Costas wrote some code…but i can not compile it, Where,HOW, which library for my setup?
ESP8266 - (ESP-01) - Arduino (Nano)?

I answered the specific question you asked… basically “it depends” :stuck_out_tongue_winking_eye:

That particular example is for ESP as a standalone, using actual Blynk library and code (aka firmware) uploaded on the ESP itself. No Arduino.

But when an ESP is used with AT firmware (not Blynk code, just simple AT command code) then it simply acts as a WiFi to serial adapter for the Arduino… and the Arduino runs the Blynk library and code… but a different Blynk library, one that is not compatible with some of the files required for that example; ESP8266WiFi.h library Blynk.connectWiFi() & Blynk.config() commands, etc.

hehe… so that code in example is impossibe torun in my setup…

Ok… so how i can achieve same result as written in this example?
is there any blynk. methods?