Ethernet and RCswitch at the same time?

Hello,

I’m new in programming on Arduino, but I have a problem I don’t knw how to solve.

I try to open a network connection and receive 433MHz Signals with the Arduino.
Both seperated is functional, but if I open the network connection and than try to receive signals nothing is happen.

#include <RCSwitch.h>
#include <EthernetUdp.h>         // UDP library from: bjoern@cs.stanford.edu 12/30/2008
#include <Ethernet.h>
#include <SPI.h>

// Network Configuration
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,0,100 };

RCSwitch mySwitch = RCSwitch();

void setup() {
  // start the Ethernet
  Ethernet.begin(mac, ip);
  
  Serial.begin(9600);
  mySwitch.enableReceive(0);  // Receiver on inerrupt 0 => that is pin #2
}

void loop() {
  if (mySwitch.available()) {
    output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
    mySwitch.resetAvailable();
  }
}

If I uncomment the line which is starting the ethernet connection everything is working fine. Can somebody explain me why this happen?

Tank you,
Michael

I have tested something and I found that there comes some output after some minutes with a delay and not every signal is catched.

#include <RCSwitch.h>
#include <EthernetUdp.h>         // UDP library from: bjoern@cs.stanford.edu 12/30/2008
#include <Ethernet.h>
#include <SPI.h>

// Network Configuration
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,0,100 };

RCSwitch mySwitch = RCSwitch();

void setup() {
  // start the Ethernet
  Ethernet.begin(mac, ip);
  
  Serial.begin(9600);
  mySwitch.enableReceive(0);  // Receiver on inerrupt 0 => that is pin #2
}

void loop() {
  if (mySwitch.available()) {
     Serial.print (mySwitch.getReceivedValue());
  mySwitch.resetAvailable();
  }
}

I think this is a very simple code but I can’t see the error.
It would be nice if somebody can see my mistake :slight_smile:

Thank you,
Michael