OK - I have it all worked out!!!
For the N00BS who would like to not have to spend 3 days reverse engineering the code.. Here are some key tidbits that I couldn't find documented anywhere..
1: Enable on the gateway for MqTT or Ethernet GW
To do this you need to uncomment the line below in utility/RF24_config.h:
//#define SOFTSPI // Requires library from https://github.com/greiman/DigitalIO
You only uncomment this line, DO NOT UNCOMMENT SPI_UART as well ( This caused me a days worth of trying to work out what I did wrong )
IMPORTANT: This file effects the entire library, so if you enable this it effects your sensors as well.
2: Wire for SOFTSPI
Because you've now just enabled SOFTSPI, you need to wire your project accordingly. The default wiring diagrams that are noted everywhere are not valid anymore..
the code is now using the following changes:
//These are default, but you can change them if you like:
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;
3: Validate your radios
The best thing to do once you've wired up your radios is to dump out the config. This will allow you to validate the wiring is correct and let you know if you've done anything wrong.
The best way to do this is to add a RF24::printDetails(); line into MySensors.cpp like this:
open the MySensors.cpp file and locate the line that looks like this:
MySensor::setupRadio(rf24_pa_dbm_e paLevel, uint8_t channel, rf24_datarate_e dataRate)
at the bottom of the block add RF24::printDetails(); like this:
void MySensor::setupRadio(rf24_pa_dbm_e paLevel, uint8_t channel, rf24_datarate_e dataRate) {
failedTransmissions = 0;
// Start up the radio library
RF24::begin();
if (!RF24::isPVariant()) {
debug(PSTR("check wires\n"));
while(1);
}
RF24::setAutoAck(1);
RF24::setAutoAck(BROADCAST_PIPE,false); // Turn off auto ack for broadcast
RF24::enableAckPayload();
RF24::setChannel(channel);
RF24::setPALevel(paLevel);
RF24::setDataRate(dataRate);
RF24::setRetries(5,15);
RF24::setCRCLength(RF24_CRC_16);
RF24::enableDynamicPayloads();
// All nodes listen to broadcast pipe (for FIND_PARENT_RESPONSE messages)
RF24::openReadingPipe(BROADCAST_PIPE, TO_ADDR(BROADCAST_ADDRESS));
RF24::printDetails();
}
If the output shows all 0's or all FF's, then your wiring is in-correct and the radio is not initializing correctly.
4: You've done all this, but you're still receiving an error check wires:
This either means you've not initialized the board correctly and the wiring is still incorrect OR you have a non-Plus radio ( RF24L01 vs RF24L01+ )
To check this, comment out the while(1) line in the MySensors.cpp file like this:
if (!RF24::isPVariant()) {
debug(PSTR("check wires\n"));
//while(1);
}
This will alow the initialization to proceed if the device is not a plus version, this way the printDetails() code you've added will be triggered and you can continue to investigate.
IMPORTANT NOTE:
The printDetails() output will only show that you have a plus version of the radio if its wired correct and is initializing. If its not initialized, it will not show the proper version of the radio. I had this and spend a day updating code to support a different data rate when it was un-necessary.
Hopefully this is helpful information and thank you everyone who chipped in some info to giude me to these conclusions..
Admins: I would highly recommend you guys explain the SOFTSPI bits within the documentation for the Ethernet/MqTT gateways - If it was documented well I think i would have had a lot less trouble. Just my 2 cents.