ElectronAssetTracker
ElectronAssetTracker copied to clipboard
redeclaration of 'LIS3DH_RANGE_4_G'
Veryfing code using this library in Particle Build fails with this error:
AssetTracker/AssetTracker.h:431:32: error: redeclaration of 'LIS3DH_RANGE_4_G'
LIS3DH_RANGE_4_G = 0b01, // /- 4g
^
Did you have any luck with this error? I'm working on the electron tracker with altitude and i have the same error.
Thanks!
@Brianmerle how are you using the library and which example code did you use?
Here is the code I used: https://github.com/habeducation/Particle3GTracker/blob/master/Tracker2.ino
And the libraries: https://github.com/habeducation/AssetTracker/tree/master/firmware
It is for a high altitude weather balloon. It has altitude added into the tracker code. Thanks again!
On Fri, May 25, 2018 at 7:07 AM, Kenneth Lim [email protected] wrote:
@Brianmerle https://github.com/Brianmerle how are you using the library and which example code did you use?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/particle-iot/AssetTracker/issues/12#issuecomment-392033005, or mute the thread https://github.com/notifications/unsubscribe-auth/AlvruiPVX-n2-DWeaQouIcJkL48niwfkks5t1_PxgaJpZM4KqrAd .
Hello @Brianmerle,
it looks like the AssetTracker.h
and AssetTracker.cpp
are symlinks so i cannot compile Tracker2.ino
successfully.
I would also recommend renaming your AssetTracker.*
files to another name since it clashes with the AssetTracker.*
of the library itself.
I will rename the AssetTracker files to something else. Aren't these the actual files? https://github.com/habeducation/AssetTracker/tree/master/firmware I'm confused about the symlink. In the tree he has the symlinks changed to actual files.
Thanks for your help!
Yeah but it's symlink here: https://github.com/habeducation/Particle3GTracker/blob/master/AssetTracker.cpp
Are you using the Web IDE or CLI to compile code?
I am guessing that you did the following:
- Added the official
AssetTracker
library to the project - Created a
AssetTracker.h
andAssetTracker.cpp
file and got the contents from https://github.com/habeducation/AssetTracker
If you want to use the AssertTracker
library from https://github.com/habeducation/AssetTracker,
you won't need to include the official AssetTracker
library.
Using the CLI, i managed to compile using your AssetTracker.h/cpp
and Tracker2.ino
files:
$ ls -l
-rw-r--r-- 1 kennethlimcp staff 25411 May 26 20:07 AssetTracker.cpp
-rw-r--r-- 1 kennethlimcp staff 17055 May 26 20:07 AssetTracker.h
-rw-r--r-- 1 kennethlimcp staff 5313 May 26 20:08 Tracker2.ino
-rw-r--r-- 1 kennethlimcp staff 24212 May 26 20:08 photon_firmware_1527336499593.bin
$ pcp
Compiling code for photon
Including:
AssetTracker.h
Tracker2.ino
AssetTracker.cpp
attempting to compile firmware
downloading binary from: /v1/binaries/5b094e38632000662a7e94d6
saving to: photon_firmware_1527336499593.bin
Memory use:
text data bss dec hex filename
24028 184 1776 25988 6584 /workspace/target/workspace.elf
Compile succeeded.
Saved firmware to: /Users/kennethlimcp/Desktop/AssetTrackerTest/photon_firmware_1527336499593.bin
I was using the web IDE. I can try using CLI. Thanks for looking into this!
You don't need to switch over to CLI. Just remove the AssetTracker
library from that project and it should work fine.

OK. I'll try that this evening after work.
I was able to flash it, thanks! There seems to be some issues as I am not getting GPS or altitude readings but am able to get battery readings and change settings like frequency of location updates via a web page. The creator is thinking that there may be hardware changes from the V1 to V2 so that the code may need to be modified.
@Brianmerle you might need to sync up the https://github.com/habeducation/AssetTracker repository with newer commits from this repository or simply try out the examples from this repository before using the customized one.