I receive data, but it doesn't make sense - SOLVED
Posted: Wed Jun 13, 2007 11:59 pm
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by b_weijenberg</i>
<br />Ludo,
You have to put the receiver in Variable Length mode (command hex F02C)
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
done
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
The first byte you receive will contain the message length in bits. For an RFXPower this will be hex 30 (48 decimal)
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
done too
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
1) Check the number of bits received - should be hex 30,
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
$bytesNumber = scalar @bytes;
return 0 if ($bytesNumber != 6);
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
2) Check if the 2 address bytes have the correct format: Byte 2 = byte 1 with the complement of the upper nibble (bit 7-4)
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
So I guess you are talking about byte 0 and 1, I did this test:
if (($bytes[0] + ($bytes[1] ^ 0x0F)) == 0xFF) {
But I never fill this condition, am I right?
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
3) Check the 4 bits parity: This is the complement of:
byte 0 bit 7-4 + byte 0 bit 3-0 + byte 1 bit 7-4 + byte 1 bit 3-0 + byte 2 bit 7-4 + byte 2 bit 3-0 + byte 3 bit 7-4 + byte 3 bit 3-0 + byte 4 bit 7-4 + byte 4 bit 3-0 + byte 5 bit 7-4
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
I didn't yet try this one, because I don't success the second one.
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
If this check is OK it is 99.999% sure it is an RFXPower or RFXMeter packet
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Not yet, but I am asking me some questions about my communication between my rfxcom and my rfxpower, I think I am going to run a test with RFreceiver.exe from a windows machine, because in parallel I manage fine RFX10, I detect my Oregon Sensors, so maybe the problem is not in the code.
<br />Ludo,
You have to put the receiver in Variable Length mode (command hex F02C)
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
done
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
The first byte you receive will contain the message length in bits. For an RFXPower this will be hex 30 (48 decimal)
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
done too
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
1) Check the number of bits received - should be hex 30,
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
$bytesNumber = scalar @bytes;
return 0 if ($bytesNumber != 6);
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
2) Check if the 2 address bytes have the correct format: Byte 2 = byte 1 with the complement of the upper nibble (bit 7-4)
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
So I guess you are talking about byte 0 and 1, I did this test:
if (($bytes[0] + ($bytes[1] ^ 0x0F)) == 0xFF) {
But I never fill this condition, am I right?
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
3) Check the 4 bits parity: This is the complement of:
byte 0 bit 7-4 + byte 0 bit 3-0 + byte 1 bit 7-4 + byte 1 bit 3-0 + byte 2 bit 7-4 + byte 2 bit 3-0 + byte 3 bit 7-4 + byte 3 bit 3-0 + byte 4 bit 7-4 + byte 4 bit 3-0 + byte 5 bit 7-4
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
I didn't yet try this one, because I don't success the second one.
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
If this check is OK it is 99.999% sure it is an RFXPower or RFXMeter packet
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Not yet, but I am asking me some questions about my communication between my rfxcom and my rfxpower, I think I am going to run a test with RFreceiver.exe from a windows machine, because in parallel I manage fine RFX10, I detect my Oregon Sensors, so maybe the problem is not in the code.