Return to Project-GC

Welcome to Project-GC Q&A. Ask questions and get answers from other Project-GC users.

If you get a good answer, click the checkbox on the left to select it as the best answer.

Upvote answers or questions that have helped you.

If you don't get clear answers, edit your question to make it clearer.

+1 vote
1.4k views

I'm trying to set up dynamic location notifiers. The instructions are clear, but I can't get it to work. HTTP Test fails with the following message:

Unexpected code Response{protocol=h2, code=400, message=, url=https://project-gc.com/api/UserLocation/Update/?protocol=1&uid=2263355&latitude=%LAT&longitude=%LON&acc=%ACC&ts=%TIMESTAMP&token=xxxxxxxx&nid=3326}
{"errorMessage":"Invalid coordinates"}

I tried hardcoding %LAT and %LON to 56 and 10. Then token parsing fails. (I wrote the right token, of course, not xxxxxxxx.) Given the coordinate problem, I think something more fundamental is broken. Have any of you had similar problems?

in Support and help by jacobsedk (500 points)
I had a look in the log file, and the %LAT and %LON values are filled in just fine when I start logging, it appears (56.16 and 9.55, respectively). I'm getting an "Unexpected response code Responce{protocol=h2, code=401, message=, url=https://...}" error, though.
I thought I would try to get the https call to work first, without using GPSLogger. Am I correct in assuming that I should be able to type something like https://project-gc.com/api/UserLocation/Update/?protocol=1&uid=2263355&latitude=56.000&longitude=9.000&acc=21.200&ts=1530954345&token=xxxxxxxx&nid=3333 into my browser to test it? All I get is {"errorMessage":"Invalid token"}. (I copy-pasted the token directly from the settings page, so it should be OK. It doesn't have any weird characters. I tried refreshing a few times, but to no avail.) Wouldn't this suggest that there's something wrong with my call rather than with my GPSLogger setup? How do I proceed from here? I would love to get it up and running!
Is this working now? I keep getting error on invalid token, no matter how many times I have tried to create new token or generated a new notifier.

"errorMessage": "Invalid token"
Yes, that should work. If not, there is still something wrong on PGC side.
Still can't get it to work. I'll try again in a few weeks' time or if something gets posted here. Thanks,.

2 Answers

+1 vote
 
Best answer

The app is definitely sending &latitude=%LAT and &longitude=%LON when doing a HTTP test. %TIMESTAMP ain't translated either and %ACC seems to be broken data, those two ain't used by PGC right now though.

It seems like it's the test only that's broken though. As long as your URL actually is correct, it will still work, besides the test. The latest version is from May 27th on Play, so it must have been broken for quite a while now.

If I understand this post correctly, the test is not supposed to send real values. In that case, we should remove the testing part from the documentation, or at least be clear about what to expect from the test. We could potentially detect that it's a test and respond with something good.

by magma1447 (Admin) (241k points)
selected by jacobsedk
Here is actually an issue created by a Project-GC user as well:
https://github.com/mendhak/gpslogger/issues/663
You're absolutely right. It seems to be only the test case that fails. I should have just let it run and examine the log file instead. That you so much for clearing this up. Can't wait to get my first PGC notification from this category!
GPS Logger is now up and running and appears to be doing its thing. A few caches have been released near me, but I have yet to receive a dynamic notification. Is that because the caches were covered by my other static notifications (one for work and one for home each of which did trigger as it should), or is something amiss?
That's a correct assumption. By design you will only get one email per geocache, it's not very likely that anyone would like to get duplicates. If I recall something, the notifier with the smallest radius/distance is ran first, where an empty field counts as endless. As soon as there is a match, an email is sent and the rest of the notifiers are skipped for that geocache/person.
That sounds like a solid design. I will shrink or disable my home/work notifiers temporarily to give the dynamic notifier a chance. I will let you know how it goes.
Bingo! I'm now getting the dynamic notifications I was expecting. Thank you so much for your help and for adding such a cool feature to Project-GC.
0 votes

Still can't get it to work, but I'm getting close now!

I haven't changed anything on my end, but I now get an OK if I hardwire the coordinates and submit https://project-gc.com/api/UserLocation/Update/?protocol=1&uid=2263355&latitude=%LAT&longitude=%LON&acc=%ACC&ts=%TIMESTAMP&token=xxxxxxxx&nid=3333! Things are checked on the other end, too: If I put in an invalid token, nid or uid, I get a failure message.

Unfortunately, I still get an "unexpected code response" with {"errorMessage":"Invalid coordinates"} if I use %LAT or %LON. Does PGC somehow parse them wrong?

by jacobsedk (500 points)
edited by jacobsedk
I'm guessing that all the % expansions fail entirely. It appears that PGC will happily accept any text in the acc and ts fields, while it (obviously) requires meaningful data in the latatide and longitute fields. So the problem is probably on the GPS Logger side.

Has anybody gotten this to work?
I am getting the same error message, and my app used to work. I am starting to wonder if the app has changed.
...