Invalid Token with Blynk and IFTTTT

Before i start, i did looked at several other post and didn’t find what i am looking for so started new post.

Question 1 - Can i test Blynk connectivity with IFFTT without connecting ESP8266?
Question 2 - When i am trying from BLynk app to ON/OFF it works with ESP8266 but same if i try from IFFTT with URL “http://188.166.206.43/585cb9xxxxxxxxxxxxf68f9ce/update/D5” it says Invalid Token.

Now i am located in US where as ESP8266 board is in India, so not sure if it will block. For safer side i tried from my brothers india number which is on same wifi as ESP8266 it didn’t work. (Possible email id is different in IFTTT and my brothers phone)

My intention here is to find out where issue is, Invalid token, not sure why when i am putting it in browser i get that. Same issue i see with IFTTT it says Error 400 which could be same “Invalid token” just different description there. Plus when i can operate Blynk app from USA and operate lights in india, why can’t it work with IFTTT?

Yes

First of all, I’m assuming that you’re using the Blynk cloud servers, is that correct?

Which country were you in when you created the Blynk project on your phone?

You’ve obtained the IP address of 188.166.206.43 by pinging blynk-cloud.com from a PC. Which country were you in when you did this?

EDIT - Don’t worry about answering those questions, I’ve worked-out the answers for myself.
You need to use this IP address in your IFTTT recipe:

45.55.96.146

Pete.

I’ll explain a bit more about how this works.

When you create a project, it’s created on the nearest Blynk server. When you try to access that project from your phone then Blynk does some clever stuff and works-out which server your project is on and re-directs everything there, wherever you are in the world.

The same thing happens with your ESP8266 device, when it connects to Blynk then the connection process works and links the device to the server that holds your project, regardless of where in the world that device is.

Webhook/API calls are different, they need to be told which server to use.

You do this by pinging blynk-cloud.com from a PC that’s in the country where the project was created.
I think you’ve done that ping from america, and so were given the American server IP, but no project with that auth code exists on the american server, it exist on the Asia server instead.

If you’d asked your brother to do that ping test from India he would have obtained the correct IP address for the Asia server.

Your problem now is that you’ve shared your auth code on a public forum, so anyone can now control your device whenever they want!
I’ve edited your post to block-out some of the auth code, and hidden the version of your post that included the full auth code, so you should be fairly safe. However, when you get back to India you should generate a new auth code from the app, re-flash your hardware to use this new auth code, and update your IFTTT recipe with the new auth code.

One more thing, the API call that you’re using will update pin GPIO5, not the pin labelled D5 on your NodeMCU, which is GPIO14
I see that both of these pins are used in your app, so it’s not clear which one you actually want to control.

Pete.

Pete,
Thanks for explanation and encrypting my auth code, will make sure to create new project once i am done with testing to be safe. :slight_smile:

Now coming back to IP you gave me, the IP you shared gave me new error “Wrong request format.”
http://45.55.96.146/585cb******************************ce/update/D5

Now i am trying to set D1 pin on my ESP8266 which is GPIO5. Let me know if i am doing anything wrong here, looking at error i think its issue with my request parameter in URL but not quite sure…

More background -

  • Blynk project is created in USA.
  • IFTTT creation location USA
  • Calling Blynk URL above is also from USA.
  • ESP8266 board is in india.

As always thanks and appreciate your quick response, this is my first time trying something with blynk and didn’t expect that quick response.

Post a screenshot of your IFTTT recipe (with the middle bit of your auth code covered-up.

Pete.

You need to complete the URL with the value you wish to update the pin with… EG.

http://45.55.96.146/585cb******************************ce/update/D5?value=1

You may also need to add in a port to your IP… typically it is 8080 for Local Server (and assuming your port forwarding is setup)

http://45.55.96.146:8080/585cb******************************ce/update/D5?value=1

EDIT - Opps, I was assuming browser based entry… probably totally different with actual IFTTT apps, etc… I don’t use them :stuck_out_tongue:

You know what, i figured it out. While reading forum i noticed few people mentioned to use GET instead of PUT so my IFTTT was set on that. When you asked me screenshot i noticed that and after changing back to PUT it worked…

Thanks for your reply…

Now as you are expert can you share your opinion :slight_smile:

I am trying to do home automation project with 8 channel relay and NodeMCU, so far everything is good. But is this really a better way of doing via Blynk or i can simply code my NodeMCU to communicate directly with my Google Home. I know its possible to do with Alexa as i found an example of code for that, but seems like for Google home only way is using IFTTT + Blynk or IFTTT + heroku.

Your inputs would be helpful for me to follow right direction…

I’m not really a google home user. I have one, but I’ve never gotten around to integrating it with any of my accounts.

There was this thread, and last time I looked the service wasn’t working, but it seems like now it at least allows me to log in:

Then there’s Sinric, which is discussed in a few places on the forum, including here:

and the Sinric github page is here:

I’d forget heroku, all the cool people use Blynk :wink:

Pete.

Thanks for info…I know i am cool :slight_smile:

1 Like

Hello to you. please help me i find the same invalid token problem with blynk IFTTT and google assistant. while all procedures are followed.

Please help me.