RFM69 support on ethernet gateway
-
OK, so I have tried implementing the SOFTSPI, but have not had any luck.
I did the following:
Remove any and all things related to RF24 as I won't be using it.
//////////////////////////////////////////////
Changed MyConfig.h to include:#define SOFTSPI
#ifdef SOFTSPI
// Define the soft SPI pins used for RF69 radio
const uint8_t SOFT_SPI_MISO_PIN = 16;
const uint8_t SOFT_SPI_MOSI_PIN = 15;
const uint8_t SOFT_SPI_SCK_PIN = 14;
const uint8_t SPI_MODE = 0;
#define RF69_SPI_CS 6 // SS is the SPI slave select pin, for instance D10 on atmega328#else
#define RF69_SPI_CS SS//SS // SS is the SPI slave select pin, for instance D10 on atmega328
#endif
//////////////////////////////////////////////////
Change RF69.h to include:#define RF69_MAX_DATA_LEN 61
#if defined SOFTSPI
#include <DigitalIO.h>
#else
#include <SPI.h>
#endif-> lower down
class RFM69 {
private:
#ifdef SOFTSPI
SoftSPI<SOFT_SPI_MISO_PIN, SOFT_SPI_MOSI_PIN, SOFT_SPI_SCK_PIN,SPI_MODE> spi;
#define _SPI spi
#else
#define _SPI SPI
#endif////////////////////////////
changed RFM69.cpp:-
changed all SPI.xxx calls in file to _SPI.xxx
////////////////////////////////////////
Everything works if I NOT #define SoftSPI and connect radio to normal SPI pins without ethernet shield.
When I #define softspi and move radio to defined pins, the radio does not initialise.Maybe one of you clever people can help.
Thanks
-
-
See this thread: http://forum.mysensors.org/topic/1810/no-softspi-support-for-rfm69/2
There is a post in there w/ a github repository to a SoftSPI version of the RFM69 code posted by @gieemek. There is also some links I posted there to (especially this one: https://lowpowerlab.com/forum/index.php/topic,838.0) where the LowPowerLab folks have implemented SoftSPI support. It might be worth trying to integrate their updated code into the MySensors.
-
I tried the SoftSPI without success !! As I am MySensors newbie I decided to get more experience on setting my network (Some nodes with serial gateway connected to Jeedom using the current branch) and then I will come back with the dev branch.
I am not to far as the serial gateway is working fine with RFM69 and nodes are working with Arduino bootloader.@hek: I think I tried everithing (3 differrent lib for softspi or hard spi) but the debug mode need to be improved to understand where is the problem. It's just what I think, I could be wrong ;)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login