Author Topic: VP2 decoding with Arduino UNO and RFM69HCW transceiver  (Read 233 times)

0 Members and 1 Guest are viewing this topic.

Offline bmd_online

  • Member
  • *
  • Posts: 3
VP2 decoding with Arduino UNO and RFM69HCW transceiver
« 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. RFM69HCW chipset only, not entire Feather board.
I've tried several libraries, from dekay to mcrossley, including kobuki and hydrosense ones.
Everytime with same difficulties.

First, I have to add a manual reset in initialization setup :
Code: [Select]
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 :
Code: [Select]
void DavisRFM69::isr0() { selfPointer->interruptHandler(); }

(...)

bool DavisRFM69::receiveDone() {
  return _packetReceived;
}

To :
Code: [Select]
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, I have this sequence (every 2.5 sec) :
Code: [Select]
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.


Offline bmd_online

  • Member
  • *
  • Posts: 3
Re: VP2 decoding with Arduino UNO and RFM69HCW transceiver
« Reply #1 on: September 19, 2018, 06:16:32 PM »
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):
Code: [Select]
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.
« Last Edit: September 21, 2018, 12:38:47 PM by bmd_online »

Offline bmd_online

  • Member
  • *
  • Posts: 3
Re: VP2 decoding with Arduino UNO and RFM69HCW transceiver
« Reply #2 on: September 21, 2018, 12:36:57 PM »
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.99F
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.40F = 20.76C

Using this, my measures looks really better.
 [ You are not allowed to view attachments ]

 

anything