Well... At last I got some time to dig in to the problem and it turns out it was a quick 10-minute fix. The fix is quick and dirty and if someone have an idea of how to make it prettier that would be nice.
Anyways.. I really like the RA-01 and RA-02 from AI-thinker and I have been using them for many types of projects so when I saw that the pinout was the same on my module and the nrf24 I was quite happy. Upon plugging the module in and activating MY_DEBUG_VERBOSE_RFM95 option it prints the following:
RFM95:INIT:PIN,CS=24,IQP=32,IQN=32,RST=43
!RFM95:INIT:SANCHK FAIL
Checking the documentation I see that the rfm24 uses different pins on the SAMD compared to the rfm69hw.
I then went in to the variant.h file of the Sensebender and from row 245 and on the definitions needs to be altered.
#define MY_RFM95_SPI_CS (29ul) // Changed from 30
#define MY_RFM95_IRQ_PIN (31ul) // Changed from 32
#define MY_RFM95_IRQ_NUM (31ul) // Changed from 32
Upon compiling and uploading i get:
RFM95:INIT:PIN,CS=24,IQP=32,IQN=32,RST=43
!RFM95:INIT:SANCHK FAIL
So i notice the CS-pin is 24 even though i defined MY_RFM95_SPI_CS as 29.
Searching the variant.h file for 24u I find change the following on row 156:
#define PIN_SPI_SS (29u) // Changed from 24
Upon compiling and uploading I see:
0;255;3;0;9;3932 RFM95:INIT
0;255;3;0;9;3937 RFM95:INIT:PIN,CS=29,IQP=31,IQN=31,RST=43
0;255;3;0;9;3947 RFM95:PTX:LEVEL=13
0;255;3;0;9;3948 TSM:INIT:TSP OK
0;255;3;0;9;3948 TSM:INIT:GW MODE
0;255;3;0;9;3948 TSM:READY:ID=0,PAR=0,DIS=0
0;255;3;0;9;3948 MCO:REG:NOT NEEDED
0;255;3;0;14;Gateway startup complete.
0;255;0;0;18;2.3.2
0;255;3;0;9;3949 MCO:BGN:STP
0;255;3;0;9;3949 MCO:BGN:INIT OK,TSP=1
0;255;3;0;9;3949 TSM:READY:NWD REQ
0;255;3;0;9;3949 RFM95:SWR:SEND,TO=255,SEQ=0,RETRY=0
0;255;3;0;9;4010 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=NACK:
0;255;3;0;9;21316 RFM95:SAC:SEND ACK,TO=3,SEQ=1636,RSSI=-60,SNR=10
0;255;3;0;9;22566 TSF:MSG:READ,3-3-0,s=2,c=1,t=17,pt=5,l=4,sg=0:351
The messages are coming in!
I tried doing the defines in my sketch but the PIN_SPI_SS is overwritten.
So for anyone wanting to use the RA-01 or RA-02 (SX1278) instead of the nRF24, go ahead!
I am not really sure I understand why the HAL is using the "PIN_SPI_SS" instead of the "MY_RFM95_SPI_CS"
Isn't CE,SS,CS all different names for the same thing?