Can't connect except for telnet

hello!

I’m trying to start using blank with my uno and ethernet shield but i can’t connect using the simple exemples except when i send the telnet command:

Last login: Tue Oct 13 20:28:57 on ttys000
MBP-de-Bernardo:~ bernardovalente$ telnet blynk-cloud.com 8442
Trying 45.55.195.102…
Connected to blynk-cloud.com.
Escape character is ‘^]’.
Connection closed by foreign host.

the code:

#define BLYNK_DEBUG // Optional, this enables lots of prints
#define BLYNK_PRINT Serial
#define BLYNK_PRINT Serial // Enables Serial Monitor
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h> // This part is for Ethernet stuff

char auth[] = "b2b8139fbb5942929dc6e44e6c4e5ef6"; // Put your Auth Token here. (see Step 3 above)

void setup()
{
  Serial.begin(9600); // See the connection status in Serial Monitor
  Blynk.begin(auth);  // Here your Arduino connects to the Blynk Cloud.
}

void loop()
{
  Blynk.run(); // All the Blynk Magic happens here...

  // 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 keep getting this in the serial:

[tting IP...
[0] Blynk v0.3.1
[0] Getting IP...

can anyone help me? is it simple?

thank you

does anyone have a solution?

Have you tried to use Ethernet shield without Blynk?

@vshymanskyy, @Dmitriy - what do you think?

no i haven’t, i got it yesterday and im not very familiar with this hole networking stuff, i´ve been browsing through the web and even spoke with vodafone that provides my service and they can’t help me.

what should i do?

Just try using regular Arduino Ethernet examples (bundled with Arduino IDE, not the Blynk).
And read this: https://github.com/blynkkk/blynk-library/blob/master/docs/Troubleshooting.md#connection (Connection problem, point #1)

i was trying to use a static ip but i don’t seem to connect to the server

/*******************************************************************
 Blynk lets you create beautiful drag-and-drop visual interfaces
 for your projects in 5 minutes. And it works with almost every
 hardware out there.

 Docs, Tutorials, everything:  http://www.blynk.cc
 Github:                       http://github.com/blynkkk
 Blynk Community:              http://community.blynk.cc
 Follow Us:                    http://www.facebook.com/blynkapp
                               http://twitter.com/blynk_app

 Blynk library is licensed under MIT license
 This example code is in public domain.

*********************************************************************

 You’ll need, in general:
  - Blynk App (download from AppStore or Google Play)
  - Arduino UNO or similar microcontroller board
  - Decide how to connect Arduino to the Internet (USB, Ethernet,
    Wi-Fi, etc.). Bluetooth is on the way.

 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.

*********************************************************************

 Let’s turn ON your LED with Blynk!
 In this example we'll use Arduino UNO + Ethernet Shield

 5 Steps guide:
 (watch video tutorial here: )

  1. Connect LED to Pin 9
  ( http://arduino.cc/en/uploads/Tutorial/simplefade_bb.png )

 In the Blynk App:
  2. Create New Project
  3. Email yourself Auth Token. You can do it later at any time
  4. Add a Button Widget. Select Pin D9 in Widget's Settings
  5. Press Play icon. Enjoy Blynking!

********************************************************************/
#define BLYNK_DEBUG // Optional, this enables lots of prints
#define BLYNK_PRINT Serial
#define BLYNK_PRINT Serial // Enables Serial Monitor
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h> // This part is for Ethernet stuff

char auth[] = "b2b8139fbb5942929dc6e44e6c4e5ef6"; // Put your Auth Token here. (see Step 3 above)

IPAddress server_ip (10, 0, 0, 10);

// Mac address should be different for each device in your LAN
byte arduino_mac[] = { 0x90, 0xA2, 0xDA, 0x10, 0x1F, 0xC4 };
IPAddress arduino_ip ( 192,   168,   1,  70);
IPAddress dns_ip     (  8,   8,   8,   8);
IPAddress gateway_ip ( 192,   168,   1,   254);
IPAddress subnet_mask(255, 255, 255,   0);

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, "cloud.blynk.cc", 8442, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);
  // Or like this:
  //Blynk.begin(auth, "cloud.blynk.cc", 8442, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);
}

void loop()
{
  Blynk.run(); // All the Blynk Magic happens here...

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

but i get this

[k v0.3.1
[0] Using static IP
[0] Blynk v0.3.1
[0] Using static IP
[1300] My IP: 0.106.106.106
[5001] Connecting to cloud.blynk.cc:8442

and now the talent command doesn’t work

MBP-de-Bernardo:~ bernardovalente$ telnet cloud.blynk.cc
Trying 45.55.195.102…
telnet: connect to address 45.55.195.102: Connection refused
telnet: Unable to connect to remote host

Any ideas? Thank you

I’m having the same issue with my ENC28J60. No way it will connect to Blynk cloud service anymore :frowning:

The regular Arduino examples from UIP work perfectly, for instance the AdvancedChatServer example. So there for I don’t think it’s a connection or module issue. I’m using the 0.3.1 library at the moment, but the 0.3.0 gives the same.

Apparently it was a local issue. I reset my modem and accesspoints and everything went back to normal. I guess it was some weird dhcp or arp issue. So, lesson learned, reset your internet stuff if u can’t connect :slight_smile:

ahah doesn’t work for me though :sweat:

Your IP settings in the Arduino look a bit messed up. It start with 0 and you used 192.x.x.x in your sketch. Have you tried re-uploading the sketch? It most likely is the cause of your problem.

yeah i don’t get it either! i have been trying different stuff for days and i’m not going nowhere…i don’t know what to do more

@bernas_123 Let’s start from the beggining. Execute :

telnet blynk-cloud.com 8442

And post here results.

i get this

MBP-de-Bernardo:~ bernardovalente$ telnet cloud.blynk.cc 8442
Trying 45.55.195.102...
Connected to blynk-cloud.com.
Escape character is '^]'.
Connection closed by foreign host.

Which ethernet shield are you using? I myself use the enc28j60 which basically is a network plug for your arduino and it has been running stable for a couple days now. They are also dead cheap on dx.com, ebay and such. They require just four wires and work perfectly. Can’t really see anything wrong with your setup. Network settings appear to be ok.

Stupid question maybe, but have you tried a different ethernet cable?

I use the official arduino ethernet rev2 i think but in considering trying others, im going to check that one or maybe a wifi shield i dont know. Yeah i tried a couple cable but the result is still the same…

The ENC is not 100% stable if you ask me, but it’s worth a shot because it’s that cheap.

Wifi could be an option too. I have good experience with the esp-12 from dx.com. That does it’s job properly and so far more stable than the ethernet one, weird, but true :slight_smile:

i preferred to use the ethernet shield but i think im gonna give the wifi shield a shot and see if it works and i get a connection. although i really wanted to know why i can’t make an ethernet connection work… many thanks for your responses =)

@bernas_123 Okey. At least problem not in your router (as telnet works). Let’s try first a connection via USB. Please unplug your ethernet shield and follow this instructions. It should take you less than 5 mins. But if USB works than we will come closer to resolve your issue.

1 Like

i tried the usb connection and i was having troubles installing scout cause im using a maca but i got it working but when i copy the serial adress in terminal i get this

Reconnecting in 3s...
Connecting: GOPEN:/dev/tty.usbmodemfa131,raw,echo=0,clocal=1,cs8,nonblock=1,ixoff=0,ixon=0,ispeed=9600,ospeed=9600,crtscts=0 <-> openssl-connect:cloud.blynk.cc:8441,cafile=/Users/bernardovalente/Documents/Arduino/libraries/Blynk/scripts/certs/server.crt,nodelay
2015/10/25 12:54:53 socat[34737] N opening character device "/dev/tty.usbmodemfa131" for reading and writing
2015/10/25 12:54:53 socat[34737] N opening connection to LEN=16 AF=2 45.55.195.102:8441
2015/10/25 12:54:53 socat[34737] N successfully connected from local address LEN=16 AF=2 192.168.1.67:60650
2015/10/25 12:54:53 socat[34737] N trusting certificate, commonName matches
2015/10/25 12:54:53 socat[34737] N SSL connection using ECDHE-RSA-AES128-GCM-SHA256
2015/10/25 12:54:53 socat[34737] N SSL connection compression "none"
2015/10/25 12:54:53 socat[34737] N SSL connection expansion "none"
2015/10/25 12:54:53 socat[34737] N starting data transfer loop with FDs [5,5] and [6,6]
2015/10/25 12:55:10 socat[34737] N socket 2 (fd 6) is at EOF
2015/10/25 12:55:10 socat[34737] N exiting with status 0
Reconnecting in 3s...
Connecting: GOPEN:/dev/tty.usbmodemfa131,raw,echo=0,clocal=1,cs8,nonblock=1,ixoff=0,ixon=0,ispeed=9600,ospeed=9600,crtscts=0 <-> openssl-connect:cloud.blynk.cc:8441,cafile=/Users/bernardovalente/Documents/Arduino/libraries/Blynk/scripts/certs/server.crt,nodelay
2015/10/25 12:55:13 socat[34744] N opening character device "/dev/tty.usbmodemfa131" for reading and writing
2015/10/25 12:55:13 socat[34744] N opening connection to LEN=16 AF=2 45.55.195.102:8441
2015/10/25 12:55:13 socat[34744] N successfully connected from local address LEN=16 AF=2 192.168.1.67:60651
2015/10/25 12:55:14 socat[34744] N trusting certificate, commonName matches
2015/10/25 12:55:14 socat[34744] N SSL connection using ECDHE-RSA-AES128-GCM-SHA256
2015/10/25 12:55:14 socat[34744] N SSL connection compression "none"
2015/10/25 12:55:14 socat[34744] N SSL connection expansion "none"
2015/10/25 12:55:14 socat[34744] N starting data transfer loop with FDs [5,5] and [6,6]