Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

RFM69 simple to use library and code example
Goto page 1, 2  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Wed Apr 11, 2018 9:06 pm    Post subject: RFM69 simple to use library and code example Reply with quote

Hello. Here you have working code that I made long time ago from some Arduino library. Code need some optimisation maybe but it works very well.
These modules have much better range than nRF24+ (even with LNA and PA).
You must always consider that nRF24 can transmit 285kb up to 2Mb but for short range where RFM can transmit up to 300kb only but for greater range. Mainly because nRF work on 2.4GHz and RFM work on 433MHz.

I test modules shown on attached picture. I got good signal even in my car from very long distances. I test it with Mega328P @16MHz powered by two AAA batteries (means 3V) so no additional level translators was used.

For sending you can use 49 char long "Send_str" or 50 bytes long Buff(50) that overlayed "Send_str" (can be extended to 60 bytes)
For receiving you can read 60 char long "Rx_str" or 61 bytes long buffer named "Datab()"
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Thu Apr 12, 2018 1:46 pm    Post subject: Reply with quote

thanks for sharing Very Happy
you are very productive!

what is the range with the shown antenna in the forest?

_________________
Mark
Back to top
View user's profile Visit poster's website
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Thu Apr 12, 2018 4:24 pm    Post subject: Reply with quote

The range was impressive to me and suprising because previous tests I was made on foot.
When I take receiver of the attached test code in to the car I receive clear packets every 500ms about 1,5km from home ... I dont need more range
So if anyone can confirm better range then please let Us know Very Happy
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Thu Apr 12, 2018 7:57 pm    Post subject: Reply with quote

that is more than good enough for me Very Happy
_________________
Mark
Back to top
View user's profile Visit poster's website
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Thu Apr 12, 2018 8:31 pm    Post subject: Reply with quote

Yes but I always think about that it is spread in the "range" So for young players..
Negotiation of the power needed is important. When is sunny, power can be reduced. Max power is needed when moisture/rain.

GSM telephones uses power negotiation from long years so why We dont?

Please code somehow your data because it can be "affected" like in the "Mission Impossible" film...and then after some year some hacker can open your garage door...
I direct it to "young players" or anyone who want to transfer permits to its "smart home" Very Happy
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Fri Apr 13, 2018 12:09 pm    Post subject: Reply with quote

yes that is good advice.
About a safe protocol and i do not get why cars do not use it : have 2 way data transfer.
Then the sender can use aes to encode a simple string like : 1+2
then the receiver decodes and replies with the answer.
And the sender can send a simple new challenge every time.
It will be very hard to decode it. especial if you also encode the challenge with a simple algo so even the challenge is not readable.
it will be near to impossible to hack it.

_________________
Mark
Back to top
View user's profile Visit poster's website
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Fri Apr 13, 2018 1:39 pm    Post subject: Reply with quote

Yes. This mechanism is used for login to the GSM network. Provider know one number in the SIM (i dont remember this name now) but login into the network is ->SIM sends its number->provider send the challenge to then SIM to do some mathematic calculations with given varaiables->and provider know what answear should be...

BTW this module makes some cryptographic available Wink In the program header/constants you can see Const Encryptkey = "sampleEncryptKey"

When I wrote my previous post I was think that not always full power is needed because anyone can hear the transmition. Power should be adequate to the needs.
Back to top
View user's profile Visit poster's website
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1257
Location: SYDNEY

australia.gif
PostPosted: Fri Apr 13, 2018 2:20 pm    Post subject: Reply with quote

From the data sheet
"As shown in Figure 33 and Figure 34 above the message part of the Packet can be encrypted and decrypted with the
cipher 128- cipher key stored in the configuration registers."
Interesting device.
400Mhz has fairly good penetration of buildings
The problem that can arise is interference from industrial transmitters in the same frequency allocation.
Would be nice to have a library in bascom for it.

Regards Paul
Back to top
View user's profile
lslabs2005

Bascom Member



Joined: 28 Dec 2004
Posts: 57

PostPosted: Fri Apr 13, 2018 2:31 pm    Post subject: Where can I buy this module with an antenna? Reply with quote

Where can I buy this module with an antenna?
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Fri Apr 13, 2018 3:23 pm    Post subject: Reply with quote

For tests I buy "pigtail" - it is a piece of coax wire with SMA and UFL connectors. I cut UFL and solder wire to the modules.
Then I take 433MHz antennas from another modules I have SRWF-50 but any 433MHz anntennass should work.
(In the attached pic male connector is shown where my antennas needs female)
Back to top
View user's profile Visit poster's website
Climber

Bascom Member



Joined: 05 Jun 2012
Posts: 15

PostPosted: Sun Apr 15, 2018 8:53 am    Post subject: Reply with quote

Hi,
does anyone know if the control system of the RFM63W is the same as RFM69 or at least similar?
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Sun Apr 15, 2018 9:21 am    Post subject: Reply with quote

I know only RFM69W and RFM69HW (there is also HCW version)
Standard RFM69W have 13dBm where HW version have more power 20dBm
Link to the datasheets http://www.hoperf.com/rf_transceiver/ic/RF69W.html

In the library you can simply choose
Code:
Const Is_rfm69hw = 1                                    ' set to 1 Only For Rfm69hw! set to 0 if You Have Rfm69w!    
Back to top
View user's profile Visit poster's website
nucutza

Bascom Member



Joined: 13 Aug 2016
Posts: 1

blank.gif
PostPosted: Sun Apr 15, 2018 2:27 pm    Post subject: Reply with quote

Hi

Does this library work with all RFM69 modules ? I mean with other frequency (868, 915)
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Thu Apr 26, 2018 12:06 pm    Post subject: Reply with quote

nucutza wrote:
Does this library work with all RFM69 modules ? I mean with other frequency (868, 915)

I will test them soon because they just arrived Razz
Back to top
View user's profile Visit poster's website
hg7kaz

Bascom Member



Joined: 15 Aug 2007
Posts: 9

hungary.gif
PostPosted: Mon Jan 03, 2022 8:14 pm    Post subject: Reply with quote

I see this thread is long dead. Anyway, I ask, can this module work with this program using 8MHz clock? Timings, interrupts, etc.?
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum