I’m having problems with Twitter. A few months ago I had it setup correctly and working as intended. The project hasn’t been running for a while and while testing my code today I couldn’t get Blynk to tweet.
In the original code I used a timestamp to make every tweet unique and used it as a data logger since the amount of e-mails per day is restricted. I’ve already tried the following things;
Wrote a tweet manually (works)
Make a brand new twitter account
Updated the library and app
Using a different mobile device
Setting up twitter from another device
Stripped down the code to just tweet (see the code beneath, Auth token is removed)
Deleted Blynk linked apps on Twitter and added it again
In my opinion I tried to change everything I could and the problem has to lie within the Blynk app / Twitter widget.
I’m using a Controllino (based on Arduino MEGA) with in build Ethernet shield.
Tried with Android 6.0 (tablet), 8.0 (phone) and IOS (iPhone).
Using Blynk server
Library version 0.5.3 with the most recent Blynk app for IOS, V2.26.7 and 2.27.1 for Android
Any help is appreciated!
Edit: Removed some data from sketch because of privacy. Also trying to use Superchart to log data instead of Twitter as a work around.
#include <Controllino.h>
#include <SPI.h>
#include <BlynkSimpleEthernet.h>
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
WidgetTerminal terminal(V20); //32 characters, 5 lines
char auth[] = "X"; // Auth token
#define W5100_CS 10
#define SDCARD_CS 4
bool ledActief = false;
bool Tweet = false;
bool Tweeted = false;
void setup() {
Blynk.begin(auth);
terminal.println("Blynk app v" BLYNK_VERSION " | Status: Online | ");
terminal.flush();
Blynk.run();
}
void loop() {
Blynk.run();
if (Tweet == true && Tweeted == false) {
terminal.print("Tweet has been send");
Blynk.tweet("2019-01-21 15:30: TESTING 1..2..3..");
Tweeted = true;
}
}
BLYNK_WRITE(V13) { //Pushbutton
if (param.asInt()) {
Tweet = true;
terminal.println("V13 activated");
terminal.flush();
}
}
Thanks for responding. As stated I made a snippet of my code to test it out. The original code is much more complex and did contain the timestamp and time limitation by default. This code only tweets once (see boolean “Tweeted”) so both of your suggestions are not needed.
EDIT: Just to be clear; this tweet has never been send and thus is unique!
I appreciate the fact that you took the time to respond, but your response doesn’t really help for the question asked. I changed the code following your advice but the problem still occurs.
#include <Controllino.h>
#include <SPI.h>
#include <BlynkSimpleEthernet.h>
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
WidgetTerminal terminal(V20); //32 characters, 5 lines
char auth[] = "x"; // Auth token
#define W5100_CS 10 //Was 10,
#define SDCARD_CS 4
bool Tweeted = false;
void setup() {
Blynk.begin(auth);
terminal.println("Blynk app v" BLYNK_VERSION " | Status: Online | ");
terminal.flush();
}
void loop() {
Blynk.run();
}
BLYNK_WRITE(V13) { //Pushbutton
if (param.asInt()) {
terminal.println("V13 activated");
if (Tweeted == false) {
Blynk.tweet("2019-01-21 15:30: TESTING 1..2..3..");
terminal.println("Tweet send");
Tweeted = true;
}
terminal.flush();
}
}
This is only “clear” now But even so, it is a poor way to test when you could easily add in some random or incrementing number to be sure you are not violating some twitter limitation.
Basically it looks suspicious, so I questioned it.
And even your “new” code can clearly be reset via a button, to resend the exact same tweet… so how can you really be sure that isn’t the issue?
Oh, so sorry… I actually know the answer, but am just stringing you along (JK)
But seriously, I obviously don’t have your account, so can’t test your settings, and can only give out suggestions based on the data you provide and what code I see.
This is also not clear… did you properly setup the twitter widget on the phone that is running the project?
I understand your reasoning but since I mentioned “use a timestamp to make every tweet unique” I thought it would be clear that I undestand the Twitter policy. I will make sure to be more specific next time.
Because no tweets are send at all from Blynk. The original complete code functioned before and even when I change the hardcoded timestamp nothing happens. It doesn’t matter what unique text I use.
I was pretty specific in my post and was under the presumption that if read carefully your questions would be obsolete. The fact that I put something in the loop has nothing to do with the problem as described because as I said, it worked properly before; 25k+ tweets have been send with the original complete code. In hindsight I should’ve mentioned this in my OP.
Yes. Tried it countless times with a couple of phones and a tablet and even a brand new account. I expected it to work since it did before (didn’t change anything on my first test) but when it didn’t I started trying different methods without succes.
I’m well aware that my response might look grumpy or ungrateful and would like to imply once again that I do really appreciate your help. I understand that you get alot of ‘dumb’ questions and thats why you are asking these (seemingly) basic questions. I did alot of troubleshooting already and did my best to state this in the OP.
I implemented Superchart as a data logger which is a better solution in some aspects, so there’s no urgent need for a solution anymore. It is interesting to tackle this problem nonetheless i.m.o.
Thanks again Gunner, without people like you this community wouldn’t be what it is and while this is my first post I’ve read alot of topics to solve my problems.
No problem… I tried twitter once long ago and didn’t like it, so it is my own fault for answering
And against my better judgment, I just set up another Twitter account and tested on my Cloud Server account (since I recall that Blynk Twitter doesn’t work on Local Server anyhow)…
I have to agree… it doesn’t seem to be working with Blynk for me either… no errors, no tweets (from Blynk), nada…
Android Beta App
Cloud Server
Library 0.5.4
Something for the devs to deal with I guess… @Dmitriy ?
PS very hard to search the forum for twitter issues since the keyword twitter shows up in sooo many example sketches so this issue may already be well known??
Had the same issue while searching! But since there were no recent entries with Twitter being the main concern I thought I’d make a post.
Will check again if the devs come up with an answer, but as said before I don’t really need a fix anymore since I’m using Superchart as a better alternative.
Sorry all. Since Blynk collects the stats from Cloud users, not Local Server users, I would guess this means no more tweeting from Blynk for the indefinite future.
@Gunner, I hate to bring this up again, but when @Dmitriy said they have no plans to make the Twitter Widget work and you asked if this included the Twitter Widget working with the Cloud Server and @Dmitriy said, “No” … can I take this to mean they plan to fix the Twitter Widget in conjunction with the Cloud Server? Has there been any further discussion regarding a bug fix in the last few weeks I may have missed?
I haven’t a clue how to interpret some of Dmitriy’s answers I don’t clearly recall any follow up commentary… but I suspect twitter may be one of those “soon to be dropped” options from Blynk’s beginnings.
I never twit (tweet? twitter?), so I personally don’t care… I was just trying to assist others whenever it came up, so I created an account that shall forever remain unused
@Gunner for BLE/BT Blynk.tweet (and, probably, Blynk.mail) will work in same way as Blynk.notify, so it is not about twitter widget in its ordinary way.
OK… so Blynk can still use twitter?? It is just that a few people have ran into issues (using Cloud) tryng to do so, that havent been resolved… or even officially looked at. AKA this topic for one.
Again, I am not going to test it anymore myself … so I will leave this issue as is for others to work on. But thanks.
I mean that the update I’ve uploaded to beta is not about sending tweets to twitter. It just handle the tweet/notify request from BLE/BT hardware and shows an alert with their message, nothing connected to twitter.
OK, I got it… so my reference of your other post was not relevant to this OP
But rather that post was just saying that notification (and apperenly twitter) calls in the sketch will now register on the phone in BT/BLE connection mode now, just as it did in other WiFi, ethernet, etc. modes.