Hello!
I’m trying to experiment with custom connection. The problem is it simply doesn’t work.
As far as I understood it sould work exactly like the Serial_USB connection.
I have Arduino UNO and a single button widget operating built-in LED on PIN 13. The IDE is 1.6.6.
With the SerialUSB everthing works ok: I run the proxy-script on my com3 port, the android frontend runs ok and the LED responds to my button.
But with User_defined_connection example it doesn’t work. I load the example sketch, change only auth key, then run the sctipt and nothing happens. The script loops in connecting/disconnecting.
Connect(“cloud.blynk.cc”, “8442”) - OK
InOut() START
DSR is OFF
Received EOF
EVENT_CLOSE
InOut() - STOP
Disconnect() - OK
Connect(“cloud.blynk.cc”, “8442”) - OK
InOut() START
DSR is OFF
Received EOF
EVENT_CLOSE
InOut() - STOP
Disconnect() - OK
Connect(“cloud.blynk.cc”, “8442”) - OK
InOut() START
DSR is OFF
Received EOF
EVENT_CLOSE
InOut() - STOP
Disconnect() - OK
Connect(“cloud.blynk.cc”, “8442”) - OK
InOut() START
DSR is OFF
The android frontend says there is no connection to my hardware. The LED doesn’t respond.
What am I doing wrong?
Btw. is it needed to check connection status in code? The [connected] variable seems to be always true in the example sketch…
Yes, it’s always connected because the serial connection is always ready to send/receive.
Please enable #define BLYNK_DEBUG so you can see actual Blynk communication.
Ok, thank you. But before digging into debug I just would like to know: should the user_defined_connection sketch work “out of the box” like serial_USB, or not? Mine does not as described above.
Update: I tried the debug port, I get following output:
[1] Blynk v0.3.1
[2002] Login timeout
[2025] Login timeout
[2049] Login timeout
[2072] Login timeout
[2096] Login timeout
…
[2494] Login timeout
[2518] Login timeout
[2541] Login timeout
…
That means, the Blynk.begin() shows the lib version. Then the first Blynk.connect() fails after 2 s. Then it keeps failing in loop. Actually it misreports timeout, while there can’t be timeouts each 25 ms.
Btw, I placed debug messages within BlynkStreamRead and BlynkStreamWrite, but never saw them in the debug output. That means that custom functions are never called when establishing connection, and that’s very strange.