Greetings. Here is my request that returns ‘Invalid Token’. Same goes for wget and any tools on my NY digitalocean server.
# curl -v http://blynk-cloud.com:8080/token/get/v5
* Hostname was NOT found in DNS cache
* Trying 45.55.96.146…
* Connected to blynk-cloud.com (45.55.96.146) port 8080 (#0)
> GET /token/get/v5 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: blynk-cloud.com:8080
> Accept: /
>
< HTTP/1.1 400 Bad Request
< connection: keep-alive
< content-type: text/plain;charset=utf-8
< access-control-allow-origin: *
< content-length: 14
<
* Connection #0 to host blynk-cloud.com left intact
Invalid token.
And now interesting part. I copied and pasted request command to my PC and it worked fine.
Any ideas?
PS: of course, token in request log replaced with placeholder. just in case…
You mean to make new project and use another token?
Have you moved location or method of connection from broadband to GSM etc?
nope.
But look, the thing is, my PC makes successfull request to blynk API, but digitalocean returns ‘invalid token’
By the way, same error occurs if I make requests not to blynk cloud domain name, but to it’s IP with my PC… Maybe these issues are somehow connected?
Ok I am going to guess Geo-DNS issue. Wherever Digitalocean server is, it probably has a different IP for Blynk than you do. They appear to have 45.55.96.146 so you should create an account on this IP from the app rather than using Blynk’s default (which is blynk-cloud.com).
You will get new token to try in the API.
From your machine what IP do you get when you ping blynk-cloud.com?
tried making requests with both IP’s - same error
So when I will make a new project with 45.55.96.146 IP, should I still use blynk’s domain when making requests? or IP?
Turns out that all I had to do is to make requests not to domain name, but to specific IP. And for some reason, that requests with IP’s failed yesterday. Anyways, it works fine today, thanks again.