Asset Tracker GPS real-time google map

2 Likes

Thanks very much

Yello! Iā€™ve tried to get this to run last night for hoursā€¦
I manged the HTML / API part of it but flashing my electron fails.

I had a look at the files but canā€™t wrap my head around the .cpp and .h files, I only ever used the Arduini IDE or the particle.io web IDE. Neither of them seem to like the .cpp or .h files in the git repo.

Is my IDE setup wrong, what setup do I need?
Do I simply need a different file extension (tried that, failed)?

Any other pointers on how to get the right code on the electron to start tracking is much appreciatedā€¦!

Thanks in advance!

If you are using Paritcle Build (Web IDE) then youā€™d just need to go to the libraries drawer (bookmark symbol on the left), click on ASSETTRACKER, there click 1_GPS_FEATURES.CPP and press USE THIS EXAMPLE.
Then you just need to make sure youā€™ve got the correct device selected and also the correct target firmware version and hit build

These might help too
https://docs.particle.io/guide/getting-started/build/photon/#using-libraries
https://docs.particle.io/guide/getting-started/build/photon/#wait-what-is-firmware-


BTW, if you are refereing to a particlular repo/sample/ā€¦ itā€™s always good to repeat the link in your own post to avoid confusion of which repo/sample/ā€¦ you are refering to and saves peoplo who intend to help from having to search for it and/or guess (possibly wrong) the respective source.

1 Like

This is so badass. Thanks! Exactly what I needed as the other half of a working tracker.

Thanks for this great project and the code.

Mine currently isnā€™t connecting. Im getting the GPS error still on the web UI. Is there anything else you need to do once you tell the browser your device and insert the API key? I feel like im missing something, but not sure. Will try connecting again tomorrow.

Nic

What exact error on which Web UI?

Thanks for the response. on the html mapview provided by Hypno Iā€™m getting ā€œWaiting for GPS eventsā€¦ā€ on the bottom. Loaded his html code from github onto my server. (and used my own api key). but I still get ā€œWaiting for GPS eventsā€¦ā€ on both mine and his.

Thanks!

Do you see the coordinates published by your AssetTracker on https://console.particle.io/logs ?
And if you are using the .js file from this post how do you tell the server which devices to listen to?

I did not. Is that something that should be posted in the log on its own? Or do I have to setup the log to print the coordinates ?

As I understand the firmware that should be running on your Electron, it Particle.publish()es the coordinates to the Particle cloud and the js-server subscribes to these events.
But if you donā€™t see them in the console, the server hasnā€™t got anything to look for.
And since these events are also marked PRIVATE you could only subscribe to these events when the server is also using your Particle account.

Maybe @Hypnopompia can chime in to guide you through the exact setup process of that project.

Yeah, the first step here before messing with the map web page is to get your electron sending gps events and seeing them on the console.particle.io logs. Double check that the firmware was loaded correctly to the electron and the electron is properly connected to the gps tracker. Take the tracker outside and/or get an external antennae for it.

Once you get the events showing up in the console log, then the map should start working.

Hereā€™s the firmware library you want to upload to the electron:

https://docs.particle.io/datasheets/particle-shields/#asset-tracker-library

1 Like

Hi guys, and @Hypnopompia ,
if you place the asset tracker along with the external antenna inside the glove compartment of a car, or the trunk (or inside a container by that matter), what would the GPS do?
will the GPS ever get a location, even if very inaccurate? or it will not give a location at all?

thanks!
Gustavo.

I have great luck with getting a good signal with an external antenna. It even worked in the basement of my house. Iā€™m pretty sure with a good antenna, it would work fine in your glove compartment.

3 Likes

the havocstudios.com/assettracker/ link uses the ā€œhttps://cdn.jsdelivr.net/sparkjs/0.5.9/spark.min.jsā€ , the system works really well. Iā€™ve had some small connection issues trying to get the maps to display different asset tracker units. I use the access token to retrieve the information and a php file sends the device information to the php page with the maps api and the access token. I guess my question would be how long do you think the spark.min.js will work before I have to use particle.min.js? and would you have any example of how to use the particle.min.js with the access token allowing the user to access devices?
and Thank you for the Example you provided !! it really helped me out.

Ancient thread I knowā€¦ but has anyone whoā€™s using mfa with their particle.io account used this? Iā€™m curious if since this is still ā€œsparkā€ functions if there is anyone out there whoā€™s already updated it to use the particle login process.

Also curious if anyone has been able to skip the login process completely and just track a specific asset using particle API keys and tokens.