Asset tracker not working

I am new to this device but managed to get an application on the Photon working, now I am trying to get the asset tracker on the Electron working
I get 'Build didn’t produce binary’
So I stripped everything out until I was left with:

#include "application.h"
#include "AssetTracker.h"
// Set whether you want the device to publish data to the internet by default here.
// 1 will Particle.publish AND Serial.print, 0 will just Serial.print
// Extremely useful for saving data while developing close enough to have a cable plugged in.
// You can also change this remotely using the Particle.function "tmode" defined in setup()
int transmittingData = 1;

// Used to keep track of the last time we published data
long lastPublish = 0;

// How many minutes between publishes? 10+ recommended for long-time continuous publishing!
int delayMinutes = 10;

// Creating an AssetTracker named 't' for us to reference
AssetTracker t = AssetTracker();

// A FuelGauge named 'fuel' for checking on the battery state
FuelGauge fuel;

int transmitMode(String command);
int batteryStatus(String command);
int gpsPublish(String command);

// setup() and loop() are both required. setup() runs once when the device starts
// and is used for registering functions and variables and initializing things
void setup() {

and still get the problem.
If I comment out AssetTracker t = AssetTracker();
then I get success!!

Can any one help please?

How did you include the asset tracker library?

You included the header file “AssetTracker.h”. The library is certainly not included.
So when you are contructing an AssetTracker with AssetTracker t = AssetTracker(); the compiler looks for the function definition AssetTracker(); in this case the constructor and doesn’t find it. Make sure the library in which AssetTracker is defined is loaded.

It is in the same folder as the GPS program.

Seeing as this is the included example, I downloaded the lot and gave it a shot:


Seems to work fine in that setup?

Make sure you didn’t name your program AssetTracker.ino. Have the same base name with both .ino and .cpp extensions will cause a build did not produce binary error. Just name your program file to anything else, like AssetTrackerTest.ino.

I have been trying to compile the program with Particle Dev not CLI
But I tried to copy what you have done and got the following result.
I have uploaded Particle CLI and Node.js
Notice that my GPS prog is not .ino

That’s because you copied the path, whereas you should be opening the command line from that path (in the AssetTracker-master folder) :wink:
I should compile in Dev as well. Could you make a screenshot of that? Try removing the examples folder and only opening the AssetTracker-master folder, nothing else.