Code Monkey home page Code Monkey logo

arduino_mkrgps's Introduction

arduino_mkrgps's People

Contributors

aentinger avatar canchebagur avatar dependabot[bot] avatar jhansson-ard avatar karlsoderby avatar misterawesome23 avatar per1234 avatar sandeepmistry avatar

Stargazers

 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

arduino_mkrgps's Issues

Arduino IoT and MKR GPS library Compatibility

Hardware used

MKR GSM 1400 with MKR GPS attached as a shield.

Issue description

When using the MKR GPS example sketch, GPS data immediately appears in the serial monitor.

However, when using the following code to send GPS data to Arduino IoT hub, the GPS data never comes.

A connection to IoT cloud is made successfully but the function GPS.available() always returns 0.

Code

#include <Arduino_MKRGPS.h>
#include <ArduinoIoTCloud.h>
#include <Arduino_ConnectionHandler.h>

#define THING_ID ""
#define BOARD_ID ""

const char GPRS_APN[]      = "";
const char PINNUMBER[]     = "";
const char GPRS_LOGIN[]    = "";
const char GPRS_PASSWORD[] = "";

float lat;
float lon;

GSMConnectionHandler ArduinoIoTPreferredConnection(PINNUMBER,GPRS_APN,GPRS_LOGIN, GPRS_PASSWORD); 
                                                   
void setup() {
  Serial.begin(9600);
  while(!Serial);
  
  if(!GPS.begin(GPS_MODE_SHIELD)){
    Serial.println("Failed to initialize GPS!");
    while(1);
  }else Serial.println("GPS Initilized OK!");
 
  initProperties();

  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  setDebugMessageLevel(4);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  delay(10000);
  
  if (GPS.available()){
    lat = GPS.latitude();
    lon = GPS.longitude();  

    Serial.println("Latitude: " + String(lat));
    Serial.println("Longitude: " + String(lon));
  }
}

void initProperties(){
  ArduinoCloud.setThingId(THING_ID);
  ArduinoCloud.addProperty(lat, READ, ON_CHANGE);
  ArduinoCloud.addProperty(lon, READ, ON_CHANGE);
}

GPS max altitude

Hi!
The chip used by this shield should be able to reach also 40-50km of altitude, but it is necessary to change its working mode.
If I'm not wrong, it should be the airborne mode, but the API of this library does not show how to do it.
Could you provide a snippet to set it? Is it possible to do it? Do you know which mode is set in the chip usually?

Thank you in advance!

serial poll() is always reading only 1 byte per call

if (_stream->available()) {

The current version is "taking forever" to read a GPS location, if the user has a significant delay (e.g. 500ms) in the loop() method, since on each GPS.available() call only 1 byte is read.

proposed fix: replace the "if" with a "while" in line 195 (GPS.cpp)

Another tip: make the GPS_DEBUG flag available in the begin() method (2nd argument or so), to better track issues like this easily and without modifying the library.

field '_ts' has incomplete type 'timespec'

I downloaded the example GPSLocation.ino but when compiling it I get the following error: GPS.h:88:19: error: field '_ts' has incomplete type 'timespec' struct timespec _ts; In file included from sketch\GPS.cpp:23:0: sketch\minmea/minmea.h:214:27: note: forward declaration of 'struct timespec'

I'm using Arduino: 1.8.13
fel
(Windows 10), Board: "Arduino Uno"

add a function to use the geofence

I would like to ask the developers to add some simple functions:
a function to use the geofence
I noticed that the library is already prepared for this.

GPS.begin() works only with serial port connected

Hey I am currently working on a tracking device with LiPo battery and BLE, I fount that if the device is not booted using the USB connected as serial port the GPS shield attacked to a Arduino MKR 1010 Wifi will not work. After hours of debugging I found that the problem was created by GPS.begin() , but if I use it as shield it won't crash:

if (!GPS.begin(GPS_MODE_SHIELD)) {
      Serial.println("Failed to initialize GPS!");
    while (1)
      ;
  }

Any ideas?

Method SerialDDC::write(uint8_t) cannot work

See the code below, from this file:

size_t SerialDDC::write(uint8_t b)
{
  return write(&b, sizeof(b));
}

size_t SerialDDC::write(const uint8_t *buffer, size_t size)
{
  if (size < 2) {
    return 0;
  }

  ...
}

What's the purpose of the size < 2 test at the beginning of SerialDDC::write(const uint8_t, size_t)?
I tried to remove it and calling the method with only one byte, and indeed it doesn't work :-) Why?

Also, because of the above, method SerialDDC::write(uint8_t) always fails.

MRK Format Portenta issue with MKR-GPS

Has anyone tried the MKR-GPS with the PortentaH7 either using the MKR headers or the eslov connector?

I had similar issues with the MKR-IMU but just bent the reset pin out of the way to solve the issue. This time bending the reset pin does not seem to solve the red flash of death, however using the eslov cable does let it compile and run, just not getting any data.

Wondering if this is relevant to issue Arduino IoT and MKR GPS library Compatibility

That perhaps running begin each loop might be helpful.

Wire library is closed when GPS is not wired

I'm using Arduino MKRGSM 1400 and MKR GPS shield connected via I2C.

If the I2C is not wired (GPS shield is not connected at all) when calling GPS.begin(); it ends up calling (twice) _wire->end(); which closes wire library.

If there is more than one I2C device wire.begin(); needs to be called again.

I think _wire->end(); shouldn't be called as you can never be sure if there is more than one I2C device.

Thanks for your time.

Add function to vary the GPS update frequency

I would like to ask the developers to add some simple functions:

  • A function to vary the GPS update frequency
  • A function to disable NMEA sentences and use the UBX protocol
  • A function that allows the use of geofences

I noticed that the library is already prepared for this.

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.