gmag11 / WifiLocation

Google GeoLocation API wrapper for Arduino MKR1000, ESP8266 and ESP32
MIT License
212 stars 48 forks source link

Empty results #1

Closed alxferraz closed 7 years ago

alxferraz commented 7 years ago

Hi!, thanks for your library! I'm trying to use this and i have a problem.

Location request data [ {"macAddress":"98:97:D1:DF:6F:74","signalStrength":-74,"channel":1}, {"macAddress":"34:57:60:11:0E:EC","signalStrength":-88,"channel":2}, {"macAddress":"48:EE:0C:11:52:23","signalStrength":-43,"channel":9}, {"macAddress":"70:62:B8:29:C0:20","signalStrength":-74,"channel":6}, {"macAddress":"C4:12:F5:46:C4:0B","signalStrength":-88,"channel":10}] Latitude: 0.0000000 Longitude: 0.0000000 Accuracy: 40000

this is the output when trying to run the example provided. I've checked my API key. Do you have any ideias on what is wrong?

gmag11 commented 7 years ago

Hi @alxferraz Have you tried to enable debug info con WifiLocation.h? Please do that and copy the output here.

Library gives that result when there is a fault of any kink (like a connection problem or a wrong Google secret)

alxferraz commented 7 years ago

HI @gmag11 ! i just did what you suggested the output i got:

Status = 6
Attempting to connect to WPA SSID: FF
Status = 6
Attempting to connect to WPA SSID: FF
Status = 6
Attempting to connect to WPA SSID: FF
Status = 6
Attempting to connect to WPA SSID: FF
Status = 6
Connected to API endpoint
17 WiFi networks found
WiFi list :
[
{"macAddress":"98:97:D1:DF:6F:74","signalStrength":-66,"channel":1},
{"macAddress":"84:E0:58:12:4E:54","signalStrength":-87,"channel":1},
{"macAddress":"04:8D:39:15:E1:E8","signalStrength":-86,"channel":9},
{"macAddress":"34:57:60:11:0E:EC","signalStrength":-90,"channel":2},
{"macAddress":"C4:12:F5:46:C4:0B","signalStrength":-83,"channel":9},
{"macAddress":"00:02:6F:AA:9B:B4","signalStrength":-90,"channel":4},
{"macAddress":"70:62:B8:29:C0:20","signalStrength":-57,"channel":6},
{"macAddress":"AC:C6:62:29:8F:38","signalStrength":-93,"channel":6},
{"macAddress":"AC:C6:62:28:0D:30","signalStrength":-91,"channel":6},
{"macAddress":"34:57:60:57:71:54","signalStrength":-92,"channel":6},
{"macAddress":"48:EE:0C:11:52:23","signalStrength":-59,"channel":9},
{"macAddress":"04:8D:39:07:3A:F0","signalStrength":-83,"channel":10},
{"macAddress":"54:B8:0A:F9:49:2A","signalStrength":-90,"channel":10},
{"macAddress":"C4:12:F5:46:14:FA","signalStrength":-88,"channel":10},
{"macAddress":"6C:19:8F:02:50:F8","signalStrength":-84,"channel":11},
{"macAddress":"D8:FE:E3:62:2B:4C","signalStrength":-87,"channel":11},
{"macAddress":"5E:E3:0E:2C:C1:6C","signalStrength":-92,"channel":11}]
requesting URL: /geolocation/v1/geolocate?key="my own key here"
request: 
POST /geolocation/v1/geolocate?key=my own key here HTTP/1.1
Host: www.googleapis.com
User-Agent: ESP8266
Content-Type:application/json
Content-Length:1201
Connection: close

{"wifiAccessPoints":[
{"macAddress":"98:97:D1:DF:6F:74","signalStrength":-66,"channel":1},
{"macAddress":"84:E0:58:12:4E:54","signalStrength":-87,"channel":1},
{"macAddress":"04:8D:39:15:E1:E8","signalStrength":-86,"channel":9},
{"macAddress":"34:57:60:11:0E:EC","signalStrength":-90,"channel":2},
{"macAddress":"C4:12:F5:46:C4:0B","signalStrength":-83,"channel":9},
{"macAddress":"00:02:6F:AA:9B:B4","signalStrength":-90,"channel":4},
{"macAddress":"70:62:B8:29:C0:20","signalStrength":-57,"channel":6},
{"macAddress":"AC:C6:62:29:8F:38","signalStrength":-93,"channel":6},
{"macAddress":"AC:C6:62:28:0D:30","signalStrength":-91,"channel":6},
{"macAddress":"34:57:60:57:71:54","signalStrength":-92,"channel":6},
{"macAddress":"48:EE:0C:11:52:23","signalStrength":-59,"channel":9},
{"macAddress":"04:8D:39:07:3A:F0","signalStrength":-83,"channel":10},
{"macAddress":"54:B8:0A:F9:49:2A","signalStrength":-90,"channel":10},
{"macAddress":"C4:12:F5:46:14:FA","signalStrength":-88,"channel":10},
{"macAddress":"6C:19:8F:02:50:F8","signalStrength":-84,"channel":11},
{"macAddress":"D8:FE:E3:62:2B:4C","signalStrength":-87,"channel":11},
{"macAddress":"5E:E3:0E:2C:C1:6C","signalStrength":-92,"channel":11}]}
request sent
Free heap: 37936

Soft WDT reset

ctx: cont 
sp: 3fff0d40 end: 3fff0ff0 offset: 01b0

>>>stack>>>
3fff0ef0:  40203f50 3ffefdc4 3ffeff0c 402043b0  
3fff0f00:  3ffefdb8 3ffefdc4 3ffeff0c 40203c9a  
3fff0f10:  00000000 00000000 00000000 00000000  
3fff0f20:  00000000 00000000 00000000 00000000  
3fff0f30:  00000000 00000001 3ffe9103 40204e74  
3fff0f40:  3fff6bfc 0000057f 0000057e 3fff75c4  
3fff0f50:  000004bf 000004b1 3fff19cc 0000000f  
3fff0f60:  00000000 3ffeff0c 3ffe8350 3ffefde0  
3fff0f70:  4021da23 3ffeffc8 40204adc 3ffeffd0  
3fff0f80:  3fff1a0c 40202608 000003e8 3ffeffc8  
3fff0f90:  3ffefde0 3ffe8350 3ffeff0c 40202246  
3fff0fa0:  feefeffe feefeffe feefeffe feefeffe  
3fff0fb0:  feefeffe feefeffe feefeffe feefeffe  
3fff0fc0:  feefeffe feefeffe feefeffe feefeffe  
3fff0fd0:  3fffdad0 00000000 3ffeffc0 40204b20  
3fff0fe0:  feefeffe feefeffe 3ffeffd0 40100718  
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(1,6)

 ets Jan  8 2013,rst cause:4, boot mode:(1,6)

wdt reset

I only changed my api key in the code and increased the delay while trying to connect to my wifi network. Thank You!

alxferraz commented 7 years ago

I just tested with another nodemcu and it worked! thank you! it might have been a hardware issue