Page 1 of 1

Gill GMX550 Rain Gauge

Posted: Thu Nov 14, 2019 7:03 pm
by jot4p
Hi,

I have 1 P&S Agriculture Extreme and 1 Maximet 550 weather station.

How I can adjust the value of mm/tip of the rain gauge ? It's possible to send 1 command to adjut for 0.001 ?

Best Regards.

Re: Gill GMX550 Rain Gauge

Posted: Tue Nov 19, 2019 10:04 am
by libelium-dev
Hi,

Apologies for the delay answering, we had misplaced your message.

Yes, it's possible to configure the mm/tip. We have just tried to configure it to another Maximet model and the following code has worked. Please try it and let us know if it works. Set the debug mode to 2 before uploading the code to check if the commands are sent properly.

Code: Select all

/*
    ----------- [Ag_xtr_23] - Send commands to weather station --------------------

    Explanation: Basic example that turns on and send commands to weather
    station. Please set DEBUG_XTR to 2 in order to print the answers
    by the serial monitor. This example permits to set Time and Date in Maximet
    RTC very easily via USB port. There is an interface which asks the user
    to introduce the Date and Time as specified without any need to change
    this code.

    Copyright (C) 2018 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:           3.1
    Design:            David Gascón
    Implementation:    J.Siscart, V.Boria
*/

#include <WaspSensorXtr.h>

/*
  SELECT THE RIGHT SOCKET FOR EACH SENSOR.

  Possible sockets for this sensor are:
  - XTR_SOCKET_E           _________
                          |---------|
                          | A  B  C |
                          |_D__E__F_|


  Example: a 5TM sensor on socket A will be
  [Sensor Class] [Sensor Name] [Selected socket]
  Decagon_5TM    mySensor      (XTR_SOCKET_A);

  Refer to the technical guide for information about possible combinations.
  www.libelium.com/downloads/documentation/smart_agriculture_xtreme_sensor_board.pdf
*/

int year;
int month;
int day;
int hour;
int minute;
int second;

// buffer to set the date and time
char buffer[100];
char input[100];

//   [Sensor Class] [Sensor Name]
weatherStation mySensor;

uint8_t response = 0;

void setup()
{
  USB.println(F("Weather station example for setting date and time"));
  USB.println(F("***********"));
  USB.println(F("Note: Please enable DEBUG_XTR to 2 in WaspSensorXtr.h to see the Maximet answers"));
  USB.println(F("***********"));
 
  //  Turn ON the sensor
  mySensor.ON();
    
  mySensor.sendCommand("RGTIPSIZE 0.001");
  delay(5000);

}

void loop()
{
 
  mySensor.sendCommand("RGTIPSIZE");
  delay(5000);
 
}




/*********************************
*
* get numBytes from USB port
*
**********************************/
boolean getData(int numBytes)
{
  memset(input, 0x00, sizeof(input) );
  int i=0;
  USB.flush();
  int nRead=0;
 
  while(!USB.available());
 
  while(USB.available()>0)
  {
    input[i]=USB.read();
   
    if( (input[i]=='\r') && (input[i]=='\n') )
    {
      input[i]='\0';
    }
    else
    {
      i++;
    }
  }
 
  nRead=i;
 
  if(nRead != numBytes)
  {
    USB.print(F("must write "));
    USB.print(numBytes, DEC);
    USB.print(F(" characters. Read "));    
    USB.print(nRead, DEC);
    USB.println(F(" bytes"));
    return false;
  }
  else
  {
    input[i]='\0';
    return true;
  }
 
}

Regards