I am starting to blynk over USB serial; it works at home and now I tried to run the same sketch at work but get the following error
could it be the company firewall?
Connecting device at COM11 to cloud.blynk.cc:8442âŚ
OpenC0C("\.\COM11", baud=9600, data=8, parity=no, stop=1) - OK
Connect(): connect(âcloud.blynk.ccâ, â8442â) ERROR Unknown error (10061)
Reconnecting in 3sâŚ
Waiting for 0 seconds, press a key to continue âŚ
OpenC0C("\.\COM11", baud=9600, data=8, parity=no, stop=1) - OK
Connect(): connect(âcloud.blynk.ccâ, â8442â) ERROR Unknown error (10061)
Reconnecting in 3sâŚ
Waiting for 0 seconds, press a key to continue âŚ
OpenC0C("\.\COM11", baud=9600, data=8, parity=no, stop=1) - OK
/**************************************************************
-
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.
-
Blynk library is licensed under MIT license
-
This example code is in public domain.
- This example shows how to use ordinary Arduino Serial
- to connect your project to Blynk.
- Feel free to apply it to any other example. Itâs simple!
-
- Optional, but recommended.
- Connect additional USB-serial adapter to see the prints.
-
- Edit auth token and upload this sketch.
-
- Run the script (script located in âscriptsâ folder of library root,
- e.g. âblynk-library/scriptsâ) for redirecting traffic to server:
-
for Windows: scripts/blynk-ser.bat
-
for Linux and OSX: ./scripts/blynk-ser.sh (may need to run with sudo)
- You can specify port, baud rate, and server endpoint like this:
-
./blynk-ser.sh -c <serial port> -b <baud rate> -s <server address> -p <server port>
- For instance :
-
./blynk-ser.sh -c /dev/ttyACM0 -b 9600 -s cloud.blynk.cc -p 8442
- Run blynk-ser.sh -h for more information
- Be sure to select the right serial port (there may be multiple).
- Attention!
-
Arduino IDE may complain with "programmer is not responding".
-
You need to terminate script before uploading new sketch.
-
- Start blynking!
- Start blynking!
**************************************************************/
// You could use a spare Hardware Serial on boards that have it (like Mega)
#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11);
#define BLYNK_PRINT SwSerial
#include <BlynkSimpleSerial.h>
#include <SimpleTimer.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = âXXXXXXXXXXXâ;
WidgetLED led1(1);
WidgetLED led2(2);
SimpleTimer timer;
void setup()
{
SwSerial.begin(9600);
Blynk.begin(auth);
timer.setInterval(1000, sendUptime);
timer.setInterval(1000, blinkLedWidget);
timer.setInterval(1500, fadeLedWidget);
// Default baud rate is 9600. You could specify it like this:
//Blynk.begin(auth, 57600);
}
void sendUptime()
{
// You can send any value at any time.
// Please donât send more that 10 values per second.
Blynk.virtualWrite(5, millis()/1000);
Blynk.virtualWrite(6, millis()/1000);
}
void blinkLedWidget()
{
if (led1.getValue()) {
led1.off();
BLYNK_LOG(âLED1: offâ);
} else {
led1.on();
BLYNK_LOG(âLED1: onâ);
}
}
void fadeLedWidget()
{
if (led2.getValue()) {
led1.off();
BLYNK_LOG(âLED2: offâ);
} else {
led2.on();
BLYNK_LOG(âLED2: onâ);
}
}
void loop()
{
Blynk.run();
timer.run(); // Initiates SimpleTimer
}