“No such file or directory” in web IDE

I’m trying to setup my particle electron asset tracker… When I follow the instructions from here:

I keep getting this error… I know I don’t have my device token number in… but I get an error then too.

Any advice on what I’m missing?

1 Like

@tate2326 Perhaps the title to this post should be: Error Compiling the Particle Asset Tracker ?

The fatal error message indicates that there is no file Adafruit_GPS.h found.

It is very difficult for me to see the details of the webIDE you have posted but there appears to be an #include for AssetTracker twice?

I built this a little while ago and the example I followed used the library Particle-GPS.

#include <Particle-GPS.h>
#include <LIS3DH.h>
/* -----------------------------------------------------------
This example shows a lot of different features. As configured here
it will check for a good GPS fix every 10 minutes and publish that data
if there is one. If not, it will save your data by staying quiet. It also
registers 3 Particle.functions for changing whether it publishes,
reading the battery level, and manually requesting a GPS reading.
---------------------------------------------------------------*/
#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 = 0;

// 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;

void setup()
{
    // Sets up all the necessary AssetTracker bits
    t.begin();
    // Enable the GPS module. Defaults to off to save power.
    // Takes 1.5s or so because of delays.
    t.gpsOn();
    // Opens up a Serial port so you can listen over USB
    Serial.begin(9600);
    // These three functions are useful for remote diagnostics. Read more below.
    Particle.function("tmode", transmitMode);
    Particle.function("batt", batteryStatus);
    Particle.function("gps", gpsPublish);
}

void loop()
{
    // You'll need to run this every loop to capture the GPS output
    t.updateGPS();
    // if the current time - the last time we published is greater than your set delay...
    if (millis()-lastPublish > delayMinutes*60*1000) {
        // Remember when we published
        lastPublish = millis();
        //String pubAccel = String::format("%d,%d,%d", t.readX(), t.readY(), t.readZ());
        //Serial.println(pubAccel);
        //Particle.publish("A", pubAccel, 60, PRIVATE);

        // Dumps the full NMEA sentence to serial in case you're curious
        Serial.println(t.preNMEA());

        // GPS requires a "fix" on the satellites to give good data,
        // so we should only publish data if there's a fix
        if (t.gpsFix())
        {
            // Only publish if we're in transmittingData mode 1;
            if (transmittingData)
            {
                // Short publish names save data!
                Particle.publish("G", t.readLatLon(), 60, PRIVATE);
            }
            // but always report the data over serial for local development
            Serial.println(t.readLatLon());
        }
    }
}
// Allows you to remotely change whether a device is publishing to the cloud
// or is only reporting data over Serial. Saves data when using only Serial!
// Change the default at the top of the code.
int transmitMode(String command)
{
    transmittingData = atoi(command);
    return 1;
}

// Actively ask for a GPS reading if you're impatient. Only publishes if there's
// a GPS fix, otherwise returns '0'
int gpsPublish(String command)
{
    if (t.gpsFix()) {
        Particle.publish("G", t.readLatLon(), 60, PRIVATE);

        // uncomment next line if you want a manual publish to reset delay counter
        // lastPublish = millis();
        return 1;
    } else {
      return 0;
    }
}

// Lets you remotely check the battery status by calling the function "batt"
// Triggers a publish with the info (so subscribe or watch the dashboard)
// and also returns a '1' if there's >10% battery left and a '0' if below
int batteryStatus(String command)
{
    // Publish the battery voltage and percentage of battery remaining
    // if you want to be really efficient, just report one of these
    // the String::format("%f.2") part gives us a string to publish,
    // but with only 2 decimal points to save space
    Particle.publish("B",
          "v:" + String::format("%.2f",fuel.getVCell()) +
          ",c:" + String::format("%.2f",fuel.getSoC()),
          60, PRIVATE
    );
    // if there's more than 10% of the battery left, then return 1
    if (fuel.getSoC()>10){ return 1;}
    // if you're running out of battery, return 0
    else { return 0;}
}
1 Like

Not sure what I did but I closed the IDE and then retried it later and it worked fine… well, atleast it downloaded and acted like it was working… but I’m not able to see any gps posititons on mysignal.io.

Here is the code i’m using… idea why it is not showing my gps position? Not sure if the problem is on mysignal.io end or my codes end… thanks

#include "SignalMQTT.h"
#include "AssetTracker.h"

// Once you created a device at mysignal.io, you'll begin
// given a device token. Insert the device token between the quotes
#ifndef TOKEN
#define TOKEN "mysecrettoken#:)"
#endif

void callback(char* topic, byte* payload, unsigned int length);

// Track last time coordinates were published
long lastPublish = 0;

// How many milliseconds between publishes 
int delayMillis = 10000;

AssetTracker t = AssetTracker();

// Define a client connection name 'signal'
MySignal signal(TOKEN, callback);

void callback(char* topic, uint8_t* payload, unsigned int length) {
    char p[length + 1];
    memcpy(p, payload, length);
    p[length] = NULL;
}

void setup() {
    t.begin();
    
    t.gpsOn();

    // Opens up a Serial port so you can listen over USB
    Serial.begin(9600);
    
    // Initialize the connection to Signal
    signal.initialize();

}

// loop() runs continuously
void loop() {        

    // Reconnect if connection to Signal was lost
    if(!signal.isConnected()){
        signal.connect();
    }
    
    t.updateGPS();

    // Delay the loop
    if (millis()-lastPublish > delayMillis) {
        lastPublish = millis();

        if (t.gpsFix()) {
            if (signal.isConnected()) {
                // Publish coordinates
                signal.publishCoordinates(t.readLatLon());
            }
            Serial.println(t.readLatLon());
        }
    }

    // Maintain the connection to Signal if connected
    if (signal.isConnected()){
        signal.loop();
    }
}

I downloaded and ran your code. Where should it publish the gps coordinates to? In my example it published to the mysignal.io website.... I didn't see anyplace here to post a token or app id.

thanks for your help!

This will publish to the console.particle.io/events

I think @scruffr has identified the output - there is a private message called "G" and the same data printed to the Serial port.

ok… all I am getting in my events is this…

This is my first particle electron so I’m a noob to these things… i have done some of the basic tutorials with success… flashing LED over the cloud etc.

Hi @tate2326. Are you still running into issues? (I’m the developer of https://mysignal.io btw :slight_smile:)

Can you make sure your Electron is running at least version 0.6.4 of the firmware?

34%20AM

#include "SignalMQTT.h"
#include "AssetTracker.h"

// Once you created a device at mysignal.io, you'll begin
// given a device token. Insert the device token between the quotes
#ifndef TOKEN
#define TOKEN "mysecrettoken#:)"
#endif

void callback(char* topic, byte* payload, unsigned int length);

// Track last time coordinates were published
long lastPublish = 0;

// How many milliseconds between publishes 
int delayMillis = 10000;

AssetTracker t = AssetTracker();

// Define a client connection name 'signal'
MySignal signal(TOKEN, callback);

void callback(char* topic, uint8_t* payload, unsigned int length) {
    char p[length + 1];
    memcpy(p, payload, length);
    p[length] = NULL;
}

void setup() {
    t.begin();

    t.gpsOn();

    // Opens up a Serial port so you can listen over USB
    Serial.begin(9600);

    // Initialize the connection to Signal
    signal.initialize();

}

// loop() runs continuously
void loop() {        

    // Reconnect if connection to Signal was lost
    if(!signal.isConnected()){
        signal.connect();
    }

    t.updateGPS();

    // Delay the loop
    if (millis()-lastPublish &gt; delayMillis) {
        lastPublish = millis();

        if (t.gpsFix()) {
            if (signal.isConnected()) {
                // Publish coordinates
                signal.publishCoordinates(t.readLatLon());
            }
            Serial.println(t.readLatLon());
        }
    }

    // Maintain the connection to Signal if connected
    if (signal.isConnected()){
        signal.loop();
    }
}

still needing help… tried some other options with no luck.

Is there an email address I could send you screenshots with my token# so they aren’t blasted all over this site… lol

The code you just posted compiles (aside from a glitch in the millis timer where you see “&gt;”). Are you still having compilation issues or GPS location issues? It would be helpful if you re-stated your issues because of the lengthy time gap from when you started the post.

Have you considered switching to the “AssetTrackerRK” library? It is more stable/reliable than the “official” asset tracker library.

2 Likes

well… I was able to get the file to compile and flash to my electron… but it never would show a location on mysignal.io… or blynk… or any other app that i tried to use. Now I’m back to compilation errors due to tweaking the file to see if that helped…

I’m a particle electron noob, i’ve done “turn the led on/off via cellular” even " turn on a relay via cellular" but tracking a particle electron/boron has really stumped me!!!

I switched the asset tracker library to “AssetTrackerRK” library and now I get this error…

Here is my current file:

// This #include statement was automatically added by the Particle IDE.
#include "AssetTrackerRK.h"




#include "SignalMQTT.h"



// Once you created a device at mysignal.io, you'll begin
// given a device token. Insert the device token between the quotes
#ifndef TOKEN
#define TOKEN "token#"
#endif

void callback(char* topic, byte* payload, unsigned int length);

// Track last time coordinates were published
long lastPublish = 0;

// How many milliseconds between publishes 
int delayMillis = 10000;

AssetTracker t = AssetTracker();

// Define a client connection name 'signal'
MySignal signal(TOKEN, callback);

void callback(char* topic, uint8_t* payload, unsigned int length) {
    char p[length + 1];
    memcpy(p, payload, length);
    p[length] = NULL;
}

void setup() {
    t.begin();
    
    t.gpsOn();

    // Opens up a Serial port so you can listen over USB
    Serial.begin(9600);
    
    // Initialize the connection to Signal
    signal.initialize();

}

// loop() runs continuously
void loop() {        

    // Reconnect if connection to Signal was lost
    if(!signal.isConnected()){
        signal.connect();
    }
    
    t.updateGPS();

    // Delay the loop
    if (millis()-lastPublish > delayMillis) {
        lastPublish = millis();

        if (t.gpsFix()) {
            if (signal.isConnected()) {
                // Publish coordinates
                signal.publishCoordinates(t.readLatLon());
            }
            Serial.println(t.readLatLon());
        }
    }

    // Maintain the connection to Signal if connected
    if (signal.isConnected()){
        signal.loop();
    }
}




My Electron is breathing cyan but the asset tracker never lights up and/or shows SAT FIX… I’ve tried connecting a antenna to it as well, also connecting 12v power to the board… no change.

Makes me think it’s my code

Make sure you remove the old asset tracker library from your project. Using WebIDE, click on the code icon image then click the “X” next to the library you want to remove:

image

And make sure you put it by a window or outside to get a SAT fix. You won’t usually see any satellites indoors unless next to a window with a clear view of the sky (no tall buildings).

1 Like

I keep getting the same "No such file or directory with just about every library I try to use. I wanted to use the DHT sensor and I get the same error on several of them. Seems like if it’s in the list it shoudl be there right? If I don’t get “No such file or directory” error, It just times out and says the server could not process in time blah blah. The only thing I seem to be able to get compiled or flash is very simple no library type stuff.

This would suggest you are targeting a device OS version prior to 0.5.3.
Try out 0.7.0

That sort of reason was already mentioned in one of the previous posts in this thread

It looks like it is 0.8.0-rc.25. Right out of the box it made me upgrade the firmware. You say “OS” are you talking somehting different than the firmware? I might need to go back and do some more reading.
thanks!

The firmware on these devices consists of separate modules

  • bootloader
  • system (1, 2 or 3 submodules)
  • user application

While all these are considered firmware they all have their individual tasks and the system part is what allows the user application to properly function (operate) ontop of hence is considered the Operating System (OS).

1 Like

okay, sounds like I need to go do some studying.
thanks!

1 Like