BLYNK
HOME       📲 GETTING STARTED       đź“— DOCS       âť“HELP CENTER       👉 SKETCH BUILDER

Login timeout error

Im new to Blynk and Arduino and I’m trying to get a DHT 22 sensor to work with it and for some reason it keeps coming up with
[0]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v0.6.1 on Arduino Mega ADK

[94] Connecting…
[3115] Login timeout
[5115] Connecting…

could someone please help

Please post your sketch.

Pete.

/*************************************************************
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 shows how value can be pushed from Arduino to
the Blynk App.

WARNING :
For this example you’ll need Adafruit DHT sensor libraries:
https://github.com/adafruit/Adafruit_Sensor
https://github.com/adafruit/DHT-sensor-library

App project setup:
Value Display widget attached to V5
Value Display widget attached to V6
*************************************************************/

/* Comment this out to disable prints and save space */

#define BLYNK_PRINT Serial


#include <BlynkSimpleStream.h>
#include <DHT.h>


char auth[] = "0HYGVE5MuxEHATWVKaPJLtj7FcblRdGQ";

#define DHTPIN 2


#define DHTTYPE DHT22   // DHT 22 


DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;

// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void sendSensor()
{
  float h = dht.readHumidity();

  if (isnan(h))
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V5, h);

}

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

  // Blynk will work through Serial1
  // Do not read or write this serial manually in your sketch
  Serial1.begin(9600);
  Blynk.begin(Serial, auth);

  dht.begin();

  // Setup a function to be called every second
  timer.setInterval(10000, sendSensor);
}

void loop()
{
  Blynk.run();
  timer.run();
}

@Mason please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

Sorted the ``` and also the app is saying it want online yet aswell

So, you’re trying to use the Blynk serial connection.
This requires you to edit the script to specify the correct COM port and to have the script running in a command prompt window all of the time. Have you done this?

Also, you are attempting to use the Serial port for both debug messages and the serial connection to Blynk via your PC. You can’t do this.
If you want to see serial debug messages with this connection method then you’ll need an FTDI adapter connected to a different hardware serial port on your Mega, and re-direct your debug messages to that port.

Pete.

Yeah I’m trying to use the serial connection and I’ve changed the script to specify this but it keep coming up with different errors and I’ve also tried the CMD and it coming up with more errors.
and how do you change it so I can use the Serial port for just the serial connection to Blynk to the PC


Remove this…

And this is a waste of time…

as Serial1 is not being used for anything.

You may also want to change the script to use port 8080 instead of 80.

Pete.