[SOLVED] Serial USB, can't get it to connect

{“id”:2,“name”:“New Project”,“createdAt”:1485625992613,“updatedAt”:1485626241209,“devices”:[{“id”:0,“name”:“New Device”,“boardType”:“Arduino UNO”,“token”:"****************************************",“connectionType”:“USB”,“status”:“OFFLINE”,“disconnectTime”:0}],“theme”:“Blynk”,“keepScreenOn”:false,“isAppConnectedOn”:false,“isShared”:false,“isActive”:false}

Ok that confirms you are using a valid token.

You might have some ports blocked.
Try the following from dos command / console to see if it connects for a short duration before disconnecting you

telnet blynk-cloud.com 8443

Edit: You should concentrate on the regular USB sketch not the SoftwareSerial one.

I even did a ping.

Try telnet to the correct port number.

I tried telnet blynk-cloud.com 8443 and 8442

I get connection closed by remote host.

Try commenting out this line… and any other Serial.print() lines that might use the same serial connection as the USB link

Tried that, no help…

#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); // RX, TX

//  #define BLYNK_PRINT DebugSerial
#include <BlynkSimpleStream.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "b90131baf3b24c87906023a1e5f8937d";

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

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

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

Well, I used the code provided above, and after a few attempts was able to get it to connect… however I did need to move #include <BlynkSimpleStream.h> to the top before it would connect… strangely, after that initial link, it didn’t matter if it was the first or 2nd include (probably just coincidental?.. but try it).

That didn’t work either…

Well, it isn’t the code… I am out of valid ideas.

OK, I rigged up my Mega to test dual port options. I can connect just fine using the standard USB port.

So as a test - to closely simulate what you might be doing, I set up blynk.begin on the 2nd serial port for the server connection (hardware serial via USB-TTL adapter on my Arduino Mega), and left BLYNK_PRINT set to the built in port to monitor.

It would try to connect, and occasionally say ready, but wouldn’t complete connection. I suspect that something just doesn’t like connecting to the server using anything but the primary port.

Solution?.. just use the built-in USB for the server connection and use softserial and a terminal program for whatever else you needed the 2nd serial port for.

Oh, wait… as I dug further back in your post here, I realised that you may have already tried that… if so, then sorry, there are a couple of similar USB-server issue posts and I am getting a bit mixed up as to which is which :stuck_out_tongue:

Thanks for trying, I am giving up for now…

Is it that bad? do you have a final code? and is it still a nano? can I please have a shot at it.

Just trying to the Blynk serial usb basic code to work with UNO.

i Have a sample code that I edited for my purposes do you want to give it a shot? I can put it in ubuntu pastebin and you can have it.

And I think the problem might not be with the code in itself but the execution. Could you please elaborate how you connected yourself to the internet.

I have the Arduino Uno R3 connected to Windows 10 computer via USB, which connects to router via ethernet, connected to modem.

I have followed the Blynk example
http://docs.blynk.cc/#hardware-set-ups-arduino-over-usb-no-shield
and


also,
https://github.com/blynkkk/blynk-library/wiki/USB-Serial

Hi,

Sorry to say, but I have the same problem as tbarritt reported above and I can not see any solution in the post or other posts that would help me.

The problem is a connection time-out as well as the app shows the Arduino Uno to be off-line.

In order to keep it simple I have used the Get started-code from Blynk - “Arduino Uno / Serial/USB / GettingStarted/BlynkBlink” without modifications. The USB-script has been run with COM3.

I have a feeling that it is a connection problem to the cloud server. I have connected both via the normal router and a mobil connection as well as tried on Win10 and Win7.

I am a bit stuck here and would appreciate some advice.

I exclusively use USB link for all my Arduinos… mainly because I have no other option at this time :slight_smile: So here are my hints and tips:

AVOID all references to the same serial connection that the link utilises. That means you MUST modify many of the examples to comment out #define BLYNK_PRINT Serial and duplicate Serial.begin(9600); lines.

Do not open the IDE monitor, or any other terminal program (if on same COM port)… common sense you say?? perhaps, but sometimes I have had a minimised window that I forgot to close :blush:

Speaking of minimised windows or forgetting… always make sure your batch script IS running, on the correct server designation (cloud or local IP), COM port and BAUD rate, as well as not showing any errors or repetitive connection attempts.

When lockup/disconnect issues happen, the best way to reconnect is to close and restart the batch file script… while I have seen it automatically reconnect at times, it is not always reliable. That said, I have had links that have lasted days, with glitches but still reconnect, eventually, particularly if I close the app (but not stop the project) then reopen the app.

Don’t attempt to do too much, or assume that a faster BAUD rate is better… basic serial communication does not have the same packet error correction as TCP/IP, so some data might get missed and cause continuity issues.

1 Like

At risk of double redundancy… :wink: I should point out that it is NOT a directly server related issue! The USB link is just that, a link between two differing types of communication (RS-232 and TCP/IP), so the old adage “garbage in, garbage out” applies: The server looks for data via TCP/IP and if that data gets garbled up in the translation, then no worky worky.

As it has been mentioned to me in this forum, get a proper connection :stuck_out_tongue: … USB link is a temporary, quick and dirty “benchtop” troubleshooting solution to get a basic Arduino communicating with a server, before setting it loose with proper ethernet communication (tethered or wirelessly).