I have a Blynk App that needs to send 4 values to a Thingspeak channel. I manage to “post” 1 value but I need to post multiple at once so for example field1 needs the value of V1, field2 of V2 … ans so on
What is the exact syntax needed in the Blynbk App and can I do this with one webhook or do I need 4 of them to pass all 4 values ?
You need to collect values from all pins and write them into 1 pin (used by WebHook). Also you need to use the /pin[NUMBER]/ binding for WebHook setup:
@Tony_Knors if you have set Webhook as V1 and you need to send data for 4 fields use last screenshot from @BlynkAndroidDev but extend to pin[3] to give a 4 element array.
When I have multiple fields to populate I generally send it all as one big String including the field names etc. If you are still struggling I will dig out my Thingspeak code.
I think with the url you mean api.thing. not api/thing…
Blynk designed the Webhook so that a GET will also perform a POST and therefore POST is almost never needed.
Switch method to GET and remove the entry from Body.
With the correct url including API key press the Run Test button in the Webhook and it should show Result:OK.
If it doesn’t you have url or key incorrect. If you are sure it’s correct and it still gives error you might be “Blynk Blocked” for 10 failed attempts. Delete the Webhook and start again to release the block.
The Run Test is a new feature to try to avoid being Blynk Blocked and running a successful test might have the same effect as deleting the widget and starting again. @Dmitriy does a successful test remove the block?
Now that you have a successful test you need to “break” the Webhook by adding /pin/ to the end of it. When you had /pin/ it will be highlighted in green. Not for you, but sometimes an API url might end with / and therefore when you add the pin it will have a double backslash at the end of the url i.e. //pin/.
If you click Run Test again it will fail as it doesn’t understand what /pin/ means, this is ok. @Dmitriy can the test be set to exclude any /pin/ references in the url?
@Tony_Knors I never use POST or BODY with Blynk Webhook’s.
Disable the Webhook until you have the correct details or you might be blocked by Blynk.
Get your ESP to give you the V6value and paste it into a web browser.
I notice when I do that I get a sequentially increasing number returned, 16, 17, 18 etc and if I refresh the browser too quickly I get a 0. Think this is Thingspeak’s minimum wait between API calls.
Let me know when ESP output data is working in a browser.
You might need to send me your key via PM so I can unblock your Blynk account with an Android phone if iOS doesn’t have the Run Test. Or borrow an Android device from a friend.