BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Blynk.tweet not working with Particle Photon?


#1

Hi all,

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.
  • I’ve tried a different Twitter account.

#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?


#2

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?


#3

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.

BTW: As I said, ‘Blynk.notify’ works flawlessly


#4

Ahh, I missed the Particle Photon in the title :blush: Don’t know how they work anyhow :stuck_out_tongue:

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.


#5

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();
}

#6

Usually… but as stated, I am unfamiliar with how the Particle lineup works.

And perhaps that is also the issue with Twitter? Sorry, you have to wait for someone else to chime in on this one.


#7

You can’t tweet from the local server as it requires Tweeter Blynk app credentials. Which we can’t share due to security reasons.

For push notifications we are using different credentials so we can share them on the local server.
We can make it work, but efforts don’t worth it.


#8

Thanks @Dmitriy However, I clouded the waters a bit :blush: This OP is NOT using Local Server… but is using a Particle board/IDE… so not sure if that makes a difference or not.


#9

See initial post, I’m NOT using a Local Server.


#10

@Brounzer oh, sorry. In that case please try to Revoke access and within blynk app remove and add widget again.


#11

Doesn’t work.

  • I’ve revoked access
  • Removed the widget
  • Removed the tweet calls in my firmware, uploaded
  • Killed and restarted the Blynk app.
  • Restarted phone (even)
  • Re-added the widget, logged in, allowed access, re-added the .tweet() call in my firmware

See also my initial post where I tried it with a different Twitter account. This also had no effect.

It case it is any worth mentioning: Blynk.email() does work.


#12

Please provide me with your login email. I’ll check logs.


#14

Just to check: I remember I just replied with my email, but did you remove it?
If so: OK, thanks. Let me know what you find!


#15

yes


#16

Ok. Bug is confirmed. Thank you. It is in 3-d party library :frowning:.


#17

That’s unfortunate.
I guess the bug is filed and now it’s just a matter of time right…?


#18

@Brounzer as quick fix I’ll downgrade library version. And yes - bug is filed :slight_smile:.


#19

@Brounzer fix deployed. Thanks again for reporting.


#20

A post was split to a new topic: Please help. Blynk.tweet not working!


#21