Hi Rob!
First thank you so much for your prompt response, it's very kind of you taking the time to review my issue!
I have been following your advice, I were able to get to points 4 and 5; it also calls the add() function. But the only values I get are:
One second ...0,0,0.0,0.0,0.00,0.00,2.34,nan,0,0,0
I've been digging deeper: as mentioned, it enters to the add() function, it also enters to the else block here:
void add(byte bitData) {
Serial.println("POINT>> 10 Enters add()");
if (discNos > 0) {
discNos--;//discard bits before real data
Serial.println("POINT>> 11 - add() - if (discNos > 0) {");
}
else { <<<<<<<<<<<ENTERS HERE
And sometimes here:
Serial.println("POINT>> 12 - add() - else {");
//the incoming bitstream has bytes placed in reversed nibble order on the fly, then the CS is done.
if (bitData) {
//if it is a '1' OR it in, others leave at a '0'
manchester[nosBytes] |= oregon[nosBits];//places the reversed low nibble, with hi nibble, on the fly!!!
Serial.println("POINT>> 13 - add() - if (bitData) { ");
}
but it never enters to any of these:
if (manchester[0] == 0xA2) {
maxBytes = 11; //rain
csIndex = 19;
}
if (manchester[0] == 0xA1) {
maxBytes = 10; //wind
csIndex = 18;
Serial.println("Wind S detected");
}
if (manchester[0] == 0xAF) {
maxBytes = 9; //temp
csIndex = 16;
Serial.println("Temp S detected");
}
if (manchester[0] == 0xAD) {
maxBytes = 8; //UV Light Detector
csIndex = 14; //CS byte begins at 14 nibble
}
if (manchester[0] == 0xA3) {
maxBytes = 10; //experimental, Solar,Strikes,UV
csIndex = 18; //CS byte begins at 18 nibble
}
Hence I'm wondering if maybe the issue is that my sensor may have a different Hex code... Where do those codes come from?
Checking one of your sources (http://wmrx00.sourceforge.net/Arduino/OregonScientific-RF-Protocols.pdf) I found in page 10 all known Sensor ID Codes; my device is the WTGR800 and while is not specifically in the list, there is a WGR800 that includes a temperature/RH sensor; hex code = 1994 but the format seems to be different from the two digits hex codes from this block of code... So how shall I format it?
Also is there a way to find the right values for the
maxBytes
and
csIndex
of my sensor, or just trial and error?
It never gets to this code:
if (nosBytes == maxBytes) {
Serial.println("POINT>> 14 - add() - if (nosBytes == maxBytes) {");
hexBinDump();
digitalWrite(ledPin, 1);
Serial.println("WCheck SUM");
//Check Checksum first
if (ValidCS(csIndex)) {
//Process the byte array into Human readable numbers
analyseData();
}
noErrors = false; //make it begin again from the start
I really hope to get my sensor up and running, I'm looking forward to start extending my station with more of the OS great devices...
I will get a new Rx like the one you recommend ASAP, for now I have my sensor close to the RX.
Once again thank you for your help!
Javier