blynkkk / blynk-library

Blynk library for IoT boards. Works with Arduino, ESP32, ESP8266, Raspberry Pi, Particle, ARM Mbed, etc.
https://blynk.io
MIT License
3.81k stars 1.38k forks source link

Blynk REST API Not working Properly with any other client except Browser #478

Closed jigneshk5 closed 4 years ago

jigneshk5 commented 4 years ago

Blynk library version: [ 0.6.0 ] IDE: [Arduino] IDE version: [ 1.8.12 ] Board type: [ nodemcu ]

Scenario, steps to reproduce

I'm simply sending data every sec from hardware to my Blynk project. Blynk project is showing it good. But, I want to use this pin value with http rest api of blynk-cloud. Requesting [http://blynk-cloud.com/{auth-key}/get/V3] from a browser gives me the correct response. But I can't get changing PIN VALUE on any other client by making a GET request. In python:

import requests
inport time
while(True):
     response = requests.get('http://blynk-cloud.com/{auth-key}/get/V3')
     print(response.content)
     time.sleep(1)

Expected Result

As the arduino sketch sending different values every second, it should have printed new value sent from hardware on console. While requesting from browser gives desired updated response.

Actual Result

But it's printing same value of pin V3 again and again. Until, we send a GET request from browser again (say, we got new_res as response) and now it's printing the new res again and again on python console.

jigneshk5 commented 4 years ago

I figure out that, we need to turn on our Blynk project while working with Rest Api too. This solved my issue.