jgromes / RadioLib

Universal wireless communication library for embedded devices
https://jgromes.github.io/RadioLib/
MIT License
1.6k stars 400 forks source link

A question regarding RFM95 module initialization #104

Closed vukasinsk closed 4 years ago

vukasinsk commented 4 years ago

After successfully working with SX1278 434MHz module I encountered some issues with RFM95 (868MHz) modules. I tried to upload and run both examples Receive_Interrupt and Transmit_Interrupt from the SX127X label in the "Examples" section. I am using an Arduino Pro Mini coupled with RFM95. Pin connections, screenshot of the issue and pin illustritations of both SX1278 and RFM95 are uploaded in the pictures. (Debug mode enabled in typedef.h)

P.S Jan, I tried lora.begin(868.0) at first. But I just got the code -2 issue (like now) and I figured I wasn't allowed to use begin() without fully providing all arguments. Thank you for your lightning quick e-mail reply and for your time! :) Issue LoraMappingtoArduino LoraSX1278 Pins RFM95 Pins

jgromes commented 4 years ago

Looks like the version number read form SPI doesn't match the expected for RFM95 (0x12 instead of 0x11). Are you sure the chip is actually RFM95, as opposed to RFM96?

You can provide just the first few parameters, the rest will use the default.

vukasinsk commented 4 years ago

Checked it on Aliexpress exactly 10 minutes ago. They say the RFM95s use RFM96 chips. What am I supposed to change and where if that's the case?

jgromes commented 4 years ago

Just change the type, i.e. RFM96 lora = new Module(10, 2, 9, 3);

vukasinsk commented 4 years ago

Just did. Getting code -12 right now.

define | ERR_INVALID_FREQUENCY   -12

  | The supplied frequency value is invalid for this module.

Note: Supplied lora.begin() with 868.0

vukasinsk commented 4 years ago

Here's a link to the product if that can help anything at all. https://www.aliexpress.com/item/32844406764.html?spm=a2g0s.9042311.0.0.5c654c4d7XBAie

jgromes commented 4 years ago

The chip on the radio is RFM96, which doesn't support 868 MHz, only 433 - 470.

vukasinsk commented 4 years ago

That is a bummer. Soldered 20 868MHz antennas. Thank you once again.

jgromes commented 4 years ago

Check the real hardware whenever possible before buying ;) Photos on the aliexpress listing are actually pretty good, you can see that the chip has "RF96" written on it.