So I have the Asset Tracker with a working Electron plugged into it. I uploaded the “GPS_EXAMPLE” code to it so that it would publish its latitude and longitude to the cloud. However, whenever I press the “Get” button next to the lat and lon variables, it returns a zero every time. Am I doing something wrong? The code is just the unedited gps example that I got from the web editor.
You may want to try using the AssetTrackerRK library. The instructions are here and it’s AssetTrackerRK in the community libraries. It’s nearly a drop-in replacement for the official library.
I’ve seen the problem happen where you get 0,0 even though you have a GPS fix (red LED starts blinking, with the AssetTracker v2) with the official library, which uses the Adafruit GPS parser. I’ve had better luck with AssetTrackerRK, which uses TinyGPS++ internally.
Okay so I’m using that example, @rickkas7. Am I supposed to be seeing something in the Event Logs? Nothing is coming up. I am a beginner to this so I know I’m probably doing something wrong.
I just flashed the Simple_GPS example to my electron. Is that all I do? Or do i need to do something else?
Also, I don’t know how to see the serial output from the electron. I feel like that would be a big help in this.
Okay so I found the problem. I was using Microsoft Edge instead of Chrome. Now I can see the events in the Event Logs. But I still have a problem with the Simple_GPS example. Whenever the gps location is updated, I get an error saying, “no location”
Is there a way to fix this? I am just using the example, so it should work.
@nick13579, the “no location” message means the GPS doesn’t have a valid fix yet. You want to make sure the Asset Tracker has a good view of the sky. That generally means not indoors. You could place it next to a window but that may not be enough.
It depends on what the building is made out of and how much and what type of material the roof is made out of.
I’ve always been able to get pretty quick GPS fixes inside my house or garage with a regular stick built home. But you will have a hard time getting a GPS fix inside a place like a large shopping center where the roof is metal.
If you want to get an initial fix place the unit outside clear of any obstructions and then make sure you use the coin cell battery to help future fixes happen quickly.