ElectronAssetTracker icon indicating copy to clipboard operation
ElectronAssetTracker copied to clipboard

redeclaration of 'LIS3DH_RANGE_4_G'

Open pwdel opened this issue 8 years ago • 12 comments

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
                                ^

pwdel avatar Nov 06 '16 20:11 pwdel

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 avatar May 24 '18 04:05 Brianmerle

@Brianmerle how are you using the library and which example code did you use?

kennethlimcp avatar May 25 '18 12:05 kennethlimcp

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 .

Brianmerle avatar May 25 '18 12:05 Brianmerle

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.

kennethlimcp avatar May 26 '18 11:05 kennethlimcp

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!

Brianmerle avatar May 26 '18 12:05 Brianmerle

Yeah but it's symlink here: https://github.com/habeducation/Particle3GTracker/blob/master/AssetTracker.cpp

kennethlimcp avatar May 26 '18 12:05 kennethlimcp

Are you using the Web IDE or CLI to compile code?

I am guessing that you did the following:

  1. Added the official AssetTracker library to the project
  2. Created a AssetTracker.h and AssetTracker.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

kennethlimcp avatar May 26 '18 12:05 kennethlimcp

I was using the web IDE. I can try using CLI. Thanks for looking into this!

Brianmerle avatar May 26 '18 12:05 Brianmerle

You don't need to switch over to CLI. Just remove the AssetTracker library from that project and it should work fine.

screen shot 2018-05-26 at 20 18 04

kennethlimcp avatar May 26 '18 12:05 kennethlimcp

OK. I'll try that this evening after work.

Brianmerle avatar May 26 '18 12:05 Brianmerle

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 avatar May 29 '18 02:05 Brianmerle

@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.

kennethlimcp avatar May 29 '18 08:05 kennethlimcp