Simplest test for auth token?

I am trying to follow this tutorial, which looks like it should be simple: Raspberry Pi Pico | Cricket WiFi | Blynk phone alerts (thingsonedge.com)

However, nothing is happening (and it seems that Blynk UI has changed significantly since this was written). I’m trying to unit test the various elements to try to troubleshoot, and my suspicion currently is that something is wrong with the auth token.

I’m trying this:

curl --include --request POST --header "Content-Type: application/json" --data-binary "{\"body\" : \"hello from curl\"}" http://blynk-cloud.com/(my token here)/notify

and it’s giving me an ‘invalid token’ error.

Pinging blynk-cloud.com returns 139.59.206.133 (which I understand is the Frankfurt server, that makes sense since I’m in Europe) - I’ve tried substituting 188.166.206.43 for Singapore and 45.55.96.146 for New York but I still get ‘invalid token’.

My question is - should this work? Or is this a rabbit hole which has nothing to do with the issue?

The Cricket part all seems to be working as expected so far, it generates the temporary network and I can configure it as described in the article so I don’t have any particular concerns on that side (yet).

If you’re using Blynk IoT rather than Blynk Legacy (as shown in the screenshots in the link) then the server url is blynk.cloud

Pete.

Thanks!

Ok, I have a bit of progress:

curl --include --request POST --header "Content-Type: application/json" --data-binary "{\"body\" : \"hello from curl\"}" http://blynk.cloud/(my token here)/notify

This doesn’t give an error at least, although it’s not triggering a notification either.

I’ve also just discovered that https://blynk.cloud/external/api/logEvent?token=(my token here)&code=hello does trigger the ‘hello’ notification that I configured by following Get Notifications - Blynk Documentation.

I still haven’t got the Cricket to trigger, but I guess that’s out of scope for this forum. Cheers for the fast reply.

Notifications work differently in Blynk IoT, and the HTTP(S) API syntax is different too.

https://docs.blynk.io/en/blynk.cloud/https-api-overview

https://docs.blynk.io/en/getting-started/notification-management

Pete.

1 Like