Please add a guide for how to connect use the RFM69(H)W
I have been trying to understand how to connect/configure the arduino+RFM69W for over a week now without success. You have to modify Mysensors.h, Myconfig.h, serialgateway sketch and more. I am missing something and can't get it to work and would love a complete guide of everything I need to alter to get it to work.
Hello Cliff, did you found information on how to use/connect the RFM69 ? I will start soon but it seems a little bit difficult to find information for using MySensor and RFM69 ... Thanks !
I added a guide on the main site a few weeks ago:
Thanks Hek !! Do you also add procedure for modification of librairie to use RFM69 ? I understood that something needs to be done ?
Yes, it would be very helpful to have a guide that shows what needed in software to add the RFM69 radio, how to change its I/O pins, change its power out, setup for HW variant... in 1.5 and 1.6
A guide for using Moteino and Moteino-Mega with these radios would be helpful.
I think I can do it but not before end of February ...
Moteino should work out of the box with the dev-branch. Think it defaults to its pin-wiring.
Not sure about the Moteino-mega though. Haven't got that one.
The fix for the long term, is radio abstraction...
ie: radio = rfm69c, or radio = rfm69w, or radio = rfm69hw, or radio = nRF24 or radio = xyz
with some layer of abstraction for radio options like the ones below...
radio.set_freq= 912650000 ( this could imply the band also)
radio.set_channel = 72
#define MY_RFM69HW true
#define MY_RFM69_FREQUENCY RF69_915MHZ
#define RFM69_FREQUENCY 912650000
#define RFM69_NETWORKID 120
#define RF69_SPI_CS 10
#define RF69_IRQ_PIN 2
#define RF69_IRQ_NUM 0
all items like this should be abstracted to the radio level...
for now, it would be nice to have a guide for using each type of radio, with documentation on all known options...
(By the way, MY_RFM69_FREQUENCY should be MY_RFM69_BAND, as it selects the freq band the radio is in, not its exact frequency)
Thanks... my two bits...
PRs against dev-branch is welcome.
@hek the pins on Moteino-Mega do not correspond:
D2 - DIO0
D4 - NSS
D5 - MOSI
D6 - MISO
D7 - SCK
Where do I change the softSPI settings please for RFM69(H)W? It is not in MyConfig.h for rfm69?
The SPI connections are hardware SPI in the chip, not a softSPI.. (may work, but I have not tested)
If you look at the data sheet and schematics for the Mega, you see that the SPI pins are very well documented.....
Pins 7-6--5-4 are the four standard SPI pins, SCK, MISO, MOSI, SS, pin D2 is use as the interrupt from DIO0 on the radio... Look at the schematic and you see the correct pin-out from the radio to the processor... You will note the swap in MISO and MOSI pins. In on the CPU is out on the radio.. ect...
In my main code I use these defines... not in the config.h file... ( you could put them there also)
I'm using ver 2.0 code base, NOT 1.4 or 1.5
#ifdef __AVR_ATmega1284P__ // use for Moteino Mega Note: LED on Mega are 1 = on, 0 = off // MoteinoMEGA #define MY_RF69_SPI_CS 4 #define MY_RF69_IRQ_PIN 2 #define MY_RF69_IRQ_NUM 2 #define MY_DEFAULT_TX_LED_PIN 15 // the PCB, on board LED #define MY_DEFAULT_ERR_LED_PIN 7 #define MY_DEFAULT_RX_LED_PIN 6 #else // Moteino #define MY_RF69_SPI_CS 10 #define MY_RF69_IRQ_PIN 2 #define MY_RF69_IRQ_NUM 0 #define MY_DEFAULT_TX_LED_PIN 9 // 4 on sensor 2a PCB as LED3 (9 == on Moteino) #define MY_DEFAULT_ERR_LED_PIN 6 // 6 on sensor 2a PCB as Err #define MY_DEFAULT_RX_LED_PIN 7 // 7 on sensor 2a PCB as Rx #endif
@lafleur Thanks. Yes I did look at the schematics of Mega.
Looking at your post above, where do you define MISO, MOSI and SCK please? I can see you defined MY_RF69_SPI_CS, MY_RF69_IRQ_PIN MY_RF69_IRQ_NUM only
The pins for the SPI device is supplied by the SPI support library for the CPU device that you are using in the Arduino IDE library
@lafleur OK, but there is no such thing as soft SPI for this module?
There might be, do a search for: "arduino software spi"
Almost all chip supported by the Arduino IDE have one or more hardware SPI channels, each can be shared with multiple SPI devices connected to it with proper selection of the device CS line...
So the need for a software SPI is rare...
@hek I can confirm that Moteino Mega USB (and I think Moteino Mega as well) works out of the box:
Starting sensor (RRNNA-, 2.0.0-beta) Radio init successful. find parent send: 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: find parent send: 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: Init complete, id=255, parent=255, distance=255 find parent send: 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: