GPS + Radiation board does not work together

Everything about programming the platform and using the Waspmote API
BranoV
Posts: 21
Joined: Wed Mar 22, 2017 3:28 pm

Re: GPS + Radiation board does not work together

Post by BranoV » Mon Jun 19, 2017 4:14 pm

Hi,

I did so, I turned OFF SX1272 module, and SD card still did not work.

Code: Select all

/*  
 *  ------ [GPS_02] - Using ephemeris  -------- 
 *  
 *  Explanation: Set GPS module ON. Wait until it is connected to
 *  the satellites. Then ephemeris are requested and stored in SD
 *  card. Secondly, ephemeris are loaded to the GPS module from
 *  the SD card
 *  
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L. 
 *  http://www.libelium.com 
 *  
 *  This program is free software: you can redistribute it and/or modify 
 *  it under the terms of the GNU General Public License as published by 
 *  the Free Software Foundation, either version 3 of the License, or 
 *  (at your option) any later version. 
 *  
 *  This program is distributed in the hope that it will be useful, 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 *  GNU General Public License for more details. 
 *  
 *  You should have received a copy of the GNU General Public License 
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 *  
 *  Version:           0.1 
 *  Design:            David Gascón 
 *  Implementation:    Yuri Carmona
 */
#include <WaspSensorRadiation.h>
#include <WaspFrame.h>
#include <WaspSX1272.h>
#include <WaspGPS.h>

// define GPS timeout when connecting to satellites
// this time is defined in seconds (240sec = 4minutes)
#define TIMEOUT 240

// define status variable for GPS connection
bool status;


void setup()
{  
  // open USB port
  USB.ON();
  sx1272.OFF();
  // setup the GPS module
  USB.println("GPS_02 example");

  // Init SD
  SD.ON();

  // Turn GPS on
  GPS.ON(); 
}



void loop()
{
  ////////////////////////////////////////////////////////
  // 1. wait for GPS signal for specific time
  ////////////////////////////////////////////////////////
  status = GPS.waitForSignal(TIMEOUT);
  
  if( status == true )
  {
    USB.println(F("\n----------------------"));
    USB.println(F("Connected"));
    USB.println(F("----------------------"));
  }
  else
  {
    USB.println(F("\n----------------------"));
    USB.println(F("GPS TIMEOUT. NOT connected"));
    USB.println(F("----------------------"));
  }

  ////////////////////////////////////////////////////////
  // 2. if connected, store & load ephemeris
  ////////////////////////////////////////////////////////
  if( status == true )
  {
    // store ephemeris to SD card
    USB.print("Save Ephemeris (ok=1; error=0):");
    USB.println(GPS.saveEphems(),DEC);

    delay(5000);

    // load ephemeris from SD card
    USB.print("Load Ephemeris (ok=1; error=0):");
    USB.println(GPS.loadEphems(),DEC);
  }

}

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: GPS + Radiation board does not work together

Post by libelium-dev » Wed Jun 21, 2017 10:24 am

Hi,

What output do you get? What API are you using?

Regards

BranoV
Posts: 21
Joined: Wed Mar 22, 2017 3:28 pm

Re: GPS + Radiation board does not work together

Post by BranoV » Wed Jun 21, 2017 3:32 pm

Hello,

this is my output

Code: Select all

E#
GPS_02 example

----------------------
Connected
----------------------
Save Ephemeris (ok=1; error=0):-3
Load Ephemeris (ok=1; error=0):error seeking on: EPHEM.TXT

I am using api-v028 and ide-v6.02. I think that void WaspSPI::close() procedure can make a problem, but as I have mentioned.. I am beginner here.. Many thanks for effort!

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: GPS + Radiation board does not work together

Post by libelium-dev » Fri Jun 23, 2017 2:54 pm

Hi BranoV,

Sorry for our delay answering.

Part of our team is on holidays. We will be back to you as soon as possible.

Sorry for the inconvenience.

Regards

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: GPS + Radiation board does not work together

Post by libelium-dev » Mon Jun 26, 2017 9:59 am

Hi,

Error -3 means that there aren't ephem data returned by GPS receiver. Where did you test your device inside or outside? It seems a problem with the GPS signal, could you try it outside and with a direct line of sight to the sky.?

Regards

BranoV
Posts: 21
Joined: Wed Mar 22, 2017 3:28 pm

Re: GPS + Radiation board does not work together

Post by BranoV » Mon Jun 26, 2017 12:32 pm

Hello, thanks for your answer. I have test my device outside with a direct line of sight. As I have mentioned before, if include <WaspSX1272.h> is commented everything work smoothly.

With the best
Brano

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: GPS + Radiation board does not work together

Post by libelium-dev » Tue Jun 27, 2017 3:00 pm

Hi,

It is a weird issue.

Could you run this code and post the output you get? Does it work?

Code: Select all

#include <WaspSensorRadiation.h>
#include <WaspFrame.h>
#include <WaspSX1272.h>
#include <WaspGPS.h>

char filename[]="FILE1.TXT";

void setup()
{ 
  // open USB port
  USB.ON();
  sx1272.OFF();
  // setup the GPS module
  //USB.println("GPS_02 example");

  // Init SD
  SD.ON();

  // Turn GPS on
  //GPS.ON();

    // Delete file
  if(SD.del(filename)) 
  {
    USB.println(F("file deleted"));
  }
  else 
  {
    USB.println(F("file NOT deleted"));  
  }
}

void loop()
{
   // Create file1
  if(SD.create(filename))
  {
    USB.println(F("file created"));
  }
  else 
  {
    USB.println(F("file NOT created"));  
  }  
    
  delay(5000);
}
Regards

BranoV
Posts: 21
Joined: Wed Mar 22, 2017 3:28 pm

Re: GPS + Radiation board does not work together

Post by BranoV » Mon Jul 03, 2017 8:39 am

Dear developers, here there is the requested output:

Code: Select all

E#
file deleted
file created
file NOT created
file NOT created
file NOT created
file NOT created
file NOT created
file NOT created

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: GPS + Radiation board does not work together

Post by libelium-dev » Wed Jul 05, 2017 2:25 pm

Hi,

Sorry for our delay answering. We are trying to find where the problem is. Could you use this example code to use ephemeris? Does it work? What output do you get?
http://www.libelium.com/development/was ... ephemeris/

Regards

BranoV
Posts: 21
Joined: Wed Mar 22, 2017 3:28 pm

Re: GPS + Radiation board does not work together

Post by BranoV » Thu Jul 06, 2017 9:37 am

Dear developers, I am sending you output of the testing code:

Code: Select all

E#
GPS_02 example
bufferBin=00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
----------------------
Connected
----------------------
Save Ephemeris (ok=1; error=0):-3
Load Ephemeris (ok=1; error=0):error seeking on: EPHEM.TXT

0
Save Ephemeris (ok=1; error=0):




1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):



1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):-3
Load Ephemeris (ok=1; error=0):error seeking on: EPHEM.TXT

0
Save Ephemeris (ok=1; error=0):




1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):




1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):




1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):




1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):




1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):-3
Load Ephemeris (ok=1; error=0):error seeking on: EPHEM.TXT

0
Save Ephemeris (ok=1; error=0):




1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):-3
Load Ephemeris (ok=1; error=0):error seeking on: EPHEM.TXT

0
Save Ephemeris (ok=1; error=0):




1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):




1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):




1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):




1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):




1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):-3
Load Ephemeris (ok=1; error=0):error seeking on: EPHEM.TXT

0
Save Ephemeris (ok=1; error=0):




1
Load Ephemeris (ok=1; error=0):1
Save Ephemeris (ok=1; error=0):-3
Load Ephemeris (ok=1; error=0):error seeking on: EPHEM.TXT

0
Save Ephemeris (ok=1; error=0):




1

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest