Code Monkey home page Code Monkey logo

electronassettracker's Introduction

Electron Asset Tracker

Build Status

The Asset Tracker has a lot of features, but some of these aren't as straightforward to use as simple LEDs and sensors. This library abstracts a lot of the complexity and provides simple functions with broad capability. It wraps modified versions of both Adafruit's Ultimate GPS and LIS3DH Arduino libraries, as well as some novel functions.

Examples

  1. GPS Features - How to use the GPS efficiently, and some nice Electron functions
  2. Accelerometer - Using the accelerometer with some cute tricks
  3. WakeOnMove - Waking up from sleep mode when the Electron is moved

electronassettracker's People

Contributors

debbiegillespie avatar jenesaisdiq avatar kenwalker avatar m-mcgowan avatar mohitbhoite avatar monkbroc avatar rickkas7 avatar technox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

electronassettracker's Issues

Adafruit_GPS::parse is not robust to certain strings

In the parse function, there is a test for the char 4 from the end to make sure it is a '' followed by a checksum test if it is a '', but the alternative, when there is not a '*' does not do an early return with false.

An input string that starts with "$GPGGA" or "$GPRMC" but does not have a '*' at the end will cause the code to attempt to parse an illegal string.

A better approach might be to have an early return with false if there is no '*' character four from the end.

The original Adafruit library also has this problem of course.

See this particle community discussion for more details:

https://community.particle.io/t/default-example-for-asset-tracker-gps-prints-erratic-nmea-sentences-to-serial/21356

redeclaration of 'LIS3DH_RANGE_16_G'

Veryfing code using this library in Particle Build fails with this error:

AssetTracker/AssetTracker.h:429:31: error: redeclaration of 'LIS3DH_RANGE_16_G'
   LIS3DH_RANGE_16_G         = 0b11,   //  /- 16g
                               ^

uBlox branch returning junk GPS data

Hey @mohitbhoite, I'm using the first example to publish out the GPS location and I'm getting garbage. Function returns 1, which should indicate it has a fix, but I'm getting data like
97.000000,0.000000

Also haven't seen the SAT_FIX LED blinking, so maybe that needs to be ported to this hardware as well?

Orientation implementation

Hi i have tried using the function getOrientation() which is private, i edit it and make it public, however there is no implementation on .cpp for it. Any ideas?

Accelerometer: cancelling gravity and using Z (LowPowerWakeMode)

So, as i understand it - Z axis determination is turned off, as it wasn't clear how to get the chip to cancel out the effects of gravity:

setting: writeRegister8(REG_CTRL_REG2, CTRL_REG2_HPM1 | CTRL_REG2_HPM0 | CTRL_REG2_HPIS1);

& adding Z axis to int1_cfg seems to solve the problem. I can't say i quite understand how this works, as the documentation really isn't clear [to a newb like me]...

redeclaration of 'LIS3DH_RANGE_8_G'

Veryfing code using this library in Particle Build fails with this error:

AssetTracker/AssetTracker.h:430:32: error: redeclaration of 'LIS3DH_RANGE_8_G'
   LIS3DH_RANGE_8_G           = 0b10,   //  /- 8g
                                ^

GPS gets a fix but function returns 0

While trying to implement the Asset tracker example (in particle documents), I bumped into the issue that GPS shows that it has gotten a fix on the position (by turning the "GPS FIX" led off) but the function .gpsfix() returns 0, so no data is collected.

My Hardware setup: I had replaced Electron with a Photon (don't think it matters here!). Used USB to power up and also used external Antenna.

After discussing the issue on forum, I worked on https://github.com/rickkas7/AssetTrackerRK by rickkas7. His library is based on TInyGPS++. Now the module is working perfectly. So it seems like the issue was with the Adafruit GPS library.

It would be great if the problem with Adafruit library is resolved!

'WKP' was not declared in this scope

Veryfing code using this library in Particle Build fails with this error:

AssetTracker/AssetTracker.h:579:16: error: 'WKP' was not declared in this scope
   int intPin = WKP

Access to latitudeDegrees and longitudeDegrees from library

I'm working on a project where I'd like access to latitudeDegrees and longitudeDegrees but at the moment the only access is through readLatLon() and you'd have to parse the string results.

Adding accessors in AssetTracker.cpp and AssetTracker.h is pretty trivial and I'll open up a pull request.

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
                                ^

Need function declarations in examples

Hey @mohitbhoite, I was finally testing the ublox branch and got compile errors on the first example (and I'd expect the others to throw it as well). The errors are that transmitMode, batteryStatus, and gpsPublish are undeclared when Particle.function tries to reference them. Fixed easily by adding these up above setup()

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

This was in Dev. Maybe something's different in Build, or because I was using 061rc2? Worth adding them to all the examples.

readXYZmagnitude() returns zero when GPS is on

I am trying to combine the GPSfeatures and accelerometer examples and only send latlon when the accelerator is activated. I can get the serial to print the accelerometer values for X, Y and Z but as soon as on turn GPSOn() then I my accelerometer only reads zero for all three access and the magnitude. Has anyone seen this before? Also does anyone know what pins are being used in the asset tracker?

thanks

altitude

Anyone working on getting the altitude? I am having trouble figuring it out.

error: AssetTracker.h: No such file or directory

I am trying to implement the 1_GPS_Features example of the Asset Tracker Library onto my electron asset tracker. However, when I try to compile the given code (in the Particle Web IDE), I get an error message saying-

1_gps_features.cpp:10:26: fatal error: AssetTracker.h: No such file or directory

The AssetTracker.h file is clearly in the library that the code is implementing so I do not understand why this error is occurring. Any suggestions?

gpsFix does not work correctly.

gpsFix will return true as long as a fix was established once.

Current code as of v.10:
bool AssetTracker::gpsFix() { if ((gps.latitude == 0.0) || (gps.longitude == 0.0)){ return false; } else { return true; }

If a fix is lost, gps.latitude and gps.longitude return their previous values, so this logic will only ever work upon powerup.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.