readPluviometerCurrent() question / too small rainfall values

Post Reply
Nishant
Posts: 10
Joined: Mon Sep 10, 2018 2:02 am
Company: UC

readPluviometerCurrent() question / too small rainfall values

Post by Nishant » Tue Sep 24, 2019 8:06 am

The Pluviometer readings are inaccurate,the current hour readings indicate 500mm/hr, last day and last hour readings show 0 mm/hr. The temp,pressure & humidity readings are zero as well. I have uploaded the code, please let me know if there's any bug in the code.

The output recorded in excel sheet is as follows

Wind Speed km/hr Rain: Current Hour mm/h Rain: Previous Hour mm/h Rain: Last Day mm/day Wind Vane Solar Radiation um/m-2/s-1 Humidity % Pressure kPa Battery % Upload Timestamp (UTC) Upload Time (Local)
6.4 500 0 0 SW 0 -20 0 0 95 1569044720 21/09/2019 15:45
8 500 0 0 SW 0 -20 0 0 95 1569044749 21/09/2019 15:45
14.4 500 0 0 S 0 -20 0 0 95 1569044778 21/09/2019 15:46
14.4 500 0 0 S 0 -20 0 0 95 1569044808 21/09/2019 15:46
9.6 500 0 0 SW 0 -20 0 0 95 1569044837 21/09/2019 15:47
6.4 500 0 0 SW 0 -20 0 0 95 1569044866 21/09/2019 15:47
13.6 500 0 0 SW 0 -20 0 0 95 1569044895 21/09/2019 15:48
12 500 0 0 SW 0 -20 0 0 95 1569044924 21/09/2019 15:48
8.8 500 0 0 SW 0 -20 0 0 95 1569044953 21/09/2019 15:49
10.4 500 0 0 SW 0 -20 0 0 95 1569044982 21/09/2019 15:49
12 500 0 0 SSE 0 -20 0 0 95 1569045011 21/09/2019 15:50
14.4 500 0 0 S 0 -20 0 0 95 1569045039 21/09/2019 15:50
5.6 500 0 0 S 0 -20 0 0 95 1569045069 21/09/2019 15:51
5.6 500 0 0 SW 0 -20 0 0 95 1569045097 21/09/2019 15:51
5.6 500 0 0 SW 0 -20 0 0 95 1569045126 21/09/2019 15:52
4 500 0 0 W 0 -20 0 0 95 1569045154 21/09/2019 15:52
7.2 500 0 0 SSW 0 -20 0 0 95 1569045183 21/09/2019 15:53
5.6 500 0 0 SW 0 -20 0 0 95 1569045212 21/09/2019 15:53
15.2 500 0 0 S 0 -20 0 0 95 1569045241 21/09/2019 15:54
3.2 500 0 0 SW 0 -20 0 0 95 1569045270 21/09/2019 15:54
5.6 500 0 0 SW 0 -20 0 0 95 1569045299 21/09/2019 15:54
8.8 500 0 0 W 0 -20 0 0 95 1569045328 21/09/2019 15:55
6.4 500 0 0 SW 0 -20 0 0 95 1569045357 21/09/2019 15:55
20 500 0 0 S 0 -20 0 0 95 1569045386 21/09/2019 15:56

Code: Select all

/*
    --- 4G_11 - TCP client  ---

    Explanation: This example shows how to open a TCP client socket
    to the specified server address and port. Besides, the functions
    for sending/receiving data are used.

    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.2
    Design:            David Gascón
    Implementation:    Alejandro Gállego
*/

#include <WaspSensorAgr_v30.h>
#include <Wasp4G.h>
#include <WaspFrame.h>

//SETTING UP SMART AGRI SENSORS

// Variable to store the anemometer vane[10]
float anemometer;

// Variable to store the pluviometer vane[10]
float pluviometer1; //mm in current hour 
float pluviometer2; //mm in previous hour
float pluviometer3; //mm in last 24 hours


// variable to store the number of pending pulses
int pendingPulses;

weatherStationClass weather;

// Instance object
radiationClass radSensor;
// Variable to store the radiation conversion value
float radiation,value;

float temp,humd,pres;







// Setting 4g
// APN settings
///////////////////////////////////////
char apn[] = "yesinternet";
//char apn[} = "telstra.internet"
char login[] = "";
char password[] = "";
///////////////////////////////////////

// SERVER settings
///////////////////////////////////////
char host[] = "api.cbrdata.com";
uint16_t remote_port = 80;
///////////////////////////////////////

// define Socket ID (from 'CONNECTION_1' to 'CONNECTION_6')
///////////////////////////////////////
uint8_t connId = Wasp4G::CONNECTION_1;
///////////////////////////////////////

// define data to send through TCP socket
///////////////////////////////////////
char http_format[] =
  "GET /api/v2/nodeupload?frame=%s&accesskey=8a5728cacf16d004b9e2c078 HTTP/1.1\r\n"\
  "Host: api.cbrdata.com\r\n"\
  "Content-Length: 0\r\n\r\n";
///////////////////////////////////////

// define variables
uint8_t  error;
uint32_t previous;
uint8_t  socketIndex;
char data[500];







void setup()
{
  USB.ON();
  USB.println(F("Start program"));
  //////////////////////////////////////////////////
  // 1. sets operator parameters
  //////////////////////////////////////////////////
  _4G.set_APN(apn, login, password);

  
}



void loop()
{

      /////////////////////////////////////////////
  // 1. Enter sleep mode
  /////////////////////////////////////////////
  Agriculture.sleepAgr("00:00:00:10", RTC_ABSOLUTE, RTC_ALM1_MODE5, SENSOR_ON, SENS_AGR_PLUVIOMETER);

  
  // Turn on the sensor board
  Agriculture.ON();

    /////////////////////////////////////////////
  // 2.1. check pluviometer interruption
  /////////////////////////////////////////////
  if( intFlag & PLV_INT)
  {
    USB.println(F("+++ PLV interruption +++"));

    pendingPulses = intArray[PLV_POS];

    USB.print(F("Number of pending pulses:"));
    USB.println( pendingPulses );

    for(int i=0 ; i<pendingPulses; i++)
    {
      // Enter pulse information inside class structure
      weather.storePulse();

      // decrease number of pulses
      intArray[PLV_POS]--;
    }
    // Clear flag
    intFlag &= ~(PLV_INT); 
  }
  
  /////////////////////////////////////////////
  // 2.2. check RTC interruption
  /////////////////////////////////////////////
  if(intFlag & RTC_INT)
  {
    USB.println(F("+++ RTC interruption +++"));
    
    // switch on sensor board
    Agriculture.ON();
    
    RTC.ON();
    USB.print(F("Time:"));
    USB.println(RTC.getTime());    
        
    // measure sensors
    measureSensors();
    
    // Clear flag
    intFlag &= ~(RTC_INT); 
  } 

    ////////////////////////////////////////////////
  // 4. Sleep
  ////////////////////////////////////////////////
  USB.println(F("4. Enter deep sleep..."));
  PWR.deepSleep("00:00:00:10", RTC_OFFSET, RTC_ALM1_MODE1, ALL_OFF);

  USB.ON();
  USB.println(F("5. Wake up!!\n\n"));
  
}


/*******************************************************************
 *
 *  measureSensors
 *
 *  This function reads from the sensors of the Weather Station  and other sensors and 
 *  then creates a new Waspmote Frame with the sensor fields in order 
 *  to prepare this information to be sent
 *
 *******************************************************************/
void measureSensors()
{  

  USB.println(F("------------- Measurement process ------------------"));
  
  /////////////////////////////////////////////////////
  // 1. Reading sensors
  ///////////////////////////////////////////////////// 

    // Part 1: Read the ultraviolet radiation sensor
  value = radSensor.readRadiation();
  // Conversion from voltage into umol·m-2·s-1
  radiation = value / 0.0002;  
  
  // Part 2: USB printing
  // Print the radiation value through the USB
  USB.print(F("Radiation: "));
  USB.print(radiation);


    ///////////////////////////////////////
  // 1. Read BME280: temp, hum, pressure
  /////////////////////////////////////// 
  
  temp = Agriculture.getTemperature();
  humd  = Agriculture.getHumidity();
  pres = Agriculture.getPressure();  

    // And print the values via USB
  USB.println(F("***************************************"));
  USB.print(F("Temperature: "));
  USB.printFloat(temp, 2);
  USB.println(F(" Celsius degrees"));
  USB.print(F("RH: "));
  USB.printFloat(humd, 2);
  USB.println(F(" %"));
  USB.print(F("Pressure: "));
  USB.printFloat(pres, 2);
  USB.println(F(" Pa"));

  // Read the anemometer sensor 
  anemometer = weather.readAnemometer();
  
  // Read the pluviometer sensor 
  pluviometer1 = weather.readPluviometerCurrent();
  pluviometer2 = weather.readPluviometerHour();
  pluviometer3 = weather.readPluviometerDay();

  
  
  /////////////////////////////////////////////////////
  // 2. USB: Print the weather vane[10]s through the USB
  /////////////////////////////////////////////////////
  
  // Print the accumulated rainfall
  USB.print(F("Current hour accumulated rainfall (mm/h): "));
  USB.println( pluviometer1 );

  // Print the accumulated rainfall
  USB.print(F("Previous hour accumulated rainfall (mm/h): "));
  USB.println( pluviometer2 );

  // Print the accumulated rainfall
  USB.print(F("Last 24h accumulated rainfall (mm/day): "));
  USB.println( pluviometer3 );
  
  // Print the anemometer vane[10]
  USB.print(F("Anemometer: "));
  USB.print(anemometer);
  USB.println(F("km/h"));
    
  // Print the vane value
  char vane_str[10] = {0};
  switch(weather.readVaneDirection())
  {
  case  SENS_AGR_VANE_N   :  snprintf( vane_str, sizeof(vane_str), "N" );
                             break;
  case  SENS_AGR_VANE_NNE :  snprintf( vane_str, sizeof(vane_str), "NNE" );
                             break;  
  case  SENS_AGR_VANE_NE  :  snprintf( vane_str, sizeof(vane_str), "NE" );
                             break;    
  case  SENS_AGR_VANE_ENE :  snprintf( vane_str, sizeof(vane_str), "ENE" );
                             break;      
  case  SENS_AGR_VANE_E   :  snprintf( vane_str, sizeof(vane_str), "E" );
                             break;    
  case  SENS_AGR_VANE_ESE :  snprintf( vane_str, sizeof(vane_str), "ESE" );
                             break;  
  case  SENS_AGR_VANE_SE  :  snprintf( vane_str, sizeof(vane_str), "SE" );
                             break;    
  case  SENS_AGR_VANE_SSE :  snprintf( vane_str, sizeof(vane_str), "SSE" );
                             break;   
  case  SENS_AGR_VANE_S   :  snprintf( vane_str, sizeof(vane_str), "S" );
                             break; 
  case  SENS_AGR_VANE_SSW :  snprintf( vane_str, sizeof(vane_str), "SSW" );
                             break; 
  case  SENS_AGR_VANE_SW  :  snprintf( vane_str, sizeof(vane_str), "SW" );
                             break;  
  case  SENS_AGR_VANE_WSW :  snprintf( vane_str, sizeof(vane_str), "WSW" );
                             break; 
  case  SENS_AGR_VANE_W   :  snprintf( vane_str, sizeof(vane_str), "W" );
                             break;   
  case  SENS_AGR_VANE_WNW :  snprintf( vane_str, sizeof(vane_str), "WNW" );
                             break; 
  case  SENS_AGR_VANE_NW  :  snprintf( vane_str, sizeof(vane_str), "WN" );
                             break;
  case  SENS_AGR_VANE_NNW :  snprintf( vane_str, sizeof(vane_str), "NNW" );
                             break;  
  default                 :  snprintf( vane_str, sizeof(vane_str), "error" );
                             break;    
  }

  USB.println( vane_str );
  USB.println(F("----------------------------------------------------\n"));


  //////////////////////////////////////////////////
  // 1. Switch 4G ON
  //////////////////////////////////////////////////
  error = _4G.ON();

  if (error == 0)
  {
    USB.println(F("1. 4G module ready..."));


    ////////////////////////////////////////////////
    // 2. TCP socket
    ////////////////////////////////////////////////

    error = _4G.openSocketClient(connId, Wasp4G::TCP, host, remote_port);

    if (error == 0)
    {
      USB.println(F("2.1. Opening a socket... done!"));
      //////////////////////////////////////////////
      // 2.2. Create a frame and data to send via HTTP request
      //////////////////////////////////////////////

      RTC.ON();
      RTC.getTime();
     
      // set identifier
      frame.setID("sa_001");
      // Create new frame (ASCII)
      frame.createFrame(ASCII);
      // set frame fields (Time from RTC)
      frame.addSensor(SENSOR_AGR_ANE, anemometer);
      frame.addSensor(SENSOR_AGR_PLV1, pluviometer1);
      frame.addSensor(SENSOR_AGR_PLV2, pluviometer2);
      frame.addSensor(SENSOR_AGR_PLV3, pluviometer3);
      frame.addSensor(SENSOR_AGR_WV, vane_str);
      frame.addSensor(SENSOR_AGR_PAR, radiation);
      frame.addSensor(SENSOR_AGR_TC, temp);
      frame.addSensor(SENSOR_AGR_HUM, humd);
      frame.addSensor(SENSOR_AGR_PRES, pres);

      // show frame contents
      frame.showFrame();

      // define aux buffer
      char frame_string[frame.length*2 + 1];
      memset(frame_string, 0x00, sizeof(frame_string));

      // convert frame from bytes to ASCII representation
      Utils.hex2str((uint8_t*)frame.buffer, (char*)frame_string, frame.length);

      snprintf( data, sizeof(data), http_format, frame_string);
      USB.print(F("data to send:"));
      USB.println(data);


      //////////////////////////////////////////////
      // 2.3. Send it through the connection
      //////////////////////////////////////////////

      // send TCP packet
      error = _4G.send(connId, data);
      if (error == 0)
      {
        USB.println(F("2.3. Sending a frame... done!"));
      }
      else
      {
        USB.print(F("2.3. Error sending a frame. Code: "));
        USB.println(error, DEC);
      }


      //////////////////////////////////////////////
      // 2.4. Receive data
      //////////////////////////////////////////////

      // Wait for incoming data from the socket (if the other side responds)
      USB.print(F("2.4. Waiting to receive data..."));

      error = _4G.receive(connId, 60000);

      if (error == 0)
      {
        if (_4G.socketInfo[connId].size > 0)
        {
          USB.println(F("\n-----------------------------------"));
          USB.print(F("Data received:"));
          USB.println(_4G._buffer, _4G._length);
          USB.println(F("-----------------------------------"));
        }
        else
        {
          USB.println(F("NO data received"));
        }
      }
      else
      {
        USB.println(F("No data received."));
        USB.println(error, DEC);
      }
    }
    else
    {
      USB.print(F("2.1. Error opening socket. Error code: "));
      USB.println(error, DEC);
    }

    //////////////////////////////////////////////
    // 2.5. Close socket
    //////////////////////////////////////////////
    error = _4G.closeSocketClient(connId);

    if (error == 0)
    {
      USB.println(F("2.5. Socket closed OK"));
    }
    else
    {
      USB.print(F("2.5. Error closing socket. Error code: "));
      USB.println(error, DEC);
    }
  }
  else
  {
    // Problem with the communication with the 4G module
    USB.println(F("1. 4G module not started"));
  }

  ////////////////////////////////////////////////
  // 3. Powers off the 4G module
  ////////////////////////////////////////////////
  USB.println(F("3. Switch OFF 4G module"));
  _4G.OFF();
  
}




Nishant
Posts: 10
Joined: Mon Sep 10, 2018 2:02 am
Company: UC

Re: readPluviometerCurrent() question / too small rainfall values

Post by Nishant » Tue Sep 24, 2019 8:13 am

Nishant wrote:
Tue Sep 24, 2019 8:06 am
The Pluviometer readings are inaccurate,the current hour readings indicate 500mm/hr, last day and last hour readings show 0 mm/hr. The temp is -20,pressure & humidity readings are zero as well. I have uploaded the code, please let me know if there's any bug in the code.

The output recorded in excel sheet is as follows

Code: Select all

Wind Speed km/hr	Rain: Current Hour mm/h	Rain: Previous Hour mm/h	Rain: Last Day mm/day	Wind Vane	Solar Radiation um/m-2/s-1	Temp C	Humidity %	Pressure kPa	Battery %	Upload Timestamp (UTC)	Upload Time (Local)
6.4	500	0	0	SW	0	-20	0	0	95	1569044720	21/09/2019 15:45
8	500	0	0	SW	0	-20	0	0	95	1569044749	21/09/2019 15:45
14.4	500	0	0	S	0	-20	0	0	95	1569044778	21/09/2019 15:46
14.4	500	0	0	S	0	-20	0	0	95	1569044808	21/09/2019 15:46
9.6	500	0	0	SW	0	-20	0	0	95	1569044837	21/09/2019 15:47
6.4	500	0	0	SW	0	-20	0	0	95	1569044866	21/09/2019 15:47
13.6	500	0	0	SW	0	-20	0	0	95	1569044895	21/09/2019 15:48
12	500	0	0	SW	0	-20	0	0	95	1569044924	21/09/2019 15:48
8.8	500	0	0	SW	0	-20	0	0	95	1569044953	21/09/2019 15:49
10.4	500	0	0	SW	0	-20	0	0	95	1569044982	21/09/2019 15:49
12	500	0	0	SSE	0	-20	0	0	95	1569045011	21/09/2019 15:50
14.4	500	0	0	S	0	-20	0	0	95	1569045039	21/09/2019 15:50
5.6	500	0	0	S	0	-20	0	0	95	1569045069	21/09/2019 15:51
5.6	500	0	0	SW	0	-20	0	0	95	1569045097	21/09/2019 15:51
5.6	500	0	0	SW	0	-20	0	0	95	1569045126	21/09/2019 15:52
4	500	0	0	W	0	-20	0	0	95	1569045154	21/09/2019 15:52
7.2	500	0	0	SSW	0	-20	0	0	95	1569045183	21/09/2019 15:53
5.6	500	0	0	SW	0	-20	0	0	95	1569045212	21/09/2019 15:53
15.2	500	0	0	S	0	-20	0	0	95	1569045241	21/09/2019 15:54
3.2	500	0	0	SW	0	-20	0	0	95	1569045270	21/09/2019 15:54
5.6	500	0	0	SW	0	-20	0	0	95	1569045299	21/09/2019 15:54
8.8	500	0	0	W	0	-20	0	0	95	1569045328	21/09/2019 15:55
6.4	500	0	0	SW	0	-20	0	0	95	1569045357	21/09/2019 15:55
20	500	0	0	S	0	-20	0	0	95	1569045386	21/09/2019 15:56
12.8	500	0	0	SSW	0	-20	0	0	95	1569045414	21/09/2019 15:56
18.4	500	0	0	S	0	-20	0	0	95	1569045443	21/09/2019 15:57
8.8	500	0	0	S	0	-20	0	0	95	1569045473	21/09/2019 15:57
6.4	500	0	0	SW	0	-20	0	0	95	1569045502	21/09/2019 15:58
5.6	500	0	0	SW	0	-20	0	0	95	1569045531	21/09/2019 15:58
2.4	500	0	0	SW	0	-20	0	0	95	1569045559	21/09/2019 15:59
7.2	500	0	0	SW	0	-20	0	0	95	1569045589	21/09/2019 15:59
5.6	500	0	0	SW	0	-20	0	0	95	1569045618	21/09/2019 16:00
4.8	500	0	0	SW	0	-20	0	0	95	1569045647	21/09/2019 16:00
5.6	500	0	0	SW	0	-20	0	0	95	1569045676	21/09/2019 16:01
9.6	500	0	0	SW	0	-20	0	0	95	1569045704	21/09/2019 16:01
6.4	500	0	0	W	0	-20	0	0	95	1569045734	21/09/2019 16:02
11.2	500	0	0	SW	0	-20	0	0	95	1569045762	21/09/2019 16:02
4	500	0	0	SW	0	-20	0	0	95	1569045791	21/09/2019 16:03
9.6	500	0	0	S	0	-20	0	0	95	1569045820	21/09/2019 16:03
4.8	500	0	0	SW	0	-20	0	0	95	1569045850	21/09/2019 16:04
9.6	500	0	0	SW	0	-20	0	0	95	1569045878	21/09/2019 16:04
10.4	500	0	0	SW	0	-20	0	0	95	1569045907	21/09/2019 16:05
8.8	500	0	0	SW	0	-20	0	0	95	1569045936	21/09/2019 16:05
8.8	500	0	0	SE	0	-20	0	0	95	1569045965	21/09/2019 16:06
5.6	500	0	0	SW	0	-20	0	0	95	1569045994	21/09/2019 16:06
8	500	0	0	SSW	0	-20	0	0	95	1569046023	21/09/2019 16:07
5.6	500	0	0	SSW	0	-20	0	0	95	1569046053	21/09/2019 16:07
8.8	500	0	0	S	0	-20	0	0	95	1569046081	21/09/2019 16:08
8.8	500	0	0	S	0	-20	0	0	95	1569046111	21/09/2019 16:08
13.6	500	0	0	SW	0	-20	0	0	95	1569046140	21/09/2019 16:09
8	500	0	0	S	0	-20	0	0	95	1569046169	21/09/2019 16:09
4.8	500	0	0	E	0	-20	0	0	95	1569046198	21/09/2019 16:09
7.2	500	0	0	S	0	-20	0	0	95	1569046226	21/09/2019 16:10
8	500	0	0	SW	0	-20	0	0	95	1569046255	21/09/2019 16:10
4	500	0	0	S	0	-20	0	0	95	1569046284	21/09/2019 16:11
7.2	500	0	0	SW	0	-20	0	0	95	1569046313	21/09/2019 16:11
4	500	0	0	S	0	-20	0	0	95	1569046342	21/09/2019 16:12
7.2	500	0	0	SW	0	-20	0	0	95	1569046371	21/09/2019 16:12
6.4	500	0	0	S	0	-20	0	0	95	1569046400	21/09/2019 16:13
6.4	500	0	0	SW	0	-20	0	0	95	1569046430	21/09/2019 16:13
7.2	500	0	0	SW	0	-20	0	0	95	1569046459	21/09/2019 16:14
5.6	500	0	0	S	0	-20	0	0	95	1569046487	21/09/2019 16:14
3.2	500	0	0	S	0	-20	0	0	95	1569046516	21/09/2019 16:15
7.2	500	0	0	S	0	-20	0	0	95	1569046545	21/09/2019 16:15
8.8	500	0	0	SW	0	-20	0	0	95	1569046575	21/09/2019 16:16
5.6	500	0	0	SW	0	-20	0	0	95	1569046649	21/09/2019 16:17
4.8	500	0	0	SW	0	-20	0	0	95	1569046678	21/09/2019 16:17
6.4	500	0	0	S	0	-20	0	0	95	1569046707	21/09/2019 16:18
3.2	500	0	0	SW	0	-20	0	0	95	1569046736	21/09/2019 16:18
7.2	500	0	0	SW	0	-20	0	0	95	1569046765	21/09/2019 16:19
9.6	500	0	0	S	0	-20	0	0	95	1569046794	21/09/2019 16:19
12.8	500	0	0	SW	0	-20	0	0	95	1569046823	21/09/2019 16:20
7.2	500	0	0	SW	0	-20	0	0	95	1569046851	21/09/2019 16:20
7.2	500	0	0	W	0	-20	0	0	95	1569046880	21/09/2019 16:21
7.2	500	0	0	SW	0	-20	0	0	95	1569046909	21/09/2019 16:21
8	500	0	0	S	0	-20	0	0	95	1569046938	21/09/2019 16:22
6.4	500	0	0	SW	0	-20	0	0	95	1569046967	21/09/2019 16:22
3.2	500	0	0	NW	0	-20	0	0	95	1569046997	21/09/2019 16:23
4	500	0	0	SE	0	-20	0	0	95	1569047025	21/09/2019 16:23
10.4	500	0	0	S	0	-20	0	0	95	1569047055	21/09/2019 16:24
8	500	0	0	SW	0	-20	0	0	95	1569047084	21/09/2019 16:24
6.4	500	0	0	S	0	-20	0	0	95	1569047113	21/09/2019 16:25
4	500	0	0	W	0	-20	0	0	95	1569047142	21/09/2019 16:25
19.2	500	0	0	S	0	-20	0	0	95	1569047170	21/09/2019 16:26
16	500	0	0	SW	0	-20	0	0	95	1569047199	21/09/2019 16:26
17.6	500	0	0	S	0	-20	0	0	95	1569047228	21/09/2019 16:27
11.2	500	0	0	SW	0	-20	0	0	95	1569047256	21/09/2019 16:27
15.2	500	0	0	SW	0	-20	0	0	95	1569047285	21/09/2019 16:28
12	500	0	0	SW	0	-20	0	0	95	1569047314	21/09/2019 16:28
12.8	500	0	0	SW	0	-20	0	0	95	1569047343	21/09/2019 16:29
15.2	500	0	0	SW	0	-20	0	0	95	1569047372	21/09/2019 16:29
10.4	500	0	0	S	0	-20	0	0	95	1569047401	21/09/2019 16:30
16.8	500	0	0	SW	0	-20	0	0	95	1569047431	21/09/2019 16:30
11.2	500	0	0	SW	0	-20	0	0	95	1569047459	21/09/2019 16:30
7.2	500	0	0	S	0	-20	0	0	95	1569047489	21/09/2019 16:31
5.6	500	0	0	SW	0	-20	0	0	95	1569047517	21/09/2019 16:31
4.8	500	0	0	S	0	-20	0	0	95	1569047546	21/09/2019 16:32
6.4	500	0	0	S	0	-20	0	0	95	1569047575	21/09/2019 16:32
4.8	500	0	0	S	0	-20	0	0	95	1569047604	21/09/2019 16:33
3.2	500	0	0	SW	0	-20	0	0	95	1569047633	21/09/2019 16:33
4.8	500	0	0	SW	0	-20	0	0	95	1569047662	21/09/2019 16:34
4.8	500	0	0	SW	0	-20	0	0	95	1569047691	21/09/2019 16:34
7.2	500	0	0	SW	0	-20	0	0	95	1569047720	21/09/2019 16:35
7.2	500	0	0	SW	0	-20	0	0	95	1569047748	21/09/2019 16:35
4.8	500	0	0	NE	0	-20	0	0	95	1569047778	21/09/2019 16:36
12.8	500	0	0	SW	0	-20	0	0	95	1569047806	21/09/2019 16:36
5.6	500	0	0	S	0	-20	0	0	95	1569047835	21/09/2019 16:37
7.2	500	0	0	S	0	-20	0	0	95	1569047864	21/09/2019 16:37
7.2	500	0	0	SW	0	-20	0	0	95	1569047892	21/09/2019 16:38
8.8	500	0	0	SW	0	-20	0	0	95	1569047921	21/09/2019 16:38
7.2	500	0	0	SW	0	-20	0	0	95	1569047950	21/09/2019 16:39
12	500	0	0	SW	0	-20	0	0	95	1569047979	21/09/2019 16:39
10.4	500	0	0	S	0	-20	0	0	95	1569048008	21/09/2019 16:40
12.8	500	0	0	SW	0	-20	0	0	95	1569048037	21/09/2019 16:40
10.4	500	0	0	SW	0	-20	0	0	95	1569048066	21/09/2019 16:41
8.8	500	0	0	SW	0	-20	0	0	95	1569048095	21/09/2019 16:41
12.8	500	0	0	W	0	-20	0	0	95	1569048124	21/09/2019 16:42
15.2	500	0	0	SW	0	-20	0	0	95	1569048153	21/09/2019 16:42
13.6	500	0	0	S	0	-20	0	0	95	1569048181	21/09/2019 16:43
15.2	500	0	0	SW	0	-20	0	0	95	1569048211	21/09/2019 16:43
17.6	500	0	0	S	0	-20	0	0	95	1569048240	21/09/2019 16:44
18.4	500	0	0	S	0	-20	0	0	95	1569048269	21/09/2019 16:44
12.8	500	0	0	SW	0	-20	0	0	95	1569048298	21/09/2019 16:44
7.2	500	0	0	SW	0	-20	0	0	95	1569048328	21/09/2019 16:45
4.8	500	0	0	S	0	-20	0	0	95	1569048356	21/09/2019 16:45
18.4	500	0	0	SW	0	-20	0	0	95	1569048386	21/09/2019 16:46
10.4	500	0	0	S	0	-20	0	0	95	1569048414	21/09/2019 16:46
8	500	0	0	E	0	-20	0	0	95	1569048444	21/09/2019 16:47
7.2	500	0	0	SW	0	-20	0	0	95	1569048473	21/09/2019 16:47
9.6	500	0	0	W	0	-20	0	0	95	1569048502	21/09/2019 16:48
12	500	0	0	SW	0	-20	0	0	95	1569048531	21/09/2019 16:48
7.2	500	0	0	SW	0	-20	0	0	95	1569048559	21/09/2019 16:49
2.4	500	0	0	S	0	-20	0	0	95	1569048588	21/09/2019 16:49
10.4	500	0	0	S	0	-20	0	0	95	1569048617	21/09/2019 16:50
4.8	500	0	0	SW	0	-20	0	0	95	1569048645	21/09/2019 16:50
4.8	500	0	0	SW	0	-20	0	0	95	1569048675	21/09/2019 16:51
4.8	500	0	0	S	0	-20	0	0	95	1569048704	21/09/2019 16:51
4	500	0	0	S	0	-20	0	0	95	1569048733	21/09/2019 16:52
6.4	500	0	0	SW	0	-20	0	0	95	1569048762	21/09/2019 16:52
13.6	500	0	0	SW	0	-20	0	0	95	1569048791	21/09/2019 16:53
4	500	0	0	SW	0	-20	0	0	95	1569048820	21/09/2019 16:53
7.2	500	0	0	S	0	-20	0	0	95	1569048849	21/09/2019 16:54
6.4	500	0	0	SW	0	-20	0	0	95	1569048878	21/09/2019 16:54
5.6	500	0	0	SSW	0	-20	0	0	95	1569048908	21/09/2019 16:55
4.8	500	0	0	SW	0	-20	0	0	95	1569048937	21/09/2019 16:55
4.8	500	0	0	S	0	-20	0	0	95	1569048966	21/09/2019 16:56
8	500	0	0	SW	0	-20	0	0	95	1569048995	21/09/2019 16:56
10.4	500	0	0	SW	0	-20	0	0	95	1569049024	21/09/2019 16:57
12	500	0	0	SW	0	-20	0	0	95	1569049053	21/09/2019 16:57
4	500	0	0	S	0	-20	0	0	95	1569049082	21/09/2019 16:58
13.6	500	0	0	SW	0	-20	0	0	95	1569049111	21/09/2019 16:58
7.2	500	0	0	SW	0	-20	0	0	95	1569049140	21/09/2019 16:59
16	500	0	0	S	0	-20	0	0	95	1569049169	21/09/2019 16:59
12.8	500	0	0	S	0	-20	0	0	95	1569049198	21/09/2019 16:59
17.6	500	0	0	SE	0	-20	0	0	95	1569049226	21/09/2019 17:00
14.4	500	0	0	W	0	-20	0	0	95	1569049255	21/09/2019 17:00
12	500	0	0	SW	0	-20	0	0	95	1569049284	21/09/2019 17:01
8	500	0	0	SW	0	-20	0	0	95	1569049313	21/09/2019 17:01
5.6	500	0	0	SW	0	-20	0	0	95	1569049342	21/09/2019 17:02
8.8	500	0	0	SW	0	-20	0	0	95	1569049370	21/09/2019 17:02
6.4	500	0	0	S	0	-20	0	0	95	1569049400	21/09/2019 17:03
4.8	500	0	0	S	0	-20	0	0	95	1569049429	21/09/2019 17:03
10.4	500	0	0	SW	0	-20	0	0	95	1569049458	21/09/2019 17:04
15.2	500	0	0	SW	0	-20	0	0	95	1569049487	21/09/2019 17:04
8	500	0	0	SW	0	-20	0	0	95	1569049516	21/09/2019 17:05
7.2	500	0	0	SW	0	-20	0	0	95	1569049545	21/09/2019 17:05
4.8	500	0	0	SW	0	-20	0	0	95	1569049574	21/09/2019 17:06
7.2	500	0	0	S	0	-20	0	0	95	1569049603	21/09/2019 17:06
4.8	500	0	0	SW	0	-20	0	0	95	1569049632	21/09/2019 17:07
11.2	500	0	0	SW	0	-20	0	0	95	1569049661	21/09/2019 17:07
11.2	500	0	0	S	0	-20	0	0	95	1569049690	21/09/2019 17:08
11.2	500	0	0	SW	0	-20	0	0	95	1569049719	21/09/2019 17:08
8.8	500	0	0	SW	0	-20	0	0	95	1569049748	21/09/2019 17:09
10.4	500	0	0	SW	0	-20	0	0	95	1569049776	21/09/2019 17:09
8	500	0	0	SW	0	-20	0	0	95	1569049806	21/09/2019 17:10
7.2	500	0	0	SSW	0	-20	0	0	95	1569049835	21/09/2019 17:10
13.6	500	0	0	W	0	-20	0	0	95	1569049864	21/09/2019 17:11
8.8	500	0	0	S	0	-20	0	0	95	1569049894	21/09/2019 17:11
11.2	500	0	0	S	0	-20	0	0	95	1569049923	21/09/2019 17:12
13.6	500	0	0	SW	0	-20	0	0	95	1569049952	21/09/2019 17:12
8.8	500	0	0	SW	0	-20	0	0	95	1569049981	21/09/2019 17:13
8	500	0	0	S	0	-20	0	0	95	1569050010	21/09/2019 17:13
12	500	0	0	S	0	-20	0	0	95	1569050039	21/09/2019 17:13
5.6	500	0	0	WSW	0	-20	0	0	95	1569050069	21/09/2019 17:14
4	500	0	0	SW	0	-20	0	0	95	1569050098	21/09/2019 17:14
8	500	0	0	SW	0	-20	0	0	95	1569050126	21/09/2019 17:15
10.4	500	0	0	SW	0	-20	0	0	95	1569050156	21/09/2019 17:15
8.8	500	0	0	S	0	-20	0	0	95	1569050184	21/09/2019 17:16
12	500	0	0	SW	0	-20	0	0	95	1569050214	21/09/2019 17:16
11.2	500	0	0	SW	0	-20	0	0	95	1569050242	21/09/2019 17:17
10.4	500	0	0	S	0	-20	0	0	95	1569050271	21/09/2019 17:17
8.8	500	0	0	S	0	-20	0	0	95	1569050300	21/09/2019 17:18
10.4	500	0	0	SW	0	-20	0	0	95	1569050330	21/09/2019 17:18
7.2	500	0	0	SW	0	-20	0	0	95	1569050359	21/09/2019 17:19
16.8	500	0	0	S	0	-20	0	0	95	1569050387	21/09/2019 17:19
13.6	500	0	0	SW	0	-20	0	0	95	1569050416	21/09/2019 17:20
16	500	0	0	SW	0	-20	0	0	95	1569050445	21/09/2019 17:20
12	500	0	0	SW	0	-20	0	0	95	1569050473	21/09/2019 17:21
10.4	500	0	0	SW	0	-20	0	0	95	1569050502	21/09/2019 17:21
9.6	500	0	0	SW	0	-20	0	0	95	1569050531	21/09/2019 17:22
10.4	500	0	0	SW	0	-20	0	0	95	1569050560	21/09/2019 17:22
20	500	0	0	SW	0	-20	0	0	95	1569050589	21/09/2019 17:23
21.6	500	0	0	SW	0	-20	0	0	95	1569050617	21/09/2019 17:23
8	500	0	0	SW	0	-20	0	0	95	1569050646	21/09/2019 17:24
12	500	0	0	SW	0	-20	0	0	95	1569050675	21/09/2019 17:24
10.4	500	0	0	SW	0	-20	0	0	95	1569050704	21/09/2019 17:25
8	500	0	0	S	0	-20	0	0	95	1569050733	21/09/2019 17:25
9.6	500	0	0	S	0	-20	0	0	95	1569050763	21/09/2019 17:26
8	500	0	0	SW	0	-20	0	0	95	1569050792	21/09/2019 17:26
13.6	500	0	0	SW	0	-20	0	0	95	1569050820	21/09/2019 17:27
12.8	500	0	0	SW	0	-20	0	0	95	1569050850	21/09/2019 17:27
18.4	500	0	0	SW	0	-20	0	0	95	1569050879	21/09/2019 17:27
16	500	0	0	S	0	-20	0	0	95	1569050908	21/09/2019 17:28
13.6	500	0	0	SW	0	-20	0	0	95	1569050936	21/09/2019 17:28
16	500	0	0	SW	0	-20	0	0	95	1569050965	21/09/2019 17:29
12.8	500	0	0	SSW	0	-20	0	0	95	1569050994	21/09/2019 17:29
12	500	0	0	SW	0	-20	0	0	95	1569051024	21/09/2019 17:30
18.4	500	0	0	S	0	-20	0	0	95	1569051053	21/09/2019 17:30
16	500	0	0	SW	0	-20	0	0	95	1569051081	21/09/2019 17:31
15.2	500	0	0	S	0	-20	0	0	95	1569051111	21/09/2019 17:31
14.4	500	0	0	S	0	-20	0	0	95	1569051139	21/09/2019 17:32
9.6	500	0	0	SW	0	-20	0	0	95	1569051169	21/09/2019 17:32
13.6	500	0	0	SW	0	-20	0	0	95	1569051198	21/09/2019 17:33
9.6	500	0	0	SW	0	-20	0	0	95	1569051226	21/09/2019 17:33
12.8	500	0	0	S	0	-20	0	0	95	1569051256	21/09/2019 17:34
13.6	500	0	0	S	0	-20	0	0	95	1569051285	21/09/2019 17:34
11.2	500	0	0	S	0	-20	0	0	95	1569051314	21/09/2019 17:35
10.4	500	0	0	S	0	-20	0	0	95	1569051343	21/09/2019 17:35
15.2	500	0	0	SW	0	-20	0	0	95	1569051372	21/09/2019 17:36
11.2	500	0	0	SSW	0	-20	0	0	95	1569051401	21/09/2019 17:36
9.6	500	0	0	SW	0	-20	0	0	95	1569051431	21/09/2019 17:37
8.8	500	0	0	SW	0	-20	0	0	95	1569051459	21/09/2019 17:37
10.4	500	0	0	S	0	-20	0	0	95	1569051489	21/09/2019 17:38
19.2	500	0	0	SSW	0	-20	0	0	95	1569051518	21/09/2019 17:38
18.4	500	0	0	W	0	-20	0	0	95	1569051546	21/09/2019 17:39
11.2	500	0	0	SW	0	-20	0	0	95	1569051575	21/09/2019 17:39
8	500	0	0	SW	0	-20	0	0	95	1569051604	21/09/2019 17:40
5.6	500	0	0	SW	0	-20	0	0	95	1569051633	21/09/2019 17:40
5.6	500	0	0	S	0	-20	0	0	95	1569051662	21/09/2019 17:41
12.8	500	0	0	S	0	-20	0	0	95	1569051692	21/09/2019 17:41
8	500	0	0	S	0	-20	0	0	95	1569051721	21/09/2019 17:42
8	500	0	0	S	0	-20	0	0	95	1569051750	21/09/2019 17:42
10.4	500	0	0	S	0	-20	0	0	95	1569051779	21/09/2019 17:42
13.6	500	0	0	S	0	-20	0	0	95	1569051807	21/09/2019 17:43
12	500	0	0	SW	0	-20	0	0	95	1569051836	21/09/2019 17:43
11.2	500	0	0	SSW	0	-20	0	0	95	1569051865	21/09/2019 17:44
14.4	500	0	0	SW	0	-20	0	0	95	1569051894	21/09/2019 17:44
11.2	500	0	0	SW	0	-20	0	0	95	1569051923	21/09/2019 17:45
7.2	500	0	0	SE	0	-20	0	0	95	1569051953	21/09/2019 17:45
8	500	0	0	SW	0	-20	0	0	95	1569051981	21/09/2019 17:46
13.6	500	0	0	S	0	-20	0	0	95	1569052010	21/09/2019 17:46
13.6	500	0	0	SW	0	-20	0	0	95	1569052039	21/09/2019 17:47
12	500	0	0	SSW	0	-20	0	0	95	1569052068	21/09/2019 17:47
12	500	0	0	SE	0	-20	0	0	95	1569052097	21/09/2019 17:48
8	500	0	0	W	0	-20	0	0	95	1569052126	21/09/2019 17:48
8	500	0	0	SW	0	-20	0	0	95	1569052155	21/09/2019 17:49
8.8	500	0	0	SW	0	-20	0	0	95	1569052183	21/09/2019 17:49
8	500	0	0	S	0	-20	0	0	95	1569052212	21/09/2019 17:50
4.8	500	0	0	S	0	-20	0	0	95	1569052241	21/09/2019 17:50
9.6	500	0	0	SSW	0	-20	0	0	95	1569052270	21/09/2019 17:51
14.4	500	0	0	S	0	-20	0	0	95	1569052300	21/09/2019 17:51
10.4	500	0	0	WSW	0	-20	0	0	95	1569052329	21/09/2019 17:52
7.2	500	0	0	SW	0	-20	0	0	95	1569052358	21/09/2019 17:52
15.2	500	0	0	SW	0	-20	0	0	95	1569052387	21/09/2019 17:53
8	500	0	0	SW	0	-20	0	0	95	1569052416	21/09/2019 17:53
6.4	500	0	0	S	0	-20	0	0	95	1569052445	21/09/2019 17:54
8	500	0	0	SSW	0	-20	0	0	95	1569052473	21/09/2019 17:54
5.6	500	0	0	E	0	-20	0	0	95	1569052503	21/09/2019 17:55
7.2	500	0	0	SW	0	-20	0	0	95	1569052531	21/09/2019 17:55
7.2	500	0	0	SSE	0	-20	0	0	95	1569052561	21/09/2019 17:56
8.8	500	0	0	S	0	-20	0	0	95	1569052590	21/09/2019 17:56
15.2	500	0	0	S	0	-20	0	0	95	1569052619	21/09/2019 17:56
9.6	500	0	0	SW	0	-20	0	0	95	1569052648	21/09/2019 17:57
8	500	0	0	S	0	-20	0	0	95	1569052676	21/09/2019 17:57
4	500	0	0	S	0	-20	0	0	95	1569052705	21/09/2019 17:58
9.6	500	0	0	SW	0	-20	0	0	95	1569052734	21/09/2019 17:58
17.6	500	0	0	S	0	-20	0	0	95	1569052763	21/09/2019 17:59
11.2	500	0	0	SW	0	-20	0	0	95	1569052792	21/09/2019 17:59
6.4	500	0	0	SW	0	-20	0	0	95	1569052821	21/09/2019 18:00
8	500	0	0	SSW	0	-20	0	0	95	1569052850	21/09/2019 18:00
10.4	500	0	0	SW	0	-20	0	0	95	1569052879	21/09/2019 18:01
9.6	500	0	0	S	0	-20	0	0	95	1569052908	21/09/2019 18:01
6.4	500	0	0	SW	0	-20	0	0	95	1569052936	21/09/2019 18:02
7.2	500	0	0	SW	0	-20	0	0	95	1569052966	21/09/2019 18:02
19.2	500	0	0	S	0	-20	0	0	95	1569052994	21/09/2019 18:03
15.2	500	0	0	SSW	0	-20	0	0	95	1569053023	21/09/2019 18:03
8.8	500	0	0	S	0	-20	0	0	95	1569053052	21/09/2019 18:04
12.8	500	0	0	SW	0	-20	0	0	95	1569053081	21/09/2019 18:04
10.4	500	0	0	SSW	0	-20	0	0	95	1569053110	21/09/2019 18:05
12.8	500	0	0	SW	0	-20	0	0	95	1569053139	21/09/2019 18:05
12.8	500	0	0	S	0	-20	0	0	95	1569053168	21/09/2019 18:06
17.6	500	0	0	S	0	-20	0	0	95	1569053197	21/09/2019 18:06
12.8	500	0	0	SW	0	-20	0	0	95	1569053226	21/09/2019 18:07
16.8	500	0	0	S	0	-20	0	0	95	1569053255	21/09/2019 18:07
23.2	500	0	0	S	0	-20	0	0	95	1569053284	21/09/2019 18:08
12	500	0	0	SE	0	-20	0	0	95	1569053313	21/09/2019 18:08
17.6	500	0	0	S	0	-20	0	0	95	1569053342	21/09/2019 18:09
6.4	500	0	0	SW	0	-20	0	0	95	1569053371	21/09/2019 18:09
4	500	0	0	SW	0	-20	0	0	95	1569053400	21/09/2019 18:10
8	500	0	0	S	0	-20	0	0	95	1569053429	21/09/2019 18:10
5.6	500	0	0	SW	0	-20	0	0	95	1569053502	21/09/2019 18:11
8	500	0	0	S	0	-20	0	0	95	1569053531	21/09/2019 18:12
11.2	500	0	0	S	0	-20	0	0	95	1569053560	21/09/2019 18:12
9.6	500	0	0	S	0	-20	0	0	95	1569053589	21/09/2019 18:13
5.6	500	0	0	S	0	-20	0	0	95	1569053618	21/09/2019 18:13
8	500	0	0	S	0	-20	0	0	95	1569053647	21/09/2019 18:14
9.6	500	0	0	S	0	-20	0	0	95	1569053676	21/09/2019 18:14
9.6	500	0	0	SW	0	-20	0	0	95	1569053705	21/09/2019 18:15
10.4	500	0	0	SW	0	-20	0	0	95	1569053733	21/09/2019 18:15
12	500	0	0	S	0	-20	0	0	95	1569053763	21/09/2019 18:16
6.4	500	0	0	SW	0	-20	0	0	95	1569053792	21/09/2019 18:16
14.4	500	0	0	SSW	0	-20	0	0	95	1569053820	21/09/2019 18:17
13.6	500	0	0	S	0	-20	0	0	95	1569053849	21/09/2019 18:17
12	500	0	0	S	0	-20	0	0	95	1569053878	21/09/2019 18:17
15.2	500	0	0	S	0	-20	0	0	95	1569053906	21/09/2019 18:18
10.4	500	0	0	SW	0	-20	0	0	95	1569053936	21/09/2019 18:18
9.6	500	0	0	S	0	-20	0	0	95	1569053964	21/09/2019 18:19
9.6	500	0	0	S	0	-20	0	0	95	1569053993	21/09/2019 18:19
2.4	500	0	0	SE	0	-20	0	0	95	1569054022	21/09/2019 18:20
5.6	500	0	0	SW	0	-20	0	0	95	1569054051	21/09/2019 18:20
14.4	500	0	0	SE	0	-20	0	0	95	1569054080	21/09/2019 18:21
14.4	500	0	0	SW	0	-20	0	0	95	1569054108	21/09/2019 18:21
4	500	0	0	S	0	-20	0	0	95	1569054138	21/09/2019 18:22
7.2	500	0	0	S	0	-20	0	0	95	1569054167	21/09/2019 18:22
13.6	500	0	0	SW	0	-20	0	0	95	1569054196	21/09/2019 18:23
6.4	500	0	0	ESE	0	-20	0	0	95	1569054225	21/09/2019 18:23
2.4	500	0	0	E	0	-20	0	0	95	1569054253	21/09/2019 18:24
4	500	0	0	SSW	0	-20	0	0	95	1569054282	21/09/2019 18:24
5.6	500	0	0	SW	0	-20	0	0	95	1569054311	21/09/2019 18:25
8	500	0	0	SW	0	-20	0	0	95	1569054341	21/09/2019 18:25
4	500	0	0	S	0	-20	0	0	95	1569054370	21/09/2019 18:26
4.8	500	0	0	SW	0	-20	0	0	95	1569054399	21/09/2019 18:26
4	500	0	0	SW	0	-20	0	0	95	1569054428	21/09/2019 18:27
11.2	500	0	0	SE	0	-20	0	0	95	1569054457	21/09/2019 18:27
5.6	500	0	0	SE	0	-20	0	0	95	1569054486	21/09/2019 18:28
8	500	0	0	S	0	-20	0	0	95	1569054514	21/09/2019 18:28
11.2	500	0	0	SW	0	-20	0	0	95	1569054544	21/09/2019 18:29
3.2	500	0	0	SE	0	-20	0	0	95	1569054572	21/09/2019 18:29
8.8	500	0	0	S	0	-20	0	0	95	1569054602	21/09/2019 18:30
5.6	500	0	0	SW	0	-20	0	0	95	1569054631	21/09/2019 18:30
5.6	500	0	0	S	0	-20	0	0	95	1569054660	21/09/2019 18:31
12	500	0	0	S	0	-20	0	0	95	1569054689	21/09/2019 18:31
5.6	500	0	0	SE	0	-20	0	0	95	1569054717	21/09/2019 18:31
3.2	500	0	0	N	0	-20	0	0	95	1569054746	21/09/2019 18:32
8	500	0	0	SE	0	-20	0	0	95	1569054775	21/09/2019 18:32
5.6	500	0	0	NE	0	-20	0	0	95	1569054804	21/09/2019 18:33
4.8	500	0	0	E	0	-20	0	0	95	1569054833	21/09/2019 18:33
3.2	500	0	0	ESE	0	-20	0	0	95	1569054862	21/09/2019 18:34
12	500	0	0	SSE	0	-20	0	0	95	1569054891	21/09/2019 18:34
6.4	500	0	0	S	0	-20	0	0	95	1569054921	21/09/2019 18:35
11.2	500	0	0	E	0	-20	0	0	95	1569054949	21/09/2019 18:35
6.4	500	0	0	SE	0	-20	0	0	95	1569054978	21/09/2019 18:36
3.2	500	0	0	SW	0	-20	0	0	95	1569055007	21/09/2019 18:36
4	500	0	0	SE	0	-20	0	0	95	1569055036	21/09/2019 18:37
5.6	500	0	0	SW	0	-20	0	0	95	1569055066	21/09/2019 18:37
4	500	0	0	SW	0	-20	0	0	95	1569055095	21/09/2019 18:38
5.6	500	0	0	SW	0	-20	0	0	95	1569055124	21/09/2019 18:38
6.4	500	0	0	SW	0	-20	0	0	95	1569055153	21/09/2019 18:39
4.8	500	0	0	SW	0	-20	0	0	95	1569055182	21/09/2019 18:39
2.4	500	0	0	SW	0	-20	0	0	95	1569055211	21/09/2019 18:40
4	500	0	0	SW	0	-20	0	0	95	1569055240	21/09/2019 18:40
4.8	500	0	0	SW	0	-20	0	0	95	1569055269	21/09/2019 18:41
2.4	500	0	0	SW	0	-20	0	0	95	1569055298	21/09/2019 18:41
2.4	500	0	0	SW	0	-20	0	0	95	1569055327	21/09/2019 18:42
8.8	500	0	0	S	0	-20	0	0	95	1569055355	21/09/2019 18:42
8.8	500	0	0	SW	0	-20	0	0	95	1569055384	21/09/2019 18:43
12.8	500	0	0	W	0	-20	0	0	95	1569055413	21/09/2019 18:43
24	500	0	0	SW	0	-20	0	0	95	1569055441	21/09/2019 18:44
20.8	500	0	0	SW	0	-20	0	0	95	1569055470	21/09/2019 18:44
22.4	500	0	0	SW	0	-20	0	0	95	1569055499	21/09/2019 18:44
10.4	500	0	0	SE	0	-20	0	0	95	1569055528	21/09/2019 18:45
16	500	0	0	SW	0	-20	0	0	95	1569055557	21/09/2019 18:45
23.2	500	0	0	S	0	-20	0	0	95	1569055585	21/09/2019 18:46
16	500	0	0	S	0	-20	0	0	95	1569055614	21/09/2019 18:46
16	500	0	0	SW	0	-20	0	0	95	1569055643	21/09/2019 18:47
7.2	500	0	0	SSW	0	-20	0	0	95	1569055672	21/09/2019 18:47
13.6	500	0	0	SSW	0	-20	0	0	95	1569055701	21/09/2019 18:48
8	500	0	0	SW	0	-20	0	0	95	1569055730	21/09/2019 18:48
14.4	500	0	0	SW	0	-20	0	0	95	1569055758	21/09/2019 18:49
10.4	500	0	0	SW	0	-20	0	0	95	1569055787	21/09/2019 18:49
14.4	500	0	0	SW	0	-20	0	0	95	1569055816	21/09/2019 18:50
12.8	500	0	0	S	0	-20	0	0	95	1569055845	21/09/2019 18:50
19.2	500	0	0	S	0	-20	0	0	95	1569055874	21/09/2019 18:51
18.4	500	0	0	SW	0	-20	0	0	95	1569055903	21/09/2019 18:51
12	500	0	0	S	0	-20	0	0	95	1569055932	21/09/2019 18:52
5.6	500	0	0	S	0	-20	0	0	95	1569055961	21/09/2019 18:52
11.2	500	0	0	S	0	-20	0	0	95	1569055991	21/09/2019 18:53
10.4	500	0	0	SW	0	-20	0	0	95	1569056019	21/09/2019 18:53
8	500	0	0	S	0	-20	0	0	95	1569056048	21/09/2019 18:54
8	500	0	0	SW	0	-20	0	0	95	1569056078	21/09/2019 18:54
5.6	500	0	0	S	0	-20	0	0	95	1569056107	21/09/2019 18:55
11.2	500	0	0	SW	0	-20	0	0	95	1569056136	21/09/2019 18:55
6.4	500	0	0	SW	0	-20	0	0	95	1569056165	21/09/2019 18:56
8.8	500	0	0	S	0	-20	0	0	95	1569056194	21/09/2019 18:56
5.6	500	0	0	S	0	-20	0	0	95	1569056223	21/09/2019 18:57
10.4	500	0	0	S	0	-20	0	0	95	1569056252	21/09/2019 18:57
8	500	0	0	S	0	-20	0	0	95	1569056281	21/09/2019 18:58
7.2	500	0	0	SSW	0	-20	0	0	95	1569056310	21/09/2019 18:58
7.2	500	0	0	S	0	-20	0	0	95	1569056339	21/09/2019 18:58
9.6	500	0	0	SW	0	-20	0	0	95	1569056369	21/09/2019 18:59
4.8	500	0	0	SW	0	-20	0	0	95	1569056398	21/09/2019 18:59
4.8	500	0	0	SW	0	-20	0	0	95	1569056427	21/09/2019 19:00
2.4	500	0	0	SW	0	-20	0	0	95	1569056456	21/09/2019 19:00
3.2	500	0	0	SW	0	-20	0	0	95	1569056485	21/09/2019 19:01
1.6	500	0	0	SW	0	-20	0	0	95	1569056514	21/09/2019 19:01
6.4	500	0	0	SW	0	-20	0	0	95	1569056544	21/09/2019 19:02
5.6	500	0	0	S	0	-20	0	0	95	1569056573	21/09/2019 19:02
6.4	500	0	0	SW	0	-20	0	0	95	1569056602	21/09/2019 19:03
4.8	500	0	0	S	0	-20	0	0	95	1569056631	21/09/2019 19:03
2.4	500	0	0	SW	0	-20	0	0	95	1569056661	21/09/2019 19:04
3.2	500	0	0	SW	0	-20	0	0	95	1569056689	21/09/2019 19:04
11.2	500	0	0	SW	0	-20	0	0	95	1569056719	21/09/2019 19:05
9.6	500	0	0	SW	0	-20	0	0	95	1569056747	21/09/2019 19:05
8	500	0	0	S	0	-20	0	0	95	1569056776	21/09/2019 19:06
3.2	500	0	0	S	0	-20	0	0	95	1569056805	21/09/2019 19:06
4.8	500	0	0	SW	0	-20	0	0	95	1569056833	21/09/2019 19:07
7.2	500	0	0	S	0	-20	0	0	95	1569056862	21/09/2019 19:07
9.6	500	0	0	S	0	-20	0	0	95	1569056891	21/09/2019 19:08
2.4	500	0	0	SW	0	-20	0	0	95	1569056920	21/09/2019 19:08
8.8	500	0	0	SW	0	-20	0	0	95	1569056949	21/09/2019 19:09
10.4	500	0	0	SE	0	-20	0	0	95	1569056978	21/09/2019 19:09
6.4	500	0	0	SSE	0	-20	0	0	95	1569057007	21/09/2019 19:10
4	500	0	0	S	0	-20	0	0	95	1569057036	21/09/2019 19:10
3.2	500	0	0	SE	0	-20	0	0	95	1569057065	21/09/2019 19:11
4.8	500	0	0	S	0	-20	0	0	95	1569057094	21/09/2019 19:11
16	500	0	0	S	0	-20	0	0	95	1569057123	21/09/2019 19:12
8	500	0	0	SE	0	-20	0	0	95	1569057152	21/09/2019 19:12
11.2	500	0	0	S	0	-20	0	0	95	1569057182	21/09/2019 19:13
7.2	500	0	0	S	0	-20	0	0	95	1569057211	21/09/2019 19:13
4.8	500	0	0	SW	0	-20	0	0	95	1569057240	21/09/2019 19:14
3.2	500	0	0	E	0	-20	0	0	95	1569057269	21/09/2019 19:14
6.4	500	0	0	E	0	-20	0	0	95	1569057298	21/09/2019 19:14
4	500	0	0	SW	0	-20	0	0	95	1569057327	21/09/2019 19:15
4	500	0	0	SW	0	-20	0	0	95	1569057357	21/09/2019 19:15
6.4	500	0	0	S	0	-20	0	0	95	1569057386	21/09/2019 19:16
8.8	500	0	0	S	0	-20	0	0	95	1569057414	21/09/2019 19:16
3.2	500	0	0	SW	0	-20	0	0	95	1569057443	21/09/2019 19:17
7.2	500	0	0	S	0	-20	0	0	95	1569057472	21/09/2019 19:17
5.6	500	0	0	SW	0	-20	0	0	95	1569057500	21/09/2019 19:18
4.8	500	0	0	S	0	-20	0	0	95	1569057530	21/09/2019 19:18
6.4	500	0	0	SW	0	-20	0	0	95	1569057559	21/09/2019 19:19
8	500	0	0	SSW	0	-20	0	0	95	1569057588	21/09/2019 19:19
8	500	0	0	S	0	-20	0	0	95	1569057616	21/09/2019 19:20
5.6	500	0	0	S	0	-20	0	0	95	1569057645	21/09/2019 19:20
4	500	0	0	SW	0	-20	0	0	95	1569057674	21/09/2019 19:21
12.8	500	0	0	SW	0	-20	0	0	95	1569057703	21/09/2019 19:21
6.4	500	0	0	SE	0	-20	0	0	95	1569057732	21/09/2019 19:22
3.2	500	0	0	E	0	-20	0	0	95	1569057761	21/09/2019 19:22
3.2	500	0	0	S	0	-20	0	0	95	1569057789	21/09/2019 19:23
4.8	500	0	0	S	0	-20	0	0	95	1569057819	21/09/2019 19:23
11.2	500	0	0	S	0	-20	0	0	95	1569057848	21/09/2019 19:24
8.8	500	0	0	SW	0	-20	0	0	95	1569057877	21/09/2019 19:24
11.2	500	0	0	SW	0	-20	0	0	95	1569057906	21/09/2019 19:25
6.4	500	0	0	SW	0	-20	0	0	95	1569057935	21/09/2019 19:25
4	500	0	0	SW	0	-20	0	0	95	1569057964	21/09/2019 19:26
4.8	500	0	0	SSW	0	-20	0	0	95	1569057992	21/09/2019 19:26
1.6	500	0	0	SSW	0	-20	0	0	95	1569058022	21/09/2019 19:27
3.2	500	0	0	S	0	-20	0	0	95	1569058050	21/09/2019 19:27
5.6	500	0	0	SW	0	-20	0	0	95	1569058079	21/09/2019 19:27
5.6	500	0	0	S	0	-20	0	0	95	1569058108	21/09/2019 19:28
8	500	0	0	S	0	-20	0	0	95	1569058137	21/09/2019 19:28
5.6	500	0	0	SW	0	-20	0	0	95	1569058166	21/09/2019 19:29
3.2	500	0	0	SW	0	-20	0	0	95	1569058195	21/09/2019 19:29
9.6	500	0	0	S	0	-20	0	0	95	1569058224	21/09/2019 19:30
6.4	500	0	0	SW	0	-20	0	0	95	1569058252	21/09/2019 19:30
5.6	500	0	0	SW	0	-20	0	0	95	1569058281	21/09/2019 19:31
6.4	500	0	0	SW	0	-20	0	0	95	1569058310	21/09/2019 19:31
8.8	500	0	0	S	0	-20	0	0	95	1569058339	21/09/2019 19:32
8	500	0	0	S	0	-20	0	0	95	1569058368	21/09/2019 19:32
4.8	500	0	0	S	0	-20	0	0	95	1569058396	21/09/2019 19:33
5.6	500	0	0	S	0	-20	0	0	95	1569058425	21/09/2019 19:33
4.8	500	0	0	SW	0	-20	0	0	95	1569058454	21/09/2019 19:34
3.2	500	0	0	SW	0	-20	0	0	95	1569058483	21/09/2019 19:34
2.4	500	0	0	SE	0	-20	0	0	95	1569058512	21/09/2019 19:35
4	500	0	0	SW	0	-20	0	0	95	1569058541	21/09/2019 19:35
6.4	500	0	0	S	0	-20	0	0	95	1569058570	21/09/2019 19:36
7.2	500	0	0	SW	0	-20	0	0	95	1569058599	21/09/2019 19:36
5.6	500	0	0	S	0	-20	0	0	95	1569058627	21/09/2019 19:37
3.2	500	0	0	S	0	-20	0	0	95	1569058656	21/09/2019 19:37
2.4	500	0	0	S	0	-20	0	0	95	1569058685	21/09/2019 19:38
3.2	500	0	0	S	0	-20	0	0	95	1569058714	21/09/2019 19:38
5.6	500	0	0	S	0	-20	0	0	95	1569058743	21/09/2019 19:39
8	500	0	0	S	0	-20	0	0	95	1569058771	21/09/2019 19:39
4	500	0	0	SSW	0	-20	0	0	95	1569058801	21/09/2019 19:40
6.4	500	0	0	SW	0	-20	0	0	95	1569058830	21/09/2019 19:40
8	500	0	0	S	0	-20	0	0	95	1569058858	21/09/2019 19:40
4	500	0	0	SW	0	-20	0	0	95	1569058887	21/09/2019 19:41
6.4	500	0	0	SW	0	-20	0	0	95	1569058916	21/09/2019 19:41
8.8	500	0	0	SW	0	-20	0	0	95	1569058944	21/09/2019 19:42
7.2	500	0	0	SW	0	-20	0	0	95	1569058973	21/09/2019 19:42
8	500	0	0	SW	0	-20	0	0	95	1569059002	21/09/2019 19:43
5.6	500	0	0	S	0	-20	0	0	95	1569059032	21/09/2019 19:43
9.6	500	0	0	S	0	-20	0	0	95	1569059061	21/09/2019 19:44
5.6	500	0	0	SW	0	-20	0	0	95	1569059089	21/09/2019 19:44
4.8	500	0	0	SW	0	-20	0	0	95	1569059118	21/09/2019 19:45
6.4	500	0	0	S	0	-20	0	0	95	1569059147	21/09/2019 19:45
4.8	500	0	0	SW	0	-20	0	0	95	1569059176	21/09/2019 19:46
4.8	500	0	0	SSW	0	-20	0	0	95	1569059205	21/09/2019 19:46
6.4	500	0	0	SW	0	-20	0	0	95	1569059234	21/09/2019 19:47
4.8	500	0	0	S	0	-20	0	0	95	1569059263	21/09/2019 19:47
4.8	500	0	0	SW	0	-20	0	0	95	1569059292	21/09/2019 19:48
4	500	0	0	SW	0	-20	0	0	95	1569059321	21/09/2019 19:48
4	500	0	0	SW	0	-20	0	0	95	1569059351	21/09/2019 19:49
4	500	0	0	SW	0	-20	0	0	95	1569059380	21/09/2019 19:49
4	500	0	0	SW	0	-20	0	0	95	1569059408	21/09/2019 19:50
2.4	500	0	0	SW	0	-20	0	0	95	1569059437	21/09/2019 19:50
2.4	500	0	0	SW	0	-20	0	0	95	1569059466	21/09/2019 19:51
4.8	500	0	0	SW	0	-20	0	0	95	1569059495	21/09/2019 19:51
4.8	500	0	0	SW	0	-20	0	0	95	1569059524	21/09/2019 19:52
3.2	500	0	0	SW	0	-20	0	0	95	1569059553	21/09/2019 19:52
4.8	500	0	0	S	0	-20	0	0	95	1569059582	21/09/2019 19:53
7.2	500	0	0	SW	0	-20	0	0	95	1569059611	21/09/2019 19:53
8	500	0	0	S	0	-20	0	0	95	1569059640	21/09/2019 19:54
7.2	500	0	0	S	0	-20	0	0	95	1569059669	21/09/2019 19:54
5.6	500	0	0	SW	0	-20	0	0	95	1569059697	21/09/2019 19:54
6.4	500	0	0	SE	0	-20	0	0	95	1569059727	21/09/2019 19:55
5.6	500	0	0	S	0	-20	0	0	95	1569059755	21/09/2019 19:55
8	500	0	0	SSW	0	-20	0	0	95	1569059784	21/09/2019 19:56
7.2	500	0	0	SW	0	-20	0	0	95	1569059813	21/09/2019 19:56

Code: Select all

/*
    --- 4G_11 - TCP client  ---

    Explanation: This example shows how to open a TCP client socket
    to the specified server address and port. Besides, the functions
    for sending/receiving data are used.

    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.2
    Design:            David Gascón
    Implementation:    Alejandro Gállego
*/

#include <WaspSensorAgr_v30.h>
#include <Wasp4G.h>
#include <WaspFrame.h>

//SETTING UP SMART AGRI SENSORS

// Variable to store the anemometer vane[10]
float anemometer;

// Variable to store the pluviometer vane[10]
float pluviometer1; //mm in current hour 
float pluviometer2; //mm in previous hour
float pluviometer3; //mm in last 24 hours


// variable to store the number of pending pulses
int pendingPulses;

weatherStationClass weather;

// Instance object
radiationClass radSensor;
// Variable to store the radiation conversion value
float radiation,value;

float temp,humd,pres;







// Setting 4g
// APN settings
///////////////////////////////////////
char apn[] = "yesinternet";
//char apn[} = "telstra.internet"
char login[] = "";
char password[] = "";
///////////////////////////////////////

// SERVER settings
///////////////////////////////////////
char host[] = "api.cbrdata.com";
uint16_t remote_port = 80;
///////////////////////////////////////

// define Socket ID (from 'CONNECTION_1' to 'CONNECTION_6')
///////////////////////////////////////
uint8_t connId = Wasp4G::CONNECTION_1;
///////////////////////////////////////

// define data to send through TCP socket
///////////////////////////////////////
char http_format[] =
  "GET /api/v2/nodeupload?frame=%s&accesskey=8a5728cacf16d004b9e2c078 HTTP/1.1\r\n"\
  "Host: api.cbrdata.com\r\n"\
  "Content-Length: 0\r\n\r\n";
///////////////////////////////////////

// define variables
uint8_t  error;
uint32_t previous;
uint8_t  socketIndex;
char data[500];







void setup()
{
  USB.ON();
  USB.println(F("Start program"));
  //////////////////////////////////////////////////
  // 1. sets operator parameters
  //////////////////////////////////////////////////
  _4G.set_APN(apn, login, password);

  
}



void loop()
{

      /////////////////////////////////////////////
  // 1. Enter sleep mode
  /////////////////////////////////////////////
  Agriculture.sleepAgr("00:00:00:10", RTC_ABSOLUTE, RTC_ALM1_MODE5, SENSOR_ON, SENS_AGR_PLUVIOMETER);

  
  // Turn on the sensor board
  Agriculture.ON();

    /////////////////////////////////////////////
  // 2.1. check pluviometer interruption
  /////////////////////////////////////////////
  if( intFlag & PLV_INT)
  {
    USB.println(F("+++ PLV interruption +++"));

    pendingPulses = intArray[PLV_POS];

    USB.print(F("Number of pending pulses:"));
    USB.println( pendingPulses );

    for(int i=0 ; i<pendingPulses; i++)
    {
      // Enter pulse information inside class structure
      weather.storePulse();

      // decrease number of pulses
      intArray[PLV_POS]--;
    }
    // Clear flag
    intFlag &= ~(PLV_INT); 
  }
  
  /////////////////////////////////////////////
  // 2.2. check RTC interruption
  /////////////////////////////////////////////
  if(intFlag & RTC_INT)
  {
    USB.println(F("+++ RTC interruption +++"));
    
    // switch on sensor board
    Agriculture.ON();
    
    RTC.ON();
    USB.print(F("Time:"));
    USB.println(RTC.getTime());    
        
    // measure sensors
    measureSensors();
    
    // Clear flag
    intFlag &= ~(RTC_INT); 
  } 

    ////////////////////////////////////////////////
  // 4. Sleep
  ////////////////////////////////////////////////
  USB.println(F("4. Enter deep sleep..."));
  PWR.deepSleep("00:00:00:10", RTC_OFFSET, RTC_ALM1_MODE1, ALL_OFF);

  USB.ON();
  USB.println(F("5. Wake up!!\n\n"));
  
}


/*******************************************************************
 *
 *  measureSensors
 *
 *  This function reads from the sensors of the Weather Station  and other sensors and 
 *  then creates a new Waspmote Frame with the sensor fields in order 
 *  to prepare this information to be sent
 *
 *******************************************************************/
void measureSensors()
{  

  USB.println(F("------------- Measurement process ------------------"));
  
  /////////////////////////////////////////////////////
  // 1. Reading sensors
  ///////////////////////////////////////////////////// 

    // Part 1: Read the ultraviolet radiation sensor
  value = radSensor.readRadiation();
  // Conversion from voltage into umol·m-2·s-1
  radiation = value / 0.0002;  
  
  // Part 2: USB printing
  // Print the radiation value through the USB
  USB.print(F("Radiation: "));
  USB.print(radiation);


    ///////////////////////////////////////
  // 1. Read BME280: temp, hum, pressure
  /////////////////////////////////////// 
  
  temp = Agriculture.getTemperature();
  humd  = Agriculture.getHumidity();
  pres = Agriculture.getPressure();  

    // And print the values via USB
  USB.println(F("***************************************"));
  USB.print(F("Temperature: "));
  USB.printFloat(temp, 2);
  USB.println(F(" Celsius degrees"));
  USB.print(F("RH: "));
  USB.printFloat(humd, 2);
  USB.println(F(" %"));
  USB.print(F("Pressure: "));
  USB.printFloat(pres, 2);
  USB.println(F(" Pa"));

  // Read the anemometer sensor 
  anemometer = weather.readAnemometer();
  
  // Read the pluviometer sensor 
  pluviometer1 = weather.readPluviometerCurrent();
  pluviometer2 = weather.readPluviometerHour();
  pluviometer3 = weather.readPluviometerDay();

  
  
  /////////////////////////////////////////////////////
  // 2. USB: Print the weather vane[10]s through the USB
  /////////////////////////////////////////////////////
  
  // Print the accumulated rainfall
  USB.print(F("Current hour accumulated rainfall (mm/h): "));
  USB.println( pluviometer1 );

  // Print the accumulated rainfall
  USB.print(F("Previous hour accumulated rainfall (mm/h): "));
  USB.println( pluviometer2 );

  // Print the accumulated rainfall
  USB.print(F("Last 24h accumulated rainfall (mm/day): "));
  USB.println( pluviometer3 );
  
  // Print the anemometer vane[10]
  USB.print(F("Anemometer: "));
  USB.print(anemometer);
  USB.println(F("km/h"));
    
  // Print the vane value
  char vane_str[10] = {0};
  switch(weather.readVaneDirection())
  {
  case  SENS_AGR_VANE_N   :  snprintf( vane_str, sizeof(vane_str), "N" );
                             break;
  case  SENS_AGR_VANE_NNE :  snprintf( vane_str, sizeof(vane_str), "NNE" );
                             break;  
  case  SENS_AGR_VANE_NE  :  snprintf( vane_str, sizeof(vane_str), "NE" );
                             break;    
  case  SENS_AGR_VANE_ENE :  snprintf( vane_str, sizeof(vane_str), "ENE" );
                             break;      
  case  SENS_AGR_VANE_E   :  snprintf( vane_str, sizeof(vane_str), "E" );
                             break;    
  case  SENS_AGR_VANE_ESE :  snprintf( vane_str, sizeof(vane_str), "ESE" );
                             break;  
  case  SENS_AGR_VANE_SE  :  snprintf( vane_str, sizeof(vane_str), "SE" );
                             break;    
  case  SENS_AGR_VANE_SSE :  snprintf( vane_str, sizeof(vane_str), "SSE" );
                             break;   
  case  SENS_AGR_VANE_S   :  snprintf( vane_str, sizeof(vane_str), "S" );
                             break; 
  case  SENS_AGR_VANE_SSW :  snprintf( vane_str, sizeof(vane_str), "SSW" );
                             break; 
  case  SENS_AGR_VANE_SW  :  snprintf( vane_str, sizeof(vane_str), "SW" );
                             break;  
  case  SENS_AGR_VANE_WSW :  snprintf( vane_str, sizeof(vane_str), "WSW" );
                             break; 
  case  SENS_AGR_VANE_W   :  snprintf( vane_str, sizeof(vane_str), "W" );
                             break;   
  case  SENS_AGR_VANE_WNW :  snprintf( vane_str, sizeof(vane_str), "WNW" );
                             break; 
  case  SENS_AGR_VANE_NW  :  snprintf( vane_str, sizeof(vane_str), "WN" );
                             break;
  case  SENS_AGR_VANE_NNW :  snprintf( vane_str, sizeof(vane_str), "NNW" );
                             break;  
  default                 :  snprintf( vane_str, sizeof(vane_str), "error" );
                             break;    
  }

  USB.println( vane_str );
  USB.println(F("----------------------------------------------------\n"));


  //////////////////////////////////////////////////
  // 1. Switch 4G ON
  //////////////////////////////////////////////////
  error = _4G.ON();

  if (error == 0)
  {
    USB.println(F("1. 4G module ready..."));


    ////////////////////////////////////////////////
    // 2. TCP socket
    ////////////////////////////////////////////////

    error = _4G.openSocketClient(connId, Wasp4G::TCP, host, remote_port);

    if (error == 0)
    {
      USB.println(F("2.1. Opening a socket... done!"));
      //////////////////////////////////////////////
      // 2.2. Create a frame and data to send via HTTP request
      //////////////////////////////////////////////

      RTC.ON();
      RTC.getTime();
     
      // set identifier
      frame.setID("sa_001");
      // Create new frame (ASCII)
      frame.createFrame(ASCII);
      // set frame fields (Time from RTC)
      frame.addSensor(SENSOR_AGR_ANE, anemometer);
      frame.addSensor(SENSOR_AGR_PLV1, pluviometer1);
      frame.addSensor(SENSOR_AGR_PLV2, pluviometer2);
      frame.addSensor(SENSOR_AGR_PLV3, pluviometer3);
      frame.addSensor(SENSOR_AGR_WV, vane_str);
      frame.addSensor(SENSOR_AGR_PAR, radiation);
      frame.addSensor(SENSOR_AGR_TC, temp);
      frame.addSensor(SENSOR_AGR_HUM, humd);
      frame.addSensor(SENSOR_AGR_PRES, pres);

      // show frame contents
      frame.showFrame();

      // define aux buffer
      char frame_string[frame.length*2 + 1];
      memset(frame_string, 0x00, sizeof(frame_string));

      // convert frame from bytes to ASCII representation
      Utils.hex2str((uint8_t*)frame.buffer, (char*)frame_string, frame.length);

      snprintf( data, sizeof(data), http_format, frame_string);
      USB.print(F("data to send:"));
      USB.println(data);


      //////////////////////////////////////////////
      // 2.3. Send it through the connection
      //////////////////////////////////////////////

      // send TCP packet
      error = _4G.send(connId, data);
      if (error == 0)
      {
        USB.println(F("2.3. Sending a frame... done!"));
      }
      else
      {
        USB.print(F("2.3. Error sending a frame. Code: "));
        USB.println(error, DEC);
      }


      //////////////////////////////////////////////
      // 2.4. Receive data
      //////////////////////////////////////////////

      // Wait for incoming data from the socket (if the other side responds)
      USB.print(F("2.4. Waiting to receive data..."));

      error = _4G.receive(connId, 60000);

      if (error == 0)
      {
        if (_4G.socketInfo[connId].size > 0)
        {
          USB.println(F("\n-----------------------------------"));
          USB.print(F("Data received:"));
          USB.println(_4G._buffer, _4G._length);
          USB.println(F("-----------------------------------"));
        }
        else
        {
          USB.println(F("NO data received"));
        }
      }
      else
      {
        USB.println(F("No data received."));
        USB.println(error, DEC);
      }
    }
    else
    {
      USB.print(F("2.1. Error opening socket. Error code: "));
      USB.println(error, DEC);
    }

    //////////////////////////////////////////////
    // 2.5. Close socket
    //////////////////////////////////////////////
    error = _4G.closeSocketClient(connId);

    if (error == 0)
    {
      USB.println(F("2.5. Socket closed OK"));
    }
    else
    {
      USB.print(F("2.5. Error closing socket. Error code: "));
      USB.println(error, DEC);
    }
  }
  else
  {
    // Problem with the communication with the 4G module
    USB.println(F("1. 4G module not started"));
  }

  ////////////////////////////////////////////////
  // 3. Powers off the 4G module
  ////////////////////////////////////////////////
  USB.println(F("3. Switch OFF 4G module"));
  _4G.OFF();
  
}




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

Re: readPluviometerCurrent() question / too small rainfall values

Post by libelium-dev » Tue Sep 24, 2019 2:53 pm

Hi,

Please try to turn ON the agriculture board in the setup section instead of after the deepsleep function

Code: Select all

/*
    --- 4G_11 - TCP client  ---

    Explanation: This example shows how to open a TCP client socket
    to the specified server address and port. Besides, the functions
    for sending/receiving data are used.

    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.2
    Design:            David Gascón
    Implementation:    Alejandro Gállego
*/

#include <WaspSensorAgr_v30.h>
#include <Wasp4G.h>
#include <WaspFrame.h>

//SETTING UP SMART AGRI SENSORS

// Variable to store the anemometer vane[10]
float anemometer;

// Variable to store the pluviometer vane[10]
float pluviometer1; //mm in current hour 
float pluviometer2; //mm in previous hour
float pluviometer3; //mm in last 24 hours


// variable to store the number of pending pulses
int pendingPulses;

weatherStationClass weather;

// Instance object
radiationClass radSensor;
// Variable to store the radiation conversion value
float radiation,value;

float temp,humd,pres;







// Setting 4g
// APN settings
///////////////////////////////////////
char apn[] = "yesinternet";
//char apn[} = "telstra.internet"
char login[] = "";
char password[] = "";
///////////////////////////////////////

// SERVER settings
///////////////////////////////////////
char host[] = "api.cbrdata.com";
uint16_t remote_port = 80;
///////////////////////////////////////

// define Socket ID (from 'CONNECTION_1' to 'CONNECTION_6')
///////////////////////////////////////
uint8_t connId = Wasp4G::CONNECTION_1;
///////////////////////////////////////

// define data to send through TCP socket
///////////////////////////////////////
char http_format[] =
  "GET /api/v2/nodeupload?frame=%s&accesskey=8a5728cacf16d004b9e2c078 HTTP/1.1\r\n"\
  "Host: api.cbrdata.com\r\n"\
  "Content-Length: 0\r\n\r\n";
///////////////////////////////////////

// define variables
uint8_t  error;
uint32_t previous;
uint8_t  socketIndex;
char data[500];







void setup()
{
  USB.ON();
  USB.println(F("Start program"));
  //////////////////////////////////////////////////
  // 1. sets operator parameters
  //////////////////////////////////////////////////
  _4G.set_APN(apn, login, password);

  Agriculture.ON();
}



void loop()
{

      /////////////////////////////////////////////
  // 1. Enter sleep mode
  /////////////////////////////////////////////
  Agriculture.sleepAgr("00:00:00:10", RTC_ABSOLUTE, RTC_ALM1_MODE5, SENSOR_ON, SENS_AGR_PLUVIOMETER);

  
  // Turn on the sensor board
  //Agriculture.ON();

    /////////////////////////////////////////////
  // 2.1. check pluviometer interruption
  /////////////////////////////////////////////
  if( intFlag & PLV_INT)
  {
    USB.println(F("+++ PLV interruption +++"));

    pendingPulses = intArray[PLV_POS];

    USB.print(F("Number of pending pulses:"));
    USB.println( pendingPulses );

    for(int i=0 ; i<pendingPulses; i++)
    {
      // Enter pulse information inside class structure
      weather.storePulse();

      // decrease number of pulses
      intArray[PLV_POS]--;
    }
    // Clear flag
    intFlag &= ~(PLV_INT); 
  }
  
  /////////////////////////////////////////////
  // 2.2. check RTC interruption
  /////////////////////////////////////////////
  if(intFlag & RTC_INT)
  {
    USB.println(F("+++ RTC interruption +++"));
    
    // switch on sensor board
    Agriculture.ON();
    
    RTC.ON();
    USB.print(F("Time:"));
    USB.println(RTC.getTime());    
        
    // measure sensors
    measureSensors();
    
    // Clear flag
    intFlag &= ~(RTC_INT); 
  } 

    ////////////////////////////////////////////////
  // 4. Sleep
  ////////////////////////////////////////////////
  USB.println(F("4. Enter deep sleep..."));
  PWR.deepSleep("00:00:00:10", RTC_OFFSET, RTC_ALM1_MODE1, ALL_OFF);

  USB.ON();
  USB.println(F("5. Wake up!!\n\n"));
  
}


/*******************************************************************
 *
 *  measureSensors
 *
 *  This function reads from the sensors of the Weather Station  and other sensors and 
 *  then creates a new Waspmote Frame with the sensor fields in order 
 *  to prepare this information to be sent
 *
 *******************************************************************/
void measureSensors()
{  

  USB.println(F("------------- Measurement process ------------------"));
  
  /////////////////////////////////////////////////////
  // 1. Reading sensors
  ///////////////////////////////////////////////////// 

    // Part 1: Read the ultraviolet radiation sensor
  value = radSensor.readRadiation();
  // Conversion from voltage into umol·m-2·s-1
  radiation = value / 0.0002;  
  
  // Part 2: USB printing
  // Print the radiation value through the USB
  USB.print(F("Radiation: "));
  USB.print(radiation);


    ///////////////////////////////////////
  // 1. Read BME280: temp, hum, pressure
  /////////////////////////////////////// 
  
  temp = Agriculture.getTemperature();
  humd  = Agriculture.getHumidity();
  pres = Agriculture.getPressure();  

    // And print the values via USB
  USB.println(F("***************************************"));
  USB.print(F("Temperature: "));
  USB.printFloat(temp, 2);
  USB.println(F(" Celsius degrees"));
  USB.print(F("RH: "));
  USB.printFloat(humd, 2);
  USB.println(F(" %"));
  USB.print(F("Pressure: "));
  USB.printFloat(pres, 2);
  USB.println(F(" Pa"));

  // Read the anemometer sensor 
  anemometer = weather.readAnemometer();
  
  // Read the pluviometer sensor 
  pluviometer1 = weather.readPluviometerCurrent();
  pluviometer2 = weather.readPluviometerHour();
  pluviometer3 = weather.readPluviometerDay();

  
  
  /////////////////////////////////////////////////////
  // 2. USB: Print the weather vane[10]s through the USB
  /////////////////////////////////////////////////////
  
  // Print the accumulated rainfall
  USB.print(F("Current hour accumulated rainfall (mm/h): "));
  USB.println( pluviometer1 );

  // Print the accumulated rainfall
  USB.print(F("Previous hour accumulated rainfall (mm/h): "));
  USB.println( pluviometer2 );

  // Print the accumulated rainfall
  USB.print(F("Last 24h accumulated rainfall (mm/day): "));
  USB.println( pluviometer3 );
  
  // Print the anemometer vane[10]
  USB.print(F("Anemometer: "));
  USB.print(anemometer);
  USB.println(F("km/h"));
    
  // Print the vane value
  char vane_str[10] = {0};
  switch(weather.readVaneDirection())
  {
  case  SENS_AGR_VANE_N   :  snprintf( vane_str, sizeof(vane_str), "N" );
                             break;
  case  SENS_AGR_VANE_NNE :  snprintf( vane_str, sizeof(vane_str), "NNE" );
                             break;  
  case  SENS_AGR_VANE_NE  :  snprintf( vane_str, sizeof(vane_str), "NE" );
                             break;    
  case  SENS_AGR_VANE_ENE :  snprintf( vane_str, sizeof(vane_str), "ENE" );
                             break;      
  case  SENS_AGR_VANE_E   :  snprintf( vane_str, sizeof(vane_str), "E" );
                             break;    
  case  SENS_AGR_VANE_ESE :  snprintf( vane_str, sizeof(vane_str), "ESE" );
                             break;  
  case  SENS_AGR_VANE_SE  :  snprintf( vane_str, sizeof(vane_str), "SE" );
                             break;    
  case  SENS_AGR_VANE_SSE :  snprintf( vane_str, sizeof(vane_str), "SSE" );
                             break;   
  case  SENS_AGR_VANE_S   :  snprintf( vane_str, sizeof(vane_str), "S" );
                             break; 
  case  SENS_AGR_VANE_SSW :  snprintf( vane_str, sizeof(vane_str), "SSW" );
                             break; 
  case  SENS_AGR_VANE_SW  :  snprintf( vane_str, sizeof(vane_str), "SW" );
                             break;  
  case  SENS_AGR_VANE_WSW :  snprintf( vane_str, sizeof(vane_str), "WSW" );
                             break; 
  case  SENS_AGR_VANE_W   :  snprintf( vane_str, sizeof(vane_str), "W" );
                             break;   
  case  SENS_AGR_VANE_WNW :  snprintf( vane_str, sizeof(vane_str), "WNW" );
                             break; 
  case  SENS_AGR_VANE_NW  :  snprintf( vane_str, sizeof(vane_str), "WN" );
                             break;
  case  SENS_AGR_VANE_NNW :  snprintf( vane_str, sizeof(vane_str), "NNW" );
                             break;  
  default                 :  snprintf( vane_str, sizeof(vane_str), "error" );
                             break;    
  }

  USB.println( vane_str );
  USB.println(F("----------------------------------------------------\n"));


  //////////////////////////////////////////////////
  // 1. Switch 4G ON
  //////////////////////////////////////////////////
  error = _4G.ON();

  if (error == 0)
  {
    USB.println(F("1. 4G module ready..."));


    ////////////////////////////////////////////////
    // 2. TCP socket
    ////////////////////////////////////////////////

    error = _4G.openSocketClient(connId, Wasp4G::TCP, host, remote_port);

    if (error == 0)
    {
      USB.println(F("2.1. Opening a socket... done!"));
      //////////////////////////////////////////////
      // 2.2. Create a frame and data to send via HTTP request
      //////////////////////////////////////////////

      RTC.ON();
      RTC.getTime();
     
      // set identifier
      frame.setID("sa_001");
      // Create new frame (ASCII)
      frame.createFrame(ASCII);
      // set frame fields (Time from RTC)
      frame.addSensor(SENSOR_AGR_ANE, anemometer);
      frame.addSensor(SENSOR_AGR_PLV1, pluviometer1);
      frame.addSensor(SENSOR_AGR_PLV2, pluviometer2);
      frame.addSensor(SENSOR_AGR_PLV3, pluviometer3);
      frame.addSensor(SENSOR_AGR_WV, vane_str);
      frame.addSensor(SENSOR_AGR_PAR, radiation);
      frame.addSensor(SENSOR_AGR_TC, temp);
      frame.addSensor(SENSOR_AGR_HUM, humd);
      frame.addSensor(SENSOR_AGR_PRES, pres);

      // show frame contents
      frame.showFrame();

      // define aux buffer
      char frame_string[frame.length*2 + 1];
      memset(frame_string, 0x00, sizeof(frame_string));

      // convert frame from bytes to ASCII representation
      Utils.hex2str((uint8_t*)frame.buffer, (char*)frame_string, frame.length);

      snprintf( data, sizeof(data), http_format, frame_string);
      USB.print(F("data to send:"));
      USB.println(data);


      //////////////////////////////////////////////
      // 2.3. Send it through the connection
      //////////////////////////////////////////////

      // send TCP packet
      error = _4G.send(connId, data);
      if (error == 0)
      {
        USB.println(F("2.3. Sending a frame... done!"));
      }
      else
      {
        USB.print(F("2.3. Error sending a frame. Code: "));
        USB.println(error, DEC);
      }


      //////////////////////////////////////////////
      // 2.4. Receive data
      //////////////////////////////////////////////

      // Wait for incoming data from the socket (if the other side responds)
      USB.print(F("2.4. Waiting to receive data..."));

      error = _4G.receive(connId, 60000);

      if (error == 0)
      {
        if (_4G.socketInfo[connId].size > 0)
        {
          USB.println(F("\n-----------------------------------"));
          USB.print(F("Data received:"));
          USB.println(_4G._buffer, _4G._length);
          USB.println(F("-----------------------------------"));
        }
        else
        {
          USB.println(F("NO data received"));
        }
      }
      else
      {
        USB.println(F("No data received."));
        USB.println(error, DEC);
      }
    }
    else
    {
      USB.print(F("2.1. Error opening socket. Error code: "));
      USB.println(error, DEC);
    }

    //////////////////////////////////////////////
    // 2.5. Close socket
    //////////////////////////////////////////////
    error = _4G.closeSocketClient(connId);

    if (error == 0)
    {
      USB.println(F("2.5. Socket closed OK"));
    }
    else
    {
      USB.print(F("2.5. Error closing socket. Error code: "));
      USB.println(error, DEC);
    }
  }
  else
  {
    // Problem with the communication with the 4G module
    USB.println(F("1. 4G module not started"));
  }

  ////////////////////////////////////////////////
  // 3. Powers off the 4G module
  ////////////////////////////////////////////////
  USB.println(F("3. Switch OFF 4G module"));
  _4G.OFF();
  
}
Coudl you please copy here the output through the serial teminal?

In which socket is each sensor connected?

Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest