# Asset tracker v2 accelerometer

**URL:** https://community.particle.io/t/asset-tracker-v2-accelerometer/50337
**Category:** Firmware
**Tags:** electron
**Created:** [June 13, 2019, 3:41pm UTC](https://community.particle.io/t/asset-tracker-v2-accelerometer/50337 "2019-06-13T15:41:30Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![cabz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/cabz/32/20359_2.png) [@cabz](https://community.particle.io/u/cabz)
#### Post date: [June 13, 2019, 3:41pm UTC](https://community.particle.io/t/asset-tracker-v2-accelerometer/50337/1 "2019-06-13T15:41:30Z")

</div>

Hello guys

I have an asset tracker v2 with an electron and using the sample code / libraries for the accelerometer given by particle but cannot make it work

Any of you can provide me please a project where it is working?

thanks!

---

<div class="post-metadata">

### Author: ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)
#### Post date: [June 13, 2019, 5:15pm UTC](https://community.particle.io/t/asset-tracker-v2-accelerometer/50337/2 "2019-06-13T17:15:06Z")

</div>

Try the AssetTrackerRK library - there are some more samples too.

---

<div class="post-metadata">

### Author: ![cabz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/cabz/32/20359_2.png) [@cabz](https://community.particle.io/u/cabz)
#### Post date: [June 14, 2019, 5:51pm UTC](https://community.particle.io/t/asset-tracker-v2-accelerometer/50337/3 "2019-06-14T17:51:15Z")

</div>

Im already using AssetTrackerRK library, but still not working.  
GPS working good but accelerometer is not.

---

<div class="post-metadata">

### Author: ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)
#### Post date: [June 14, 2019, 7:28pm UTC](https://community.particle.io/t/asset-tracker-v2-accelerometer/50337/4 "2019-06-14T19:28:40Z")

</div>

Try the 4\_AccelerometerSamples example and see if you have any output.

Also since the LIS3DH on the AssetTracker uses SPI, make sure you’re not using pins A2, A3, A4, or A5 for anything else.

---

<div class="post-metadata">

### Author: ![cabz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/cabz/32/20359_2.png) [@cabz](https://community.particle.io/u/cabz)
#### Post date: [June 15, 2019, 6:48pm UTC](https://community.particle.io/t/asset-tracker-v2-accelerometer/50337/5 "2019-06-15T18:48:33Z")

</div>

Thanks Rick,

Where can I find that 4\_AccelerometerSamples?

Thanks

---

<div class="post-metadata">

### Author: ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)
#### Post date: [June 15, 2019, 7:41pm UTC](https://community.particle.io/t/asset-tracker-v2-accelerometer/50337/6 "2019-06-15T19:41:24Z")

</div>

> [@cabz](#):
>
> Where can I find that 4\_AccelerometerSamples?

> **[Particle Web IDE](https://build.particle.io/libs/AssetTrackerRK/0.2.3/tab/example/4_AccelerometerSamples.ino)**
>
> Write and flash code to your Particle devices

Then click the **USE THIS EXAMPLE** button to make a new project from the library example.

---

<div class="post-metadata">

### Author: ![cabz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/cabz/32/20359_2.png) [@cabz](https://community.particle.io/u/cabz)
#### Post date: [June 21, 2019, 11:13pm UTC](https://community.particle.io/t/asset-tracker-v2-accelerometer/50337/7 "2019-06-21T23:13:22Z")

</div>

Rick, now I have another issue:

What happens is: I take the assets to the street, for couple minutes the GPS is working good, after 2 hours, one or two stop working, not receiving cords, even when reset, flash, not going back to life.

The weird thing is after couple hours the signal can be back again, and the same… after couple minutes or hours stop sending location, even when using the function to get GPS again is always giving 0.

Sometimes is not getting signal after one day in the street, so it’s weird because at least 1 time should have received GPS data.

Having all of them in the same room, let’s say 2-3 out of 10 stop working, then those 3 get signal and other 3 starts failing…

I start using cell tower identification to locate the assets and its always working but the GPS is not

Is there any issue known with GPS from the latest OS releases?

Any of you guys have issues with the hardware of the asset tracker v2? or should I focus on software only?

thanks

---

<div class="post-metadata">

### Author: ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)
#### Post date: [June 22, 2019, 11:06am UTC](https://community.particle.io/t/asset-tracker-v2-accelerometer/50337/8 "2019-06-22T11:06:26Z")

</div>

Are you using an external GPS antenna?

---

<div class="post-metadata">

### Author: ![cabz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/cabz/32/20359_2.png) [@cabz](https://community.particle.io/u/cabz)
#### Post date: [June 22, 2019, 11:18am UTC](https://community.particle.io/t/asset-tracker-v2-accelerometer/50337/9 "2019-06-22T11:18:25Z")

</div>

Yes, I’m using external GPS antenna

---

<div class="post-metadata">

### Author: ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)
#### Post date: [June 22, 2019, 11:41am UTC](https://community.particle.io/t/asset-tracker-v2-accelerometer/50337/10 "2019-06-22T11:41:55Z")

</div>

That’s not expected. Make sure you are calling updateGPS() very frequently - every loop and make sure you aren’t doing anything the can block the loop from executing, like calling delay().

Or use startThreadedMode() to enable threaded mode so you don’t need to do that.
