Unable to compile Asset Tracker code on WebIDE or Dev

I have a new and fully tested Electron plugged into the Asset Tracker project board and I’m trying to compile and download the supplied software in the Asset Tracker library. I’ve tried both the Web IDE and Dev with compile errors. Yes, I can get the Asset Tracker library linked with with my .ino file.
Question: Should I be able to get this project working using the Web IDE?

Here is my process using the Web IDE:
First, using the library I see 4 programs listed: 1_GPS_Features.cpp, 2_Accelerometer.cpp, AssetTracker.cpp and AssetTracker.h. I am assuming AssetTracker.cpp is the main program so I copy/pasted it into my project .ino file I named LR_AssetTracker. Next I link the library to the project file LR_AssetTracker.ino. I can see the indicator of the addition of the library. Also, I can see the #include AssetTracker/AssetTracker.h added to the .ino file. When I compile I get an error mesage that it can’t find AssetTracker/AssetTracker.h. So, I changed the include to simply AssetTracker.h and compile again. I no longer complains it can’t find the include file but I get this:

lr_assettracker.cpp: In member function ‘void AssetTracker::updateGPS()’:
lr_assettracker.cpp:82:10: warning: unused variable ‘c’ [-Wunused-variable]
char c = gps.read();
^
In file included from lr_assettracker.cpp:2:0:
AssetTracker/AssetTracker.h: In constructor ‘Adafruit_LIS3DH::Adafruit_LIS3DH()’:
AssetTracker/AssetTracker.h:481:29: warning: ‘Adafruit_LIS3DH::_sck’ will be initialized after [-Wreorder]
int8_t _cs, _mosi, _miso, _sck;
^
AssetTracker/AssetTracker.h:477:11: warning: ‘int32_t Adafruit_LIS3DH::_sensorID’ [-Wreorder]
int32_t _sensorID;
^
lr_assettracker.cpp:658:1: warning: when initialized here [-Wreorder]
@brief Instantiates a new LIS3DH class in I2C or SPI mode
^
In file included from lr_assettracker.cpp:2:0:
AssetTracker/AssetTracker.h: In constructor ‘Adafruit_LIS3DH::Adafruit_LIS3DH(int8_t)’:
AssetTracker/AssetTracker.h:481:29: warning: ‘Adafruit_LIS3DH::_sck’ will be initialized after [-Wreorder]
int8_t _cs, _mosi, _miso, _sck;
^
AssetTracker/AssetTracker.h:477:11: warning: ‘int32_t Adafruit_LIS3DH::_sensorID’ [-Wreorder]
int32_t _sensorID;
^
lr_assettracker.cpp:663:1: warning: when initialized here [-Wreorder]
: _cs(-1), _mosi(-1), _miso(-1), _sck(-1), _sensorID(-1)
^
In file included from lr_assettracker.cpp:2:0:
AssetTracker/AssetTracker.h: In constructor ‘Adafruit_LIS3DH::Adafruit_LIS3DH(int8_t, int8_t, int8_t, int8_t)’:
AssetTracker/AssetTracker.h:481:29: warning: ‘Adafruit_LIS3DH::_sck’ will be initialized after [-Wreorder]
int8_t _cs, _mosi, _miso, _sck;
^

I can only see warnings that won’t prevent a build - what are the errors?

And that’s not the way how you’d import libraries into your project.
AssetTracker.cpp is not the main program but the actual library implementation file.

If you want to start off with one of the samples (1_GPS_Features.cpp, 2_Accelerometer.cpp or `3_WakeOnMove.cpp - if you don’t see that, you should refresh libraries), you just click on one of these and press USE THIS EXAMPLE. I’d recommend going with the samples first.

If you only want to import the lib, you shan’t copy-paste the files either, but click INCLUDE IN APP, select the respective .ino in your project list and click ADD TO THIS APP.

For Particle Dev, you’d click on the GitHub icon next to the lib name and download the library repo from there, unzip the file and copy the contents of the firmware sub-folder(withoutexamples/`) into your project folder (possibly in a dedicated subfolder)

But that process will get easier soon when Libraries 2.0 gets released.

Thank you ScruffR for the quick reply. My original posting ended up truncating the long list of errors which as you point out are actually warnings. I just deleted my original attempt and started with a fresh Web IDE.

I followed your steps and selected 1_GPS_Features.cpp as my main program using your recommendation of “Use This Example” button. That one step also included the AssetTracker library. It compiled without errors and I downloaded it into the Electron.
Success! My Asset Tracker board is finally flashing the GPS Fix led! Time to dig out the antenna.

Before I do that, I plan to document the steps and practice a bit. Also, I want to do the same with Dev and document that as well.

Thanks again,
LR

1 Like