Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Overall hardware setup guide
#31

Hi,

By using some php scripts on the server side, its possible to store in a MySQL db any data provided by Cumulus. Having the data in an SQL table you can do whatever you want with it. Unfortunately I can't describe the process in detail, but I'm sure there are here some English speaking users that are using similar functions.

The Pro2 PLUS have two GPIO ports plus one GPO port, which can be used to control external devices. Users can write their own mini pieces of code which will be executed at each minute. Any of variable containing weather data can be used.
On the WeatherDuino Pro2 PLUS software, give a look on the GPIO_Task tab:


Code:
// --------------------------------------------------------------------------------------
//   User programable GPIO tasks
// --------------------------------------------------------------------------------------
#if (USE_GPIO == 1)
void GPIO_tasks()
{
 //                      : Usable vars (most commom)                            - Description
 //
 // Inside Temperature   : Output_T_Int                                         - Inside Temperature in Tenths of Degrees
 // Inside Humidity      : Output_H_Int                                         - Inside Humidity in Tenths of %
 // Outside Temperatures : TX_Unit[TX_UnitID, 0 to 2].TemperaturaExt[Sensor, 0 to 1]  - Temperature from Sensor 0 or 1 at TX unit TX_UnitID, in Tenths of Degree
 // Outside Humidities   : TX_Unit[TX_UnitID, 0 to 2].HumidadeExt[Sensor, 0 to 1]     - Humidity from Sensor 0 or 1 at TX unit TX_UnitID, in Tenths of %
 // Wind Average         : TX_Unit[TX_UnitID].Wind_average                            - Wind Average from TX unit TX_UnitID in m/s * 1000
 // Wind Gust            : TX_Unit[TX_UnitID].Wind_gust                               - Wind Gust from TX unit TX_UnitID in m/s * 1000
 // Wind Dir             : TX_Unit[TX_UnitID].Wind_gust                               - Wind Direction from TX unit TX_UnitID in degrees (0 to 359)
 // Daily Rain           : Output_RToday                                        - Total Rain today in Rain_Display_Unit
 // RainFall Rate        : Output_RainFallRate                                  - Current RainFall Rate in Rain_Display_Unit
 // Solar Radiation      : Output_SRad                                          - Current Solar Radiation in W/m2
 // Index UV             : Output_UV                                            - Value is UV Index * 1000
 // Soil Temperature     : Soil_Data[sensor number 0 to 3][0]                   - Soil temperature in Degrees Celsius
 // Soil Moisture        : Soil_Data[sensor number 0 to 3][1]                   - Soil Moisture in VMC
 // Leaf Temperature     : Leaf_Data[sensor number 0 to 3][0]                   - Leaf temperature in Degrees Celsius
 // Leaf Wetness         : Leaf_Data[sensor number 0 to 3][1]                   - Leaf Wetness. Range is from 0 (dry) to 15.

 // Instructions to use the GPO, GPO_1 and GPO_2 ports on the RX Plus board
 //
 // ATENTION: The GPO output is ACTIVE LOW
 // Use this command turn ON the GPO Output   : setPortLOW(PORTL, 3)
 // Use this command turn OFF the GPO Output  : setPortHIGH(PORTL, 3)

 // GPIO_1 and GPIO_2 outputs are ACTIVE HIGH
 // ** To write to GPIO_1 or GPIO_2 use the following commands:  
 // Use this command to turn ON the GPIO_1 Output  : setPortHIGH(PORTE, 4)
 // Use this command to turn OFF the GPIO_1 Output : setPortLOW(PORTE, 4)
 // Use this command to turn ON the GPIO_2 Output  : setPortHIGH(PORTE, 5)
 // Use this command to turn OFF the GPIO_2 Output : setPortLOW(PORTE, 5)

 // ** To read from GPIO_1 or GPIO_2 use the follwing commands:
 // Read GPIO_1 pin state  : digitalRead(2)
 // Read GPIO_2 pin state  : digitalRead(3)


// -------------------------------------------------------------------
//   IMPORTANT: Never use delays or anything else which takes long time to execute
// -------------------------------------------------------------------

// Examples of usage:
//
// Example 1: The GPO port can be used to directly drive a relay up to 70mA. Remember GPO is ACTIVE LOW!!!
// If Today Rain reaches a defined threshold, the GPO turns OFF the relay,
// which can be used to drive a main valve of a watering system.
 
 float Threshold = 0.3;      
 if (Output_RToday >= Threshold )  // If today rain is greater or equal to defined threshold...
  {  
    setPortHIGH(PORTL, 3);   // Turns OFF the output, disabling the watering system.
  }  
 else setPortLOW(PORTL, 3);  // Turns ON the output, enabling the main valve of the watering system.

//

Reply
#32

Hey, look what I found Smile
https://www.renovateforum.com/f192/ifttt...ost1076201
Reply
#33

Thanks Werk - you have pointed me the right direction, i will do some digging and come back with more questions. One question - can the soil moisture data be logged to a database in the manner you describe ?

I should say that I plan using the Weatherduino in combination with my existing Opensprinkler for irrigation control. Opensprinkler is another Arduino based open source system. It is an internet based irrigation controller that extracts the weather information for any Wunderground site you point it to, and can make adjustments to the amount of irrigation water supplier based on the weather. The method used for the irrigation adjustments in the current released firmware is currently poor, but there is running code on Github for the device that calculates Evapotranspiration - so i need to see if i can get that running at some stage. I saw a post from you a while ago showing some interest in ET so here's the link to the post if you are interested.

https://opensprinkler.com/forums/topic/a...inkler-et/

Thanks again.
Reply
#34

(18-05-2018, 03:59)coupe pete Wrote:  Thanks Werk - you have pointed me the right direction, i will do some digging and come back with more questions. One question - can the soil moisture data be logged to a database in the manner you describe ?

Yes, it can. It all depends on the PHP script running on the server, usually called by a cron job.
Cumulus can process and upload to your server a lot of custom defined files. Those files can have any data available through Cumulus webtags.
In attach is an example of the file I use for myself, then its just a matter of having on the server a PHP script called by a cronjob which reads the file and inserts the data on an SQL db/table.


Some time ago I gave a look at the Opensprinkler project, very interesting stuff.
Thanks for the link to ET info.


Attached Files
.rar VPSoilDataSqlT.rar Size: 192 bytes  Downloads: 264

Reply
#35

Thanks a lot.
Reply
#36

Have made some good progress on Cumulus once I found the guide in the Weatherduino Wiki link for setting up Cumulus and made sure VP1 switch was closed. I am using a windows PC as a server and installing the latest version of Cumulus 1. A few minutes after Cumulus starts communicating with the Weatherduino I get the message "Not receiving data" on the Weatherduino touch screen. It only seems to recover with disconnect and power off, then on. The web interface to the Weatherduino seems to still work and transmit data from the Tx board, and the link to Wunderground seems to be working though the data is suspiciously flat. I have not let it run long enough to properly confirm if the data is updating from the Tx. Any ideas ?
Reply
#37

Well, seems the WeatherDuino Wiki is starting to be useful. Thank you.

(20-05-2018, 05:07)coupe pete Wrote:  A few minutes after Cumulus starts communicating with the Weatherduino I get the message "Not receiving data" on the Weatherduino touch screen. It only seems to recover with disconnect and power off, then on. ...

Very strange, is this happen every time Cumulus starts?
What RF Efficiency values are you getting? (the value only is meaningful after 1 hour of continuous operation)
Are you refreshing the web page provided by the WeatherDuino very often?

Smile Good choice, I'm also using Cumulus1 on a low power PC.

Reply
#38

44.2% RF efficiency - and just did the same thing again with a different USB cable, and previously I had tried swapping the USB port and got a similar result. Is there any way I can tell if the Rx unit is still responding ? The web server shows the same data as prior to connecting but the touch screen on the Weatherduino only shows internal temp only. I'll give it some thought - i might need to go through and redo the config settings in the Rx unit. 

Yes the Wiki is a great idea ;-) and progressing well.
Reply
#39

The RF efficiency is somewhat low, the first thing that should be done is try to improve it.
Things you could try:
Try find a better spot for the receiver, sometimes moving it just 30 to 50 cm do a big diferrence.
Try diferrent placements of the antennas in both TX and RX (Horizontal, Vertical). Avoid using antennas with a cable extension on the TX unit, a direct attachment of the antenna to the SMA connector avoids signal looses.

Stop Cumulus, open the Cumulus.ini file and search for this:

Code:
VP2SleepInterval

change the value to 1500.

Don't refresh the webpage served by WeatherDuino to often, every time the page is generated, reception is frozen (arduino isn't a multitask system, and generating the webpage consumes a lot of time)

Let me know if this helped.

Reply
#40

Thanks Werk - I discovered the antenna on the Tx unit had fallen off its currently only a magnetic base - so I corrected that but unfortunately the RF efficiency dropped to 16%  Huh  There's a lot of things I can try to improve.

Before I start trying out these things I just want to confirm I understand the way to assess improvements. I assume the RF efficiency is a ratio of packets successfully received, versus total packets detected ?  and it needs to run for at least hour for the measure to be useful ?  Is it a rolling average - can you confirm over what time ? or do I need to reset the unit for each test.

Is there some sort of signal strength indicator - is that what the 3 dots on the front of the touchscreen are ? is it possible to get a signal strength from somewhere ?
Reply




Users browsing this thread: 1 Guest(s)