BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Connection to Cloud server

Before creating the topic

  1. Search forum for similar topics
  2. Check http://docs.blynk.cc and http://help.blynk.cc/
  3. Add details :
    • Hardware model + communication type. For example: Arduino UNO with Ethernet Shield
    • Smartphone OS (iOS or Android) + version
    • Blynk server or local server
    • Blynk Library version
    • Add your sketch code. :point_up:Code should be formatted as example below.

Simply paste your code between ``` If you don’t format your code, your topic can be deleted by moderators.

/* 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[] = "xxxxxxxxxx143a69a5bd844bxxxxxxxx";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "VodafoneMobileWiFixxxxxxxxx";
char pass[] = "xxxxxxxxxxx";
String response = "";  
char c ;
// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1

// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(4, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 19200

ESP8266 wifi(&EspSerial);

void setup()
{
  // Debug console
  Serial.begin(19200);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);
 // EspSerial.println();
//   sendData("AT+RST", 3000, true);
//  sendData("AT+UART?", 3000, true);
// sendData("AT+CIPSERVER?", 3000, true);
// sendData("AT+CIPSTATUS?", 3000, true);
  // Blynk.begin(auth, wifi2, ssid, pass);
 // wifi.setDHCP(1, 1, 1); //Enable dhcp in station mode and save in flash of esp8266
  Blynk.config(wifi, auth, "blynk-cloud.com", 80);
 // Blynk.config(wifi, auth, "45.55.96.146", 80);
   //Blynk.config(auth);

  //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, "45:55:96:146", 443);
  Blynk.connect();
}

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!
}

Not the easiest create of topic! Does not show where I should type???
Hope this is correct!
I am really in a cul-de-sac, no idea what to do, have done hundreds of readings on Internet and this forum, no answer.
Android 8, Esp8266 2016, it recognizes latest commands.Tried on windows 10 and windows 7, same.
The code does not matter, because it works on another modem, a MicroTik Routerboard…
This is just an example sketch I am using to test, gives the same results.
I initially thought maybe too much code, then Arduino Uno acts strange, so tried less code.
At home it does not work on my Vodafone wifi modem, a Huawei: It connects to the wifi modem, but then prints message: Login timeout repeatedly.
I have tried hundreds of different things, think it is likely my modem.
What I do not understand, is, if it is the modem, how come I can connect to cloud server by sending individual commands to the Esp8266?
Got the IP back, 45.55.96.146
But how to fix?

This is the second thread you’ve created. I’ve deleted your first as it didn’t contain anything except the template text.

Try scrolling up and reading what you’ve posted in this thread and ask yourself if it makes any sense to other forum users. You’ll see that the template text prompts you to add things like details of your hardware, library and app versions etc. This text is meant to be delegated by you and replaced with the requested information, plus a description of your problem. The title of your other thread implied that you were having problems connecting to the cloud server. If that’s the case then you should include the output from your serial monitor as well.

Please use the pencil icon at the bottom of your first post to edit it so that we can understand your problem and offer some guidance as to how to solve it.

Pete.

In your research on this forum, did you see any mention of 9600 being the fastest baud rate that can be used successfully with a combination of Arduino Uno and ESP-01?
Dig a little deeper and you’ll find information on the AT commands needed to set the ESP-01 to the correct baud rate to match your sketch. You’ll also see people recommending separate power supplies, with a shared ground, for the Arduino and ESP-01.

Pete.

Hi Pete, no use talking about baud. It works!
Only on my modem it does not. Also, not much to type re serial, runs until connected to wifi router, then I get login timeout. That is all. Nothing to do with baudrate. I have tried 9600. Did not expect such a curt, almost nasty reply after battling for so long. Thanks anyway

If the BAUD rate is too high then, while it will work for the initial connection between the Arduino and ESP, it might fail once attempting Blynk connection.

Your prior time battling is not relevant to our answers. We see many, many, many, questions… 99% already answered in this forum, and answer accordingly to your your own questions details and tone.

Please follow the given advice, lower the BAUD rate and provide us with less pain and more details like code, Debug Serial output (if you have another TTL-Serial adapter to do so with), versions, wiring and power setup, etc. Then we will try to make sense of it and assist.

Just two things:

  1. It worked at my sister’s place. 100%, been tested for a week, no problems.
    Then I came home and it did not work here.
  2. I have tried 9600, did not give readable response.
    Esp8266 supplied from a 3 amp buck converter.
    And as I said, can connect to cloud server at same baud when I send individual commands to Esp8266.
    Here is the serial response as I said, connected to wifi, then login timeout:
[999] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Arduino Uno

[1545] Connecting to VodafoneMobileWiFi-A33145
[4666] 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
[9842] +CIFSR:STAIP,"192.168.0.102"
+CIFSR:STAMAC,"68:c6:3a:da:d8:1d"
[9846] Connected to WiFi
[25588] Login timeout
[57005] Login timeout

Sorry I was also a bit perplexed, 70 years old and having much frustration.
First tried RemoteXY, also did not work on this modem.
And thank you for your trouble.

Then most likely a local networking issue… However, that is also the hardest, if even possible, for us to troubleshoot.

You need to set both code command and reprogram the ESP (with AT commands) when changing BAUD rates… but if as you state it did work elsewhere for extended times then leave it as is for now.

Can you layout your connection details… this looks a lot like your ESP is linking to a mobile hotspot or something, not your home router.

Also, how are you getting the Serial output?? via the programming USB port on the UNO? What is your ESP connection? Can you supply your code (properly formatted as shown in the Welcome Topic) so we can see.

You have a few years on me :slight_smile: and I am also starting to yell “Get off my LAN!” as time goes on :wink: But good on ya for tackling a “current” tech trend :+1:

You might want to read this thread:

I realise that it’s not exactly the same scenario, but as @GunnerTechTools has said, this looks like a mobile hotspot:

I’m guessing from what you’ve said that it’s actually a router that has a 3/4G SIM card in it. In which case, the conclusion from the linked thread that

Vodacom South Africa 3G data connection, is blocking Blynk-cloud (PSH flagged) TCP/IP login binary-payload packets when my NodeMCU attempts to connect via WIFI tethered smartphone

may also apply to your situation. Vodacom appears to be a subsidiary of Vodafone, so I’d think that is where your issue lies.

You should still use a baud rate of no more than 9600 with SoftwareSerial, and a separate PSU with common grounds for your devices if you want consistent results with the hardware you’re using.

Pete.

1 Like

Hi Pete, thanks very much. Makes sense. I should have explained better about the wifi modem with simcard. Will get a proper router. And sorry about my bad first post. I will learn from that mistake

1 Like