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

Tries to connect but times out.

[0]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v0.4.3 on Arduino Nano

[5001] Connecting…
[10041] Connecting…
[12081] Login timeout
[15081] Connecting…
[17121] Login timeout
[20121] Connecting…
[22161] Login timeout
[25161] Connecting…
[27201] Login timeout
[30201] Connecting…
[32241] Login timeout

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <BlynkSimpleStream.h>

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

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

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

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

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

What type of computer are you hooked up to, and have you ran the required USB-Network redirection script?

Arduino over USB

Also, Cloud or Local server?

Windows 10
yes.
Blynk cloud server

C:\WINDOWS\system32>cd C:\Users\Tony\Documents\Arduino\libraries\Blynk\scripts

C:\Users\Tony\Documents\Arduino\libraries\Blynk\scripts>blynk-ser.bat -c COM10
Connecting device at COM10 to blynk-cloud.com:8442
OpenC0C("\.\COM10", baud=9600, data=8, parity=no, stop=1) - OK
Connect(“blynk-cloud.com”, “8442”) - OK
InOut() START
DSR is OFF

OK, have you tested connection using the Nano’s built in port… not as convenient for long term, but lets make sure your auth code works and all.

If so, then as you are using Soft Serial, I suspect you have some TTL to USB adapter that is communicating to COM10. First, confirm that the COM port is correct for the device. Windows device manager can show that. And also if there are any driver issues… I get those occasionally on my Win 10 setup as I also use USB on three different boards, with one using a TTL adapter.

You could also Stop the script and use a basic terminal program, like Termite, to check that the auth code is being transmitted OK through the TTL adapter.

Tried with nano, no luck…
I can ping blynk-cloud.com and it reaches it.

Still just getting:
connecting…
Login timout
connecting…
Login timout

You have ran the required command prompt script as well?

http://docs.blynk.cc/#hardware-set-ups-arduino-over-usb-no-shield

It is also accessable (for when using programming port) within the IDE.

Yes I ran the script blynk-ser.bat.

Connecting device at COM6 to blynk-cloud.com:8442
OpenC0C("\.\COM6", baud=9600, data=8, parity=no, stop=1) - OK
Connect(“blynk-cloud.com”, “8442”) - OK
InOut() START
DSR is OFF

My “TOOLS” does not have the Blynk: Run USB script.

Download the latest library which includes the /tools folder. This will add the blynk updater (very handy) and also USB script features.

I have v0.4.4 installed… no tools

Did you download the .zip file? Open it and you will see the /tools folder.

Not sure why I didn’t have it, but now I do…

Still no luck with the Serial USB connection.

with Software Serial I get:

[0]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v0.4.4 on Arduino Uno

[5001] Connecting…
[10041] Connecting…
[12081] Login timeout
[15081] Connecting…
[17121] Login timeout
[20121] Connecting…
[22161] Login timeout
[25161] Connecting…
[27201] Login timeout
[30201] Connecting…
[32241] Login timeout
[35241] Connecting…

with Serial USB I get:

Dump a copy of your full current sketch (minus auth) and I will try to duplicate all the hardware and software serial links that I can.

@tbarritt the screenshot for the USB connection confirms you are connected to the server. You might want to remove the screenshot though as it shows your server access details.

It does?? I have seen that when I haven’t got my USB link running… thus no server connection. That is just the UNO output as it is trying to handshake with it’s auth code (this is a tin can and string link for us non WiFi folk :stuck_out_tongue: ).

@tbarritt and yes… just regenerate (refresh) your auth code to keep out the snoops :slight_smile:

@Gunner it’s a long time since I have used USB but that’s what I thought you saw when you connected.

Is there actually some other details shown on screen with a USB connection?

I’m just trying to get the examples to work for now…
Serial USB or Software Serial, neither will work for me.

No it just keeps repeating the auth token on the same line.
Software serial gets timeout.

[0]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v0.4.4 on Arduino Uno

[5001] Connecting…
[10041] Connecting…
[12081] Login timeout
[15081] Connecting…
[17121] Login timeout
[20121] Connecting…

@tbarritt does the server respond with a json file with the following url in a browser (enter your token in the url)

http://blynk-cloud.com/your_token/project