I have seem plenty examples of serial output where Blynk is giving debug data via Serial…but I don’t get any. I’m using BLE and not wifi/Ethernet like most/all examples I’ve seen. But, nothing I’ve read indicates that should affect anything.
Basically, I can send data via Serial.print…but I get nothing from BLYNK_PRINT or BLYNK_LOG, and BLYNK_DEBUG makes no difference.
As I understand it, Blynk Debug uses the default serial port… probably more refered to as the USB/programming port.
And as it drastically slows things down, i don’t think you would even want it running over BLE (even if it is able).
Plug your device into a computer and utilize the IDE monitor or a terminal program to watch the debug statements as you test your otherwise BLE connected device.
Sorry, I didn’t clarify. The serial monitor is running across the default serial port via USB. And I see nothing. I’m simply using Blynk across BLE to control the device. Hope that clarifies.
Ah. So I noticed that pattern and tried it but it resulted in a build error…so I thought it was wrong…good to know it wasn’t…here’s the error:
Arduino: 1.8.1 (Mac OS X), Board: "Arduino/Genuino 101"
In file included from /Users/ajmoon/Documents/Arduino/libraries/Blynk/src/Blynk/BlynkApi.h:15:0,
from /Users/ajmoon/Documents/Arduino/libraries/Blynk/src/BlynkApiArduino.h:14,
from /Users/ajmoon/Documents/Arduino/libraries/Blynk/src/BlynkSimpleCurieBLE.h:22,
from /Users/ajmoon/gits/Water-top-off/Water-top-off.ino:13:
/Users/ajmoon/gits/Water-top-off/Water-top-off.ino: In function ‘void hearbeat()’:
/Users/ajmoon/Documents/Arduino/libraries/Blynk/src/Blynk/BlynkDebug.h:95:78: error: ‘BLYNK_LOG_UNAVAILABLE’ was not declared in this scope
#define BLYNK_LOG(msg, ...) BLYNK_LOG_UNAVAILABLE(msg, ##__VA_ARGS__)
^
/Users/ajmoon/gits/Water-top-off/Water-top-off.ino:334:3: note: in expansion of macro ‘BLYNK_LOG’
BLYNK_LOG("This is my test value: %d", 10);
^
exit status 1
Error compiling for board Arduino/Genuino 101.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Yeah…that’s no where in the docs…it says to use that with no explanation of where or how. As you can see from my code I am assuming I can kinda use it like Serial.print(). Is that not the case?
Guys, not every API is available on every platform.
BLYNK_LOG is missing due to 101 limitation.
You can use Serial directly or BLYNK_LOG1, BLYNK_LOG2 … (numbers stay for count of arguments)
Based on the very limited documentation I’ve already read I think I can replace Serial.print() with BLYNK_LOG() Then, if I comment out #define BLYNK_PRINT Serial later then those will not take up CPU cycles. You seem to indicate that I need to put #define BLYNK_LOG(msg, ...) BLYNK_LOG_UNAVAILABLE(msg, ##VA_ARGS) somewhere…I’m guessing before the void setup() based on the #define. But what am I defining? can you point me to an example?
haha…so magical commands that are in no documentation? sweet. Can you offer some sort of documentation? Because simply replacing BLYNK_LOG with BLYNK_LOG1 didn’t help anything.
OK… too may different (but related) issues building here.
1st. Add the two lines mentioned, to the TOP of your sketch.
2nd. REMOVE #define BLYNK_LOG if you have it anywhere.
In fact, if you are using an Arduino 101 (of which I have no experience with) then remove any reference of BLYNK_LOG (as per @vshymanskyy).
Then once you can both compile without error and see lots and lots of text scrolling on your serial monitor… then we can work on the proper use of BLYNK_LOG, or alternate print options for whatever you need logs for in the first place
Okay, it’s building for now. My hardware is at work and its midnight so I’ll test it when I get in (tomorrow morning) and will let you know. Thanks for the help so far @Gunner & @vshymanskyy!
okay…Blynk info is flowing both BLYNK_PRINT and BLYNK_DEBUG make a difference. What I was hoping to do was write my debug info to serial using BLYNK_LOG so that when I disable BLYNK_PRINT all my debug data goes away without having to comment out everything or wrap serial statements in IF. On the Arduino 101 what are my options? Thanks.
@moonmeister Glad to hear you are up and running again (hopefully not back to square one?)
Having used the debug, but never the Blynk_Log, and now the ‘issue’ with the 101, I will probably need to defer to @vshymanskyy or someone else to hopefully supply come coherent answer for both of us.