Pages: 1 2 [3]   Go Down
Author Topic: New library for RF22, RFM22 radio modules  (Read 14541 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12200
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmm, the plot is thickening...   Firstly I went to look at my order for the RFM22's I have - I am pretty sure they were originally sparkfun ones but I sourced them from SKPang here in the UK in November last year.  I presume the RFM22B has superseded these now, but there must be lots of the the non-B versions out there...

Secondly I looked at the breakout board photo on the Sparkfun website: http://www.sparkfun.com/products/10154  It shows a RF22S chip rather than a RF22B on the module (which although not identical in layout to my RFM22 has an antenna switch chip.).

It also shows the breakout board does not connect to ANT_TX and ANT_RX at all... Despite being loaded with a module that requires them...

So it seems Sparkfun weren't aware of the issue when selling previous modules, which I presume the photos come from.  Also its not clear that they have their data right on the newer RFM22B modules, claiming 17dBm rather than 13dBm....

Then again can anyone trust the Hope RF datasheets anyway (they certainly confuse/conflate the chip v. module specs).

If anyone has a good photo of an alleged RFM22_B_ module its easy to tell if it has a 6-leg antenna-switch chip on it...  If it has then the ANT_TX and ANT_RX pins need driving.  Also if anyone has done a range test at 17dBm at 9600baud and 30kHz deviation - should be over a mile by my calculations with quarter-wave antennas.
Logged

[ I won't respond to messages, use the forum please ]

0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12200
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've just had a play on the new 1.7 version on my "RFM02S Rev 0.2" modules (version code reads as 0x02 BTW).  Just tried the rf22_test example:

(Firstly just to say the ANT_TX and ANT_RX pins are doing the right thing smiley-wink

test_rssi code doesn't work until I add some more delays in a couple of places - presume this is silicon differences.  It was getting stuck after reporting just 3 of the 5 frequencies (and reporting FF for each).  Adding delay(2) after setModeRx in test_rssi meant all 5 were reported (as FF),changing delayMicroseconds(200) to 1600 meant more sensible RSSI values started to appear...

test_tx seems to be putting out RF (according to passive rx probe), but test_rx() on the other module isn't doing anything in response (not even the "recv 1 failed" message appears).

I presume all the tests work fine on RFM22B modules?

I noticed a couple of things about the library BTW - you do timeout tests that don't work at wraparound (see waitAvailableTimeout() in RF22.cpp for instance).

Also you assume that the chip can't fall out of tx or tx modes by itself (it can) and you cache the believed tx/tx/idle state in the library.
Thus a call to setModeRx() for example might do nothing even when the chips in Idle mode.

[ I may find time to trawl through all the differences in the RF22 v RF22B datasheets for some answers.. ]
Logged

[ I won't respond to messages, use the forum please ]

0
Offline Offline
Jr. Member
**
Karma: 2
Posts: 81
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi MarkT

I take it out are testing with RFM22, not RFM22?

I dont claim the lib works with RFM22, and have not tested with RFM22, only with RFM22B. All the tests and sample code works fine here with RFM22Bs. I understand other users are working fine with the RFM22B too.

I take your point about the possible timeout wrap for timeouts that cross over 42 days and will look at that.

I hear what you say about the mode, but I _think_ I catch all the cases where that can happen and force it back to RX mode.



Logged

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 3
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All, I have a RF data project coming up this winter. I have had the Hope RF stuff in the back of my mind. I am wondering, how do these radios and the library handle other radios on the same frequency but not talking to my radio? If I had several point/multipoint systems within range of each other, would this work?
Logged

0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12200
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All, I have a RF data project coming up this winter. I have had the Hope RF stuff in the back of my mind. I am wondering, how do these radios and the library handle other radios on the same frequency but not talking to my radio? If I had several point/multipoint systems within range of each other, would this work?


Well firstly all these packet-based ISM transceiver chips allow a wide choice of modulation (OOK, FSK/GFSK) at a range of baud rates and deviations.  They have packet synch sequence (sometimes programmable) that must be present for a packet to be recognised.  Then you have 1 to 4 bytes of header that must be matched for the packet to be recognised (some chips allow an all-FF broadcast address too).

And finally some chips allow a choice of CRC algorithm.

So you can encode a "network id" into the header and have different systems working on the same frequency without problems (so long as the collision-rate doesn't get too bad).  Furthermore you can select different frequencies for different networks, or implement a frequency-hopping protocol to utilise available bandwidth more evenly.

Some chips have a good digital RSSI signal you can use to determine clear channels, others like the RFM12 / RFM12B dont have such good support (only a binary indication).

For lots of useful advice and code and experience with the RFM12/RFM12B I suggest the http://jeelabs.net/ site.

For the RFM22B look at the recent topic on mikem's RF22 library.
Logged

[ I won't respond to messages, use the forum please ]

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 3
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks mark. I understand that we can direct packets to specific devices and/or specific networks. I was more concerned about actual RF interfearence. With FSK, everyone is using the same physical channel at the same time. I was looking at a spread spectrum system for this reason, because these systems will be mobile and setting them all up ahead of time to use different frequencies is not possible.
Logged

0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12200
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks mark. I understand that we can direct packets to specific devices and/or specific networks. I was more concerned about actual RF interfearence. With FSK, everyone is using the same physical channel at the same time. I was looking at a spread spectrum system for this reason, because these systems will be mobile and setting them all up ahead of time to use different frequencies is not possible.

Actually with FSK you are free to use different channels if you want...  A mesh could use separate channels for data, acknowledgements and routing packets if you wanted. Narrowband FM can give you 25kHz channel spacing perhaps in ISM bands?
(At 2.4GHz perhaps 100kHz is more realistic).

Frequency hopping is also feasible - different networks use different hopping sequences to minimize interference??

Using high datarates means short duration packets reducing collision probability (and possibly lower power consumption) at the expense of some range (and wider channels).  The nRF24L01+ (and RFM70) 2.4GHz module goes up to 2Mbps and has 32 byte max packets (40 including housekeeping) meaning packet duration is only 160us.

And finally parts of the ISM bands are limited to low duty cycle use only (1%, 0.1%) in order to allow frequency sharing.
Logged

[ I won't respond to messages, use the forum please ]

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 3
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mark, that's great info, thank you!
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 153
veroboaring is the new XGame - Extreme Veroboarder
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all!
Have test this library with a 200 chars payload buffer?.
For some reason my client-server MESH fails, i get the ACK from server and the server can se the packet send but not the payload of this packet.

Now I'm testing all about the FIFO and if the Int() of the module recharge the next 64 bytes on the TX FIFO.

The library work is i divide this 200 byte buffer into several 64 bytes?

Best Regards
Frank smiley-razz
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 153
veroboaring is the new XGame - Extreme Veroboarder
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Solved!...a better coding and more few bytes free at Ram and now works great!

Now only to get more free memory, what is the part of the library that use more RAM?, the routing table is not...

Best Regards
Frank
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 153
veroboaring is the new XGame - Extreme Veroboarder
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all!
Mike why you store this:

Quote
   /// Array of the last seen sequence number indexed by node address that sent it
    /// It is used for duplicate detection. Duplicated messages are re-acknowledged when received
    /// (this is generally due to lost ACKs, causing the sender to retransmit, even though we have already
    /// received that message)
    uint8_t _seenIds[256];

Why not use a TTL at the message header?, the packet that is at the netowork for more than some time will be discarted at the next node

and about the TEMP buffer, i think that you are using the same for TX/RX, but why not use a reference from the main loop?

Quote
   /// Temporary mesage buffer
    static uint8_t _tmpMessage[RF22_ROUTER_MAX_MESSAGE_LEN];

At the first will be 256 bytes less if we can think in other mechanism, and at the tmpMessage will be some too !


I will keep coding!

Best Regards
Frank
« Last Edit: August 22, 2011, 08:10:09 pm by FrankRadio » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not work under Arduino 1.0  smiley-cry
under 0022 is fine
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

where can I download the latest version of the Rf22 library.
I can only find the download link for version 1.30
Logged

Pages: 1 2 [3]   Go Up
Jump to: