@mfalkvidd Thanks again for your reply, I greatly appreciate your efforts. So, I have made some good progress and now I think we are getting close. I discovered a bit of an anomaly in the way things are described on the website which doesn’t make it easy to understand how to connect things up when your first crack at this. It is probably worthwhile clarifying on this page https://www.mysensors.org/build/ethernet_gateway. So what I have discovered is that the page linked to above describes setting the NRF24L01 on pins A2,A1,SCK,CSN,CE however it also goes on to talk about potential conflicts with SPI, and to use alternative pins, however, it doesn’t really make it very clear how to do that.
So here is what I did. I found a library called NRF24L01_h which was provided to me by Device.bit when I was looking at using their approach. By reading this I was able to get a much clearer understanding of how the SPI works and as you can see this file maps the NRF24L01 pins to 30,28,26,24,22 and 32 as the IRQ.
#ifndef NRF24L01_h
#define NRF24L01_h
#include "API.h"
//---------------------------------------------
#define TX_ADR_WIDTH 5
// 5 unsigned chars TX(RX) address width
#define TX_PLOAD_WIDTH 1
// 20 unsigned chars TX payload
//---------------------------------------------
#define CE 22
// CE_BIT: Digital Input Chip Enable Activates RX or TX mode
#define CSN 24
// CSN BIT: Digital Input SPI Chip Select
#define SCK_PIN 26
// SCK BIT: Digital Input SPI Clock
#define MOSI_PIN 28
// MOSI BIT: Digital Input SPI Slave Data Input
#define MISO_PIN 30
// MISO BIT: Digital Output SPI Slave Data Output, with tri-state option
#define IRQ 32
// IRQ BIT: Digital Output Maskable interrupt pin
//*********************************************
#endif
So I started to re-write the example code to user this but in doing so I discovered these lines of code in the example script and then the penny dropped.
#if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD)
#define MY_SOFTSPI
#define MY_SOFT_SPI_SCK_PIN 14
#define MY_SOFT_SPI_MISO_PIN 16
#define MY_SOFT_SPI_MOSI_PIN 15
#endif
// When W5100 is connected we have to move CE/CSN pins for NRF radio
#ifndef MY_RF24_CE_PIN
#define MY_RF24_CE_PIN 5
#endif
#ifndef MY_RF24_CS_PIN
#define MY_RF24_CS_PIN 6
#endif
0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
0;255;3;0;9;TSM:INIT
0;255;3;0;9;TSM:RADIO:OK
0;255;3;0;9;TSM:GW MODE
0;255;3;0;9;TSM:READY
IP: x.x.20.12
So we are away. The radio is working and now I am starting to understand how the code works a little better….however!!!!
In the Ethernet code there is a line #define MY_PORT 5003 which is what mynode will connect to. Only issue now is this port doesn’t seem to be open or it is in the wrong mode somewhere deeper in the code. If I load the example code for Chat server. And set the port to 5003 then my node can connect to the Mega no problem. So I know it's not firewall or hardware or in fact network related. Can you point me in the right direction to troubleshoot this please. i suspect the issue will be in one of the libraries further down the line.