jeelabs / jeelib

JeeLib for Arduino IDE: Ports, RF12, and RF69 drivers from JeeLabs
https://jeelabs.org/202x/sw/jeelib/
The Unlicense
489 stars 215 forks source link

Add support for receiving fixed length packets #67

Closed cadwal closed 10 years ago

cadwal commented 10 years ago

This allows use of the RF12 driver to receive data from sources that do not implement the RF12 protocol. Includes a sample for the EMT7110 energy meter.

I have seen others do similar changes so there might be more people interested in this feature if it fits in with the intent of the driver. Doing something like it for transmitting data would be far more invasive.

cadwal commented 10 years ago

I will also think about those options (though I would perhaps not call them a simplification, but rather clever :-)), but I messed up my branching so I will close this request and come up with some new ones.

That branch should add one cycle to the normal path and two to the fixed reception path but that one calculates no crc so there should plenty to spare there. Is the normal path that close to the edge of missing received bytes at 4MHz?

jcw commented 10 years ago

Is the normal path that close to the edge of missing received bytes at 4MHz?

Nah... it's not an issue really. I think the simplest trick is as follows: when the first byte comes in: pre-fill the length and skip over it if a fixed-packet size has been set. Then the rest can stay the same? CRC will be off - oh, wait, those two CRC bytes need to be accounted for in the prefix-size calculation.

jcw commented 10 years ago

Looking forward to try this out, by the way. I've got some energy meters which I've always suspected of being compatible with the RFM12B.

cadwal commented 10 years ago

Now there is two different pull requests, one with the original code that you probably want to skip, and one with the logic from your second idea. The two crc bytes are included in the "+ 5" logic already I think? It works without any specific changes for that at least.

Anything from WH Madolyn (its on the sticker on the meters/weather stations) in the last two years is likely to use the RFM02/RFM01 combo for wireless transmissions.

On 8 March 2014 20:40, Jean-Claude Wippler notifications@github.com wrote:

Looking forward to try this out, by the way. I've got some energy meters which I've always suspected of being compatible with the RFM12B.

Reply to this email directly or view it on GitHubhttps://github.com/jcw/jeelib/pull/67#issuecomment-37107453 .