Problem with Geolocation
Bighoneypot opened this issue · 4 comments
Bighoneypot commented
Dear @gmag11 I try your library but I Have this problem
My API work fine and I have a Full GCloud and i have created a new certificate via linux.
What is the problem?? Because 404 ?
`requesting URL: /geolocation/v1/geolocate?key=AI***************************gz-mXZIxXI
request:
POST /geolocation/v1/geolocate?key=AI****************************gz-mXZIxXI HTTP/1.1
Host: www.googleapis.com
User-Agent: ESP8266
Content-Type:application/json
Content-Length:523
Connection: keep-alive
{"considerIP":false,"wifiAccessPoints":[{"macAddress":"DC:XXXXX8:4D","signalStrength":-50,"channel":1},
{"macAddress":"FC:XXXX:E5:41","signalStrength":-86,"channel":8},
{"macAddress":"F0:2XXXXX:1B:D0","signalStrength":-56,"channel":8},
{"macAddress":"F0:2FXXXXXD:1B:D5","signalStrength":-55,"channel":8},
{"macAddress":"F0:2FXXXXXXB:D6","signalStrength":-56,"channel":8},
{"macAddress":"FC:3FXXXXXXC:85","signalStrength":-48,"channel":8},
{"macAddress":"42:EXXXXX:4C","signalStrength":-34,"channel":8}]}
request sent
Free heap: 3688
.
Got response:
HTTP/1.1 404 Not Found
Vary: X-Origin
Vary: Referer
Content-Type: application/json; charset=UTF-8
Date: Tue, 29 Mar 2022 14:23:22 GMT
Server: scaffolding on HTTPServer2
Cache-Control: private
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Accept-Ranges: none
Vary: Origin,Accept-Encoding
Transfer-Encoding: chunked
108
{
"error": {
"code": 404,
"message": "Requested entity was not found.",
"errors": [
{
"message": "Requested entity was not found.",
"domain": "global",
"reason": "notFound"
}
],
"status": "NOT_FOUND"
}
}
0
Location request data
7 WiFi networks found
WiFi list:
[{"macAddress":"DC:AXXXX0C:A8:4D","signalStrength":-53,"channel":1},
{"macAddress":"FC:3F:DXXXXX:85","signalStrength":-45,"channel":8},
{"macAddress":"42XXXX:4C","signalStrength":-17,"channel":8},
{"macAddress":"FC:34:9XXXX5:41","signalStrength":-85,"channel":8},
{"macAddress":"F0:2XXXXX1B:D6","signalStrength":-55,"channel":8},
{"macAddress":"F0:2XXB:D0","signalStrength":-53,"channel":8},
{"macAddress":"F0:2F:XXXB:D5","signalStrength":-54,"channel":8}]
[{"macAddress":"DC:AXXXX8:4D","signalStrength":-53,"channel":1},
{"macAddress":"FC:3FXXXX:2C:85","signalStrength":-45,"channel":8},
{"macAddress":"42:EXXX:7E:4C","signalStrength":-17,"channel":8},
{"macAddress":"FC:3XXX1:E5:41","signalStrength":-85,"channel":8},
{"macAddress":"F0:2F:7XXXB:D6","signalStrength":-55,"channel":8},
{"macAddress":"F0:2F:7XXXXB:D0","signalStrength":-53,"channel":8},
{"macAddress":"F0:2FXXXXXB:D5","signalStrength":-54,"channel":8}]
Location: 0.0000000,0.0000000
Longitude: 0.0000000
Accuracy: 40000`
gmag11 commented
It is working fine in my side. Check your Google Cloud account to see if you have any restriction.
requesting URL: /geolocation/v1/geolocate?key=AIzaSyxxxxxxxxxxxxxxxxxxxxxrnUI
request:
POST /geolocation/v1/geolocate?key=AIzaSyxxxxxxxxxxxxxxxxxxxxxrnUI HTTP/1.1
Host: www.googleapis.com
User-Agent: ESP32
Content-Type:application/json
Content-Length:1843
Connection: keep-alive
{"considerIP":false,"wifiAccessPoints":[{"macAddress":"XX:XX:XX:XX:XX:XX","signalStrength":-66,"channel":6},
{"macAddress":"XX:XX:XX:XX:XX:XX","signalStrength":-69,"channel":6},
{"macAddress":"XX:XX:XX:XX:XX:XX","signalStrength":-73,"channel":6},
{"macAddress":"XX:XX:XX:XX:XX:XX","signalStrength":-74,"channel":6},
...
{"macAddress":"XX:XX:XX:XX:XX:XX","signalStrength":-93,"channel":10},
{"macAddress":"XX:XX:XX:XX:XX:XX","signalStrength":-94,"channel":6},
{"macAddress":"XX:XX:XX:XX:XX:XX","signalStrength":-95,"channel":11}]}
request sent
Free heap: 209768
.
Got response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Vary: X-Origin
Vary: Referer
Date: Thu, 23 Jun 2022 07:40:01 GMT
Server: scaffolding on HTTPServer2
Cache-Control: private
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Accept-Ranges: none
Vary: Origin,Accept-Encoding
Transfer-Encoding: chunked
{
"location": {
"lat": x.372281,
"lng": x.7398717
},
"accuracy": 18.192
}
Lat: x.3722801
Lon: x.7398717
Accuracy: 18
jjarpa commented
Hi Guys.
Not sure if this information is useful:
- I add libraries first, using sketch menu. After that I load the Google GeoLoc example. All working good.
- I decide to make a copy in order to test again. Once I compile and load the code, I got the same behavior:
Location: 0.0000000,0.0000000
Longitude: 0.0000000
Accuracy: 40000`
I mean 1) works, but 2) doesn't.
best.
jjarpa commented
Please forget my previous comment. I realize i made a mistake in code. I erased setClock () function; and (i believe) this created this behavior.
Best.
Bighoneypot commented
Hi, I'll try this as soon as possible, thanks.