GPS + Radiation board does not work together

Everything about programming the platform and using the Waspmote API
libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: GPS + Radiation board does not work together

Post by libelium-dev » Thu Jul 06, 2017 4:47 pm

Hi,

It shows the same error as before.

Code: Select all

----------------------
Connected
----------------------
Save Ephemeris (ok=1; error=0):-3
Load Ephemeris (ok=1; error=0):error seeking on: EPHEM.TXT
Could you post the code that works and its output?

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 5:16 pm

Dear developers,
here it is.

INPUT:

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;

// Variable to store measured radiation
float radiationcpm;
float radiationusv;

// Define private key to encrypt message  
char node_ID[] = "Node_01";

// define the destination address to send packets
uint8_t rx_address = 3;

// status variable
int8_t e;

void setup()
{  
  // open USB port
  USB.ON();

  // setup the GPS module
  USB.println("GPS_02 example");
//  sx1272.OFF(); 
  // Init SD
  SD.OFF();
  delay(1000);
  SD.ON();

  // Turn GPS on
  GPS.ON(); 
  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("----------------------"));
  }
      USB.print("Save Ephemeris (ok=1; error=0):");
    USB.println(GPS.saveEphems(),DEC);
}



void loop()
{
//  sx1272.OFF(); 
  ////////////////////////////////////////////////////////
  // 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);
  }

}
OUTPUT:

Code: Select all

E#
GPS_02 example

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

1

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

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

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

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

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

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

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

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

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

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

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



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

Re: GPS + Radiation board does not work together

Post by BranoV » Tue Jul 11, 2017 9:20 am

Dear developers, please are there any news with our problem?
Thank you.

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 12, 2017 10:20 am

Hi,

Sorry for the delay answering, it is a weird issue and we are taking a look at the libraries in order to see if there is a bug.

We think that some registers are configured incorrectly when SD.ON(), SD.OFF() or sx1272.OFF() functions are running.

What output do you get with the following code which doesn't turn off the lora module?

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;

// Variable to store measured radiation
float radiationcpm;
float radiationusv;

// Define private key to encrypt message  
char node_ID[] = "Node_01";

// define the destination address to send packets
uint8_t rx_address = 3;

// status variable
int8_t e;

void setup()
{  
  // open USB port
  USB.ON();

  // setup the GPS module
  USB.println("GPS_02 example");
  
  // Init SD
  SD.ON();

  // Turn GPS on
  GPS.ON(); 
  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("----------------------"));
  }
      USB.print("Save Ephemeris (ok=1; error=0):");
    USB.println(GPS.saveEphems(),DEC);
}


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);
  }

}
Regards

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

Re: GPS + Radiation board does not work together

Post by BranoV » Fri Jul 14, 2017 1:22 pm

Dear all,
here I am sending the output:

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;

// Variable to store measured radiation
float radiationcpm;
float radiationusv;

// Define private key to encrypt message  
char node_ID[] = "Node_01";

// define the destination address to send packets
uint8_t rx_address = 3;

// status variable
int8_t e;

void setup()
{  
  // open USB port
  USB.ON();

  // setup the GPS module
  USB.println("GPS_02 example");
  
  // Init SD
  SD.ON();

  // Turn GPS on
  GPS.ON(); 
  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("----------------------"));
  }
      USB.print("Save Ephemeris (ok=1; error=0):");
    USB.println(GPS.saveEphems(),DEC);
}


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 » Mon Jul 17, 2017 11:40 am

Hi,

You copied the code instead of the output.

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 17, 2017 4:26 pm

I am very sorry:

Code: Select all

E#
GPS_02 example

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




1

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




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

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




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

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




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

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




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

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




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

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




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

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




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

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




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

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




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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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





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

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




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 Jul 17, 2017 4:39 pm

Hi,

It seems that now it works, right?

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 17, 2017 5:08 pm

Hi yes, I am going to test if I can use LORA without turning it off with radiation board and gps. I ll let you know.

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 Jul 18, 2017 10:26 am

Glad to hear it works! :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest