WXforum.net
Weather Station Hardware => Davis Instruments Weather Stations => Topic started by: bmd_online on September 19, 2018, 05:45:43 PM
-
Hi,
Since many years I'm using a Lacrosse WS2300 weather station, receiving data through 433Mhz receiver connected to an Arduino nano.
Now, I'm trying to do the same with a Davis VP2.
I'm using an Arduino (uno and/or nano), with an Adafruit transceiver (https://www.adafruit.com/product/3070). RFM69HCW chipset only, not entire Feather board.
I've tried several libraries, from dekay (https://github.com/dekay/DavisRFM69) to mcrossley (https://github.com/mcrossley/VPTools), including kobuki (https://github.com/kobuki/VPTools) and hydrosense (https://github.com/HydroSense/FeatherM0_Davis_ISS_rx) ones.
Everytime with same difficulties.
First, I have to add a manual reset in initialization setup :
void setup() {
(...)
pinMode(RFM69_RST, OUTPUT);
digitalWrite(RFM69_RST, LOW);
(...)
// manual reset
digitalWrite(RFM69_RST, HIGH);
delay(10);
digitalWrite(RFM69_RST, LOW);
delay(10);
radio.initialize();
(...)
}
Then, I have to adjust DavisRFM69.cpp isr0 code, based on LowPowerLab code, doing something like this...
From :
void DavisRFM69::isr0() { selfPointer->interruptHandler(); }
(...)
bool DavisRFM69::receiveDone() {
return _packetReceived;
}
To :
void DavisRFM69::isr0() { _haveData = true; }
(...)
bool DavisRFM69::receiveDone() {
//ATOMIC_BLOCK(ATOMIC_FORCEON)
//{
if (_haveData) {
_haveData = false;
interruptHandler();
return _packetReceived;
}
/*if (_mode == RF69_MODE_RX && PAYLOADLEN > 0)
{
setMode(RF69_MODE_STANDBY); // enables interrupts
return true;
}
else*/ if (_mode == RF69_MODE_RX) // already in RX no payload yet
{
return false;
}
receiveBegin();
return false;
//}
}
Without that, I have strange behaviors : hangs, restarts, weired data.
Now everything is working : I'm receiving about 98% good packets.
Like mcrossley (http://www.wxforum.net/index.php?topic=10739.msg306565#msg306565), I have this sequence (every 2.5 sec) :
8 E 5 4
8 E 5 9
8 E 5 C
8 E 5 A
8 E 5 6
In next post, I will describe my problems managing received data.
-
As I said before, packets are correctly received.
But the content of the packages is strange. The coding looks different !
At least the temperature.
Here is a sample of received temperature packets (msg 0x8):
raw:80-00-00-4D-81-00-A3-75-FF-FF (temp:124.0)
raw:80-00-00-4E-01-00-E1-BD-FF-FF (temp:124.8)
raw:80-00-00-4E-41-00-EC-71-FF-FF (temp:125.2)
raw:80-00-00-4E-81-00-FA-25-FF-FF (temp:125.6)
raw:80-00-00-4E-C1-00-F7-E9-FF-FF (temp:126.0)
raw:80-00-00-4F-01-00-D6-8D-FF-FF (temp:126.4)
raw:80-00-00-4F-41-00-DB-41-FF-FF (temp:126.8)
For the last 24, my WS2300 temperature looks like this :
[ You are not allowed to view attachments ]
And, VP2 data give me something like this :
[ You are not allowed to view attachments ]
The curve is upside down, the scale does not mean anything.
When I invert the curve (the scale does not matter), it looks like this :
[ You are not allowed to view attachments ]
I collect good data, but I could not decode them properly with VP2 common decypher.
-
I've found a solution, certainly not the best, but it's working :
First, I have to invert (bitwise_not) temperature bytes. Don't know why !
For example,
80-00-00-60-01-00-71-38-FF-FF
Bytes are 60-01
not(60) : 9F
not(01) : FE
Then, I can apply usual method 9F-FE means 255.99°F
This temperature doesn't means anything, but values aren't upside/down anymore.
Now, I'm comparing measures from ISS with my WS2300 database, and perform a linear regression
I got my coefficients : y = 0.4004x - 29.027.
I've tried with rounded values 0.4 and 29.
0.4x255.99-29 = 73.40°F = 20.76°C
Using this, my measures looks really better.
[ You are not allowed to view attachments ]