Code compiling but not working

Hello! I am able to flash this custom code to my electron asset tracker V2 with no errors but then it is not working as expected. I’m not sure where to go from here. I have contacted the creator but I don’t think he is able to work with it. I know that it was created for the asset tracker V1 so there could be an issue there.
Thanks!

link to .ino file: https://github.com/habeducation/Particle3GTracker/blob/master/Tracker2.ino
link to .cpp file https://github.com/habeducation/AssetTracker/blob/master/firmware/AssetTracker.cpp
.h file: https://github.com/habeducation/AssetTracker/blob/master/firmware/AssetTracker.h
link to tracking web page: http://hab.education/pages/track_admin.html

Seeing as it's custom code, we have no idea what you expect it to do.

What does it do?
What doesn't it do?
What do you expect it to do?
What have you tried already?

of course, expectations would be helpful!

The code is forked from the asset tracker library. Basically GPS readings on the build console as well as a webpage using google maps.

I am able to use the standard gps asset tracker code that the custom code is forked from.

The major difference in code is that the custom .ino file includes altitude which is necessary for a high altitude balloon.

When I compile the code (successfully) all lights turn off on the electron and no readings are given in the console or webpage.

Thanks!

The better starting point would be AssetTrackerRK as it’s built ontop of a more up to date GPS library.
And if you need help with that library @rickkas7 is usually very responsive on the forum.

5 Likes

With AssetTrackerRK you can get the altitude by:

tracker.getTinyGPSPlus()->altitude.meters() 

or several other units if you prefer.

1 Like

Thanks, I’m going to look at it!

Thanks, i’m now closer than ever! I’m using the 6-backwardcompatibleapi.ino file and it is showing the GPS and battery successfully in the console as well as the google maps webpage but I’m still not seeing altitude in either. the webpage i’m using just says alt. NaN. Any ideas?

Have you got a fix on at least four satellites?

Ah, I see how that is necessary. How do I check that?

The TinyGPSPlus class contains a field satellites.