weather station ws3000

Questions about the Waspmote board and its modules
Post Reply
jot4p
Posts: 192
Joined: Thu Apr 21, 2016 5:19 pm

weather station ws3000

Post by jot4p » Thu Oct 11, 2018 11:17 am

Hi,

I have an old weather station ws3000 and a old wasp pro v1.2.

I need to obtain the values of pluv from the last hour and the last 24 hours, but at same time I need to put the wasp to sleep.

It's possible ?

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

Re: weather station ws3000

Post by libelium-dev » Mon Oct 15, 2018 8:45 am

Hi,

Yes, waspmote will wake up each time a interruption from the pluviometer will occur and it will update the accumulated rainfall.
http://www.libelium.com/v12/development ... r-reading/

Regards

jot4p
Posts: 192
Joined: Thu Apr 21, 2016 5:19 pm

Re: weather station ws3000

Post by jot4p » Mon Oct 22, 2018 12:07 pm

My problem is that plv (current hour) value is always around 13mm.

This command " intFlag &= ~(PLV INT);" reset the counter correct ?

What is wrong ?

My code:

Code: Select all

#include <WaspSensorAgr_v20.h>
#include <WaspFrame.h>
#include <WaspLoRaWAN.h>

uint8_t socket = SOCKET0;
uint8_t PORT = 5;

/*************************************************************** GATEWAY ***********************************************/
char APP_EUI[] = "xxxxxxxxxxxxxxxx";
char APP_KEY[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
/*************************************************************** GATEWAY ***********************************************/

float temperature;
float humidity;
float UVvalue;
float radiation;
float anemometer;
float pluviometer1;
float pluviometer2;
float pluviometer3;
int vane;

uint8_t error;

unsigned long pluviometerCounter = 0;
float pluviometer;
int pendingPulses;


void setup()
{
  // Turn on the USB and print a start message
  USB.ON();
  USB.println(F("START"));

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

  // Turn on the RTC
  RTC.ON();
  USB.print(F("Time:"));
  USB.println(RTC.getTime());


  /*
    RTC_ALM1_MODE1: Day, hours, minutes and seconds match
    RTC_ALM1_MODE2: Date, hours, minutes and seconds match
    RTC_ALM1_MODE3: Hours, minutes and seconds match
    RTC_ALM1_MODE4: Minutes and seconds match
    RTC_ALM1_MODE5: Seconds match
    RTC_ALM1_MODE6: Once per second
  */

}



void loop()
{

  /////////////////////////////////////////////
  // 1. Enter sleep mode
  /////////////////////////////////////////////
  SensorAgrv20.sleepAgr("00:00:13:00", RTC_OFFSET, RTC_ALM1_MODE4, SENSOR_ON, SENS_AGR_PLUVIOMETER); //13 + 2 min for code processing.


  /////////////////////////////////////////////
  // 2.1 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
      SensorAgrv20.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
    SensorAgrv20.ON();

    RTC.ON();
    USB.print(F("Time:"));
    USB.println(RTC.getTime());

    // measure sensors
    measureSensors();

    // Clear flag
    intFlag &= ~(RTC_INT);
  }

}



void measureSensors() {

// read sensors and send code here 

}


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

Re: weather station ws3000

Post by libelium-dev » Tue Oct 23, 2018 10:43 am

Hi,

intFlag &= ~(PLV_INT) command resets the interruption flag, not the accumulated rainfall. If the Current hour accumulated rainfall is 13mm/h and it isn't generated more interruption, it should decrease during the following hours.

Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest