I’ve tried looking on the forums but to no avail.
I cannot get the Blynk.tweet() method call to produce a Tweet on my account. Not a single one.
However, I can post tweets manually on my own profile.
I’m using the Blynk Server, NOT LOCAL, and I’m running the latest Android app on 8.1
What I’ve done:
Added the Twitter widget to my project on Android
Authorized Blynk. Checked my profile ‘Apps’ and it’s there for sure:
I’m simply sending a Tweet within my setup method, or loop (considering the max 5 sec interval + no 2 tweets equal content).
I’ve tried re-adding the widget. Disconnecting account and reconnecting.
#include <blynk.h>
#include <map>
#include <vector>
char auth[] = "(removed)";
int currentUse;
String lastTelegram;
ProfilesManager profilesManager;
void setup() {
profilesManager.begin();
Blynk.begin(auth);
Serial1.begin(115200, SERIAL_8N1);
Particle.function("addAppliance", onAddAppliance);
Particle.publish("BOOT", "Boot completed");
Blynk.tweet(String::format("Test, my tweet %d : %d", Time.hour(), Time.minute());
`Blynk.notify("Notifications work");`
Blynk.run();
}
void loop() {
Blynk.run();
(other content left out, max processing time of the rest is ~11 ms)
}
Also later on I simply try this by initializing a Timer and callback once after 30 sec:
Blynk.tweet("My first tweet!");
I get a notification (see setup) that ‘notifications work’.
What’s wrong here?
If it’s the Blynk library… is the Blynk.tweet() providing a callback to indicate success or is there any other method in the Blynk library that I can debug?
I don’t twit… and it doesn’t work with Local Server anyhow, but one thing that looks strange in your setup is… How are you connecting the MCU device (whatever it is) to the Cloud Server?? I see none of the required libraries for an Arduino, ESP, Ethernet, USB or Wifi link?
Particle’s RTOS fires up the wifi and connection before setup is invoked.
Meaning that the first instruction in my setup is only invoked after the Wifi connection is completed.
Ahh, I missed the Particle Photon in the title Don’t know how they work anyhow
OK, so to confirm… when you state Blynk Server, you are meaning the Blynk Cloud Server… correct? And not the Blynk Local Server… as that doesn’t support Twitter (at least it didn’t last time I tried)
Totally different thing from twitter, or even email.
I’m not using a Local Server.
If I would, I would have needed to specify the server in the Blynk.config() arguments right? I’ve only specified the Auth argument in .begin().
I’ve made the setup even more explicit now, but no Tweets yet.
void setup() {
Blynk.begin(auth);
Blynk.connect();
bool result = Blynk.connected(); // <--- checked this, returns TRUE, I assume either .begin or .connect is a synchronous call then.
Blynk.tweet("Test, my tweet");
Blynk.run();
}
Thanks @Dmitriy However, I clouded the waters a bit This OP is NOT using Local Server… but is using a Particle board/IDE… so not sure if that makes a difference or not.